:root {
  --ink: #132a3a;
  --muted: #536b79;
  --paper: #fffdf7;
  --cream: #f4efe1;
  --navy: #12344d;
  --navy-2: #1d4f6d;
  --orange: #f06a2a;
  --orange-dark: #b83f0b;
  --yellow: #ffd75a;
  --green: #0b745a;
  --red: #a32828;
  --border: #c8d2d8;
  --shadow: 0 10px 30px rgb(18 52 77 / 10%);
  font-family: ui-rounded, "Arial Rounded MT Bold", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-size: 100%;
  line-height: 1.5;
}

* { box-sizing: border-box; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
html { scroll-behavior: auto; }
body { margin: 0; min-width: 320px; background: linear-gradient(180deg, var(--paper), var(--cream)); }
a { color: var(--navy-2); text-decoration-thickness: 2px; text-underline-offset: .2em; }
a:hover { color: var(--orange-dark); }
button, input, select { font: inherit; }
button, .button {
  min-height: 44px; min-width: 44px; padding: .65rem 1rem; border: 2px solid var(--navy);
  border-radius: .7rem; background: white; color: var(--navy); font-weight: 750; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
button:hover, .button:hover { background: #eef5f8; color: var(--navy); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 4px solid var(--yellow); outline-offset: 3px;
}
button:disabled { cursor: not-allowed; opacity: .5; }
.primary { background: var(--orange); border-color: var(--orange-dark); color: #19110d; box-shadow: 0 4px 0 var(--orange-dark); }
.primary:hover { background: #ff8248; color: #19110d; }
.danger-button { color: var(--red); border-color: var(--red); }
.link-button { min-height: 44px; border: 0; background: transparent; padding-inline: .4rem; text-decoration: underline; }

.skip-link { position: absolute; z-index: 100; left: 1rem; top: -10rem; background: white; padding: .8rem; }
.skip-link:focus { top: 1rem; }
.site-header { min-height: 72px; padding: .75rem clamp(1rem, 4vw, 3rem); background: var(--navy); color: white; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-header a, .site-header button { color: white; }
.brand { display: flex; align-items: center; gap: .7rem; color: white; font-weight: 850; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; border-radius: 50%; background: var(--yellow); color: var(--navy); display: grid; place-items: center; font-size: .9rem; letter-spacing: -.05em; }
.site-header nav { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; }
.site-header nav a, .breadcrumb a, .data-card > a { min-height: 44px; display: inline-flex; align-items: center; }
.inline-form { display: inline; margin: 0; }

main { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(1.5rem, 4vw, 4rem) 0; }
footer { padding: 2rem 1rem; background: var(--navy); color: white; text-align: center; }
h1, h2, h3 { line-height: 1.1; color: var(--navy); text-wrap: balance; }
h1 { font-size: clamp(2.15rem, 6vw, 4.75rem); letter-spacing: -.045em; margin: .2rem 0 1rem; }
h2 { font-size: clamp(1.55rem, 3vw, 2.35rem); margin: .25rem 0 1rem; }
h3 { font-size: 1.15rem; }
.eyebrow { color: var(--orange-dark); font-weight: 850; letter-spacing: .11em; text-transform: uppercase; font-size: .78rem; margin: 0; }
.lede { font-size: clamp(1.1rem, 2vw, 1.35rem); max-width: 55ch; }
.narrow { max-width: 760px; margin-inline: auto; }
.hero { margin-bottom: 2.5rem; }
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); gap: 2rem; align-items: center; }
.data-card, .panel, .route-card, .departure-card, .stamp-card { background: rgb(255 255 255 / 88%); border: 1px solid var(--border); border-radius: 1rem; padding: clamp(1rem, 3vw, 1.75rem); box-shadow: var(--shadow); }
.data-card dl, .scoreboard dl, .score-row, .summary-list { margin: 0; }
.data-card dl div, .summary-list div { border-bottom: 1px solid var(--border); padding: .7rem 0; }
dt { color: var(--muted); font-size: .82rem; font-weight: 700; }
dd { margin: 0; font-weight: 800; }
.panel { margin-block: 2rem; }
.login-card { margin-top: 6vh; }

label, legend { font-weight: 750; }
input, select { min-height: 48px; width: 100%; padding: .65rem .75rem; border: 2px solid #8096a3; border-radius: .55rem; background: white; color: var(--ink); }
input[type="checkbox"], input[type="radio"] { width: 1.35rem; min-height: 1.35rem; height: 1.35rem; accent-color: var(--orange-dark); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field.wide { grid-column: 1 / -1; }
.hint { margin: 0; color: var(--muted); font-size: .9rem; }
.radio-row { border: 0; padding: 0; display: flex; gap: 1rem; flex-wrap: wrap; }
.radio-row legend { margin-bottom: .4rem; }
.radio-row label { min-height: 44px; display: flex; gap: .5rem; align-items: center; }
.align-end { justify-content: end; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.route-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); gap: 1rem; }
.route-card h3 { font-size: 1.4rem; margin-block: 1rem .5rem; }
.route-card-top, .action-bar, .button-row, .step-actions, .danger-zone { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.route-card-top { justify-content: space-between; }
.compare-check { min-height: 44px; display: flex; align-items: center; gap: .5rem; }
.badge { display: inline-block; border-radius: 999px; background: #e6edf1; padding: .25rem .55rem; font-size: .78rem; font-weight: 800; }
.score-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.empty-state { border: 2px dashed #91a5b0; border-radius: 1rem; padding: 2rem; color: var(--muted); }
.backup form { margin-top: 1rem; max-width: 520px; display: grid; gap: .6rem; }

.breadcrumb { display: flex; gap: .55rem; margin-bottom: 1.5rem; }
.route-hero { display: grid; grid-template-columns: 1fr minmax(320px, .9fr); gap: 2rem; align-items: stretch; }
.current-time { font-size: 1.3rem; font-weight: 750; }
.scoreboard { background: var(--navy); color: white; padding: 1.5rem; border-radius: 1.2rem; box-shadow: var(--shadow); }
.score-main { color: var(--yellow); font-weight: 900; font-size: 1.5rem; }
.score-main span { font-size: clamp(3rem, 7vw, 5rem); line-height: .9; }
.scoreboard dl { margin-top: 1.2rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; }
.scoreboard dt { color: #d9e6ed; }.scoreboard dd { color: white; }
.action-bar { margin-block: 1.5rem 2rem; }
.action-bar form, .step-actions form, .danger-zone form { margin: 0; }
.alert { border-left: .5rem solid var(--orange); background: #fff3d1; padding: 1rem 1.25rem; border-radius: .6rem; margin-block: 1.2rem; }
.alert.danger { border-color: var(--red); background: #fff0ef; }.alert.success { border-color: var(--green); background: #e8f7f1; }
.stamp-card { background: #fff3bf; border: 2px solid #b98500; margin-block: 2rem; }
.chooser { margin-block: 3rem; }
.loading-status { min-height: 3rem; padding: 1rem 0; font-weight: 750; }
.departure-list, .destination-list, .timeline, .checklist, .issue-list { list-style: none; padding: 0; }
.departure-list { display: grid; gap: 1rem; }
.departure-card { box-shadow: none; }
.departure-card.risky { border: 3px solid var(--orange-dark); }
.departure-header { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.departure-header { min-height: 48px; cursor: pointer; }
.departure-title { color: var(--navy); font-size: 1.2rem; font-weight: 850; }
.departure-card details[open] .departure-header { border-bottom: 1px solid var(--border); padding-bottom: .8rem; }
.warning-text { color: #77210c; }
.destination-list { display: grid; gap: .6rem; }
.destination-button { width: 100%; min-height: 58px; justify-content: flex-start; text-align: left; font-weight: 700; }
.option-main, .option-route { display: block; width: 100%; }
.option-route { margin-top: .25rem; color: var(--muted); font-size: .86rem; font-weight: 600; }
.destination-button.unresolved { border-style: dashed; }
.option-warning { color: var(--red); }

.timeline { position: relative; }
.timeline li { margin-bottom: 1rem; }
.timeline article { display: grid; grid-template-columns: 48px 1fr; gap: 1rem; align-items: start; }
.step-number { width: 48px; height: 48px; background: var(--yellow); border: 2px solid var(--navy); border-radius: 50%; display: grid; place-items: center; font-weight: 900; }
.step-body { background: white; border-bottom: 1px solid var(--border); padding: .25rem 0 1.4rem; }
.step-body h3 { margin-top: .2rem; }
.settings summary { min-height: 44px; display: flex; align-items: center; font-size: 1.25rem; font-weight: 800; cursor: pointer; }
.danger-zone { border-top: 1px solid var(--border); margin-top: 1.5rem; padding-top: 1.5rem; }

.checklist { display: grid; gap: .8rem; }
.checklist li { background: white; border: 2px solid var(--border); border-radius: .8rem; }
.checklist label { min-height: 76px; display: flex; align-items: center; gap: 1rem; padding: .85rem; }
.checklist li.done { background: #e6f4ef; border-color: var(--green); }
.checklist li.done span { text-decoration: line-through; text-decoration-thickness: 2px; }
.offline-note { border-left: 4px solid var(--green); padding-left: 1rem; }
.comparison { overflow-x: auto; margin-block: 1.5rem; }
table { border-collapse: collapse; width: 100%; background: white; }
caption { text-align: left; font-weight: 750; padding: .75rem 0; }
th, td { border: 1px solid var(--border); padding: .9rem; text-align: left; }
th { background: #eaf0f3; }
.summary-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .7rem; }
.issue-list li { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.flash-stack { position: relative; width: min(900px, calc(100% - 2rem)); margin: 1rem auto 0; }
.flash { padding: .8rem 1rem; background: white; border-left: .4rem solid var(--navy); }.flash.error { border-color: var(--red); }.flash.success { border-color: var(--green); }

@media (max-width: 760px) {
  .site-header, .site-header nav { align-items: flex-start; }
  .site-header { flex-direction: column; }
  .split, .route-hero, .form-grid { grid-template-columns: 1fr; }
  .field.wide { grid-column: auto; }
  .scoreboard dl { grid-template-columns: 1fr 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
}

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

@media (forced-colors: active) {
  .scoreboard, .brand-mark, .step-number, .primary { border: 2px solid ButtonText; }
}
