    :root {
      color-scheme: dark;
      --bg: #282a36;
      --panel: #303341;
      --panel-deep: #242631;
      --line: #44475a;
      --text: #f8f8f2;
      --muted: #a5acc3;
      --comment: #6272a4;
      --purple: #bd93f9;
      --pink: #ff79c6;
      --cyan: #8be9fd;
      --green: #50fa7b;
      --orange: #ffb86c;
      --yellow: #f1fa8c;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }
    * { box-sizing: border-box; }
    body { margin: 0; background: var(--bg); color: var(--text); }
    button, input { font: inherit; }
    button { cursor: pointer; }
    .page { max-width: 1540px; margin: 0 auto; padding: 32px clamp(16px, 3vw, 48px) 60px; }
    .masthead { display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 25px; }
    .live { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; margin-left: auto; }
    .refresh { padding: 9px 15px; border: 1px solid var(--purple); border-radius: 8px; background: #bd93f91f; color: var(--purple); font-size: 12px; font-weight: 800; letter-spacing: .05em; }
    .refresh:hover:not(:disabled) { background: var(--purple); color: var(--bg); }
    .refresh:disabled { opacity: .45; cursor: not-allowed; }
    .refresh-note { max-width: 330px; color: var(--muted); font-size: 11px; line-height: 1.45; text-align: right; }
    .refresh-note.failed { color: var(--pink); }
    .eyebrow { color: var(--pink); font-size: 12px; font-weight: 800; letter-spacing: .19em; text-transform: uppercase; }
    h1 { margin: 8px 0 7px; font-size: clamp(30px, 4.5vw, 58px); line-height: 1.05; letter-spacing: -.055em; }
    .lede { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.5; }
    .brand { width: 60px; height: 60px; flex: none; border: 1px solid #70568f; border-radius: 16px; background: linear-gradient(140deg, #bd93f9 0%, #ff79c6 100%); color: var(--bg); display: grid; place-items: center; font-weight: 950; font-size: 27px; box-shadow: 0 12px 34px #ff79c620; }
    .tabs { display: flex; gap: 7px; overflow-x: auto; padding: 20px 0 17px; scrollbar-color: var(--comment) transparent; }
    .tab { flex: none; padding: 9px 13px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--panel-deep); font-size: 12px; font-weight: 750; letter-spacing: .025em; }
    .tab:first-child { position: sticky; left: 0; z-index: 2; box-shadow: 7px 0 12px var(--bg); }
    .tab:hover, .pill:hover, .legend-item:hover { border-color: var(--purple); color: var(--text); }
    .tab[aria-selected="true"] { color: var(--bg); border-color: var(--purple); background: var(--purple); box-shadow: 0 4px 18px #bd93f936; }
    .team-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 15px; margin: 0 0 17px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
    .team-picker label { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
    .team-search-wrap { position: relative; flex: 1 1 300px; max-width: 540px; }
    #teamSearch { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--panel-deep); outline: none; }
    #teamSearch:focus { border-color: var(--purple); box-shadow: 0 0 0 2px #bd93f933; }
    #teamResults { position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 5; max-height: 330px; overflow-y: auto; border: 1px solid var(--purple); border-radius: 9px; background: #1b1d27; box-shadow: 0 14px 35px #0008; }
    .team-result { display: flex; gap: 10px; align-items: center; justify-content: space-between; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); color: var(--text); background: transparent; text-align: left; }
    .team-result:last-child { border-bottom: 0; }
    .team-result:hover, .team-result[aria-selected="true"] { background: #bd93f92a; }
    .team-result span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .team-result span:last-child { flex: none; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
    .team-search-note { color: var(--muted); font-size: 12px; }
    .clear-team { padding: 8px 10px; border: 1px solid var(--yellow); border-radius: 7px; background: #f1fa8c18; color: var(--yellow); font-size: 12px; font-weight: 750; }
    .summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 17px; }
    .summary.has-selection { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .stat { padding: 16px 19px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); min-width: 0; }
    .stat.selected { border-color: var(--yellow); box-shadow: 0 0 0 1px #f1fa8c35; }
    .stat.selected .label { color: var(--yellow); }
    .stat .label { display: block; color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 750; }
    .stat .value { display: block; margin: 6px 0 3px; font-size: clamp(20px, 2.5vw, 30px); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .stat .detail { color: var(--muted); font-size: 12px; }
    .chart-card, .section-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 36px #14151e35; }
    .chart-card { padding: 20px 22px 19px; }
    .card-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
    h2 { margin: 0; font-size: 23px; letter-spacing: -.035em; }
    .note { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
    .controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin: 20px 0 11px; }
    .control-side { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
    .control-title { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; margin-right: 3px; }
    .pill { border: 1px solid var(--line); border-radius: 7px; color: var(--muted); padding: 7px 10px; background: var(--panel-deep); font-size: 12px; font-weight: 750; }
    .pill.active { border-color: var(--cyan); background: #8be9fd1b; color: var(--cyan); }
    .pill.finish { color: var(--pink); border-color: #ff79c66b; }
    .range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
    .range input { width: 83px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-deep); color: var(--text); padding: 7px 8px; font-variant-numeric: tabular-nums; }
    .range input:focus { outline: 2px solid var(--purple); outline-offset: 1px; }
    .chart-frame { position: relative; border: 1px solid #414456; border-radius: 11px; background: var(--panel-deep); overflow: hidden; }
    #mainChart { display: block; width: 100%; height: auto; touch-action: none; }
    #mainChart text { fill: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
    #mainChart .axis-title { fill: var(--text); font-size: 11px; font-weight: 700; letter-spacing: .05em; }
    .tooltip { position: absolute; pointer-events: none; z-index: 3; min-width: 210px; max-width: 280px; padding: 11px 12px; border: 1px solid var(--purple); border-radius: 9px; background: #1b1d27f5; box-shadow: 0 10px 28px #0008; font-size: 12px; font-variant-numeric: tabular-nums; }
    .tooltip[hidden] { display: none; }
    .tip-title { font-weight: 800; color: var(--text); margin-bottom: 7px; }
    .tip-row { display: flex; justify-content: space-between; gap: 16px; line-height: 1.7; }
    .tip-row b { color: var(--text); }
    .tip-row.focus b { color: var(--pink); }
    .tip-row.selected b { color: var(--yellow); }
    .tip-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .hint { margin: 10px 1px 0; color: var(--muted); font-size: 12px; }
    .legend { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 17px; }
    .legend-item { min-width: 0; display: flex; gap: 8px; align-items: center; text-align: left; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-deep); color: var(--text); }
    .legend-item.dim { opacity: .4; }
    .legend-item.selected, .mini.selected { border-color: var(--yellow); }
    .legend-swatch { width: 23px; flex: none; height: 4px; border-radius: 5px; }
    .legend-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; }
    .legend-value { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
    .subhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 31px 0 12px; }
    .subhead p { margin: 0; color: var(--muted); font-size: 12px; }
    .mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .mini { padding: 14px 16px 9px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); text-align: left; color: var(--text); min-width: 0; }
    .mini:hover, .mini.focus { border-color: var(--purple); }
    .mini-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
    .mini-name { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; font-weight: 800; }
    .mini-meta { color: var(--muted); font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; }
    .mini svg { display: block; width: 100%; height: auto; margin-top: 4px; }
    .section-card { margin-top: 28px; padding: 20px 22px 10px; }
    .table-wrap { overflow-x: auto; margin-top: 12px; }
    table { border-collapse: collapse; width: 100%; }
    th, td { padding: 10px 10px; border-top: 1px solid var(--line); text-align: left; font-size: 13px; }
    th { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .075em; }
    td.num { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
    td.team { font-weight: 750; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    tr.mine td.team { color: var(--purple); }
    tr.selected td.team { color: var(--yellow); }
    tr.own-break td { color: var(--pink); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
    tr.own-break.ours td { color: var(--purple); }
    .table-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 9px; }
    footer { color: var(--muted); font-size: 12px; line-height: 1.55; margin-top: 25px; }
    footer code { color: var(--cyan); }
    [hidden] { display: none !important; }
    @media (max-width: 980px) { .legend, .summary.has-selection { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
    @media (max-width: 680px) { .masthead { align-items: start; } .brand { width: 45px; height: 45px; font-size: 20px; } .summary, .summary.has-selection, .mini-grid { grid-template-columns: 1fr; } .chart-card, .section-card { padding-inline: 13px; } .legend { grid-template-columns: 1fr 1fr; } .card-head { display: block; } }
    .lanes { margin: 10px 0 4px; }
    .pill-row { display: inline-flex; flex-wrap: wrap; gap: 6px; }
    .lane-note { color: #9aa1c4; font-size: 13px; align-self: center; }
    tr.lane-ours td, tr.q-ours td { color: #bd93f9; }
    td.behind { color: #ff5555; }
    td.ahead { color: #50fa7b; }
    .back-link { margin: 0 0 14px; font-size: 13px; }
    .back-link a { color: var(--cyan); text-decoration: none; }
    .back-link a:hover { color: var(--pink); }

