/* Club Ladder design system. Tokens first; every component reads from them.
   Brand: ink neutrals, one accent (board teal), and two site colors that only ever mark data:
   Lichess blue and chess.com orange (validated as a categorical pair, light and dark). */
:root {
  --accent: #0f766e;
  --accent-hover: #0d645d;
  --accent-ink: #ffffff;
  --accent-soft: #e6f4f2;
  --accent-line: #8ccfc6;

  --bg: #ffffff;
  --surface: #fafafa;
  --surface-2: #f3f4f4;
  --surface-3: #e9ebeb;
  --border: #e3e5e5;
  --border-strong: #cfd3d3;
  --text: #0b0d0d;
  --text-2: #464c4c;
  --text-3: #687070;
  --link: #0b0d0d;
  --focus: #2563eb;

  --up: #15803d;
  --up-bg: #e9f7ee;
  --down: #b91c1c;
  --down-bg: #fdecec;
  --warn: #9a5800;
  --warn-bg: #fff4e0;
  --info: #1d4ed8;
  --info-bg: #eaf0ff;

  --li: #2a78d6;      /* Lichess series */
  --cc: #eb6834;      /* chess.com series */
  --ctx: #a3a9a9;     /* context series: recessive gray */
  --chart-grid: #eceeee;
  --chart-axis: #cfd3d3;
  /* sequential ramp for activity (games per day), one hue */
  --h0: #f1f3f3; --h1: #c9ece7; --h2: #8bd3c8; --h3: #3fa99c; --h4: #0f766e; --h5: #0a4f49;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --fs-12: 12px; --fs-13: 13px; --fs-14: 14px; --fs-16: 16px; --fs-18: 18px;
  --fs-22: 22px; --fs-28: 28px; --fs-36: 36px; --fs-44: 44px;
  --lh: 1.5;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px; --s20: 80px;
  --r-sm: 4px; --r-md: 6px; --r-lg: 10px; --r-full: 999px;
  --shadow-sm: 0 1px 2px rgba(10, 13, 13, .05);
  --shadow-md: 0 4px 14px rgba(10, 13, 13, .08), 0 1px 3px rgba(10, 13, 13, .06);
  --shadow-lg: 0 18px 50px rgba(10, 13, 13, .16), 0 2px 6px rgba(10, 13, 13, .06);
  --ease: cubic-bezier(.2, .7, .3, 1);
  --t: 120ms;
  --w-page: 1240px;
  --w-prose: 720px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #2cc0ae; --accent-hover: #4fd0c0; --accent-ink: #04201d; --accent-soft: #0d2826; --accent-line: #1d625a;
    --bg: #0c0d0d; --surface: #121414; --surface-2: #191c1c; --surface-3: #232727; --border: #262a2a; --border-strong: #3a4040;
    --text: #f2f4f4; --text-2: #b3baba; --text-3: #8d9696; --link: #f2f4f4; --focus: #6aa0ff;
    --up: #4ade80; --up-bg: #0f2618; --down: #f87171; --down-bg: #2c1212; --warn: #fbbf24; --warn-bg: #2a1f06; --info: #7aa7ff; --info-bg: #111a33;
    --li: #3987e5; --cc: #d95926; --ctx: #5c6464; --chart-grid: #1d2121; --chart-axis: #3a4040;
    --h0: #171a1a; --h1: #12302d; --h2: #145049; --h3: #17786c; --h4: #2cc0ae; --h5: #8ee6da;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5); --shadow-md: 0 6px 18px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .04);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .05);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: #2cc0ae; --accent-hover: #4fd0c0; --accent-ink: #04201d; --accent-soft: #0d2826; --accent-line: #1d625a;
  --bg: #0c0d0d; --surface: #121414; --surface-2: #191c1c; --surface-3: #232727; --border: #262a2a; --border-strong: #3a4040;
  --text: #f2f4f4; --text-2: #b3baba; --text-3: #8d9696; --link: #f2f4f4; --focus: #6aa0ff;
  --up: #4ade80; --up-bg: #0f2618; --down: #f87171; --down-bg: #2c1212; --warn: #fbbf24; --warn-bg: #2a1f06; --info: #7aa7ff; --info-bg: #111a33;
  --li: #3987e5; --cc: #d95926; --ctx: #5c6464; --chart-grid: #1d2121; --chart-axis: #3a4040;
  --h0: #171a1a; --h1: #12302d; --h2: #145049; --h3: #17786c; --h4: #2cc0ae; --h5: #8ee6da;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5); --shadow-md: 0 6px 18px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .04);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .05);
  color-scheme: dark;
}

/* base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--fs-14)/var(--lh) var(--font); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--link); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.011em; font-weight: 650; }
h1 { font-size: var(--fs-36); letter-spacing: -0.022em; }
h2 { font-size: var(--fs-22); letter-spacing: -0.017em; }
h3 { font-size: var(--fs-16); }
h4 { font-size: var(--fs-14); }
p { margin: 0 0 var(--s3); }
code, kbd, pre, .mono { font-family: var(--mono); font-size: 0.92em; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0 4px; }
kbd { display: inline-block; min-width: 20px; padding: 0 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: var(--r-sm); background: var(--surface); font-size: 11px; line-height: 18px; text-align: center; color: var(--text-2); }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s6) 0; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: var(--fs-13); color: var(--text-2); }
.xs { font-size: var(--fs-12); color: var(--text-3); }
.up { color: var(--up); }
.down { color: var(--down); }
.nowrap { white-space: nowrap; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.i { display: inline-block; vertical-align: -0.18em; flex: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* layout */
.wrap { max-width: var(--w-page); margin: 0 auto; padding: 0 var(--s6); }
.wrap-prose { max-width: var(--w-prose); }
main { display: block; min-height: 60vh; }
.section { padding: var(--s16) 0; border-top: 1px solid var(--border); }
.section:first-child { border-top: 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s6); flex-wrap: wrap; }
.section-head p { margin: var(--s2) 0 0; color: var(--text-2); max-width: 660px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-12); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin-bottom: var(--s2); }
.grid { display: grid; gap: var(--s4); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s12); align-items: center; }
.row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.spacer { flex: 1; }
.page-head { padding: var(--s10) 0 var(--s6); }
.page-head h1 { font-size: var(--fs-28); }
.page-head .lede { margin-top: var(--s2); color: var(--text-2); font-size: var(--fs-16); max-width: 720px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: var(--fs-13); color: var(--text-3); margin-bottom: var(--s3); }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: var(--r-md); z-index: 100; }
.skip:focus { top: 8px; }

/* brand: two rails, four rungs, the top rung in the accent */
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.brand svg { width: 22px; height: 22px; }
.mark .rail, .mark .rung { fill: var(--text); }
.mark .top { fill: var(--accent); }

/* nav */
.nav { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); }
.nav .wrap { display: flex; align-items: center; gap: var(--s5); height: 56px; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links > a, .nav-links > .menu-wrap > button { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px; border-radius: var(--r-md); color: var(--text-2); text-decoration: none; font: 500 var(--fs-14) var(--font); background: none; border: 0; cursor: pointer; }
.nav-links > a:hover, .nav-links > .menu-wrap > button:hover { color: var(--text); background: var(--surface-2); }
.nav-links a[aria-current="page"], .nav-links button[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.kbtn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 10px; min-width: 190px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text-3); font: inherit; font-size: var(--fs-13); cursor: pointer; }
.kbtn:hover { border-color: var(--border-strong); color: var(--text-2); }
.kbtn kbd { margin-left: auto; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-md); border: 1px solid transparent; background: none; color: var(--text-2); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; min-width: 8px; height: 8px; border-radius: var(--r-full); background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.nav-burger { display: none; }
.mobile-menu { position: fixed; inset: 56px 0 0; z-index: 39; background: var(--bg); padding: var(--s4) var(--s4) var(--s10); overflow-y: auto; border-top: 1px solid var(--border); }
.mobile-menu a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 var(--s2); color: var(--text); text-decoration: none; font-size: var(--fs-16); border-bottom: 1px solid var(--border); }
.mobile-menu .mm-h { margin: var(--s5) 0 var(--s1); font-size: var(--fs-12); text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }

/* buttons */
.btn { --h: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: var(--h); padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font: 550 var(--fs-14) var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease); box-shadow: var(--shadow-sm); }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-dark { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn-dark:hover { background: var(--text-2); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--down); }
.btn-sm { --h: 30px; padding: 0 10px; font-size: var(--fs-13); gap: 5px; }
.btn-lg { --h: 44px; padding: 0 20px; font-size: var(--fs-16); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { color: transparent !important; position: relative; pointer-events: none; }
.btn[aria-busy="true"]::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--text-3); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn-primary[aria-busy="true"]::after { border-color: var(--accent-ink); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; cursor: pointer; }
.linkbtn:hover { text-decoration-color: currentColor; }

/* forms */
.field { display: grid; gap: 6px; margin-bottom: var(--s4); }
.field > span, .label { font-size: var(--fs-13); font-weight: 550; color: var(--text); }
.field .hint { font-size: var(--fs-12); color: var(--text-3); font-weight: 400; }
.input, .select, textarea.input { height: 36px; width: 100%; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--bg); color: var(--text); font: var(--fs-14) var(--font); transition: border-color var(--t), box-shadow var(--t); }
textarea.input { height: auto; min-height: 96px; padding: 8px 10px; resize: vertical; }
.input.mono { font-family: var(--mono); font-size: var(--fs-13); }
.input:focus, .select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.input[aria-invalid="true"] { border-color: var(--down); }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; cursor: pointer; }
.select-sm, .input-sm { height: 30px; font-size: var(--fs-13); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--fs-14); min-height: 32px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.input-group { display: flex; gap: var(--s2); }
.input-group .input { flex: 1; min-width: 0; }
.form-msg { min-height: 20px; font-size: var(--fs-13); margin: var(--s2) 0 0; color: var(--text-2); }
.form-msg.err { color: var(--down); }
.form-msg.ok { color: var(--up); }
fieldset { border: 0; padding: 0; margin: 0 0 var(--s4); }
legend { font-size: var(--fs-13); font-weight: 550; margin-bottom: 6px; padding: 0; }

/* segmented control and tabs */
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); gap: 2px; flex-wrap: wrap; }
.seg button, .seg a { height: 28px; padding: 0 10px; border: 0; border-radius: 4px; background: none; color: var(--text-2); font: 500 var(--fs-13) var(--font); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg [aria-pressed="true"], .seg [aria-current="page"], .seg [aria-current="true"], .seg [aria-selected="true"] { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs { display: flex; gap: var(--s5); border-bottom: 1px solid var(--border); margin-bottom: var(--s5); overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0; border: 0; background: none; color: var(--text-2); font: 500 var(--fs-14) var(--font); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs [aria-current="page"], .tabs [aria-current="true"], .tabs [aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs .count { font-size: var(--fs-12); color: var(--text-3); background: var(--surface-2); border-radius: var(--r-full); padding: 0 6px; }
.tabs.sticky { position: sticky; top: 56px; z-index: 30; background: var(--bg); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: var(--r-full); font-size: 11.5px; font-weight: 600; line-height: 1; white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); vertical-align: middle; }
.badge-up { color: var(--up); background: var(--up-bg); border-color: transparent; }
.badge-down { color: var(--down); background: var(--down-bg); border-color: transparent; }
.badge-warn { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.badge-info { color: var(--info); background: var(--info-bg); border-color: transparent; }
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.badge-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 25%, transparent); }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-12); text-decoration: none; border: 1px solid var(--border); }
/* site chips: a swatch in the series color plus the site name, never color alone */
.site { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-12); color: var(--text-2); font-weight: 550; white-space: nowrap; }
.site::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--sw, var(--ctx)); flex: none; }
.site.li { --sw: var(--li); }
.site.cc { --sw: var(--cc); }
.prov { color: var(--text-3); }

/* tooltips: data-tip on any element */
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); width: max-content; max-width: 260px; padding: 6px 8px; border-radius: var(--r-md); background: var(--text); color: var(--bg); font: 500 12px/1.35 var(--font); text-align: left; white-space: normal; z-index: 60; pointer-events: none; box-shadow: var(--shadow-md); text-transform: none; letter-spacing: 0; }

/* dropdown menus */
.menu-wrap { position: relative; }
.menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 240px; padding: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-md); z-index: 50; }
.menu.right { left: auto; right: 0; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 6px 10px; border: 0; border-radius: var(--r-md); background: none; color: var(--text); font: var(--fs-14) var(--font); text-decoration: none; text-align: left; cursor: pointer; }
.menu a:hover, .menu button:hover, .menu a:focus-visible, .menu button:focus-visible { background: var(--surface-2); outline: none; }
.menu .menu-sub { display: block; font-size: var(--fs-12); color: var(--text-3); }
.menu .i { color: var(--text-3); }

/* modal and palette */
dialog.modal { width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 64px); padding: 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop, dialog.palette::backdrop { background: rgba(10, 13, 13, .45); }
dialog.modal[open], dialog.palette[open] { animation: pop var(--t) var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.99); } }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.modal-h h2 { font-size: var(--fs-16); }
.modal-b { padding: var(--s5); overflow-y: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: var(--s2); padding: var(--s3) var(--s5); border-top: 1px solid var(--border); background: var(--surface); border-radius: 0 0 var(--r-lg) var(--r-lg); }
dialog.palette { width: min(640px, calc(100vw - 24px)); margin-top: 12vh; padding: 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden; }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 0 var(--s4); border-bottom: 1px solid var(--border); }
.pal-in input { flex: 1; height: 52px; border: 0; background: none; color: var(--text); font: var(--fs-16) var(--font); outline: none; min-width: 0; }
.pal-list { max-height: min(420px, 60vh); overflow-y: auto; padding: 6px; margin: 0; list-style: none; }
.pal-list li[role="option"] { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 6px 10px; border-radius: var(--r-md); cursor: pointer; }
.pal-list li[aria-selected="true"] { background: var(--surface-2); }
.pal-list .pal-h { padding: 8px 10px 4px; font-size: var(--fs-12); color: var(--text-3); }
.pal-list .pal-meta { margin-left: auto; font-size: var(--fs-12); color: var(--text-3); white-space: nowrap; }
.pal-foot { display: flex; gap: var(--s4); padding: 8px var(--s4); border-top: 1px solid var(--border); background: var(--surface); font-size: var(--fs-12); color: var(--text-3); flex-wrap: wrap; }

/* toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: grid; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-size: var(--fs-14); animation: pop var(--t) var(--ease); }
.toast.err { background: var(--down); color: #fff; }
.toast button { margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; padding: 0 4px; font-size: 18px; line-height: 1; }

/* cards */
.card { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); padding: var(--s5); box-shadow: var(--shadow-sm); min-width: 0; }
.card-flat { box-shadow: none; }
.card-muted { background: var(--surface); box-shadow: none; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); flex-wrap: wrap; }
.card-h h3 { font-size: var(--fs-14); display: flex; align-items: center; gap: 8px; }
.card-link { display: block; color: inherit; text-decoration: none; transition: border-color var(--t); }
.card-link:hover { border-color: var(--border-strong); }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--border); gap: 1px; margin: 0; }
.stat { background: var(--bg); padding: var(--s4) var(--s4) var(--s3); min-width: 0; }
.stat dt, .stat .k { font-size: var(--fs-12); color: var(--text-3); font-weight: 500; display: flex; align-items: center; gap: 4px; }
.stat dd, .stat .v { margin: 4px 0 0; font-size: var(--fs-22); font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; }
.stat .d { font-size: var(--fs-12); color: var(--text-3); margin: 2px 0 0; }

/* tables */
.tbl-wrap { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: auto; background: var(--bg); }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; font-size: var(--fs-14); }
.tbl th { position: sticky; top: 0; z-index: 2; background: var(--surface); text-align: left; font-size: var(--fs-12); font-weight: 550; color: var(--text-3); padding: 0 12px; height: 36px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl-wrap.page-sticky { overflow: visible; }
.tbl-wrap.page-sticky .tbl th { top: 56px; }
.tbl-wrap.page-sticky.under-tabs .tbl th { top: 99px; }
.tbl-wrap.page-sticky .tbl thead tr:first-child th:first-child { border-top-left-radius: var(--r-lg); }
.tbl-wrap.page-sticky .tbl thead tr:first-child th:last-child { border-top-right-radius: var(--r-lg); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface); }
.tbl .r { text-align: right; }
.tbl .c { text-align: center; }
.tbl .sep { border-left: 1px solid var(--border); }
.tbl th.grp { height: 28px; text-align: center; border-bottom: 1px solid var(--border); }
.tbl th button.sort { display: inline-flex; align-items: center; gap: 4px; height: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.tbl th.r button.sort { flex-direction: row-reverse; }
.tbl th button.sort:hover { color: var(--text); }
.tbl th[aria-sort] { color: var(--text); }
.tbl th .sort-i { opacity: .35; }
.tbl th[aria-sort] .sort-i { opacity: 1; }
.tbl td.rank { color: var(--text-3); width: 36px; }
.tbl tfoot td { font-size: var(--fs-12); color: var(--text-3); background: var(--surface); }
.pcell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.pcell a { color: var(--text); text-decoration: none; font-weight: 600; }
.pcell a:hover { text-decoration: underline; }
.pcell .sub { display: block; font-size: var(--fs-12); color: var(--text-3); font-weight: 400; margin-top: 1px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.empty-cell { color: var(--text-3); }
.chg { font-weight: 600; white-space: nowrap; }

/* charts */
.chart-box { position: relative; }
.chart { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; user-select: none; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis { stroke: var(--chart-axis); shape-rendering: crispEdges; }
.chart text { font: 11px var(--font); fill: var(--text-3); font-variant-numeric: tabular-nums; }
.chart .ylab { text-anchor: end; }
.chart .xlab { text-anchor: middle; }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln.minor { stroke-width: 1.5; opacity: .55; }
.chart .ln.li, .chart .dot.li, .chart .bar.li { stroke: var(--li); }
.chart .ln.cc, .chart .dot.cc, .chart .bar.cc { stroke: var(--cc); }
.chart .bar.li { fill: var(--li); stroke: none; }
.chart .bar.cc { fill: var(--cc); stroke: none; }
.chart .bar.ctx { fill: var(--ctx); }
.chart .ctxline { fill: none; stroke: var(--ctx); stroke-width: 1.5; }
.chart .dot { fill: var(--bg); stroke-width: 2; }
.chart .dot.li.fill { fill: var(--li); }
.chart .dot.cc.fill { fill: var(--cc); }
.chart text.val { fill: var(--text); font-weight: 650; font-size: 12px; }
.chart text.lab { fill: var(--text-2); font-size: 11px; }
.chart text.lab b, .chart tspan.b { font-weight: 650; fill: var(--text); }
.chart .zero { stroke: var(--text-3); stroke-width: 1; shape-rendering: crispEdges; }
.chart .since { stroke: var(--text-3); stroke-width: 1; shape-rendering: crispEdges; }
.chart .hit { fill: transparent; }
.chart .cross { stroke: var(--text-2); stroke-width: 1; pointer-events: none; shape-rendering: crispEdges; }
.chart g[tabindex]:focus { outline: none; }
.chart g[tabindex]:focus .bar, .chart g[tabindex]:hover .bar { opacity: .8; }
.chart-tip { position: absolute; top: 0; left: 0; padding: 6px 9px; border-radius: var(--r-md); background: var(--text); color: var(--bg); font-size: 12px; line-height: 1.4; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-md); font-variant-numeric: tabular-nums; z-index: 5; }
.chart-tip b { font-weight: 650; }
.legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); font-size: var(--fs-12); color: var(--text-3); align-items: center; margin-top: var(--s2); }
.legend .sw { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw::before { content: ""; width: 12px; height: 3px; border-radius: 2px; background: var(--sw, var(--ctx)); }
.legend .sw.box::before { height: 10px; width: 10px; }
.legend .sw.dot::before { height: 8px; width: 8px; border-radius: 50%; }
.legend .sw.ctx::before { opacity: .55; height: 10px; width: 10px; }
.svg-tip { position: fixed; z-index: 70; padding: 6px 8px; border-radius: var(--r-md); background: var(--text); color: var(--bg); font: 500 12px/1.35 var(--font); pointer-events: none; box-shadow: var(--shadow-md); max-width: 260px; }
.legend .sw.li { --sw: var(--li); }
.legend .sw.cc { --sw: var(--cc); }
details.tableview { margin-top: var(--s2); font-size: var(--fs-13); }
details.tableview summary { cursor: pointer; color: var(--text-2); min-height: 32px; display: inline-flex; align-items: center; }
details.tableview .tbl-wrap { max-height: 340px; margin-top: var(--s2); }
.spark { display: block; width: 96px; height: 26px; overflow: visible; }
.spark path { fill: none; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark .li { stroke: var(--li); }
.spark .cc { stroke: var(--cc); }
.spark circle.li { fill: var(--li); stroke: none; }
.spark circle.cc { fill: var(--cc); stroke: none; }
.spark-empty { font-size: 11px; color: var(--text-3); }

/* heatmap: players down, days across */
.heat { display: grid; grid-template-columns: minmax(110px, 160px) minmax(0, 1fr) 44px; gap: 3px 10px; align-items: center; font-size: var(--fs-12); }
.heat .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.heat .nm a { color: var(--text); text-decoration: none; font-weight: 550; }
.heat .nm a:hover { text-decoration: underline; }
.heat .cells { display: grid; grid-template-columns: repeat(var(--days, 35), minmax(0, 1fr)); gap: 2px; }
.heat .c { height: 16px; border-radius: 2px; background: var(--h0); }
.heat .c.l1 { background: var(--h1); } .heat .c.l2 { background: var(--h2); } .heat .c.l3 { background: var(--h3); } .heat .c.l4 { background: var(--h4); } .heat .c.l5 { background: var(--h5); }
.heat .c.unk { background: repeating-linear-gradient(135deg, var(--surface-2) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--border); }
.heat .c.we { box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--text-3) 30%, transparent); }
.heat .tot { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.heat .axis { display: grid; grid-template-columns: repeat(var(--days, 35), minmax(0, 1fr)); gap: 2px; font-size: 10.5px; color: var(--text-3); }
.heat .axis span { white-space: nowrap; overflow: visible; }
.heat-key { display: inline-flex; gap: 3px; align-items: center; }
.heat-key i { width: 14px; height: 12px; border-radius: 2px; display: inline-block; background: var(--h0); }
.cal { display: grid; grid-template-rows: repeat(7, 13px); grid-auto-flow: column; grid-auto-columns: 13px; gap: 3px; }
.cal i { border-radius: 2px; background: var(--h0); display: block; }
.cal i.l1 { background: var(--h1); } .cal i.l2 { background: var(--h2); } .cal i.l3 { background: var(--h3); } .cal i.l4 { background: var(--h4); } .cal i.l5 { background: var(--h5); }
.cal i.unk { background: repeating-linear-gradient(135deg, var(--surface-2) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--border); }
.cal i.fut { background: transparent; }

/* horizontal bars in HTML (improvement leaderboard) */
.lb { display: grid; gap: 4px; }
.lb-row { display: grid; grid-template-columns: minmax(100px, 170px) minmax(0, 1fr) 64px; gap: 10px; align-items: center; font-size: var(--fs-13); min-height: 26px; }
.lb-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row .nm a { color: var(--text); text-decoration: none; font-weight: 550; }
.lb-row .nm a:hover { text-decoration: underline; }
.lb-row .nm .pool { display: block; font-size: 11px; color: var(--text-3); }
.lb-row .track { position: relative; height: 14px; }
.lb-row .track .zero { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--text-3); }
.lb-row .track .b { position: absolute; top: 0; bottom: 0; background: var(--sw); }
.lb-row .track .b.pos { border-radius: 0 4px 4px 0; }
.lb-row .track .b.neg { border-radius: 4px 0 0 4px; }
.lb-row .track .b.li { --sw: var(--li); } .lb-row .track .b.cc { --sw: var(--cc); }
.lb-row .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }

/* timeline / feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: var(--s3); align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-14); }
.feed li:last-child { border-bottom: 0; }
.feed .t { flex: none; width: 82px; font-size: var(--fs-12); color: var(--text-3); font-variant-numeric: tabular-nums; }
.feed a { color: var(--text); font-weight: 550; text-decoration: none; }
.feed a:hover { text-decoration: underline; }

/* skeletons, empty, alerts */
.skel { display: block; border-radius: var(--r-sm); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; min-height: 12px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.empty { display: grid; justify-items: center; gap: var(--s2); text-align: center; padding: var(--s10) var(--s5); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); color: var(--text-2); }
.empty .i { color: var(--text-3); }
.empty h3 { color: var(--text); }
.empty p { max-width: 440px; margin: 0; }
.alert { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); font-size: var(--fs-14); }
.alert > .i { margin-top: 2px; color: var(--text-3); }
.alert p { margin: 0; }
.alert-err { border-color: color-mix(in srgb, var(--down) 35%, transparent); background: var(--down-bg); color: var(--down); }
.alert-err > .i { color: var(--down); }
.alert-warn { border-color: color-mix(in srgb, var(--warn) 30%, transparent); background: var(--warn-bg); }
.alert-warn > .i { color: var(--warn); }
.alert-ok { border-color: color-mix(in srgb, var(--up) 30%, transparent); background: var(--up-bg); }
.alert-ok > .i { color: var(--up); }
.alert-accent { border-color: var(--accent-line); background: var(--accent-soft); }
.alert-accent > .i { color: var(--accent); }
.offline-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-full); background: var(--text); color: var(--bg); font-size: var(--fs-13); box-shadow: var(--shadow-lg); }

/* prose (docs, legal, articles) */
.prose { max-width: var(--w-prose); font-size: 15.5px; line-height: 1.65; }
.prose h2 { font-size: var(--fs-22); margin: var(--s10) 0 var(--s3); }
.prose h3 { font-size: var(--fs-18); margin: var(--s8) 0 var(--s2); }
.prose p, .prose ul, .prose ol { margin: 0 0 var(--s4); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose table { border-collapse: collapse; width: 100%; font-size: var(--fs-14); margin: 0 0 var(--s4); }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { font-size: var(--fs-12); color: var(--text-3); font-weight: 550; }
.prose dl dt { font-weight: 650; margin-top: var(--s4); }
.prose dl dd { margin: 4px 0 0; color: var(--text-2); }
pre.code { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 14px; font: 12.5px/1.6 var(--mono); overflow-x: auto; white-space: pre; margin: 0 0 var(--s3); }
pre.code:has(.copy-btn) { padding-top: 42px; }
.copy-btn { position: absolute; top: 6px; right: 6px; }
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s10); padding: var(--s8) 0 var(--s16); }
.docs-nav { position: sticky; top: 76px; align-self: start; font-size: var(--fs-14); max-height: calc(100vh - 96px); overflow-y: auto; }
.docs-nav h4 { font-size: var(--fs-12); text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin: var(--s5) 0 var(--s2); }
.docs-nav h4:first-child { margin-top: 0; }
.docs-nav a { display: block; padding: 5px 10px; margin-left: -10px; border-radius: var(--r-md); color: var(--text-2); text-decoration: none; }
.docs-nav a:hover { color: var(--text); background: var(--surface-2); }
.docs-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); font-weight: 550; }

/* landing */
.hero { padding: var(--s16) 0 var(--s10); }
.hero h1 { font-size: var(--fs-44); line-height: 1.08; letter-spacing: -0.03em; max-width: 860px; }
.hero .lede { font-size: var(--fs-18); color: var(--text-2); max-width: 700px; margin: var(--s4) 0 var(--s6); line-height: 1.5; }
.hero .cta { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.hero-meta { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin-top: var(--s5); font-size: var(--fs-13); color: var(--text-3); align-items: center; }
.start-box { display: flex; gap: var(--s2); max-width: 640px; margin-bottom: var(--s3); }
.start-box .input { height: 44px; font-size: var(--fs-16); }
.preview { margin-top: var(--s8); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-md); overflow: hidden; background: var(--bg); }
.preview-h { display: flex; align-items: center; gap: var(--s3); padding: 10px var(--s4); border-bottom: 1px solid var(--border); background: var(--surface); font-size: var(--fs-13); color: var(--text-2); flex-wrap: wrap; }
.preview-h b { color: var(--text); }
.preview-b { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.preview-b > div { padding: var(--s4); min-width: 0; }
.preview-b > div + div { border-left: 1px solid var(--border); }
.steps { counter-reset: step; }
.step { position: relative; padding-top: var(--s10); }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: 0; left: 0; width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r-md); background: var(--text); color: var(--bg); font-weight: 700; font-size: var(--fs-13); }
.step h3 { margin-bottom: var(--s2); }
.step p { color: var(--text-2); margin: 0; }
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s12); align-items: center; padding: var(--s10) 0; }
.feature.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.feature.flip .feature-copy { order: 2; }
.feature-copy h3 { font-size: var(--fs-22); letter-spacing: -0.017em; margin-bottom: var(--s3); }
.feature-copy p { color: var(--text-2); font-size: var(--fs-16); }
.feature-copy ul { padding-left: 18px; color: var(--text-2); margin: 0; }
.feature-copy li { margin-bottom: 4px; }
.shot { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); box-shadow: var(--shadow-md); padding: var(--s4); overflow: hidden; min-width: 0; }
.shot-bar { display: flex; gap: 6px; align-items: center; margin: calc(-1 * var(--s4)) calc(-1 * var(--s4)) var(--s4); padding: 8px var(--s4); border-bottom: 1px solid var(--border); background: var(--surface); font-size: var(--fs-12); color: var(--text-3); }
.audience { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.audience > div { background: var(--bg); padding: var(--s5); }
.audience h3 { display: flex; align-items: center; gap: 8px; margin-bottom: var(--s2); }
.audience p { color: var(--text-2); margin: 0; }
.bigstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s6); }
.bigstat .v { font-size: var(--fs-36); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.bigstat .k { margin-top: var(--s2); color: var(--text-2); font-size: var(--fs-14); }
.price-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); align-items: stretch; }
.price { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s6); background: var(--bg); }
.price.featured { border-color: var(--accent); box-shadow: var(--shadow-md); }
.price h3 { font-size: var(--fs-16); display: flex; align-items: center; gap: var(--s2); }
.price .amt { font-size: var(--fs-36); font-weight: 700; letter-spacing: -0.03em; margin: var(--s3) 0 0; }
.price .amt small { font-size: var(--fs-14); font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.price .was { font-size: var(--fs-13); color: var(--text-3); min-height: 20px; }
.price ul { list-style: none; padding: 0; margin: var(--s5) 0; display: grid; gap: 8px; font-size: var(--fs-14); flex: 1; align-content: start; }
.price li { display: flex; gap: 8px; align-items: flex-start; }
.price li .i { color: var(--up); margin-top: 3px; }
.price li.no { color: var(--text-3); }
.price li.no .i { color: var(--text-3); }
.cmp td:not(:first-child), .cmp th:not(:first-child) { text-align: center; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 52px; cursor: pointer; font-weight: 600; font-size: var(--fs-16); list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .i { color: var(--text-3); transition: transform var(--t); }
.faq details[open] summary .i { transform: rotate(180deg); }
.faq details > div { padding: 0 0 var(--s4); color: var(--text-2); max-width: 720px; }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: var(--s6); padding: var(--s10); border-radius: var(--r-lg); background: var(--text); color: var(--bg); flex-wrap: wrap; }
.cta-band h2 { color: var(--bg); max-width: 720px; }
.cta-band p { color: color-mix(in srgb, var(--bg) 70%, transparent); margin: var(--s2) 0 0; }
.cta-band .btn:not(.btn-primary) { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 35%, transparent); }

/* club and player pages */
.club-head { padding: var(--s6) 0 var(--s4); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s4) var(--s8); align-items: start; }
.club-head h1 { font-size: var(--fs-28); }
.club-head .desc { color: var(--text-2); margin: var(--s2) 0 0; max-width: 720px; font-size: var(--fs-16); }
.club-head .meta { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); font-size: var(--fs-13); color: var(--text-3); margin-top: var(--s3); align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; margin-bottom: var(--s3); }
.toolbar .label { font-size: var(--fs-12); color: var(--text-3); font-weight: 500; }
.panel { padding: var(--s6) 0; }
.panel + .panel { border-top: 1px solid var(--border); }
.panel > h2 { font-size: var(--fs-18); margin-bottom: var(--s2); display: flex; align-items: center; gap: var(--s2); }
.panel > .sub { color: var(--text-2); margin: 0 0 var(--s4); max-width: 720px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s6); }
.awards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; margin-bottom: var(--s4); }
.awards > div { background: var(--bg); padding: var(--s3) var(--s4); min-width: 0; }
.awards .k { font-size: var(--fs-12); color: var(--text-3); }
.awards .v { font-size: var(--fs-16); font-weight: 650; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.awards .d { font-size: var(--fs-12); color: var(--text-2); margin-top: 2px; }
.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s2); }
.pair { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); font-size: var(--fs-13); background: var(--bg); }
.pair .bd { color: var(--text-3); font-variant-numeric: tabular-nums; }
.pair .vs { color: var(--text-3); font-size: 11px; }
.pair .p { min-width: 0; }
.pair .p b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pair .p span { font-size: 11.5px; color: var(--text-3); }
.pair .p.r { text-align: right; }
.p-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s4); align-items: center; padding: var(--s6) 0 var(--s4); }
.p-head h1 { font-size: var(--fs-28); }
.p-head .accts { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: 6px; font-size: var(--fs-13); }
.p-head .accts a { color: var(--text-2); }
.p-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s8); align-items: start; padding-bottom: var(--s16); }
.p-side { position: sticky; top: 76px; display: grid; gap: var(--s4); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--s4); margin: 0; font-size: var(--fs-13); }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.embed-preview { padding: var(--s4); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface); }
.pcard { width: 100%; max-width: 420px; border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s5); background: var(--bg); box-shadow: var(--shadow-md); }
.pcard .who { display: flex; gap: var(--s3); align-items: center; }
.pcard .who b { font-size: var(--fs-18); display: block; }
.pcard .lines { margin-top: var(--s4); display: grid; gap: 6px; }
.pcard .line { display: grid; grid-template-columns: minmax(0, 1fr) 56px 52px; gap: 8px; align-items: center; font-size: var(--fs-13); font-variant-numeric: tabular-nums; }
.pcard .foot { display: flex; justify-content: space-between; margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--border); font-size: 11px; color: var(--text-3); }
.codebox { font: 700 30px/1 var(--mono); letter-spacing: .12em; padding: var(--s4) var(--s5); border: 2px dashed var(--accent-line); border-radius: var(--r-lg); background: var(--accent-soft); display: inline-block; }
.steplist { counter-reset: s; list-style: none; padding: 0; margin: 0 0 var(--s4); display: grid; gap: var(--s3); }
.steplist li { counter-increment: s; position: relative; padding-left: 36px; }
.steplist li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; font-size: 12px; font-weight: 650; }

/* dashboard and settings */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s6); padding-bottom: var(--s16); align-items: start; }
.dash-side { display: grid; gap: var(--s4); }
.ladder-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s3); }
.notif { list-style: none; margin: 0; padding: 0; }
.notif li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-13); }
.notif li:last-child { border-bottom: 0; }
.notif li.unread .ic { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.notif .ic { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r-md); background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.notif .t { color: var(--text-3); font-size: var(--fs-12); }
.notif a { color: var(--text); font-weight: 600; text-decoration: none; }
.notif a:hover { text-decoration: underline; }
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s10); padding-bottom: var(--s16); }
.settings section { padding: var(--s6) 0; border-bottom: 1px solid var(--border); }
.settings section:first-child { padding-top: 0; }
.settings h2 { font-size: var(--fs-18); margin-bottom: var(--s2); }
.channel { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.channel .who { flex: 1; min-width: 200px; }
.channel .who b { display: block; }
.channel .who span { font: 12px var(--mono); color: var(--text-3); overflow-wrap: anywhere; }
.admin-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s10); padding-bottom: var(--s16); }
.admin-grid section { padding: var(--s6) 0; border-bottom: 1px solid var(--border); }
.admin-grid section:first-child { padding-top: 0; }
.admin-grid h2 { font-size: var(--fs-18); margin-bottom: var(--s2); }

/* footer */
.foot { border-top: 1px solid var(--border); background: var(--surface); margin-top: var(--s16); }
.foot .wrap { padding-top: var(--s10); padding-bottom: var(--s8); }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr)); gap: var(--s6); }
.foot h4 { font-size: var(--fs-13); margin-bottom: var(--s3); }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.foot a { color: var(--text-2); text-decoration: none; font-size: var(--fs-13); display: inline-flex; min-height: 28px; align-items: center; }
.foot a:hover { color: var(--text); }
.foot-about p { font-size: var(--fs-13); color: var(--text-2); max-width: 300px; margin-top: var(--s3); }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-top: var(--s8); padding-top: var(--s4); border-top: 1px solid var(--border); font-size: var(--fs-12); color: var(--text-3); flex-wrap: wrap; }

/* embeds */
body.embed { background: var(--bg); padding: 10px; }
body.embed .tbl td { padding: 6px 8px; font-size: 13px; }

/* the printed page: standings and parent reports */
.print-only { display: none; }
.sheet { max-width: 900px; margin: 0 auto; padding: var(--s8) var(--s6); }
.sheet h1 { font-size: var(--fs-28); }
.sheet .sheet-meta { color: var(--text-2); margin: 4px 0 var(--s5); }
.sheet .tbl td, .sheet .tbl th { padding: 6px 8px; }
.note-box { min-height: 110px; border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 10px; white-space: pre-wrap; }
.report-sum { font-size: var(--fs-16); line-height: 1.6; }
.report-sum p { margin-bottom: var(--s2); }

.show-sm { display: none; }

/* responsive */
@media (max-width: 1100px) {
  .kbtn { min-width: 0; }
  .kbtn .kbtn-label, .kbtn kbd { display: none; }
  .p-layout, .dash { grid-template-columns: minmax(0, 1fr); }
  .p-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot-about { grid-column: 1 / -1; }
  .awards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-burger { display: inline-grid; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3, .audience, .price-grid, .two { grid-template-columns: minmax(0, 1fr); }
  .split, .feature, .feature.flip { grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
  .feature.flip .feature-copy { order: 0; }
  .preview-b { grid-template-columns: minmax(0, 1fr); }
  .preview-b > div + div { border-left: 0; border-top: 1px solid var(--border); }
  .bigstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .club-head { grid-template-columns: minmax(0, 1fr); }
  .docs, .settings, .admin-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
  .docs-nav { position: static; max-height: none; border-bottom: 1px solid var(--border); padding-bottom: var(--s4); }
  .docs-nav .dn-group { display: flex; flex-wrap: wrap; gap: 4px; }
  .docs-nav a { margin-left: 0; border: 1px solid var(--border); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 var(--s4); }
  h1 { font-size: var(--fs-28); }
  .hero { padding: var(--s10) 0 var(--s6); }
  .hero h1 { font-size: 31px; }
  .hero .lede { font-size: var(--fs-16); }
  .section { padding: var(--s12) 0; }
  .g2, .g4 { grid-template-columns: minmax(0, 1fr); }
  .p-side { grid-template-columns: minmax(0, 1fr); }
  .p-head { grid-template-columns: auto minmax(0, 1fr); }
  .p-head .actions { grid-column: 1 / -1; }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cta-band { padding: var(--s6); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat dd, .stat .v { font-size: var(--fs-18); }
  .bigstat .v { font-size: var(--fs-28); }
  .nav .wrap { gap: var(--s2); }
  .start-box { flex-direction: column; }
  .hide-sm { display: none !important; }
  .show-sm { display: block; }
  .btn-sm, .input-sm, .select-sm { --h: 40px; height: 40px; }
  .seg button, .seg a { height: 38px; }
  .icon-btn { width: 40px; height: 40px; }
  .tabs a, .tabs button { height: 44px; }
  .foot a, .crumbs a, details.tableview summary { min-height: 40px; display: inline-flex; align-items: center; }
  .heat { grid-template-columns: 84px minmax(0, 1fr) 30px; gap: 3px 6px; }
  .heat .c { height: 14px; }
  .lb-row { grid-template-columns: 96px minmax(0, 1fr) 48px; }
  .awards > div { padding: 10px 12px; }
  .awards .v { font-size: var(--fs-14); }
  .awards .d { font-size: 11px; }
  .preview .tbl td, .preview .tbl th { padding-left: 6px; padding-right: 6px; }
  .tbl-wrap.page-sticky.under-tabs .tbl th { top: 101px; }
  /* tables collapse to rows */
  .tbl-wrap.collapse { border: 0; border-radius: 0; overflow: visible; background: none; }
  .tbl.collapse thead { display: none; }
  .tbl.collapse, .tbl.collapse tbody, .tbl.collapse tr, .tbl.collapse td { display: block; }
  .tbl.collapse tr { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
  .tbl.collapse td { border: 0; padding: 0; background: none !important; min-width: 0; }
  .tbl.collapse td.rank, .tbl.collapse td.sm-hide { display: none; }
  .tbl.collapse td.sm-full { grid-column: 1 / -1; }
  .tbl.collapse td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--text-3); }
  .tbl.collapse td.r { text-align: left; }
  .tbl.collapse td.sep { border-left: 0; }
  .tbl.collapse tbody tr:hover td { background: none; }
  .tbl.collapse tfoot { display: none; }
}
@media print {
  @page { margin: 14mm; }
  :root, :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --surface-2: #f2f2f2; --text: #000; --text-2: #333; --text-3: #555; --border: #ccc; --border-strong: #999; color-scheme: light; }
  body { font-size: 11.5pt; }
  .nav, .foot, .toasts, .no-print, .skip, .tabs, .actions, .offline-bar { display: none !important; }
  .print-only { display: block; }
  .wrap, .sheet { max-width: none; padding: 0; }
  .tbl-wrap { border: 0; overflow: visible; }
  .tbl th { position: static; background: none; color: #000; }
  .tbl tbody tr:hover td { background: none; }
  .tbl tr { break-inside: avoid; }
  .card, .shot { box-shadow: none; }
  .panel { break-inside: avoid; }
  a { text-decoration: none; color: #000; }
  .chart, .heat, .cal { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .note-box textarea { display: none; }
}
