:root {
  --bg: #f5f4ee;
  --surface: #ffffff;
  --ink: #142036;
  --muted: #5a6476;
  --line: #dcdde2;
  --ball: #c8e000;
  --hero: #142036;
  --hero-ink: #f5f4ee;
  --atp: #2563b0;
  --wta: #d0632a;
  --wide: #2563b0;
  --body: #8a5fb0;
  --T: #d0632a;
  --hard: #2f6aa8;
  --clay: #b8592c;
  --grass: #3c7d45;
  --shade: #fff3b0;
  --shade-ink: #3d3200;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1420;
    --surface: #161f30;
    --ink: #e7ebf2;
    --muted: #9aa4b6;
    --line: #2a3550;
    --hero: #0a0f19;
    --hero-ink: #e7ebf2;
    --atp: #5b9be6;
    --wta: #ec8a54;
    --wide: #5b9be6;
    --body: #b393d6;
    --T: #ec8a54;
    --shade: #4a4210;
    --shade-ink: #fff4b8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1420; --surface: #161f30; --ink: #e7ebf2; --muted: #9aa4b6; --line: #2a3550;
  --hero: #0a0f19; --hero-ink: #e7ebf2; --atp: #5b9be6; --wta: #ec8a54; --wide: #5b9be6;
  --body: #b393d6; --T: #ec8a54; --shade: #4a4210; --shade-ink: #fff4b8; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 3px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
h2 { font: 700 clamp(30px, 4vw, 42px)/1.05 "Barlow Condensed", Inter, sans-serif; letter-spacing: .01em; }
h3 { font-size: 17px; font-weight: 700; }
b { font-weight: 650; }

/* hero */
.hero { background: var(--hero); color: var(--hero-ink); padding: 56px 0 40px; position: relative; overflow: hidden; }
.ball { position: absolute; right: -110px; top: -110px; width: 380px; height: 380px; pointer-events: none; }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 600; opacity: .75; margin: 0 0 6px; }
.hero h1 { font: 700 clamp(56px, 9vw, 96px)/.9 "Barlow Condensed", Inter, sans-serif; letter-spacing: .01em; }
.hero h1::after { content: "."; color: var(--ball); }
.lede { max-width: 640px; font-size: 18px; margin: 14px 0 28px; opacity: .92; position: relative; z-index: 1; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; position: relative; z-index: 1; }
.tile { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); padding: 14px 16px; font-size: 14px; line-height: 1.4; }
.tile .big { display: block; font: 700 40px/1 "Barlow Condensed", Inter, sans-serif; color: var(--ball); margin-bottom: 6px; }
.jump { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; position: relative; z-index: 1; }
.jump a { text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); }
.jump a:first-child { background: var(--ball); color: #142036; border-color: var(--ball); }

section.wrap { padding: 64px 16px 8px; }
.sub { color: var(--muted); max-width: 680px; margin: 8px 0 20px; }

/* controls */
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.field { display: flex; flex-direction: column; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; gap: 4px; flex: 1 1 200px; }
.field input, .field select {
  font: 500 16px Inter, system-ui, sans-serif; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 11px; text-transform: none; letter-spacing: 0; width: 100%;
}
.field input:focus, .field select:focus { outline: 2px solid var(--atp); outline-offset: 1px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex: 0 0 auto; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 9px 16px; font-weight: 650; cursor: pointer; color: var(--muted); }
.seg input:checked + span { background: var(--ink); color: var(--bg); }
.seg input:focus-visible + span { outline: 2px solid var(--atp); outline-offset: -2px; }
.err { color: var(--wta); font-weight: 600; }

.report { display: grid; gap: 16px; margin-top: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card .note { color: var(--muted); font-size: 14px; margin: 6px 0 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mt { margin-top: 18px; }
.small { font-size: 13px; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.kpi { border-left: 3px solid var(--ball); padding: 2px 0 2px 12px; }
.kpi .v { font: 700 34px/1.05 "Barlow Condensed", Inter, sans-serif; font-variant-numeric: tabular-nums; }
.kpi .v small { font: 500 14px Inter, sans-serif; color: var(--muted); margin-left: 4px; }
.kpi .l { font-size: 13px; color: var(--muted); }
.kpi .d { font-size: 13px; font-weight: 600; }
.up { color: var(--atp); }
.down { color: var(--wta); }

/* court */
.court { display: grid; grid-template-columns: 1fr 1fr; border: 3px solid #fff; border-bottom: 0; border-radius: 6px 6px 0 0; background: var(--hard); position: relative; box-shadow: 0 0 0 1px var(--line); }
.court.Clay { background: var(--clay); }
.court.Grass { background: var(--grass); }
.court::after { content: "NET"; position: absolute; left: 0; right: 0; bottom: -22px; text-align: center; font-size: 11px; letter-spacing: .3em; color: var(--muted); border-top: 3px dashed var(--muted); padding-top: 3px; }
.box { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.box + .box { border-left: 3px solid #fff; }
.boxname { grid-column: 1 / -1; text-align: center; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: 8px 0 0; opacity: .9; }
.lane { color: #fff; padding: 10px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; position: relative; }
.lane + .lane { border-left: 1px dashed rgba(255,255,255,.35); }
.lane .aim { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .9; }
.lane .p { font: 700 32px/1 "Barlow Condensed", Inter, sans-serif; font-variant-numeric: tabular-nums; }
.lane .pm { font-size: 12px; opacity: .85; }
.lane .raw { font-size: 11.5px; opacity: .85; line-height: 1.3; }
.lane .use { width: 80%; height: 6px; border-radius: 3px; background: rgba(255,255,255,.25); margin-top: 4px; overflow: hidden; }
.lane .use i { display: block; height: 100%; background: var(--ball); }
.lane .uset { font-size: 11.5px; opacity: .9; }
.lane.best { box-shadow: inset 0 0 0 3px var(--ball); }
.verdicts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 34px; }
.verdict { font-size: 14px; background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.verdict b { display: block; font-size: 15px; }

/* tables */
.read { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.read caption { text-align: left; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding-bottom: 4px; }
.read th, .read td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.read th:first-child, .read td:first-child { text-align: left; }
.read thead th { font-size: 12px; color: var(--muted); font-weight: 600; }
.read td.hot { background: var(--shade); color: var(--shade-ink); font-weight: 700; }
.read tr.usual td { color: var(--muted); font-style: italic; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl thead th { font-size: 12px; color: var(--muted); }

.mixbar { display: flex; height: 26px; border-radius: 6px; overflow: hidden; font-size: 12px; font-weight: 700; color: #fff; margin: 3px 0 10px; }
.mixbar span { display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; white-space: nowrap; }
.mixrow { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; font-size: 13px; }
.mixrow .lab { color: var(--muted); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin: 6px 0; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

/* findings */
.finding { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 28px; padding: 28px 0; border-bottom: 1px solid var(--line); align-items: center; }
.finding .num { font: 700 15px "Barlow Condensed", Inter, sans-serif; color: var(--muted); letter-spacing: .12em; margin: 0 0 4px; }
.finding h3 { font: 700 28px/1.1 "Barlow Condensed", Inter, sans-serif; margin-bottom: 10px; }
.finding p { margin: 0 0 12px; }
.take { background: var(--surface); border-left: 4px solid var(--ball); padding: 10px 14px; border-radius: 0 10px 10px 0; font-size: 15px; }
figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-width: 0; }
figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font: 12px Inter, system-ui, sans-serif; }
.chart .axis line, .chart .grid line { stroke: var(--line); }
.chart .lbl { fill: var(--ink); font-weight: 600; }
.chart circle.pt { stroke: var(--surface); stroke-width: 1; }
.chart circle.pt:hover { stroke: var(--ink); stroke-width: 2; }

.prose p { margin: 6px 0 14px; font-size: 15px; }
.prose h3 { margin-top: 8px; }
ul.small { padding-left: 18px; margin: 6px 0; }
ul.small li { margin-bottom: 6px; }
.foot { padding: 36px 16px 48px; font-size: 13px; color: var(--muted); }
.tip { position: fixed; pointer-events: none; z-index: 10; background: var(--ink); color: var(--bg); font-size: 12.5px; padding: 6px 9px; border-radius: 8px; max-width: 260px; line-height: 1.35; }

@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finding { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hero { padding-top: 36px; }
  .ball { width: 220px; height: 220px; right: -90px; top: -90px; }
  .court { grid-template-columns: minmax(0, 1fr); }
  .box + .box { border-left: 0; border-top: 3px solid #fff; }
  .verdicts { grid-template-columns: minmax(0, 1fr); }
  .lane .p { font-size: 26px; }
  .tile .big { font-size: 32px; }
}
