/* Dashboard-style daily report (dark). Data colours validated all-pairs on #1a1a19. */
.dash {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321;
  --ink: #ffffff; --ink-2: #c3c2b7; --muted: #898781;
  --grid: #2c2c2a; --baseline: #383835; --border: rgba(255,255,255,.10);
  --accent: #ff5a1f; --good: #0ca30c;
  --p1: #3987e5; --p2: #199e70; --p3: #c98500;
  --act: #ecebe6; --prev: #5b5a56;
  margin: 0; background: var(--page); color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased;
}
.dash * { box-sizing: border-box; }
.dash a { color: inherit; text-decoration: none; }
.dash .wrap { width: min(1100px, calc(100% - 32px)); margin: 0 auto; }

.dash-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; }
.dash .logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; }
.day-switch { display: flex; align-items: center; gap: 14px; }
.day-switch > span { display: flex; flex-direction: column; align-items: center; }
.day-switch b { font-size: 17px; letter-spacing: -.01em; }
.day-switch small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.day-switch > a { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border); font-size: 20px; }
.day-switch > a:hover { background: var(--surface-2); }
.day-switch > a.off { opacity: .3; pointer-events: none; }
.pill { border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-family: inherit; font-weight: 600; font-size: 13px; line-height: 1; padding: 10px 16px; cursor: pointer; }
.pill.ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); padding: 8px 14px; font-size: 12px; }

.sample { color: var(--muted); font-size: 12px; margin: 4px 0 18px; }
.sample span { color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; margin-right: 8px; font-weight: 500; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 26px 20px 22px; text-align: center; }
.ring-wrap { position: relative; width: 168px; height: 168px; margin: 0 auto 14px; }
.ring { width: 100%; height: 100%; }
.ring-track { fill: none; stroke: var(--grid); }
.ring-fill { fill: none; stroke-linecap: round; }
.ring-cov .ring-fill { stroke: var(--good); }
.ring-act .ring-fill { stroke: var(--act); }
.ring-rest .ring-fill { stroke: var(--ink-2); }
.ring-value { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-value strong { font-size: 44px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.ring-value strong small { font-size: 20px; font-weight: 600; color: var(--ink-2); margin-left: 1px; }
.ring-value span { font-size: 11px; color: var(--muted); margin-top: 6px; text-transform: uppercase; letter-spacing: .08em; }
.metric h2 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.metric-sub { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-2); }
.metric-vs { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.delta { color: var(--ink); font-weight: 600; margin-right: 3px; }
.status-good { color: var(--good); font-weight: 600; }
.flag { color: var(--ink); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 14px 0; }
.tiles div { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 14px 12px; }
.tiles strong { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.tiles span { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }

.panel { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 20px 20px 16px; margin-bottom: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.muted, .legend { color: var(--muted); font-size: 11.5px; }
.legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.legend i { margin-left: 8px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: 0; }
.dot.p1, .key.p1 { background: var(--p1); fill: var(--p1); }
.dot.p2, .key.p2 { background: var(--p2); fill: var(--p2); }
.dot.p3, .key.p3 { background: var(--p3); fill: var(--p3); }
.sw { display: inline-block; width: 12px; height: 9px; border-radius: 2px; }
.sw.act, .sw.today { background: var(--act); }
.sw.prev { background: var(--prev); }
.sw.nodata { border: 1px solid var(--baseline); }
.scroll { overflow-x: auto; }
.scroll svg { display: block; width: 100%; min-width: 760px; height: auto; }

.strip .grid, .hourly .grid { stroke: var(--grid); stroke-width: 1; }
.strip .baseline, .hourly .baseline { stroke: var(--baseline); stroke-width: 1; }
.strip .axis, .hourly .axis { fill: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.strip .lane { fill: var(--ink-2); font-size: 12px; font-weight: 500; }
.strip .lane-sub { fill: var(--muted); font-size: 10px; }
.strip .lane-track { stroke: var(--grid); stroke-width: 1; }
.strip .light-area { fill: var(--ink); opacity: .07; }
.strip .light-line { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-linejoin: round; }
.strip .ann { fill: var(--muted); font-size: 10px; }
.strip .bin { fill: var(--act); }
.strip .quiet { fill: var(--surface-2); stroke: var(--baseline); }
.strip .quiet-label { fill: var(--muted); font-size: 11px; }
.strip .hit, .hourly .hit { fill: transparent; }
.strip .seg.p1 rect:not(.hit) { fill: var(--p1); }
.strip .seg.p2 rect:not(.hit) { fill: var(--p2); }
.strip .seg.p3 rect:not(.hit) { fill: var(--p3); }
.strip .hov:hover rect:not(.hit), .strip .hov.on rect:not(.hit) { stroke: var(--ink); stroke-width: 1.5; }
.strip .pin { cursor: pointer; }
.strip .pin line { stroke: var(--muted); }
.strip .pin circle { fill: var(--page); stroke: var(--ink-2); stroke-width: 1.5; }
.strip .pin text { fill: var(--ink); font-size: 10px; font-weight: 700; pointer-events: none; }
.strip .pin:hover circle, .strip .pin:focus circle { fill: var(--accent); stroke: var(--accent); }
.hourly .today { fill: var(--act); }
.hourly .prev { fill: var(--prev); }
.hourly .nodata { fill: none; stroke: var(--baseline); }
.hourly .hov:hover .hit { fill: rgba(255,255,255,.05); }
.tip { position: absolute; z-index: 5; pointer-events: none; background: #000; color: var(--ink); border: 1px solid var(--border); border-radius: 10px; padding: 7px 10px; font-size: 12px; max-width: 280px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }

.rail { list-style: none; margin: 0; padding: 0 0 6px; display: grid; grid-auto-flow: column; grid-auto-columns: 196px; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; }
.rail li { scroll-snap-align: start; }
.card { position: relative; width: 100%; text-align: left; background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 0 0 12px; color: var(--ink); font-family: inherit; cursor: pointer; overflow: hidden; }
.card:hover { border-color: rgba(255,255,255,.3); }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; }
.card-letter { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--page); border: 1.5px solid var(--ink-2); font-size: 11px; font-weight: 700; }
.card .card-letter { position: absolute; top: 8px; left: 8px; }
.card-time { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 10px 12px 0; }
.card strong { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin: 2px 12px 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 12px; }
.chips i { font-style: normal; font-size: 10.5px; color: var(--ink-2); background: var(--page); border: 1px solid var(--border); border-radius: 999px; padding: 3px 8px; }

.split { display: grid; grid-template-columns: 1fr 1.6fr; gap: 14px; }
.split .panel { margin-bottom: 14px; }
.who { display: grid; gap: 18px; padding-top: 6px; }
.who-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name num" "bar bar" "meta meta"; gap: 6px 10px; }
.who-name { grid-area: name; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.who-num { grid-area: num; font-size: 12px; color: var(--muted); }
.who-num strong { font-size: 22px; color: var(--ink); font-weight: 700; margin-right: 2px; }
.who-bar { grid-area: bar; height: 10px; background: var(--grid); border-radius: 999px; overflow: hidden; }
.who-bar b { display: block; height: 100%; border-radius: 999px; }
.who-bar b.p1 { background: var(--p1); } .who-bar b.p2 { background: var(--p2); } .who-bar b.p3 { background: var(--p3); }
.who-meta { grid-area: meta; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.trend { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.trend article { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 14px; }
.trend h3 { margin: 0 0 12px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.mbars { display: flex; gap: 8px; height: 104px; }
.mb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mb-v { font-size: 11px; color: var(--muted); }
.mb-bar { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.mb-bar b { display: block; width: 100%; background: var(--prev); border-radius: 4px 4px 0 0; min-height: 2px; }
.mb-d { font-size: 10px; color: var(--muted); }
.mb.on .mb-bar b { background: var(--act); }
.mb.on .mb-v { color: var(--ink); font-weight: 600; font-size: 12px; }
.md-track { position: relative; height: 104px; }
.md-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50px; height: 1px; background: var(--baseline); }
.md-dot { position: absolute; top: 44px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.md-dot i { width: 12px; height: 12px; border-radius: 50%; background: var(--prev); border: 2px solid var(--surface-2); }
.md-dot b { position: absolute; bottom: 20px; font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.md-dot em { font-style: normal; font-size: 10px; color: var(--muted); margin-top: 6px; }
.md-dot:nth-child(odd) b { bottom: auto; top: 34px; }
.md-dot:nth-child(odd) em { position: absolute; bottom: 20px; margin: 0; }
.md-dot.on i { background: var(--act); }
.md-dot.on b { color: var(--ink); font-weight: 700; }

.fine { color: var(--muted); font-size: 12px; margin: 6px 4px 30px; }
.fine summary { cursor: pointer; color: var(--ink-2); }
.fine ul { margin: 10px 0; padding-left: 18px; line-height: 1.8; }
.fine b { color: var(--ink-2); font-weight: 600; }
.fine a { color: var(--ink-2); text-decoration: underline; }
.dash-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; padding: 20px 0 36px; border-top: 1px solid var(--grid); }
.dash-foot a { color: var(--ink-2); }

.viewer { width: min(900px, 94vw); padding: 0; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); color: var(--ink); overflow: hidden; }
.viewer::backdrop { background: rgba(0,0,0,.8); }
.viewer img { display: block; width: 100%; height: auto; aspect-ratio: 4/3; object-fit: contain; background: #000; }
.v-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 14px; }
.v-bar { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.v-bar > div:first-of-type { flex: 1; }
.v-bar b { display: block; font-size: 16px; margin-bottom: 6px; }
.v-bar .chips { margin: 0; }
.v-nav { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.v-nav button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink); cursor: pointer; font-size: 18px; }
.v-nav button:disabled { opacity: .3; }

@media (max-width: 900px) {
  .metrics { grid-template-columns: 1fr; }
  .metric { display: grid; grid-template-columns: 120px 1fr; text-align: left; align-items: center; column-gap: 18px; padding: 18px; }
  .metric .ring-wrap { width: 120px; height: 120px; margin: 0; grid-row: span 4; }
  .ring-value strong { font-size: 32px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .split { grid-template-columns: 1fr; }
  .trend { grid-template-columns: repeat(3, 1fr); }
  .day-switch small { display: none; }
  .dash-top .pill { display: none; }
}
@media (max-width: 520px) { .trend { grid-template-columns: repeat(2, 1fr); } .tiles { grid-template-columns: repeat(2, 1fr); } }
.mdots { display: grid; gap: 12px; padding-top: 10px; }
.md-row { display: grid; grid-template-columns: 38px 1fr 40px; align-items: center; gap: 8px; font-size: 10px; color: var(--muted); }
.md-row em { font-style: normal; }
.md-line { position: relative; height: 1px; background: var(--baseline); }
.md-line i { position: absolute; top: -5px; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 50%; background: var(--prev); }
.md-row b { font-size: 12px; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.md-row.on i { background: var(--act); }
.md-row.on b { color: var(--ink); font-weight: 700; }
.ring-rest .ring-value strong, .ring-wrap:has(.ring-rest) .ring-value strong { font-size: 38px; }
.split > *, .panel, .metrics > *, .tiles > * { min-width: 0; }
.dash { overflow-x: hidden; }
@media (max-width: 900px) {
  .ring-wrap:has(.ring-rest) .ring-value strong { font-size: 26px; }
  .ring-value span { font-size: 9px; }
}
@media (max-width: 520px) {
  .dash .logo { font-size: 0; gap: 0; }
  .day-switch { gap: 10px; }
}
/* ---- generic renderer additions ---- */
.dash { --warn: #fab219; --bad: #d03b3b; }
.ring-cov.warn .ring-fill { stroke: var(--warn); }
.ring-cov.bad .ring-fill { stroke: var(--bad); }
.status-warn { color: var(--warn); font-weight: 600; }
.status-bad { color: var(--bad); font-weight: 600; }
.top-right { display: flex; align-items: center; gap: 10px; }
.cam-switch select { background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; font: inherit; font-size: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.strip .gap { fill: none; stroke: var(--baseline); stroke-width: 1; }
.strip .env line { stroke: var(--ink-2); stroke-width: 1; }
.strip .env text { fill: var(--ink-2); font-size: 10px; }
.card .faces { position: absolute; top: 8px; right: 8px; display: flex; gap: 3px; }
.faces i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-style: normal; font-size: 10px; font-weight: 700; color: #fff; border: 2px solid rgba(0,0,0,.45); }
.who-row { grid-template-areas: "name num" "bar bar" "meta meta" "fits fits"; }
.tag { font-style: normal; font-size: 10px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; margin-left: 2px; }
.outfits { grid-area: fits; display: flex; gap: 5px; margin-top: 2px; }
.outfits i { width: 22px; height: 12px; border-radius: 4px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); cursor: default; }
.outfits i.on { outline: 1.5px solid var(--ink); outline-offset: 1px; }
.who + .tip, .panel .tip { white-space: normal; }
.summary p { margin: 0; font-size: 15px; line-height: 1.75; color: var(--ink-2); max-width: 900px; }
.v-bar .chips .dot { width: 8px; height: 8px; margin-right: 2px; }
@media (max-width: 900px) { .top-right .pill { display: none; } }
.fallback { padding: 40px 0; color: var(--ink-2); line-height: 1.7; } .fallback h1 { color: var(--ink); font-size: 24px; }
/* ---- toolbar with camera picker (above the core metrics) ---- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; flex-wrap: wrap; }
.toolbar .sample { margin: 0; }
.cam-switch { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.cam-label { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.cam-select { position: relative; display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; color: var(--ink-2); }
.cam-select:hover, .cam-select:focus-within { border-color: rgba(255,255,255,.3); }
.cam-select svg { position: absolute; left: 12px; pointer-events: none; }
.cam-select svg.chev { left: auto; right: 12px; color: var(--muted); }
.cam-select select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; color: var(--ink); font: inherit; font-size: 13px; font-weight: 500; padding: 9px 34px 9px 36px; cursor: pointer; min-width: 240px; font-variant-numeric: tabular-nums; }
.cam-select select:focus { outline: none; }
.cam-select select option { background: var(--surface); color: var(--ink); }
@media (max-width: 520px) { .cam-switch { width: 100%; } .cam-select, .cam-select select { width: 100%; min-width: 0; } .cam-label { display: none; } }
