:root {
  --paper: #f6f2ea;
  --card: #fffdf8;
  --ink: #171614;
  --muted: #6a655d;
  --line: #dcd5c8;
  --accent: #0d6b5c;
  --accent-soft: #e6f0ec;
  --warn: #8a4b12;
  --warn-soft: #fbf0df;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.masthead {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 6px 0 8px;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 span {
  color: var(--muted);
  font-weight: 400;
}

.validity {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.validity strong {
  color: var(--ink);
}

.planner {
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgb(23 22 20 / 5%);
}

.stations {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

select,
input[type="time"] {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

select {
  text-overflow: ellipsis;
}

.swap,
.now {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.swap {
  width: 44px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.now {
  padding: 0 18px;
}

.swap:hover,
.now:hover {
  background: var(--accent-soft);
}

.days {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.days legend {
  margin-bottom: 6px;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips label {
  position: relative;
}

.chips input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.chips span {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.chips input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.chips input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.time-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 16px;
}

.planning {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.results {
  margin-top: 14px;
}

.hint {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  font-size: 14px;
}

.card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 1px 2px rgb(23 22 20 / 5%);
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.times {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.times.small {
  font-size: 18px;
}

.duration {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.change-line {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.change-line strong {
  color: var(--accent);
}

.timeline {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.stop {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  padding: 4px 0;
}

.time {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.name {
  font-size: 15px;
}

.tag {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ride,
.wait {
  margin-left: 34px;
  padding: 3px 0 3px 44px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.wait {
  color: var(--warn);
  font-weight: 600;
}

.later {
  margin-top: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.later summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.later summary span:last-child {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.later[open] summary {
  border-bottom: 1px solid var(--line);
}

.later .timeline {
  margin-bottom: 10px;
}

.later-item {
  padding: 14px 0;
}

.later-item + .later-item {
  border-top: 1px solid var(--line);
}

.section-label {
  margin: 20px 2px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gap {
  margin-top: 14px;
  padding: 10px 12px;
  border-left: 3px solid var(--warn);
  border-radius: 8px;
  background: var(--warn-soft);
  color: #5a3a14;
  font-size: 13px;
}

.foot {
  margin-top: 32px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.foot p {
  margin: 0 0 6px;
}

.meta {
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 520px) {
  .page {
    padding: 18px 14px 40px;
  }

  h1 {
    font-size: 24px;
  }

  .stations {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .swap {
    width: 100%;
    min-height: 40px;
  }
}
