:root {
  color-scheme: dark;
  --bg: #081b30;
  --panel: #0d2540;
  --well: #081c32;
  --edge: #35536f;
  --ink: #f5f9ff;
  --muted: #bfd0e2;
  --gold: #ffda76;
  font: 16px/1.5 system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--gold); text-underline-offset: .22em; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.shell { width: min(72rem, 100% - clamp(1.5rem, 7vw, 5rem)); margin-inline: auto; }
.skip-link { position: fixed; left: 1rem; top: -5rem; padding: .6rem; background: var(--bg); z-index: 9999; }
.skip-link:focus { top: .6rem; }
.site-bar { background: #09213a; border-bottom: 1px solid var(--edge); }
.site-bar-inner, .site-bar nav, .brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem 1.25rem;
}
.site-bar-inner { justify-content: space-between; min-height: 4.35rem; padding-block: .65rem; }
.site-bar nav a { font-size: .91rem; }
.brand { gap: .6rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand img { border-radius: .4rem; }
.page-intro { margin-block: clamp(1.5rem, 4vw, 3.25rem) 1.4rem; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 5.6vw, 3.8rem); line-height: 1.07; letter-spacing: -.035em; }
.page-intro p { color: var(--muted); margin-top: .55rem; font-size: clamp(1rem, 2vw, 1.17rem); }
.panel {
  margin-bottom: 1rem;
  padding: clamp(.85rem, 2.8vw, 1.65rem);
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: .95rem;
  scroll-margin-top: 1rem;
}
.panel-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .55rem 1rem; }
h2 { font-size: clamp(1.25rem, 3vw, 1.66rem); line-height: 1.2; }
.note, .optional, small { color: var(--muted); }
.note { margin-block: .5rem; font-size: .9rem; }
.fields { display: grid; gap: .7rem; margin: .95rem 0; align-items: end; }
.route-fields, .report-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
label { min-width: 0; display: block; font-size: .9rem; font-weight: 650; }
.optional { font-size: .8em; font-weight: 400; }
input, select, button {
  min-height: 2.7rem;
  border: 1px solid #5b7995;
  border-radius: .45rem;
  font: inherit;
  color: var(--ink);
  background: var(--well);
}
input, select { display: block; width: 100%; margin-top: .22rem; padding: .4rem .55rem; }
input[name="origin"], input[name="destination"] { font-weight: 750; letter-spacing: .045em; }
button { padding: .35rem .75rem; font-size: .92rem; font-weight: 650; cursor: pointer; }
button:hover { border-color: var(--gold); }
button:disabled { opacity: .65; cursor: wait; }
button.primary { color: #12253b; background: var(--gold); border-color: var(--gold); }
button.primary:hover { background: #ffe7a4; }
.status { margin: .75rem 0 .55rem; color: var(--muted); font-size: .91rem; }
.route-legend, .map-key { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin: .6rem 0; padding: 0; list-style: none; font-size: .85rem; }
.route-legend li, .map-key li { display: flex; align-items: center; gap: .4rem; }
.route-swatch, .dot { width: .72rem; height: .72rem; border-radius: 50%; flex: none; display: inline-block; }
.dot-high { background: var(--gold); }
.dot-low { background: #54d3cf; }
.dot-old { background: #94a3b8; }
.chart-frame { min-height: 300px; background: var(--well); border: 1px solid var(--edge); border-radius: .6rem; }
canvas[data-route-chart] { display: block; width: 100%; height: 300px; }
.route-summaries { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr)); gap: .55rem; margin-block: .75rem; }
.route-summary-card { padding: .65rem .75rem; background: var(--well); border: 1px solid var(--edge); border-radius: .55rem; }
.route-summary-card h3 { font-size: .98rem; }
.route-summary-card p { color: var(--muted); margin-top: .27rem; font-size: .86rem; }
details { margin-top: .85rem; }
summary { color: var(--gold); cursor: pointer; font-size: .92rem; }
.table-scroll { overflow-x: auto; margin-block: .65rem; border: 1px solid var(--edge); border-radius: .45rem; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
caption { text-align: left; padding: .55rem; color: var(--muted); }
th, td { text-align: left; padding: .5rem .65rem; vertical-align: top; border-bottom: 1px solid var(--edge); }
thead { background: var(--well); }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:nth-child(even) { background: #0a2037; }
time, td { font-variant-numeric: tabular-nums; }
td time { white-space: nowrap; }
td small { display: block; margin-top: .12rem; }
.map-frame {
  height: clamp(300px, 44vw, 450px);
  border: 1px solid var(--edge);
  border-radius: .6rem;
  background: #172e43;
  isolation: isolate;
}
.page-footer { display: flex; flex-wrap: wrap; gap: .4rem 1rem; justify-content: space-between; padding-block: .7rem 2rem; color: var(--muted); font-size: .88rem; }
@media (max-width: 48rem) {
  .route-fields, .report-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 30rem) {
  .site-bar nav { gap: .4rem .75rem; }
  .site-bar nav a { font-size: .8rem; }
  .chart-frame { min-height: 270px; }
  canvas[data-route-chart] { height: 270px; }
}
.route-summary-card h3 { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; }
.route-summary-card h3 small { font-weight: 400; }
.route-summary-card p.route-summary-current { color: var(--ink); }
.route-values td.is-at-threshold { color: var(--gold); font-weight: 750; }
.watchlist-controls {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr);
  gap: .8rem;
  margin-top: .85rem;
}
.watchlist-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: .6rem;
  background: var(--well);
  border: 1px solid var(--edge);
  border-radius: .55rem;
  padding: .7rem;
}
.watchlist-form label { flex: 1 1 8rem; }
.watchlist-buttons { display: flex; flex-wrap: wrap; gap: .4rem; }
.watchlist-items { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.watchlist-entry {
  background: var(--well);
  border: 1px solid var(--edge);
  border-radius: .55rem;
  padding: .65rem .75rem;
}
.watchlist-entry-heading { color: var(--gold); margin-bottom: .3rem; }
.watchlist-entry-actions { display: flex; flex-wrap: wrap; align-items: end; gap: .45rem; }
.watchlist-entry-actions button { min-height: 2.15rem; }
.watchlist-estimate { margin-top: .35rem; color: var(--muted); font-size: .88rem; }
.check-field { display: inline-flex; align-items: center; gap: .45rem; margin-top: .4rem; }
.check-field input { width: 1rem; height: 1rem; min-height: 0; margin: 0; accent-color: var(--gold); }
tr.is-watched-report, tr.watchlist-match { background: #2f352f; }
.report-watch-label, tr.watchlist-match small { color: var(--gold); }
@media (max-width: 58rem) {
  .watchlist-controls { grid-template-columns: 1fr; }
}
