:root {
  color-scheme: light;
  --ink: #223c3a;
  --muted: #657873;
  --teal: #176b5b;
  --teal-dark: #105344;
  --line: #dce4df;
  --paper: #f6f7f2;
  --error: #af3532;
  font-family: "Segoe UI", "Microsoft JhengHei", "PingFang TC", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
a { color: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.page-width { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid #bc7a22; outline-offset: 4px; }
.skip-link { position: fixed; top: 12px; left: 16px; padding: 10px 18px; background: white; z-index: 10; transform: translateY(-180%); border-radius: 6px; }
.skip-link:focus { transform: translateY(0); }

.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; justify-content: space-between; align-items: center; min-height: 92px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; }
.brand-icon { display: grid; place-items: center; width: 45px; height: 48px; color: white; background: var(--teal); border-radius: 13px; }
.brand-icon svg { width: 31px; height: 31px; }
.brand strong { display: block; font-size: 19px; letter-spacing: 1px; }
.brand-divider { color: #99afa6; margin-inline: 5px; font-weight: 400; }
.brand small { display: block; font-size: 9px; font-weight: 600; color: var(--muted); letter-spacing: 1.7px; }
nav { display: flex; align-items: center; gap: 28px; }
nav a { text-decoration: none; color: var(--muted); font-size: 14px; padding-block: 13px; }
nav .nav-active { color: var(--teal); font-weight: 700; border-bottom: 2px solid var(--teal); }
nav a:hover { color: var(--teal); }

.hero { display: flex; justify-content: space-between; align-items: center; gap: 28px; padding-block: 45px 31px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--teal); font-size: 12px; font-weight: 600; letter-spacing: 1.7px; }
.eyebrow > span { width: 6px; height: 6px; background: var(--teal); border-radius: 50%; }
h1 { font-size: clamp(30px, 3.3vw, 42px); letter-spacing: 2px; line-height: 1.35; margin: 0 0 15px; font-weight: 750; }
h1 > span { color: var(--teal); }
.hero-description { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.9; }
.journey-illustration { position: relative; width: 290px; margin-right: 12px; }
.journey-illustration svg { display: block; width: 100%; }
.journey-illustration path { stroke-width: 3; }
.track-primary { stroke: #297966; }
.track-secondary { stroke: #c6a063; }
.journey-illustration circle { fill: var(--paper); stroke: #297966; stroke-width: 3; }
.journey-illustration circle:nth-of-type(2) { stroke: #c6a063; }
.journey-illustration .destination-dot { fill: #297966; stroke: #d6e6dc; stroke-width: 8; }
.journey-illustration .destination-center { fill: white; stroke: none; }
.journey-label { position: absolute; color: var(--muted); font-size: 11px; letter-spacing: 1px; }
.label-start { top: -4px; left: 0; }
.label-end { right: 0; bottom: 37px; }

.test-notice { display: flex; align-items: center; gap: 13px; padding: 16px 20px; margin-bottom: 25px; background: #f7efdf; border: 1px solid #e9d9b7; border-radius: 10px; color: #785c2d; }
.notice-symbol { display: grid; place-items: center; flex: 0 0 19px; height: 19px; border: 1.5px solid currentColor; border-radius: 50%; font: 700 13px Georgia, serif; }
.test-notice p { margin: 0; font-size: 12px; }
.test-notice strong { display: block; font-size: 13px; font-weight: 650; }
.test-notice p > span { display: block; margin-top: 2px; }
.version-tag { margin-left: auto; border: 1px solid #dcc69f; padding: 2px 10px; border-radius: 20px; font-size: 11px; white-space: nowrap; }
.noscript-notice { color: var(--error); font-weight: 700; }

.planner-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 25px; align-items: start; }
.form-panel { background: white; border: 1px solid var(--line); border-radius: 15px; padding: 25px 28px 0; box-shadow: 0 4px 14px #263e3603; }
.form-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 24px; }
.form-topline h2 { font-size: 18px; letter-spacing: .4px; margin: 0; }
.form-topline > span { font-size: 11px; color: var(--muted); }
fieldset { min-width: 0; }
.form-section { padding: 0; margin: 0; border: 0; }
.form-section > legend { padding: 0; font-size: 17px; font-weight: 700; }
.step-number { display: inline-grid; place-items: center; width: 27px; height: 27px; margin-right: 7px; border: 1px solid #d0e2d8; border-radius: 7px; color: var(--teal); background: #eff6f0; font-size: 12px; font-weight: 700; vertical-align: 1px; }
.section-description { margin: 10px 0 19px; color: var(--muted); font-size: 12px; }
.meeting-fields { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 13px; }
.field { min-width: 0; }
.field label { display: block; margin: 0 0 7px; font-size: 12px; font-weight: 650; }
.field input { display: block; width: 100%; min-width: 0; max-width: 100%; height: 45px; padding: 9px 11px; background: white; border: 1px solid #cfd9d3; border-radius: 7px; color: var(--ink); font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.field input:hover { border-color: #8aab9d; }
.field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px #176b5b1a; }
.field input[aria-invalid="true"] { border-color: var(--error); background: #fffafa; }
.field input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px #af35321a; }
.field-hint, .field-error { margin: 6px 0 0; font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.field-hint { color: var(--muted); }
.field-error { color: var(--error); }
.station-picker { position: relative; }
.station-options {
  --station-options-gap: 4px;
  position: absolute;
  z-index: 2;
  inset-inline: 0;
  top: calc(100% + var(--station-options-gap));
  max-height: var(--station-options-max-height, 0px);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  list-style: none;
  margin: 0;
  padding: 4px;
  border: 1px solid #cfd9d3;
  border-radius: 7px;
  background: white;
  box-shadow: 0 6px 16px #223c3a26;
}
.station-options[data-above] { top: auto; bottom: calc(100% + var(--station-options-gap)); }
.station-options > li { display: flex; justify-content: space-between; align-items: center; gap: 6px; min-height: 44px; padding: 7px 9px; border-radius: 4px; cursor: pointer; font-size: 14px; overflow-wrap: anywhere; }
.station-options > li:hover { background: #f0f5ee; }
.station-options > li[aria-selected="true"] { background: #dcece1; color: var(--teal-dark); }
.station-code { flex: none; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.station-status:empty { margin: 0; }
.station-picker input[aria-invalid="true"] ~ .station-status[data-state="no-results"] { display: none; }
.meeting-section { padding-bottom: 26px; }
.travelers-section { border-top: 1px solid var(--line); padding-top: 24px; }
.travelers-section > legend { float: left; width: 100%; }
.travelers-intro { clear: both; padding-top: 1px; }
.travelers-intro .section-description { margin-bottom: 14px; }
.count-picker { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 20px; border: 1px solid #e0e7e1; border-radius: 8px; background: #f4f7f3; }
.count-picker label { cursor: pointer; position: relative; }
.count-picker input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.count-picker span { display: block; border: 1px solid transparent; border-radius: 5px; padding: 5px 20px; font-size: 12px; color: var(--muted); }
.count-picker input:checked + span { background: white; color: var(--teal); border-color: #d6e1d9; font-weight: 700; box-shadow: 0 1px 3px #223c3a09; }
.count-picker input:focus-visible + span { outline: 3px solid #bc7a22; outline-offset: 2px; }
.traveler-list { display: grid; gap: 16px; }
.traveler-card { padding: 14px 17px 17px; margin: 0; border: 1px solid var(--line); background: #fafbf8; border-radius: 9px; }
.traveler-card > legend { padding: 0 6px; margin-left: -6px; font-size: 13px; font-weight: 700; }
.traveler-avatar { display: inline-grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; margin-right: 5px; font-size: 11px; }
.avatar-a { background: #dcece1; color: #236647; }
.avatar-b { background: #f0e6d2; color: #80602a; }
.traveler-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.station-note { color: var(--muted); font-size: 11px; line-height: 1.8; margin: 16px 0 22px; }
.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding-block: 21px; border-top: 1px solid var(--line); }
.form-actions p { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.85; }
.primary-button { display: inline-flex; flex: 0 0 auto; justify-content: center; align-items: center; gap: 22px; border: 0; border-radius: 8px; background: var(--teal); color: white; padding: 12px 21px; font-size: 14px; font-weight: 600; cursor: pointer; min-height: 46px; }
.primary-button:hover { background: var(--teal-dark); }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled { opacity: .5; cursor: not-allowed; }
.primary-button > span { font-size: 20px; line-height: 1; }
.error-summary { margin-bottom: 20px; padding: 14px 16px; border: 1px solid #edc3c0; border-radius: 8px; background: #fff5f4; color: var(--error); font-size: 13px; }
.error-summary p { margin: 0 0 5px; font-weight: 700; }
.error-summary ul { margin: 0; padding-left: 19px; }
.error-summary a { text-underline-offset: 3px; }

.summary-column { display: grid; gap: 22px; }
.summary-panel { padding: 24px; border: 1px solid #cdded3; border-radius: 15px; background: #f0f5ee; }
.summary-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.summary-heading h2 { margin: 0; font-size: 18px; }
.summary-badge { padding: 3px 9px; border: 1px solid #d1ded2; border-radius: 5px; color: #55725d; font-size: 10px; white-space: nowrap; }
.summary-badge.is-confirmed { color: white; background: var(--teal); border-color: var(--teal); }
.summary-placeholder { padding: 40px 0 34px; text-align: center; }
.ticket-icon { display: inline-flex; align-items: center; gap: 11px; padding: 14px 16px; margin-bottom: 18px; background: #fffdf7; border: 1px solid #d8e1d4; border-radius: 7px; transform: rotate(-6deg); box-shadow: 4px 5px 0 #dce6d8; color: #51735f; font-size: 11px; letter-spacing: 1px; }
.ticket-line { color: #8b9f8f; font-size: 13px; }
.summary-placeholder h3 { font-size: 16px; margin: 13px 0 10px; font-weight: 600; }
.summary-placeholder p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.9; }
.summary-bottom { display: flex; gap: 7px; align-items: center; justify-content: center; padding-top: 16px; border-top: 1px dashed #cad7c9; color: #657b66; font-size: 11px; letter-spacing: 1px; }
.summary-bottom > span { font-size: 15px; }
.summary-kicker { color: var(--teal); font-size: 12px; margin-block: 23px 12px; }
.meeting-summary { margin: 0; padding-bottom: 20px; border-bottom: 1px solid #d5e0d2; }
.meeting-summary > div { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 13px; }
.meeting-summary dt { color: var(--muted); flex-shrink: 0; }
.meeting-summary dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.summary-travelers { display: grid; gap: 12px; margin-block: 20px; }
.summary-traveler { padding: 13px; background: #ffffffa6; border: 1px solid #dce5d8; border-radius: 8px; }
.summary-traveler h3 { margin: 0 0 7px; font-size: 12px; }
.summary-traveler .route { margin: 0; font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.route-arrow { padding-inline: 8px; color: #78937e; }
.summary-traveler .departure-time { margin: 5px 0 0; font-size: 11px; color: var(--muted); }
.summary-disclaimer { margin: 0 0 8px; font-size: 11px; color: var(--muted); }
.results-link { display: inline-block; margin-bottom: 18px; color: var(--teal-dark); font-size: 13px; font-weight: 650; text-underline-offset: 3px; }
.timetable-panel { min-width: 0; padding: 22px 24px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.timetable-panel h2 { margin: 0 0 14px; font-size: 16px; }
.timetable-panel input { height: auto; }
#timetable-status { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
#timetable-release-coverage, #trip-date-coverage { line-height: 1.65; }
.timetable-retry { margin-top: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--teal-dark); background: white; font-size: 13px; cursor: pointer; }
.timetable-retry:hover { border-color: var(--teal); }
.timetable-results { margin: 10px 0 0; padding: 0; list-style: none; }
.timetable-results li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 12px; overflow-wrap: anywhere; }
.timetable-results p { margin: 3px 0 0; color: var(--muted); }
#timetable-diagnostics strong { color: var(--error); }
.pair-results, .direct-results { margin-top: 28px; }
.pair-results h2, .direct-results h2 { margin: 0 0 14px; font-size: 18px; }
.pair-status { margin: 8px 0; font-size: 14px; }
.pair-status.pair-warning { padding: 10px 14px; border: 1px solid #e9d9b7; border-radius: 8px; background: #f7efdf; color: #785c2d; font-weight: 650; }
.pair-cards, .pair-routes { display: grid; gap: 12px; margin: 12px 0 0; padding: 0; list-style: none; }
.pair-cards > li { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: white; font-size: 14px; overflow-wrap: anywhere; }
.pair-cards h3 { margin: 0 0 4px; font-size: 16px; }
.pair-cards > li > p { margin: 4px 0 0; }
.pair-routes { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin-bottom: 12px; }
.pair-routes > li { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafbf8; }
.pair-meeting { color: var(--teal-dark); font-weight: 700; }
#reserved-pair-results { margin-top: 14px; }
#reserved-pair-results > summary { color: var(--teal-dark); cursor: pointer; font-size: 14px; font-weight: 650; }
.direct-travelers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; align-items: start; }
.direct-travelers > section { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: white; overflow-wrap: anywhere; }
.direct-travelers h3 { margin: 0 0 8px; font-size: 15px; }
.direct-route, .direct-count { margin: 6px 0; font-size: 14px; font-weight: 650; }
.direct-coverage, .direct-travelers details { margin: 4px 0; color: var(--muted); font-size: 12px; }
.direct-travelers summary { cursor: pointer; }
.direct-message { margin: 8px 0; color: #785c2d; font-size: 13px; }
.direct-message:empty { margin: 0; }
.direct-candidates { margin: 10px 0 0; padding: 0; list-style: none; }
.direct-candidates > li { padding-block: 10px; border-top: 1px solid var(--line); font-size: 14px; }
.direct-stop { margin: 4px 0; }
.direct-stop time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.reservation-label { display: inline-block; padding: 1px 7px; border-radius: 4px; background: #f0f5ee; color: var(--muted); font-size: 11px; }
.reservation-label.is-reserved { background: #dcece1; color: var(--teal-dark); }
.help-panel { padding: 2px 5px; }
.help-panel h2 { font-size: 13px; font-weight: 700; margin: 0 0 17px; }
.help-panel ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 17px; }
.help-panel li { display: flex; gap: 11px; }
.help-panel li > span { display: grid; place-items: center; flex: 0 0 21px; height: 21px; margin-top: 1px; border: 1px solid #d4ddd4; border-radius: 50%; color: var(--muted); font-size: 10px; }
.help-panel strong { font-size: 12px; font-weight: 600; }
.help-panel li p { font-size: 11px; color: var(--muted); margin: 2px 0 0; }
.help-note { border-top: 1px solid var(--line); padding-top: 15px; margin-top: 21px; font-size: 10px; color: var(--muted); }
.site-footer { margin-top: 35px; padding-block: 20px 27px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.6; }
.site-footer h2 { margin: 0; color: var(--ink); font-size: 16px; }
.site-footer p, .site-footer ul { margin: 7px 0 0; }
.site-footer ul { padding-inline-start: 1.5em; }
.site-footer a { color: var(--teal-dark); }

@media (min-width: 1000px) {
  .summary-column { position: sticky; top: 24px; }
}

@media (max-width: 900px) {
  .page-width { width: min(740px, calc(100% - 40px)); }
  .planner-layout { grid-template-columns: 1fr; }
  .journey-illustration { width: 200px; margin: 0; }
  .label-end { bottom: 16px; }
  .summary-column { grid-template-columns: 1.1fr 1fr; align-items: start; }
  .help-panel { grid-column: 1 / -1; padding: 19px 5px; }
}

@media (max-width: 600px) {
  .page-width { width: calc(100% - 32px); }
  .header-inner { min-height: 78px; gap: 12px; }
  .brand { gap: 9px; }
  .brand-icon { width: 36px; height: 40px; border-radius: 10px; }
  .brand-icon svg { width: 26px; height: 26px; }
  .brand strong { font-size: 15px; letter-spacing: .3px; }
  .brand small { font-size: 7px; letter-spacing: 1px; }
  nav { gap: 0; }
  nav a { font-size: 12px; }
  nav a:last-child { display: none; }
  .hero { padding-block: 30px 24px; }
  .eyebrow { font-size: 10px; letter-spacing: 1px; }
  h1 { font-size: clamp(25px, 6.6vw, 36px); letter-spacing: .8px; margin-bottom: 12px; }
  .hero-description { font-size: 12px; }
  .journey-illustration { display: none; }
  .test-notice { padding: 13px; gap: 10px; align-items: flex-start; margin-bottom: 18px; }
  .notice-symbol { margin-top: 2px; }
  .test-notice strong { font-size: 12px; }
  .test-notice p { font-size: 11px; }
  .version-tag { display: none; }
  .planner-layout { gap: 18px; }
  .form-panel { padding: 21px 18px 0; border-radius: 12px; }
  .form-topline { gap: 8px; padding-bottom: 17px; margin-bottom: 22px; }
  .form-topline h2 { font-size: 16px; }
  .form-topline > span { font-size: 10px; }
  .form-section > legend { font-size: 16px; }
  .section-description { line-height: 1.8; }
  .meeting-fields { grid-template-columns: 1fr; gap: 17px; }
  .field input { height: 48px; font-size: 16px; }
  .field label { font-size: 13px; }
  .traveler-fields { grid-template-columns: 1fr; gap: 15px; }
  .traveler-card { padding: 13px 14px 16px; }
  .count-picker { display: flex; }
  .count-picker label { flex: 1; text-align: center; }
  .count-picker span { padding: 9px; }
  .form-actions { flex-direction: column; align-items: stretch; gap: 15px; }
  .form-actions p { font-size: 11px; }
  .primary-button { min-height: 50px; }
  .summary-column { grid-template-columns: 1fr; }
  .summary-panel { padding: 22px; }
  .summary-placeholder { padding-block: 29px; }
  .help-panel { padding: 4px; }
  .site-footer { margin-top: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
