/* Open Table v2 app shell (from the AthleteBench platform UI)
   Type: Barlow (body) + Barlow Condensed (headings, numbers, table heads)
   Status colours are fixed; brand colours follow the chosen theme. */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }

:root {
  --ink: #17222c;
  --ink-2: #4a5763;
  --ink-3: #75828d;
  --paper: #eef1f0;
  --surface: #ffffff;
  --surface-2: #f6f8f7;
  --line: #d9dfdd;
  --line-2: #c4ccca;

  /* theme: midnight & teal (default) */
  --brand-dark: #12233a;
  --brand-dark-2: #1b3150;
  --brand: #0b7f80;
  --brand-ink: #075e5f;
  --brand-soft: #dceeed;
  --on-dark: #e8f0f4;
  --on-dark-2: #9fb3c4;

  /* status (fixed) */
  --good: #0ca30c;      --good-ink: #0a6e19;  --good-bg: #e3f4e1;
  --warn: #fab219;      --warn-ink: #8a5a00;  --warn-bg: #fdf1d3;
  --bad:  #d03b3b;      --bad-ink:  #a42626;  --bad-bg:  #fbe4e2;
  --none-bg: #eceeed;

  --radius: 6px;
  --radius-sm: 3px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-cond: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --rail: 232px;
}

[data-brand="charcoal-amber"] { --brand-dark:#25272b; --brand-dark-2:#33363c; --brand:#b06d00; --brand-ink:#875300; --brand-soft:#f6ead5; --on-dark-2:#b5b1a8; }
[data-brand="forest-gold"]    { --brand-dark:#183326; --brand-dark-2:#224533; --brand:#9a7a12; --brand-ink:#76600d; --brand-soft:#f1ebd3; --on-dark-2:#a9bfb2; }
[data-brand="royal-sky"]      { --brand-dark:#1b2a6b; --brand-dark-2:#25398a; --brand:#1f78c8; --brand-ink:#155e9f; --brand-soft:#dcebf8; --on-dark-2:#aab8e6; }
[data-brand="crimson-slate"]  { --brand-dark:#2b3440; --brand-dark-2:#384452; --brand:#b4263a; --brand-ink:#8f1d2e; --brand-soft:#f6dfe2; --on-dark-2:#a8b3c0; }
[data-brand="graphite-mint"]  { --brand-dark:#2a2e33; --brand-dark-2:#383d44; --brand:#1d8a6a; --brand-ink:#146a51; --brand-soft:#d9f0e8; --on-dark-2:#b1b8bf; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 15px/1.5 var(--font); font-feature-settings: "tnum" 1;
}
a { color: var(--brand-ink); text-underline-offset: 2px; }
a:hover { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--font-cond); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: .005em; }
h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0 0 .8em; max-width: 72ch; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.num { font-family: var(--font-cond); font-weight: 600; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; border:0; overflow:hidden; clip:rect(0 0 0 0); clip-path: inset(50%); white-space:nowrap; }
.chip, .counts { position: relative; }
table.board td.cell, table.board td.sum { position: relative; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail {
  background: var(--brand-dark); color: var(--on-dark);
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; padding: 20px 12px 16px;
}
.brandmark { display: flex; gap: 10px; align-items: center; padding: 0 8px 20px; text-decoration: none; color: var(--on-dark); }
.brandmark svg { flex: none; }
.brandmark b { font: 700 19px/1.05 var(--font-cond); display: block; }
.brandmark span { font-size: 12px; color: var(--on-dark-2); display: block; }
.rail nav { display: flex; flex-direction: column; gap: 1px; }
.rail .group { font: 500 13px var(--font-cond); color: var(--on-dark-2); padding: 16px 10px 4px; letter-spacing: .02em; }
.rail a.nav {
  display: flex; align-items: center; gap: 10px; color: var(--on-dark); text-decoration: none;
  padding: 7px 10px; border-radius: var(--radius-sm); font-weight: 500; font-size: 14.5px;
}
.rail a.nav svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.rail a.nav:hover { background: var(--brand-dark-2); }
.rail a.nav.active { background: var(--brand-dark-2); box-shadow: inset 3px 0 0 var(--brand); }
.rail a.nav.active svg { opacity: 1; }
.rail a.nav .count { margin-left: auto; font: 600 12px var(--font-cond); background: var(--bad); color: #fff; border-radius: 9px; padding: 0 7px; }
.rail .foot { margin-top: auto; padding: 16px 10px 0; font-size: 12px; color: var(--on-dark-2); }

.main { min-width: 0; }
.topbar {
  display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: end; justify-content: space-between;
  padding: 22px 32px 18px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar .title p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.viewbar { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.viewbar label { display: flex; flex-direction: column; font-size: 12px; color: var(--ink-3); gap: 2px; }
.viewbar select { min-width: 120px; }
.content { padding: 24px 32px 48px; max-width: 1480px; }
.btn.menu-toggle { display: none; }

/* ---------- panels & layout ---------- */
.grid { display: grid; gap: 20px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main-side { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 18px 0; }
.panel > header p { margin: 2px 0 0; color: var(--ink-3); font-size: 13px; }
.panel .body, .panel.body { padding: 14px 18px 18px; }
.panel .body.flush { padding: 10px 0 4px; }
.stack > * + * { margin-top: 20px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* KPI strip: one bar of numbers, like a results board */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--brand-dark); color: var(--on-dark); border-radius: var(--radius); overflow: hidden; }
.kpi { padding: 14px 18px 16px; border-left: 1px solid rgba(255,255,255,.08); }
.kpi:first-child { border-left: 0; }
.kpi .v { font: 700 34px/1 var(--font-cond); display: block; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 13px; color: var(--on-dark-2); display: block; margin-top: 6px; }
.kpi .v.bad { color: #ff9a8f; }
.kpi .v.good { color: #8fe0a0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { font: 600 13.5px var(--font-cond); color: var(--ink-2); text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; letter-spacing: .01em; }
table.t td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.r, table.t th.r { text-align: right; }
table.t td.c, table.t th.c { text-align: center; }
table.t tbody tr:hover td { background: var(--surface-2); }
table.t a.rowlink { color: var(--ink); text-decoration: none; font-weight: 500; }
table.t a.rowlink:hover { color: var(--brand-ink); text-decoration: underline; }
.code { font: 500 12.5px var(--font-cond); color: var(--ink-3); }

/* ---------- status chips (icon + label, never colour alone) ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; font: 600 13px/1 var(--font-cond); padding: 4px 8px 4px 6px; border-radius: var(--radius-sm); white-space: nowrap; }
.chip::before { content: ""; width: 9px; height: 9px; flex: none; }
.chip.st-green { background: var(--good-bg); color: var(--good-ink); }
.chip.st-green::before { background: var(--good); border-radius: 50%; }
.chip.st-amber { background: var(--warn-bg); color: var(--warn-ink); }
.chip.st-amber::before { background: var(--warn); transform: rotate(45deg) scale(.85); }
.chip.st-red { background: var(--bad-bg); color: var(--bad-ink); }
.chip.st-red::before { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid var(--bad); }
.chip.st-none, .chip.st-context, .chip.st-empty { background: var(--none-bg); color: var(--ink-3); }
.chip.st-none::before, .chip.st-context::before, .chip.st-empty::before { border: 1.5px solid var(--ink-3); border-radius: 50%; width: 8px; height: 8px; }

.counts { display: inline-flex; gap: 6px; }
.counts .chip { padding: 3px 6px 3px 5px; font-size: 12.5px; }

/* ---------- the board (team matrix) ---------- */
.board-wrap { overflow: auto; max-height: calc(100vh - 210px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.board { border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.board th, table.board td { border-bottom: 1px solid var(--line); }
table.board thead th {
  position: sticky; top: 0; z-index: 2; background: var(--brand-dark); color: var(--on-dark);
  font: 600 13.5px/1.1 var(--font-cond); padding: 10px 6px; text-align: center; vertical-align: bottom; min-width: 74px;
}
table.board thead th .u { display: block; color: var(--on-dark-2); font-weight: 500; font-size: 12px; margin-top: 2px; }
table.board thead th.name { left: 0; z-index: 3; text-align: left; min-width: 210px; padding-left: 14px; }
table.board thead th a { color: inherit; text-decoration: none; }
table.board thead th a:hover { text-decoration: underline; }
table.board td.name { position: sticky; left: 0; background: var(--surface); z-index: 1; padding: 6px 14px; border-right: 1px solid var(--line); white-space: nowrap; }
table.board td.name a { color: var(--ink); font-weight: 600; text-decoration: none; }
table.board td.name a:hover { color: var(--brand-ink); text-decoration: underline; }
table.board td.name .meta { display: block; color: var(--ink-3); font-size: 12px; }
table.board td.cell { padding: 3px; text-align: center; }
.cellv {
  display: flex; align-items: center; justify-content: center; gap: 4px; height: 36px; min-width: 66px; border-radius: var(--radius-sm);
  font: 600 15px/1 var(--font-cond); font-variant-numeric: tabular-nums; position: relative;
}
.cellv.st-green { background: var(--good-bg); color: var(--good-ink); box-shadow: inset 0 -3px 0 var(--good); }
.cellv.st-amber { background: var(--warn-bg); color: var(--warn-ink); box-shadow: inset 0 -3px 0 var(--warn); }
.cellv.st-red   { background: var(--bad-bg); color: var(--bad-ink); box-shadow: inset 0 -3px 0 var(--bad); }
.cellv.st-none, .cellv.st-context { background: var(--surface-2); color: var(--ink-2); }
.cellv.st-empty { color: var(--line-2); }
.cellv .tri { font-size: 10px; }
table.board td.sum { padding: 4px 10px; white-space: nowrap; text-align: center; }
table.board tbody tr:hover td.name { background: var(--surface-2); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--ink-2); }

/* ---------- lane strip (athlete profile) ---------- */
.lanes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.lane { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 10px 12px 10px 14px; position: relative; overflow: hidden; text-decoration: none; color: var(--ink); display: block; }
.lane::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line-2); }
.lane.st-green::before { background: var(--good); }
.lane.st-amber::before { background: var(--warn); }
.lane.st-red::before { background: var(--bad); }
.lane .tn { font: 600 14px var(--font-cond); color: var(--ink-2); }
.lane .tv { font: 700 28px/1.1 var(--font-cond); font-variant-numeric: tabular-nums; }
.lane .tv small { font: 500 13px var(--font); color: var(--ink-3); margin-left: 3px; }
.lane .tt { font-size: 12.5px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 6px; margin-top: 2px; }
.lane.empty .tv { color: var(--line-2); }
.lane[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
button.lane { font: inherit; text-align: left; cursor: pointer; width: 100%; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 500; }

/* percentile bar */
.pbar { display: inline-block; width: 72px; height: 6px; background: var(--line); border-radius: 3px; vertical-align: middle; margin-right: 6px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.trend-up { color: var(--good-ink); }
.trend-down { color: var(--bad-ink); }

/* ---------- forms ---------- */
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
label.f .hint { font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
input, select, textarea {
  font: inherit; font-size: 14.5px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 7px 9px; min-height: 36px; width: 100%;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
input[type=checkbox] { width: 17px; height: 17px; min-height: 0; accent-color: var(--brand); margin: 0; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.field-error input, .field-error select, .field-error textarea, input.invalid { border-color: var(--bad); background: var(--bad-bg); }
.err { color: var(--bad-ink); font-size: 12.5px; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 18px; }
.form-grid .wide { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px 18px; margin: 0 0 18px; background: var(--surface); }
legend { font: 600 17px var(--font-cond); padding: 0 6px; margin-left: -6px; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; font: 600 14.5px/1 var(--font); padding: 9px 14px; min-height: 36px;
  border-radius: var(--radius-sm); border: 1px solid var(--brand); background: var(--brand); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--ink-3); background: var(--surface-2); color: var(--ink); }
.btn.danger { background: var(--surface); color: var(--bad-ink); border-color: #e6b3ae; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: 5px 9px; min-height: 28px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; }
.linkbtn { background: none; border: 0; color: var(--brand-ink); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--ink-2); font: 600 15.5px var(--font-cond); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--brand); }

/* flash messages */
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.flash { padding: 10px 14px; border-radius: var(--radius-sm); border-left: 4px solid var(--brand); background: var(--brand-soft); font-weight: 500; }
.flash.ok { border-color: var(--good); background: var(--good-bg); }
.flash.warn { border-color: var(--warn); background: var(--warn-bg); }
.flash.error { border-color: var(--bad); background: var(--bad-bg); }

.callout { border-left: 3px solid var(--line-2); padding: 4px 0 4px 14px; color: var(--ink-2); font-size: 13.5px; max-width: 80ch; }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-2); }
.empty h3 { margin-bottom: 6px; }
.empty .actions { justify-content: center; }

/* testing grid */
.entry-head { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; align-items: end; }
table.grid-entry { border-collapse: separate; border-spacing: 0; font-size: 14px; }
table.grid-entry th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; font: 600 13px/1.1 var(--font-cond); padding: 8px 4px; border-bottom: 1px solid var(--line-2); text-align: center; min-width: 78px; }
table.grid-entry th .u { display: block; font-weight: 500; color: var(--ink-3); font-size: 12px; }
table.grid-entry th.name, table.grid-entry td.name { position: sticky; left: 0; background: var(--surface); z-index: 1; text-align: left; padding: 4px 12px; min-width: 190px; border-right: 1px solid var(--line); }
table.grid-entry th.name { z-index: 3; background: var(--surface-2); }
table.grid-entry td { border-bottom: 1px solid var(--line); padding: 3px; }
table.grid-entry input { text-align: right; padding: 5px 7px; min-height: 32px; font: 600 15px var(--font-cond); font-variant-numeric: tabular-nums; }
table.grid-entry input.changed { background: #fffbea; border-color: var(--warn); }
table.grid-entry input.notes { text-align: left; font: 400 13px var(--font); min-width: 160px; }
table.grid-entry tr.has-session td.name { box-shadow: inset 3px 0 0 var(--brand); }

.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 14px; padding: 3px 10px; font-size: 13px; background: var(--surface); text-decoration: none; color: var(--ink); }
.pill:hover { border-color: var(--brand); }
.pill input { width: 14px; height: 14px; }

.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 340px; }
.chart-box.short { height: 180px; }

details.disclose summary { cursor: pointer; color: var(--brand-ink); font-weight: 500; }
details.disclose[open] summary { margin-bottom: 10px; }

/* responsive */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpi:nth-child(4) { border-left: 0; }
  .kpi:nth-child(n+4) { border-top: 1px solid rgba(255,255,255,.08); }
  .g-main-side, .g-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; z-index: 50; width: 260px; transform: translateX(-100%); transition: transform .2s ease;
          top: 0; bottom: 0; height: auto; max-height: 100dvh; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .rail .foot { margin-top: 12px; }
  body.nav-open .rail { transform: none; box-shadow: 0 0 0 100vmax rgba(10,20,30,.4); }
  .btn.menu-toggle { display: inline-flex; }
  .topbar { padding: 14px 16px; }
  .content { padding: 16px 16px 40px; }
  .g-2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(odd) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.08); }
  h1 { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- misc additions ---------- */
.mt { margin-top: 22px; }
form.inline { display: inline; }
ol.plain, ul.plain { margin: 0; padding-left: 18px; }
ol.plain li, ul.plain li { margin-bottom: 4px; }
ol.steps { padding-left: 18px; margin: 0 0 10px; }
ol.steps li { margin-bottom: 8px; }
.mixbar { display: flex; gap: 2px; height: 14px; border-radius: 3px; overflow: hidden; margin: 4px 0 12px; }
.mixbar i { display: block; min-width: 3px; }
.mixbar i.st-green { background: var(--good); }
.mixbar i.st-amber { background: var(--warn); }
.mixbar i.st-red { background: var(--bad); }
table.mixtable td { padding: 6px 4px; }
.stack[style*="--gap"] > * + * { margin-top: var(--gap); }

/* percentile shading: one hue (brand), light -> dark */
.cellv.pq1 { background: color-mix(in srgb, var(--brand) 6%, #fff); color: var(--ink-2); }
.cellv.pq2 { background: color-mix(in srgb, var(--brand) 16%, #fff); color: var(--ink); }
.cellv.pq3 { background: color-mix(in srgb, var(--brand) 30%, #fff); color: var(--ink); }
.cellv.pq4 { background: color-mix(in srgb, var(--brand) 50%, #fff); color: var(--ink); }
.cellv.pq5 { background: var(--brand-ink); color: #fff; }
td.cell.num { text-align: center; font-family: var(--font-cond); font-weight: 600; }

/* report options */
fieldset.flat { border: 0; padding: 0; margin: 0; background: none; }
.small-legend { font: 600 14px var(--font-cond); color: var(--ink-2); padding: 0; margin: 0 0 6px; }
.checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.checklist .check { font-size: 13.5px; }
.linkbtn + .linkbtn { margin-left: 12px; }

/* sign-in page */
body.login-page { background: var(--brand-dark); min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-wrap { width: 100%; max-width: 380px; }
.login-brand { display: flex; gap: 12px; align-items: center; color: var(--on-dark); margin-bottom: 18px; }
.login-brand b { font: 700 22px/1.05 var(--font-cond); display: block; }
.login-brand span { font-size: 13px; color: var(--on-dark-2); }
.login-card { background: var(--surface); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: inset 0 3px 0 var(--brand); }
.login-card h1 { font-size: 26px; }
.login-card .btn { justify-content: center; }
.login-card p { margin: 0; }
.login-foot { color: var(--on-dark-2); text-align: center; margin-top: 14px; }
.rail .signout { background: none; border: 0; padding: 0; color: var(--on-dark-2); text-decoration: underline; cursor: pointer; font: inherit; }
.rail .signout:hover { color: var(--on-dark); }
.temp-pw { font: 700 30px/1.2 var(--font-cond); letter-spacing: .06em; background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 12px 16px; display: inline-block; user-select: all; }
.rail .whoami { color: var(--on-dark); font-weight: 600; display: block; margin-bottom: 2px; }
[hidden] { display: none !important; }
.empty p { margin-left: auto; margin-right: auto; }

/* ---------- account button + menu (bottom of sidebar) ---------- */
.usermenu { position: relative; margin: 12px -4px 0; }
.usermenu-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  background: var(--brand-dark-2); border: 1px solid rgba(255,255,255,.08); color: var(--on-dark);
  border-radius: var(--radius); padding: 8px 10px; font: inherit;
}
.usermenu-btn:hover, .usermenu-btn[aria-expanded="true"] { border-color: rgba(255,255,255,.25); }
.usermenu-btn .avatar {
  flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font: 700 14px/1 var(--font-cond); letter-spacing: .02em;
}
.usermenu-who { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.usermenu-who b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usermenu-who span { font-size: 12px; color: var(--on-dark-2); }
.usermenu-btn .chev { flex: none; opacity: .7; transition: transform .15s ease; transform: rotate(180deg); }
.usermenu-btn[aria-expanded="true"] .chev { transform: none; }
.usermenu-pop {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 20;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(10, 20, 30, .28); padding: 6px; display: flex; flex-direction: column;
}
.usermenu-pop[hidden] { display: none; }
.usermenu-head { padding: 6px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.usermenu-head b { font-size: 14px; }
.usermenu-head span { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.usermenu-pop a, .usermenu-pop button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; border-radius: var(--radius-sm);
  color: var(--ink); text-decoration: none; background: none; border: 0; font: 500 14px var(--font); cursor: pointer; text-align: left;
}
.usermenu-pop a:hover, .usermenu-pop button:hover, .usermenu-pop a:focus-visible, .usermenu-pop button:focus-visible { background: var(--surface-2); outline: none; }
.usermenu-pop svg { width: 16px; height: 16px; color: var(--ink-3); }
.usermenu-pop form { margin: 0; }
.rail .foot { padding-bottom: 0; }
.admin-tabs { margin-bottom: 20px; }
.subtabs { border-bottom-color: var(--line); }
.subtabs a { font-size: 14.5px; }
.jump { color: var(--ink-3); margin: -6px 0 16px; }

/* v1.09: athlete list filters + sortable headers */
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin: 0 0 14px; }
.filters .f { min-width: 140px; }
.filters .f select { min-width: 140px; }
.filters-meta { margin-left: auto; padding-bottom: 8px; }
table.t th.sortable a { color: inherit; text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }
table.t th.sortable a:hover { color: var(--ink); text-decoration: underline; }
table.t th.r.sortable a { flex-direction: row; }
.sort-ind { font-size: .75em; color: var(--ink-3); }
table.t th[aria-sort] .sort-ind { color: var(--brand); }

/* v1.09: drag-and-drop uploads */
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-align: center; padding: 22px 16px; border: 2px dashed var(--line-2); border-radius: var(--radius); background: var(--surface-2, #f6f8f7);
  cursor: pointer; transition: border-color .15s, background .15s; margin-top: 6px; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--brand); }
.dropzone.drag { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dropzone svg { width: 28px; height: 28px; color: var(--brand); }
.dropzone .dz-title { font-weight: 600; }
.dropzone .dz-files { font-size: 13px; color: var(--ink); }
.dropzone .dz-files li { list-style: none; }
.dropzone .dz-files ul { padding: 0; margin: 4px 0 0; }
.dropzone .dz-err { color: var(--bad, #d03b3b); font-size: 13px; }

/* v1.13: customisable dashboard */
.dash-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.widget { min-width: 0; display: flex; flex-direction: column; }
.widget > .panel, .widget > .kpis { flex: 1; }
.w-third { grid-column: span 2; } .w-half { grid-column: span 3; } .w-two-thirds { grid-column: span 4; } .w-full { grid-column: span 6; }
.dash-customise { display: flex; justify-content: flex-end; margin-bottom: -8px; }
.dash-editbar h2 { margin: 0 0 2px; }
.dash-tray { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.dash-grid.editing .widget { outline: 2px dashed var(--line-2); outline-offset: 4px; border-radius: var(--radius); }
.dash-grid.editing .widget.dragging { opacity: .45; }
.dash-grid.editing .widget.drop-before { box-shadow: -6px 0 0 -2px var(--brand); }
.dash-grid.editing .widget.drop-after { box-shadow: 6px 0 0 -2px var(--brand); }
.dash-grid.editing .w-full.drop-before { box-shadow: 0 -6px 0 -2px var(--brand); }
.dash-grid.editing .w-full.drop-after { box-shadow: 0 6px 0 -2px var(--brand); }
.dash-grid.editing .widget .panel a, .dash-grid.editing .widget .panel select:not([data-size-select]) { pointer-events: none; }
.wctl { display: flex; align-items: center; gap: 6px; padding: 6px 8px; margin-bottom: 6px; background: var(--brand-dark); color: var(--on-dark); border-radius: var(--radius-sm); font-size: 13px; }
.wctl .wtitle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wgrip { cursor: grab; font-size: 16px; line-height: 1; padding: 0 2px; user-select: none; }
.wctl select { font-size: 12px; padding: 2px 4px; min-height: 0; height: 26px; width: auto; }
.wbtn { background: rgba(255,255,255,.12); color: inherit; border: 0; border-radius: 4px; width: 26px; height: 26px; cursor: pointer; font-size: 13px; }
.wbtn:hover, .wbtn:focus-visible { background: rgba(255,255,255,.25); }
.wremove:hover { background: #d03b3b; }
.wplaceholder { border-style: dashed; }
.shortcuts { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 1100px) { .w-third { grid-column: span 3; } .w-two-thirds { grid-column: span 6; } }
@media (max-width: 760px) { .dash-grid .widget { grid-column: span 6; } }
.pl-spark { line-height: 0; padding-top: 2px !important; padding-bottom: 2px !important; } .pl-spark svg { width: 150px; height: 36px; display: block; }

/* v1.14: bulk update athletes */
.bulkbar { margin-bottom: 14px; position: sticky; top: 0; z-index: 4; border-color: var(--brand); }
.bulkbar .body { padding-top: 12px; padding-bottom: 12px; }
.bulk-head { margin-bottom: 8px; }
.bulk-fields { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.bulk-fields .f { min-width: 150px; }
.bulk-fields .actions { margin: 0; }
th.chk, td.chk { width: 34px; padding-right: 0 !important; }
td.chk input, th.chk input { width: 16px; height: 16px; }
tr.selected td { background: color-mix(in srgb, var(--brand) 8%, transparent); }

/* v1.16: single filter dropdown with chips; two-step bulk bar */
.filter-pick { width: auto; min-width: 210px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font-size: 13px; text-decoration: none; color: var(--ink); }
.filter-chip:hover { border-color: var(--bad, #d03b3b); }
.filters { align-items: center; }
.bulk-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.bulk-row .bulk-count { flex-basis: 100%; }
.bulk-row .f { min-width: 170px; }
.bulk-delete { margin-left: auto; }
.danger-panel { border-color: var(--bad, #d03b3b); }

/* Tests & groups: copy / delete */
.row-actions form.inline { margin-left: 4px; }
.btn.danger-text { color: var(--bad-ink); }
.selectbar .bulk-count { flex-basis: auto; margin-right: auto; align-self: center; }
.selectbar .bulk-row { align-items: center; }

/* Settings: phases with dates */
.phase-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; align-items: end; padding: 12px 0; border-bottom: 1px solid var(--line); }
.phase-row .f:first-of-type { grid-column: 1 / -1; }
.phase-row .phase-count { align-self: center; }
.phase-row > .row { justify-content: flex-end; }
.phase-row.phase-new { border-bottom: 0; }
.gps-lanes .lane { border-left: 3px solid var(--brand); }
.card-pick { margin: 0; border-width: 0 0 1px; border-radius: 0; }
.gps-card-opts { margin-top: 8px; padding-left: 4px; }
.gps-card-opts input[type=radio], .gps-card-opts input[type=checkbox] { width: 16px; height: 16px; flex: none; }
.gps-kind { display: grid; gap: 4px; }

/* Admin: email */
.callout-ok { border-left-color: var(--good, #0ca30c); }
.mono-text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.5; }
.email-preview { background: #f3f5f4; }
.temp-pw.link-copy { font-size: 14px; word-break: break-all; user-select: all; }
.email-on { grid-column: 1 / -1; font-weight: 600; }

/* Young players (v1.23) */
.minor-box { border: 1px solid #e6b3ae; background: color-mix(in srgb, var(--bad-bg, #fdecea) 60%, transparent); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; }
.minor-warn { font-weight: 600; margin: 0 0 6px; }
.consent-line { color: var(--ink-2); }
.consent-row td { border-top: 0 !important; padding-top: 0 !important; }
.consent-grid { margin-top: 8px; }
.notice-panel { max-width: 760px; }
.notice-list { padding-left: 20px; line-height: 1.6; }
.notice-list li { margin: 6px 0; }

/* Two-step sign-in (v1.24) */
.mfa-setup { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.mfa-qr svg { width: 200px; height: 200px; display: block; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.copy-row { display: flex; gap: 6px; }
.copy-row input { flex: 1; min-width: 0; }
.code-input { font-size: 22px; letter-spacing: 4px; max-width: 180px; font-variant-numeric: tabular-nums; }
.recovery-codes { columns: 2; font-size: 16px; line-height: 1.9; padding-left: 28px; }
@media (max-width: 700px) { .mfa-setup { grid-template-columns: 1fr; } }

/* ===================== Open Table v2 additions ===================== */
/* Tavern theme: warm dark rail with gold, parchment paper. */
[data-brand="tavern"] {
  --brand-dark:#1d1711; --brand-dark-2:#2c2318; --brand:#b8862f; --brand-ink:#8a6420; --brand-soft:#f3e7cc;
  --on-dark:#f1e6cf; --on-dark-2:#bfae8e;
  --paper:#e9dfc4; --surface:#fbf6ea; --surface-2:#f5eddb; --line:#ddcfae; --line-2:#cbb98f; --ink:#2b2117; --ink-2:#5a4a35; --ink-3:#8a7a5c;
}
[data-brand="tavern"] h1, [data-brand="tavern"] .brandmark b { font-family: "Cinzel", var(--font-cond); letter-spacing: .02em; }
@font-face { font-family:"Cinzel"; font-weight:400 600; font-display:swap; src:url("../fonts/cinzel-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family:"Cinzel"; font-weight:700 900; font-display:swap; src:url("../fonts/cinzel-latin-700-normal.woff2") format("woff2"); }

.rail .club-switch { padding: 0 14px 10px; }
.rail .club-switch select { width: 100%; background: var(--brand-dark-2); color: var(--on-dark); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); padding: 7px 8px; font: inherit; font-size: 13px; }
.rail .foot a { color: var(--on-dark-2); }

/* Game pages: give the client the full content width, parchment behind it. */
.content:has(.ot-game) { background: #e9dfc4; }

/* Public table page (guests) */
.table-page { background: #e9dfc4; }
.table-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:10px 18px; background:var(--brand-dark); color:var(--on-dark); position:sticky; top:0; z-index:20; }
.table-brand { display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--on-dark); }
.table-brand b { display:block; font-family:"Cinzel", var(--font-cond); font-size:17px; letter-spacing:.03em; }
.table-brand span span { display:block; font-size:12px; color:var(--on-dark-2); }
.table-nav { display:flex; gap:4px; flex-wrap:wrap; }
.table-nav a { color:var(--on-dark); text-decoration:none; font-size:14px; padding:6px 10px; border-radius:var(--radius); }
.table-nav a:hover { background:var(--brand-dark-2); color:#fff; }
.table-nav a.table-signin { border:1px solid var(--brand); color:var(--brand-soft); }
.table-main { max-width: 980px; margin: 0 auto; padding: 16px 16px 40px; }
.table-title { font-family:"Cinzel", var(--font-cond); color:#7a3b30; font-size:24px; margin:4px 0 14px; }
.member-actions form.inline { display:inline-flex; flex-wrap:wrap; gap:4px; justify-content:flex-end; }
.member-actions { min-width: 210px; }
.rail .signin-box { margin: 8px; padding: 12px; border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); background: var(--brand-dark-2); }
.rail .signin-box p { margin: 0 0 10px; font-size: 12.5px; line-height: 1.45; color: var(--on-dark-2); }
.rail .signin-box .btn { width: 100%; justify-content: center; }

/* ---------- bug reports (v2.04) ---------- */
.rail .nav-btn { display:flex; align-items:center; gap:10px; width:100%; margin-top:10px; background:none; border:1px dashed rgba(255,255,255,.18);
  color:var(--on-dark-2); padding:7px 10px; border-radius:var(--radius-sm); font:inherit; font-size:13.5px; cursor:pointer; text-align:left; }
.rail .nav-btn svg { width:17px; height:17px; flex:none; opacity:.75; }
.rail .nav-btn:hover { background:var(--brand-dark-2); color:var(--on-dark); }
.rail .nav-count { margin-left:auto; background:var(--brand); color:#fff; border-radius:999px; font-size:11px; font-weight:700; padding:1px 7px; }
.table-nav .table-bug { background:none; border:1px dashed rgba(255,255,255,.25); color:var(--on-dark-2); font:inherit; font-size:13px; padding:6px 10px; border-radius:var(--radius); cursor:pointer; }
.bug-dialog { border:none; border-radius:14px; padding:0; width:min(520px, calc(100vw - 32px)); box-shadow:0 20px 60px rgba(0,0,0,.35); background:#fff; color:#1f2a2a; }
.bug-dialog::backdrop { background:rgba(15,20,25,.5); }
.bug-form { padding:20px 20px 16px; display:flex; flex-direction:column; gap:10px; }
.bug-form h2 { margin:0; font-size:19px; }
.bug-form .bug-note { margin:0; font-size:13.5px; color:#4a5757; line-height:1.5; }
.bug-form label.f { display:flex; flex-direction:column; gap:6px; font-weight:600; font-size:13.5px; }
.bug-form textarea { font:inherit; font-weight:400; font-size:15px; padding:10px; border:1px solid #c9d2d0; border-radius:8px; resize:vertical; min-height:110px; }
.bug-form .bug-page { margin:0; color:#6b7777; word-break:break-all; }
.bug-status { margin:0; font-size:13.5px; min-height:1em; }
.bug-status.ok { color:#1f7a3f; font-weight:600; }
.bug-status.err { color:#a3361f; }
.bug-actions { display:flex; justify-content:flex-end; gap:8px; }
article.bug { padding:14px 18px; border-bottom:1px solid var(--line); }
article.bug:last-child { border-bottom:none; }
article.bug.bug-fixed { opacity:.65; }
.bug-meta { font-size:13px; display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.bug-page { font-size:13px; margin:4px 0; word-break:break-all; }
.bug-msg { white-space:pre-wrap; margin:6px 0; line-height:1.5; }
article.bug .actions { display:flex; gap:8px; margin-top:8px; }
/* v2.06: game pages use the whole width beside the menu, so their column is centred on wide screens */
.content:has(.ot-game) { max-width: none; }

/* ---------- v2.10 events ---------- */
.ev-card { margin-bottom: 16px; }
.ev-card h2 a { color: inherit; text-decoration: none; }
.ev-card h2 a:hover { text-decoration: underline; }
.ev-cancelled { opacity: .65; }
.ev-list { list-style: none; margin: 0; padding: 0; }
.ev-list li { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; padding: 9px 18px; border-top: 1px solid var(--line); }
.ev-list li:first-child { border-top: 0; }
.ev-num { font: 600 13px var(--font-cond); color: var(--ink-3); min-width: 58px; text-transform: uppercase; letter-spacing: .03em; }
.ev-what { flex: 1 1 200px; display: flex; flex-direction: column; min-width: 0; }
.ev-top { margin-bottom: 16px; }
.ev-top .small { margin-left: 8px; }
.ev-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.ev-table .ev-desc { white-space: pre-line; margin-top: 0; }
.ev-assign { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 4px; }
.ev-actions { margin-top: 12px; gap: 8px; }
.ev-owner-bar { margin: 16px 0 6px; gap: 10px; }
.ev-preview { white-space: pre-wrap; word-break: break-word; background: var(--bg, #f3f5f4); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 13px; line-height: 1.5; max-height: 560px; overflow: auto; margin: 0; }
details.panel > summary { cursor: pointer; list-style-position: inside; }
.ev-tables { display: grid; gap: 10px; }
.ev-trow { display: grid; grid-template-columns: 70px 190px 1fr; gap: 8px 12px; align-items: end; padding: 10px 0; border-top: 1px solid var(--line); }
.ev-trow:first-child { border-top: 0; }
.ev-trow .ev-wide { grid-column: 2 / -1; }
.ev-trow .ev-num { align-self: center; }
.ev-trow .check { grid-column: 2 / -1; }
.dm-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.dm-steps > li.done { border-color: var(--good, #2f8f5b); }
@media (max-width: 760px) {
  .ev-assign { grid-template-columns: 1fr; }
  .ev-trow { grid-template-columns: 1fr; }
  .ev-trow .ev-wide, .ev-trow .check { grid-column: auto; }
  .ev-grid { grid-template-columns: 1fr; }
  .ev-list li { padding: 9px 14px; }
}

/* ---------- v2.13 sign-up & join ---------- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.login-alt { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.join-code { font: 700 22px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.join-qr svg { width: 160px; height: 160px; display: block; background: #fff; border-radius: 6px; }
.join-row td { vertical-align: top; }
.join-off td { opacity: .55; }
.join-input { font: 600 20px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; text-transform: uppercase; }

/* ---------- v2.14 terms & privacy ---------- */
.legal-doc { max-width: 820px; }
.legal-doc .body { font-size: 15px; line-height: 1.6; }
.legal-doc h2 { font-size: 18px; margin: 22px 0 6px; }
.legal-doc h2:first-child { margin-top: 0; }
.legal-doc ul { padding-left: 20px; margin: 6px 0 12px; }
.legal-doc li { margin-bottom: 4px; }
.legal-edit { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; min-height: 420px; }
.rail .foot a { color: inherit; }
.ev-assign .ev-guest { grid-column: 1 / -1; }

/* ---------- v2.17 Discord messages ---------- */
.dm-msg { margin-bottom: 12px; }
.dm-msg > summary .chip { margin-left: 8px; }
.dm-msg-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 16px; margin-bottom: 12px; }
.dm-ph { list-style: none; padding: 0; margin: 6px 0 0; font-size: 12.5px; color: var(--ink-2); }
.dm-ph li { margin-bottom: 4px; }
.dm-ph code, .callout code { font-size: 12px; background: var(--bg, #f3f5f4); padding: 0 4px; border-radius: 3px; }
@media (max-width: 760px) { .dm-msg-grid { grid-template-columns: 1fr; } }

/* ---------- v2.20 notifications ---------- */
.notif-grid th.c, .notif-grid td.c { text-align: center; width: 110px; }
.notif-grid input[type=checkbox] { width: 18px; height: 18px; }

/* ---------- v2.20 emoji picker ---------- */
.emoji-row { display: flex; gap: 6px; align-items: center; }
.emoji-input { width: 90px; font-size: 20px; text-align: center; }
.emoji-insert { align-self: flex-start; margin-top: 6px; }
.emoji-pop { position: absolute; z-index: 60; display: none; background: var(--surface, #fff); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.25); padding: 10px; }
.emoji-pop.open { display: block; }
.emoji-search { width: 100%; margin-bottom: 8px; }
.emoji-tabs { display: flex; gap: 4px; margin-bottom: 6px; overflow-x: auto; }
.emoji-tabs button { border: 1px solid transparent; background: none; border-radius: 8px; padding: 4px 8px; font-size: 18px; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.emoji-tabs button span { font-size: 11px; color: var(--ink-3); }
.emoji-tabs button.on { border-color: var(--line-2); background: var(--bg, #f3f5f4); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 2px; max-height: 230px; overflow-y: auto; }
.emoji-grid button { font-size: 22px; line-height: 1; padding: 6px 0; border: 0; background: none; border-radius: 8px; cursor: pointer; }
.emoji-grid button:hover, .emoji-grid button:focus { background: var(--bg, #eef1ef); outline: none; }
.emoji-none { grid-column: 1 / -1; color: var(--ink-3); font-size: 13px; padding: 8px; }
.emoji-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.emoji-foot button { background: none; border: 0; color: var(--brand-ink); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.admin-tabs .nav-count { background: var(--brand); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; margin-left: 4px; }
