/* Soccer AI Analytics: "rings" theme. Dark by default (Ink page, raised cards, Volt accent); light theme uses Pitch for
   accent text and strokes and Volt only as a fill. Ring cards stay dark in both themes (.force-dark). */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque.woff") format("woff");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter.woff") format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --pitch: #0A2E1F; --volt: #D4FF3A; --chalk: #F4F7F1; --ink: #0B1711; --grass: #22C55E; --flag: #F97316;
  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 22px;
}
:root, .force-dark {
  color-scheme: dark;
  --bg: #0B1711; --side: #0E1C15; --card: #13241B; --card-2: #1A3326; --line: #1E4A35;
  --text: #F4F7F1; --muted: rgba(244,247,241,.62); --faint: rgba(244,247,241,.36); --hairline: rgba(244,247,241,.08);
  --accent-ink: #D4FF3A; --t-volt: #D4FF3A; --t-flag: #F97316; --t-grass: #22C55E;
  --bar: #D4FF3A; --track: rgba(212,255,58,.16); --bar-other: rgba(244,247,241,.32);
  --btn: #1A3326; --btn-line: #25553D; --btn-hover: #21402F;
  --field: #0F1E16; --field-line: #2A5A41; --seg-on: #2C4A3A; --hover: rgba(244,247,241,.06);
  --tip-bg: #F4F7F1; --tip-text: #0B1711; --shadow: 0 18px 50px rgba(0,0,0,.5);
  --danger: #FB923C;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #E8EEE5; --side: #F6F9F4; --card: #FFFFFF; --card-2: #EEF3EB; --line: rgba(11,23,17,.1);
  --text: #0B1711; --muted: rgba(11,23,17,.64); --faint: rgba(11,23,17,.4); --hairline: rgba(11,23,17,.07);
  --accent-ink: #0A2E1F; --t-volt: #0A2E1F; --t-flag: #C2410C; --t-grass: #15803D;
  --bar: #0A2E1F; --track: rgba(10,46,31,.1); --bar-other: rgba(11,23,17,.3);
  --btn: #FFFFFF; --btn-line: rgba(11,23,17,.16); --btn-hover: #F1F5EE;
  --field: #FFFFFF; --field-line: rgba(11,23,17,.2); --seg-on: #0A2E1F; --hover: rgba(11,23,17,.05);
  --tip-bg: #0B1711; --tip-text: #F4F7F1; --shadow: 0 18px 50px rgba(11,23,17,.18);
  --danger: #C2410C;
}
.force-dark { background: var(--card); color: var(--text); }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 0;
}
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: var(--accent-ink); }
button, input, select { font: inherit; color: inherit; }
img { display: block; }
.ic { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-radius: 6px; }
.btn:focus-visible, .icon-btn:focus-visible, .switch:focus-visible { border-radius: 999px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--volt); color: var(--pitch); padding: 10px 16px; border-radius: 999px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

.eyebrow { font: 600 13px/1.3 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* ---------- boot / fatal ---------- */
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.fatal { max-width: 480px; margin: 18vh auto 0; padding: 0 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.fatal img { border-radius: 14px; }
.fatal h1 { font: 800 30px/1.1 var(--display); letter-spacing: -.03em; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } * { transition: none !important; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 7px 15px;
  border-radius: 999px; border: 1px solid var(--btn-line); background: var(--btn); color: var(--text);
  font: 600 14px/1.2 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--btn-hover); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.small { min-height: 32px; padding: 5px 12px; font-size: 13px; }
.btn.primary { background: var(--volt); color: var(--pitch); border-color: var(--volt); font-weight: 700; }
.btn.primary:hover:not(:disabled) { background: #C6F22B; }
.btn.accent { border-color: var(--accent-ink); color: var(--accent-ink); }
.btn.danger { color: var(--danger); }
.btn.danger-fill { background: #C2410C; border-color: #C2410C; color: #fff; font-weight: 700; }
.btn.run { min-height: 46px; padding: 10px 26px; font-size: 16px; gap: 9px; }
.btn.run .ic { fill: currentColor; stroke-width: 1.5; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  border: 1px solid var(--btn-line); background: var(--btn); color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--btn-hover); }

.switch { display: inline-flex; align-items: center; gap: 9px; background: none; border: 0; padding: 6px 4px; cursor: pointer; font: 600 14px var(--sans); color: var(--text); }
.switch .track { width: 38px; height: 22px; border-radius: 11px; background: var(--card-2); border: 1px solid var(--btn-line); position: relative; transition: background .15s; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch[aria-checked="true"] .track { background: var(--volt); border-color: var(--volt); }
.switch[aria-checked="true"] .knob { transform: translateX(16px); background: var(--pitch); }
.switch:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
.topbar { display: none; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
  background: var(--side); border-right: 1px solid var(--line); padding: 20px 14px 16px;
}
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); font: 800 22px/1 var(--display); letter-spacing: -.03em; }
.brand img { border-radius: 10px; }
.side-close { display: none; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; min-height: 0; }
.side-h { margin: 16px 12px 4px; font-size: 12px; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 12px; color: var(--text);
  text-decoration: none; font-weight: 500; font-size: 14.5px; position: relative;
}
.nav-link .ic { color: var(--muted); }
.nav-link:hover { background: var(--hover); }
.nav-link[aria-current="page"] { background: var(--card-2); font-weight: 600; }
.nav-link[aria-current="page"] .ic { color: var(--accent-ink); }
.nav-link[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-ink); }
.nl-text { display: flex; flex-direction: column; min-width: 0; }
.nl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nl-owner { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-link { padding-top: 7px; padding-bottom: 7px; }
.nl-empty { padding: 4px 12px; font-size: 13px; color: var(--muted); }
.new-view { align-self: stretch; }
.side-foot { border-top: 1px solid var(--line); padding: 14px 6px 0; display: flex; flex-direction: column; gap: 10px; }
.who { display: flex; flex-direction: column; min-width: 0; }
.who .email { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

main { padding: 30px 40px 72px; min-width: 0; outline: none; }
.page { max-width: 1240px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font: 800 36px/1.08 var(--display); letter-spacing: -.035em; margin-top: 4px; overflow-wrap: anywhere; }
.page-head h1:focus { outline: none; }
.title-block { min-width: 0; max-width: 100%; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.unsaved { display: inline-block; margin-top: 8px; font: 600 12px var(--sans); color: var(--t-flag); letter-spacing: .02em; }

@media (max-width: 899px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; padding: 10px 16px; background: var(--side); border-bottom: 1px solid var(--line); }
  .topbar .brand { font-size: 19px; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); z-index: 50; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .side-close { display: inline-grid; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; }
  main { padding: 20px 16px 56px; }
  .page-head h1 { font-size: 30px; }
}

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 20px 22px 22px; min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { font: 800 20px/1.2 var(--display); letter-spacing: -.02em; }
.skel { background: linear-gradient(100deg, var(--card) 40%, var(--card-2) 50%, var(--card) 60%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.error-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.error-card p:first-child { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; color: var(--danger); }
.error-card p:first-child .ic { margin-top: 2px; }

/* ---------- overview ---------- */
.ov-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.span-5 { grid-column: span 5; } .span-7 { grid-column: span 7; } .span-12 { grid-column: span 12; }
.ring-card { display: flex; flex-direction: column; }
.ringwrap { display: flex; align-items: center; gap: 26px; flex: 1; }
.rings { flex: none; }
.legend { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.legend .k { display: flex; align-items: center; gap: 8px; font: 500 14px var(--sans); color: var(--muted); }
.legend .v { font: 800 28px/1.05 var(--display); letter-spacing: -.025em; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 4px; }
.legend .v small { font-size: .6em; font-weight: 700; opacity: .9; }
.legend .pct { font: 600 13px var(--sans); color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.sw { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.sw-volt { background: #D4FF3A; } .sw-flag { background: #F97316; } .sw-grass { background: #22C55E; }
.c-volt { color: var(--t-volt); } .c-flag { color: var(--t-flag); } .c-grass { color: var(--t-grass); }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.kpi { background: var(--card); border-radius: var(--radius); padding: 16px 18px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.kpi .num { font: 800 38px/1.05 var(--display); letter-spacing: -.035em; margin-top: 2px; overflow-wrap: anywhere; }
.kpi .small { margin-top: auto; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.trio.duo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.num-md { font: 800 28px/1.1 var(--display); letter-spacing: -.03em; margin-top: 4px; }
@media (max-width: 1180px) {
  .span-5, .span-7 { grid-column: span 12; }
  .trio { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trio > :nth-child(3) { grid-column: span 2; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trio, .trio.duo { grid-template-columns: minmax(0, 1fr); }
  .trio > :nth-child(3) { grid-column: auto; }
  .ringwrap { flex-direction: column; align-items: flex-start; }
  .kpi .num { font-size: 32px; }
}

/* ---------- horizontal bars ---------- */
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 34%) minmax(40px, 1fr) auto; align-items: center; gap: 12px; font-size: 14px; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 10px; border-radius: 5px; background: var(--track); overflow: hidden; }
.hb-track i { display: block; height: 100%; min-width: 2px; border-radius: 5px; background: var(--bar); }
.hbar.other .hb-track i { background: var(--bar-other); }
.hbar.other .hb-label { color: var(--muted); }
.hb-val { display: inline-flex; align-items: baseline; gap: 8px; justify-content: flex-end; min-width: 84px; font-variant-numeric: tabular-nums; }
.hb-val b { font-weight: 700; }
.hb-share { color: var(--muted); font-size: 13px; min-width: 38px; text-align: right; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart-svg { display: block; overflow: visible; }
.chart-svg:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 4px; border-radius: 8px; }
.grid line { stroke: var(--hairline); stroke-width: 1; }
.grid line.base { stroke: var(--line); }
.ylab, .xlab { fill: var(--muted); font: 500 11.5px var(--sans); font-variant-numeric: tabular-nums; }
.bars .mark { fill: var(--bar); transition: opacity .12s; }
.bars .mark.dim { opacity: .38; }
.line { fill: none; stroke: var(--bar); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.area { fill: var(--bar); opacity: .08; }
.enddot { fill: var(--bar); stroke: var(--card); stroke-width: 2; }
.hoverdot { fill: var(--bar); stroke: var(--card); stroke-width: 2; }
.cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.tip {
  position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, -100%); white-space: nowrap;
  background: var(--tip-bg); color: var(--tip-text); border-radius: 10px; padding: 6px 10px; font: 500 13px/1.3 var(--sans);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.tip b { font-weight: 800; }
.tip-sub { display: block; font-size: 12px; opacity: .72; }

/* ---------- query builder ---------- */
.qb-card { margin-bottom: 16px; }
.ro-note { margin-bottom: 14px; padding: 10px 14px; border-radius: 12px; background: var(--card-2); font-size: 14px; color: var(--muted); }
.qb { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.qb:disabled select, .qb:disabled input, .qb:disabled summary, .qb:disabled .btn, .qb:disabled .icon-btn { opacity: .7; cursor: not-allowed; }
.qb-row { display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: flex-start; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font: 600 13px var(--sans); color: var(--muted); }
.w-dataset { flex: 1 1 220px; max-width: 320px; }
.w-range { flex: 1 1 180px; max-width: 240px; }
.w-group { flex: 1 1 220px; max-width: 300px; }
.w-measure { flex: 1 1 160px; max-width: 220px; }
.w-limit { flex: 0 1 130px; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
select, input[type="text"], input[type="email"], input[type="number"], input[type="date"] {
  height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--field-line); background-color: var(--field);
  color: var(--text); min-width: 0; width: 100%;
}
select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238C9C92' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
select option:disabled { color: #8C9C92; }
.qb-sub { border: 0; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); min-width: 0; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.qb-sub > legend { float: left; width: 100%; padding: 0; margin-bottom: 10px; font: 600 13px var(--sans); color: var(--muted); }
.filters { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.filter-row { display: grid; grid-template-columns: minmax(130px, 200px) 96px minmax(160px, 1fr) 36px; gap: 8px; align-items: start; max-width: 760px; }
@media (max-width: 640px) { .filter-row { grid-template-columns: 1fr 96px; } .filter-row .ms { grid-column: 1 / 2; } }
.ms { position: relative; min-width: 0; }
.ms summary {
  list-style: none; height: 40px; display: flex; align-items: center; padding: 0 34px 0 12px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--field-line); background: var(--field) no-repeat right 13px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238C9C92' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ms summary::-webkit-details-marker { display: none; }
.ms summary.placeholder { color: var(--muted); }
.ms-panel {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 100%; max-width: 360px; max-height: 280px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--field-line); border-radius: 14px; padding: 6px; box-shadow: var(--shadow);
}
.ms-opt { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.ms-opt:hover { background: var(--hover); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent-ink); width: 16px; height: 16px; margin: 0; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px 6px 10px; border-radius: 999px; border: 1px solid var(--field-line); background: var(--field); cursor: pointer; font-size: 14px; }
.chip:has(input:checked) { border-color: var(--accent-ink); }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

.run-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.seg { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.seg-legend { padding: 0; font: 600 13px var(--sans); color: var(--muted); margin-bottom: 6px; }
.seg-opts { display: inline-flex; background: var(--field); border: 1px solid var(--field-line); border-radius: 999px; padding: 3px; }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg-opt span { display: block; padding: 6px 14px; border-radius: 999px; font: 600 13.5px var(--sans); color: var(--muted); }
.seg-opt input:checked + span { background: var(--seg-on); color: var(--text); }
:root[data-theme="light"] .seg-opt input:checked + span { color: #F4F7F1; }
.seg-opt input:focus-visible + span { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.seg-opt input:disabled + span { opacity: .4; }
.seg-opt input:disabled { cursor: not-allowed; }
.run-wrap { display: flex; align-items: center; gap: 12px; }
.kbd-hint { font: 600 12.5px var(--sans); color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; }

/* ---------- results ---------- */
.result-card { position: relative; min-height: 180px; }
.result-card.loading .results { opacity: .4; pointer-events: none; }
.result-card.loading::after {
  content: "Running query…"; position: absolute; left: 50%; top: 96px; transform: translateX(-50%);
  background: var(--tip-bg); color: var(--tip-text); padding: 8px 16px; border-radius: 999px; font: 600 14px var(--sans); box-shadow: var(--shadow);
}
.stale { font: 600 12.5px var(--sans); color: var(--t-flag); }
.empty-state { padding: 30px 0 22px; text-align: center; color: var(--text); display: flex; flex-direction: column; gap: 6px; }
.empty { color: var(--muted); padding: 18px 0; }
.res-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.res-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; color: var(--muted); font-size: 14px; }
.res-meta b { color: var(--text); font-weight: 700; }
.res-meta .dot { color: var(--faint); }
.note { font-size: 13.5px; color: var(--t-flag); margin-bottom: 12px; }
.table-wrap { overflow: auto; max-height: 560px; border: 1px solid var(--line); border-radius: 14px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.data th { position: sticky; top: 0; z-index: 1; background: var(--card-2); text-align: left; padding: 0; border-bottom: 1px solid var(--line); }
table.data th.num, table.data td.num { text-align: right; }
.th-btn { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 14px; font: 600 13px var(--sans); color: var(--muted); cursor: pointer; white-space: nowrap; }
th.num .th-btn { justify-content: flex-end; }
.th-btn:hover { color: var(--text); }
.th-btn:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -2px; }
th[aria-sort] .th-btn { color: var(--text); }
.sort-ind { font-size: 9px; color: var(--accent-ink); min-width: 9px; }
table.data td { padding: 9px 14px; border-bottom: 1px solid var(--hairline); white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
table.data tbody tr:hover { background: var(--hover); }
table.data tr.other td { color: var(--muted); }
.ring-result { border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- dialogs & toasts ---------- */
.dlg { border: 0; padding: 0; border-radius: var(--radius); background: var(--card); color: var(--text); width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.dlg::backdrop { background: rgba(5,12,8,.6); }
.dlg-form { padding: 22px 24px 20px; display: flex; flex-direction: column; gap: 14px; }
.dlg-title { font: 800 22px/1.2 var(--display); letter-spacing: -.02em; }
.dlg-msg { color: var(--muted); }
.dlg-err { color: var(--danger); font-size: 14px; font-weight: 600; }
.dlg-err:empty { display: none; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.goal-fields { display: flex; flex-direction: column; gap: 12px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 8px; background: var(--tip-bg); color: var(--tip-text); padding: 10px 16px; border-radius: 999px; font: 600 14px var(--sans); box-shadow: var(--shadow); transition: opacity .3s, transform .3s; max-width: min(460px, calc(100vw - 40px)); }
.toast.error { background: #C2410C; color: #fff; border-radius: 16px; }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ---------- team (admin) ---------- */
.page > section.card + section.card { margin-top: 16px; }
.invite { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.invite .grow { flex: 1 1 280px; }
.invite input { width: 100%; }
.invite-note { margin: -6px 0 14px; max-width: 70ch; }
.th-static { display: block; padding: 10px 14px; font: 600 13px var(--sans); color: var(--muted); white-space: nowrap; }
table.data.team td { max-width: none; }
.who-cell { display: flex; align-items: center; gap: 8px; }
.who-cell > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.actions-cell { text-align: right; }
.row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font: 600 12px/1.5 var(--sans); background: var(--card-2); color: var(--text); white-space: nowrap; }
.tag.on { color: var(--t-grass); }
.tag.wait { color: var(--t-flag); }
.tag.off { color: var(--muted); }
.tag.admin { background: var(--volt); color: var(--pitch); }
