/* Bahn Control Room — styled after bahnexpress.com: cream paper, near-black ink,
   warm grey pills, wide heavy headings, black pill buttons. Bright by design. */
:root {
  --bg: #fffef7;
  --paper: #ffffff;
  --sand: #f6f3ea;
  --pill: #e2ded4;
  --line: #e7e2d6;
  --ink: #12110e;
  --ink-2: #2a2721;
  --muted: #8a7f6b;
  --green: #165038;
  --green-soft: #e4eee7;
  --red: #b23a22;
  --red-soft: #fbe9e2;
  --amber: #96620c;
  --amber-soft: #f8eed8;
  --radius: 20px;
  --radius-sm: 14px;
  --wide: "Archivo", "Arial Black", system-ui, sans-serif;
  --body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.wide { font-family: var(--wide); font-stretch: 125%; }

/* Top bar */
.top { display: flex; align-items: center; gap: 24px; padding: 14px 28px; background: var(--bg); position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo { width: 22px; height: 22px; }
.mark { font-family: var(--wide); font-stretch: 125%; font-weight: 900; font-size: 22px; letter-spacing: -.02em; }
.product { color: var(--muted); font-weight: 500; margin-left: 6px; white-space: nowrap; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.tabs::-webkit-scrollbar { display: none; }
.tab { background: none; border: 0; padding: 8px 16px; border-radius: 999px; font-weight: 500; white-space: nowrap; color: var(--ink-2); }
.tab:hover { background: var(--sand); }
.tab.on { background: var(--pill); color: var(--ink); }
.tab b { margin-left: 6px; font-weight: 600; }
.tab.primary b { background: var(--red); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; }
.top-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.live { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.live b { color: var(--ink-2); font-weight: 500; }
.live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.live.on .dot { background: #2f9e5b; }
.lang { display: flex; background: var(--sand); border-radius: 999px; padding: 3px; }
.lang button { background: none; border: 0; padding: 4px 12px; font-size: 13px; font-weight: 600; border-radius: 999px; color: var(--muted); }
.lang button.on { background: var(--ink); color: var(--bg); }

/* Layout */
.layout { display: grid; grid-template-columns: minmax(340px, 420px) 1fr; min-height: calc(100vh - 63px); }
/* The order list scrolls on its own; the order page scrolls with the window. */
.queue { padding: 28px 20px 48px 28px; border-right: 1px solid var(--line); position: sticky; top: var(--top-h, 63px); align-self: start; height: calc(100vh - var(--top-h, 63px)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.detail { padding: 28px 40px 64px; max-width: 1040px; width: 100%; }
@media (max-width: 1000px) {
  .live { display: none; }
}
@media (max-width: 900px) {
  .top { flex-wrap: wrap; gap: 10px 16px; padding: 12px 16px; }
  .tabs { order: 3; flex-basis: 100%; }
  .layout { grid-template-columns: 1fr; }
  .queue { border-right: 0; padding: 20px 16px; position: static; height: auto; overflow: visible; }
  .detail { padding: 16px; }
  .layout.open .queue { display: none; }
  .layout:not(.open) .detail { display: none; }
}

.queue-title { font-family: var(--wide); font-stretch: 125%; font-weight: 900; text-transform: uppercase; font-size: 24px; letter-spacing: -.01em; line-height: 1.1; margin: 0 0 6px; }
.queue-sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.filters { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: -6px 0 14px; }
.filters input { grid-column: 1 / -1; }
.filters input, .filters select { font: inherit; font-size: 13px; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 12px; min-width: 0; }
.filters input:focus, .filters select:focus { outline: none; border-color: var(--ink); }
.filter-note { font-size: 12px; color: var(--muted); margin: -6px 0 12px; }
.linkish { background: none; border: 0; padding: 0; text-decoration: underline; color: var(--ink-2); font-size: 12px; }

/* Group banner */
.group { background: var(--amber-soft); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.group h3 { margin: 0 0 4px; font-size: 15px; }
.group p { margin: 0 0 10px; font-size: 13px; color: var(--ink-2); }
.group .refs { font-size: 12px; color: var(--muted); margin-bottom: 10px; }

/* Order list */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.row { display: block; width: 100%; text-align: left; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px 16px; transition: border-color .12s, box-shadow .12s; }
.row:hover { border-color: var(--pill); box-shadow: 0 2px 10px rgba(18, 17, 14, .05); }
.row.sel { border-color: var(--ink); }
.row-top { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.route-line { font-family: var(--wide); font-stretch: 125%; font-weight: 800; font-size: 15px; line-height: 1.3; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.route-line .arrow { color: var(--muted); font-weight: 600; }
.cc { font-family: var(--body); font-size: 10px; font-weight: 600; letter-spacing: .04em; padding: 1px 6px; border-radius: 999px; background: var(--pill); color: var(--ink-2); vertical-align: middle; }
.cc.EE { background: #dfe8f5; color: #1f3d6b; }
.meta-line { color: var(--muted); font-size: 13px; margin-top: 2px; }
.why-line { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-size: 13px; font-weight: 600; }
.why-line span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.why-line.calm { background: var(--sand); color: var(--ink-2); font-weight: 500; }
.conf { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; padding: 2px 9px; border-radius: 999px; flex-shrink: 0; }
.conf.low { color: var(--red); background: var(--red-soft); }
.conf.mid { color: var(--amber); background: var(--amber-soft); }
.conf.high { color: var(--green); background: var(--green-soft); }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); margin: 0 0 6px; font-size: 17px; }

/* Order page: one action panel, the map, then collapsed details */
.back { display: none; background: var(--sand); border: 0; border-radius: 999px; padding: 6px 14px; margin-bottom: 14px; font-weight: 500; }
@media (max-width: 900px) { .back { display: inline-block; } }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--pill); color: var(--ink-2); margin-left: 4px; vertical-align: middle; }
.ap { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 0 22px 18px; margin-bottom: 14px; overflow: hidden; }
.ap.urgent { border: 2px solid var(--ink); }
.ap-deadline { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 -22px 16px; padding: 12px 22px; color: #fff; background: var(--ink); }
.ap-deadline b { font-family: var(--wide); font-stretch: 125%; font-weight: 900; font-size: 22px; text-transform: uppercase; letter-spacing: -.01em; }
.ap-deadline span { font-size: 14px; opacity: .9; }
.ap-deadline.urgent, .ap-deadline.over { background: var(--red); }
.ap-deadline.soon { background: var(--amber); }
.ap-route { padding-top: 16px; font-family: var(--wide); font-stretch: 125%; font-weight: 800; font-size: 17px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.ap-deadline + .ap-route { padding-top: 0; }
.ap-route .arrow { color: var(--muted); }
.ap-meta { font-family: var(--body); font-weight: 400; font-size: 13px; color: var(--muted); flex-basis: 100%; }
.ap-why { margin: 12px 0 0; font-size: 15px; font-weight: 600; color: var(--red); }
.ap-why.calm { color: var(--ink-2); font-weight: 500; }
.ap-why .src { margin-left: 6px; font-weight: 400; }
.ap-label { margin-top: 16px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ap-decision { font-family: var(--wide); font-stretch: 125%; font-weight: 800; font-size: 20px; line-height: 1.35; margin: 6px 0 14px; letter-spacing: -.005em; }
.ap-rest { margin: -6px 0 14px; font-size: 14px; color: var(--ink-2); }
.ap .options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 0; border-top: 0; }
.ap .options .subhead { margin: 0 4px 0 0; }
.ap .next { cursor: pointer; }
.ap .next span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ap .next.open span { display: block; }
.ap-arrival { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.ap-arrival .arrow { color: var(--muted); }
.ap-arrival .good { color: var(--green); }
.ap-arrival .muted { margin-left: auto; font-size: 13px; }
.mapcard { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.map { height: 320px; background: var(--sand); }
@media (max-width: 700px) { .map { height: 240px; } }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 14px; font-size: 12px; color: var(--ink-2); border-top: 1px solid var(--line); }
.legend .k { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.legend .k.ok { background: #165038; } .legend .k.risk { background: #b23a22; } .legend .k.warn { background: #c8871b; }
.legend .k.good { width: 10px; height: 10px; border-radius: 50%; background: #1f7a4d; }
.legend .k.ferry { background: repeating-linear-gradient(90deg, #2f6db5 0 5px, transparent 5px 9px); }
.details { display: flex; flex-direction: column; gap: 8px; }
.sec { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-sm); }
.sec summary { cursor: pointer; padding: 12px 16px; font-weight: 600; font-size: 14px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.sec summary::-webkit-details-marker { display: none; }
.sec summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 18px; }
.sec[open] summary::after { content: "–"; }
.sec-body { padding: 0 16px 16px; }
.sec-body h2 { margin: 0 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
/* Deadline chips in the queue */
.dl { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.dl.urgent, .dl.over { background: var(--red); color: #fff; }
.dl.soon { background: var(--amber-soft); color: var(--amber); }
.dl.calm { background: var(--sand); color: var(--ink-2); }
.row.first { border: 2px solid var(--red); }
.row-flag { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--red); margin-bottom: 6px; }
.why-line { color: var(--ink); background: var(--sand); font-weight: 600; }
.row .meta-line { margin-top: 8px; }

/* Cards */
.card { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.decision { border: 2px solid var(--ink); background: var(--paper); }
.decision h2 { color: var(--ink); }
.decision .text { font-family: var(--wide); font-stretch: 125%; font-weight: 800; font-size: 19px; line-height: 1.35; margin: 0 0 10px; letter-spacing: -.005em; }
.decision .who { font-size: 14px; color: var(--ink-2); margin: 0 0 12px; }
.found { margin: 0 0 16px; padding-left: 18px; font-size: 14px; color: var(--ink-2); }
.found li { margin-bottom: 4px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn { border-radius: 999px; padding: 10px 20px; border: 1.5px solid var(--pill); background: var(--paper); font-weight: 600; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: var(--ink-2); }
.btn.soft { background: var(--pill); border-color: var(--pill); }
.btn.small { padding: 6px 14px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.options { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 4px; }
.option { display: grid; grid-template-columns: minmax(170px, auto) 1fr; gap: 12px; align-items: start; padding: 8px 0; font-size: 13px; color: var(--ink-2); }
.option .btn { justify-self: start; text-align: left; }
.btn.danger { color: var(--red); border-color: var(--red-soft); }
.btn.danger:hover { border-color: var(--red); background: var(--red-soft); }
@media (max-width: 700px) { .option { grid-template-columns: 1fr; gap: 4px; } }
.next { margin-top: 14px; font-size: 13px; color: var(--ink-2); background: var(--sand); border-radius: 12px; padding: 10px 12px; }
.next b { font-weight: 600; }
.done-note { background: var(--green-soft); color: var(--green); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.done-note span { color: var(--ink-2); }

.reasons { list-style: none; margin: 0; padding: 0; }
.reasons li { display: grid; grid-template-columns: 8px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.reasons li:first-child { border-top: 0; padding-top: 0; }
.reasons li.superseded { opacity: .6; }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--pill); }
.dot.hi { background: var(--red); } .dot.md { background: #d39a2c; }
.src { font-size: 12px; color: var(--muted); background: none; border: 0; padding: 0; text-decoration: underline; text-decoration-color: var(--pill); text-underline-offset: 3px; }
.src:hover { color: var(--ink); text-decoration-color: currentColor; }
.tag { font-size: 11px; color: var(--muted); background: var(--sand); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.tag.live { background: var(--green-soft); color: var(--green); }

/* Confidence */
.confbig { display: flex; align-items: baseline; gap: 6px; }
.confbig b { font-family: var(--wide); font-stretch: 125%; font-size: 40px; font-weight: 900; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.confbig b.low { color: var(--red); } .confbig b.mid { color: var(--amber); } .confbig b.high { color: var(--green); }
.conf-sub { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.bars { display: grid; grid-template-columns: 74px 1fr 26px; gap: 6px 8px; align-items: center; font-size: 12px; }
.bar { height: 6px; background: var(--sand); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: #d39a2c; border-radius: 99px; }
.bars .n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Timing */
.eta { list-style: none; margin: 0; padding: 0; }
.eta li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--line); align-items: baseline; }
.eta li:first-child { border-top: 0; padding-top: 0; }
.eta .k { font-size: 13px; color: var(--ink-2); }
.eta .v { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.eta .note { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.eta li.nothing { background: var(--red-soft); margin: 4px -10px; padding: 8px 10px; border-radius: 10px; border-top: 0; }
.eta li.approve { background: var(--green-soft); margin: 4px -10px; padding: 8px 10px; border-radius: 10px; border-top: 0; }
.eta li.nothing + li, .eta li.approve + li { border-top: 0; }
.chip { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; margin-left: 6px; }
.chip.late { background: var(--red); color: #fff; }
.chip.ok { background: var(--green); color: #fff; }
.chip.unknown { background: var(--ink); color: #fff; }

/* Route conditions */
.legs { list-style: none; margin: 0; padding: 0; }
.legs li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 7px 0; font-size: 13px; }
.legs .ic { width: 22px; height: 22px; border-radius: 50%; background: var(--sand); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--ink-2); }
.legs b { font-weight: 600; }
.legs .s { color: var(--muted); }
.subhead { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 12px 0 6px; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.bad { color: var(--red); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }

/* Agent */
.steps { list-style: none; margin: 0 0 14px; padding: 0; font-size: 13px; }
.steps li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 6px 0; }
.steps .ic { width: 20px; height: 20px; border-radius: 50%; background: var(--sand); display: grid; place-items: center; font-size: 10px; color: var(--muted); }
.steps li.person .ic { background: var(--ink); color: var(--bg); }
.steps .t { color: var(--muted); }
.steps .t b { color: var(--ink); font-weight: 600; }
.say-list { margin: 4px 0 0; padding-left: 18px; color: var(--ink); }
.steps .say-list li { display: list-item; padding: 0; margin: 2px 0; }
.ask { display: flex; gap: 8px; }
.ask input { flex: 1; border: 1.5px solid var(--line); background: var(--bg); border-radius: 999px; padding: 10px 16px; font: inherit; color: var(--ink); min-width: 0; }
.ask input:focus { outline: none; border-color: var(--ink); }
.working { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.working::before { content: ""; width: 12px; height: 12px; border: 2px solid var(--pill); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.timeline { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.timeline li { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline .when { color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline .who { font-weight: 600; margin-right: 6px; text-transform: capitalize; }
.linkbtn { background: none; border: 0; color: var(--ink-2); padding: 8px 0 0; font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.alts { list-style: none; margin: 8px 0 0; padding: 0; }
.alts li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.alts small { color: var(--muted); display: block; }

/* Source drawer */
.sheet { position: fixed; inset: 0; background: rgba(18, 17, 14, .25); display: flex; justify-content: flex-end; z-index: 10; }
.sheet[hidden] { display: none; }
.sheet .panel { width: min(480px, 100%); height: 100%; background: var(--bg); padding: 24px; overflow: auto; box-shadow: -8px 0 30px rgba(0, 0, 0, .08); }
.sheet h3 { margin: 0 0 4px; font-family: var(--wide); font-stretch: 125%; font-weight: 900; text-transform: uppercase; font-size: 18px; }
.sheet .meta { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.sheet .kv { font-size: 13px; }
.sheet .kv dd { word-break: break-word; }
.ev-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ev-head .meta { margin: 0; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 600; }
.ev-quote { margin: 0 0 16px; padding: 12px 14px; background: var(--sand); border-left: 3px solid var(--ink); border-radius: 0 10px 10px 0; font-size: 15px; line-height: 1.5; }
.sheet .kv.ev { font-size: 14px; margin-bottom: 18px; }
.raw { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.raw summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.raw .meta { margin: 10px 0 8px; }

.skel { background: linear-gradient(90deg, var(--sand) 0%, var(--paper) 50%, var(--sand) 100%); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: var(--radius); }
@keyframes sh { to { background-position: -200% 0; } }
.muted { color: var(--muted); }

/* Weekly report */
.report-link { background: none; border: 1.5px solid var(--pill); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.report-link:hover, .report-link.on { border-color: var(--ink); }
.report[hidden], .layout[hidden] { display: none; }
.rp { max-width: 1100px; margin: 0 auto; padding: 28px 28px 64px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 20px 0 14px; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.tile .k { font-size: 13px; color: var(--muted); font-weight: 500; }
.tile .v { font-family: var(--wide); font-stretch: 125%; font-weight: 800; font-size: 32px; line-height: 1.2; margin: 4px 0 2px; }
.tile .v small { font-family: var(--body); font-stretch: 100%; font-size: 14px; font-weight: 500; color: var(--muted); }
.tile .s { font-size: 13px; color: var(--ink-2); }
.tile.good .v { color: var(--green); }
.tile.bad .v { color: var(--red); }
.split { display: flex; gap: 2px; height: 12px; border-radius: 999px; overflow: hidden; background: var(--sand); }
.seg.early, .legend i.early, .pill.early { background: var(--green); }
.seg.ontime, .legend i.ontime { background: #7fa98f; }
.seg.missed, .legend i.missed { background: var(--red); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--ink-2); margin: 8px 0 18px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.load { background: var(--sand); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 14px; margin: 0 0 8px; }
.rp-h { font-family: var(--wide); font-stretch: 125%; font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: .02em; margin: 28px 0 10px; }
.rt-wrap { overflow-x: auto; }
.rt { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.rt th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--sand); }
.rt td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rt tr:last-child td { border-bottom: 0; }
.rt.narrow { max-width: 560px; }
.rt .ref { font-weight: 600; text-decoration: underline; text-decoration-color: var(--pill); text-underline-offset: 3px; }
.rt .sub, .sub { font-size: 12px; color: var(--muted); }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.early { color: #fff; }
.pill.ontime { background: var(--green-soft); color: var(--green); }
.muted.small { font-size: 12px; }
@media (max-width: 760px) {
  .rp { padding: 20px 16px 48px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-link { padding: 5px 10px; font-size: 12px; }
}
.rp .sec { margin-top: 24px; }
.rp .sec p { margin: 0; padding: 0 16px 16px; font-size: 14px; }

/* Score a file */
.drop { display: block; border: 2px dashed var(--pill); border-radius: var(--radius); background: var(--paper); padding: 34px 20px; text-align: center; cursor: pointer; font-size: 15px; margin: 18px 0 14px; }
.drop:hover, .drop.over { border-color: var(--ink); background: var(--sand); }
.samples { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 13px; margin-bottom: 16px; }
.sample { white-space: nowrap; }
.dl { font-size: 12px; color: var(--muted); text-decoration: underline; }
.cols .kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 13px; }
.cols dt code { font-size: 12px; }
.cols dd { margin: 0; color: var(--ink-2); }
.up-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; font-size: 14px; }
.up-head .spacer { flex: 1; }
.tiles.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.lane-chip { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--sand); color: var(--ink-2); }
.lane-chip.needs_you { background: var(--red-soft); color: var(--red); }
.lane-chip.agent { background: var(--amber-soft); color: var(--amber); }
.lane-chip.clear { background: var(--green-soft); color: var(--green); }
.rt.up .arrow { margin: 0 4px; color: var(--muted); }
.why-all { margin-top: 6px; font-size: 13px; }
.why-all summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.why-all ul { margin: 6px 0 0; padding-left: 0; list-style: none; }
.why-all li { margin: 3px 0; }
.why-all .rk { display: inline-block; min-width: 36px; font-weight: 600; color: var(--ink-2); }
.src-tag { font-size: 11px; color: var(--muted); }
.err { color: var(--red); }
.err.small { font-size: 12px; }
@media (max-width: 760px) { .tiles.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

