:root {
  --bg: #f7f6f2; --surface: #ffffff; --ink: #16181d; --muted: #5b6070; --line: #e3e1da;
  --brand: #ffc72c; --brand-ink: #1a1400; --accent: #0b6b3a; --accent-soft: #e5f3eb;
  --warn: #8a5300; --warn-soft: #fff3d6; --bad: #a32020; --bad-soft: #fde8e8; --info-soft: #e8eefc; --info: #22408f;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111317; --surface: #1a1d23; --ink: #eceef2; --muted: #9aa0ad; --line: #2b2f37;
    --brand: #ffcf4a; --accent: #5fd08f; --accent-soft: #15301f; --warn: #ffc86b; --warn-soft: #332507;
    --bad: #ff8a8a; --bad-soft: #3a1515; --info-soft: #18233f; --info: #9db6ff; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.concept-bar { background: var(--ink); color: var(--bg); font-size: 13px; text-align: center; padding: 6px 16px; }
.concept-bar a { color: var(--brand); }
.draft-bar { background: var(--info-soft); color: var(--info); padding: 10px 16px; text-align: center; font-size: 14px; }
.draft-bar button { background: none; border: 0; text-decoration: underline; cursor: pointer; color: inherit; padding: 0; }

header.site { background: var(--brand); color: var(--brand-ink); }
header.site .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.logo { font-weight: 800; letter-spacing: -.02em; text-decoration: none; font-size: 19px; display: flex; gap: 8px; align-items: center; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--brand-ink); color: var(--brand); display: grid; place-items: center; font-size: 13px; }
nav.main { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
nav.main a { text-decoration: none; padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: 15px; }
nav.main a:hover, nav.main a[aria-current] { background: rgba(0,0,0,.08); }

.hero { background: var(--brand); color: var(--brand-ink); padding: 24px 0 40px; }
.hero h1 { font-size: clamp(28px, 6vw, 44px); line-height: 1.1; margin: 0 0 6px; letter-spacing: -.03em; }
.hero p { margin: 0 0 20px; font-size: 17px; opacity: .85; }
.search { display: flex; background: #fff; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.search input { flex: 1; border: 0; padding: 16px; font-size: 17px; min-width: 0; background: transparent; color: #16181d; }
.search input:focus { outline: none; }
.search:focus-within { outline: 3px solid var(--brand-ink); }
.clock { font-size: 14px; margin-top: 10px; opacity: .8; }

main { padding: 24px 0 64px; }
h2 { font-size: 22px; letter-spacing: -.01em; margin: 32px 0 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 14px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.alerts { display: grid; gap: 10px; margin-top: -20px; position: relative; }
.alert { border-radius: var(--radius); padding: 12px 16px; background: var(--info-soft); color: var(--info); box-shadow: var(--shadow); }
.alert.warning { background: var(--warn-soft); color: var(--warn); }
.alert.severe { background: var(--bad-soft); color: var(--bad); }
.alert strong { display: block; }
.alert small { opacity: .8; }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
a.route-card { display: grid; grid-template-columns: auto 1fr; align-content: start; gap: 4px 14px; padding: 16px; text-decoration: none; transition: transform .1s; }
a.route-card:hover { transform: translateY(-2px); border-color: var(--muted); }
.badge { grid-row: 1 / span 4; align-self: start; background: var(--brand); color: var(--brand-ink); font-weight: 800; border-radius: 10px; min-width: 56px; height: 56px; display: grid; place-items: center; font-size: 18px; padding: 0 8px; letter-spacing: -.02em; }
.badge.express { background: #1b4fd8; color: #fff; } .badge.premium { background: #6b2bd9; color: #fff; } .badge.rural { background: var(--accent); color: #fff; }
.badge.small { font-size: 13px; min-width: 44px; height: 44px; }
.route-title { font-weight: 700; line-height: 1.25; }
.route-via { color: var(--muted); font-size: 14px; }
.next { font-size: 14px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pill { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.pill.stale, .pill.future { background: var(--warn-soft); color: var(--warn); }
.pill.expired { background: var(--bad-soft); color: var(--bad); }
.pill.neutral { background: var(--line); color: var(--muted); }
.empty { color: var(--muted); padding: 24px; text-align: center; }

/* route page */
.route-head { display: flex; gap: 16px; align-items: center; margin: 8px 0 16px; }
.route-head .badge { width: 72px; height: 72px; font-size: 22px; grid-row: auto; }
.route-head h1 { margin: 0; font-size: clamp(22px, 5vw, 32px); line-height: 1.15; letter-spacing: -.02em; }
.cols { display: grid; gap: 16px; grid-template-columns: 1fr; }
.cols > *, .admin > * { min-width: 0; }
@media (min-width: 860px) { .cols { grid-template-columns: 1.1fr .9fr; } }
.panel { padding: 16px 18px; }
.panel h2 { margin-top: 0; font-size: 18px; }
.big-next { display: flex; gap: 10px; flex-wrap: wrap; }
.big-next .t { font-size: 22px; font-weight: 800; background: var(--bg); border-radius: 10px; padding: 8px 12px; }
.big-next .t small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }

.diagram { width: 100%; overflow-x: auto; }
.stops { list-style: none; margin: 0; padding: 0; }
.stops li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; min-height: 44px; position: relative; }
.stops li::before { content: ""; position: absolute; left: 13px; top: 0; bottom: 0; width: 4px; background: var(--brand); }
.stops li:first-child::before { top: 50%; } .stops li:last-child::before { bottom: 50%; }
.stops .dot { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 4px solid var(--ink); margin-left: 6px; z-index: 1; }
.stops li:first-child .dot, .stops li:last-child .dot { background: var(--ink); }
.stops .eta { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 8px 12px; font-weight: 600; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--brand); }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; font-variant-numeric: tabular-nums; }
.times span { background: var(--bg); border-radius: 8px; padding: 6px; text-align: center; font-size: 14px; }
.times span.past { opacity: .4; } .times span.nextup { background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.band { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.band:last-child { border: 0; }
table.fares { width: 100%; border-collapse: collapse; font-size: 15px; }
table.fares td { padding: 8px 0; border-bottom: 1px solid var(--line); }
table.fares td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.meta { color: var(--muted); font-size: 13px; margin-top: 12px; }
.status-box { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; }
.status-box.expired { background: var(--bad-soft); color: var(--bad); }
.status-box.stale, .status-box.future { background: var(--warn-soft); color: var(--warn); }

footer.site { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 14px; }

/* admin */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 14px; cursor: pointer; font-weight: 600; text-decoration: none; font-size: 15px; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.danger { color: var(--bad); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 20px; }
.admin { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .admin { grid-template-columns: 260px 1fr; } }
.side-list { padding: 8px; max-height: 70vh; overflow: auto; }
.side-list button { display: flex; width: 100%; gap: 10px; align-items: center; border: 0; background: none; padding: 8px; border-radius: 8px; cursor: pointer; text-align: left; }
.side-list button[aria-current="true"] { background: var(--bg); }
.side-list .name { font-size: 14px; line-height: 1.2; }
label.f { display: grid; gap: 4px; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
label.f input, label.f select, label.f textarea { font-weight: 400; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg); width: 100%; }
label.f textarea { min-height: 70px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
label.f .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.row2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 0 0 12px; }
legend { font-weight: 700; font-size: 14px; padding: 0 6px; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

/* pitch */
.prose { max-width: 720px; } .prose p, .prose li { font-size: 17px; }
.compare { display: grid; gap: 12px; grid-template-columns: 1fr; } @media (min-width: 700px) { .compare { grid-template-columns: 1fr 1fr; } }
.compare .card { padding: 16px 18px; } .compare h3 { margin-top: 0; }
.compare ul { padding-left: 18px; margin: 0; } .compare li { margin-bottom: 6px; }
