/* Pokey website styles. All colors, fonts, spacing and radii come from tokens.css
   (copied verbatim from brand/tokens/ by brand/tools/sync.sh); never hardcode hex values here. */
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--color-accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
table, .num, input[type="number"], progress + p { font-variant-numeric: tabular-nums; }

h1 { font-size: 30px; margin: 0 0 var(--space-5); }
h2 { font-size: 19px; line-height: 1.3; letter-spacing: 0; margin: var(--space-6) 0 var(--space-3); }
.card h2 { margin-top: 0; }
.card > :last-child, .card form > :last-child { margin-bottom: 0; }
.card > label:first-child, .card form > label:first-child { margin-top: 0; }
p { margin: 0 0 var(--space-3); }
.muted { color: var(--color-text-secondary); }
.caption { font-size: 12px; line-height: 1.45; color: var(--color-text-secondary); }
.row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.spacer { margin-left: auto; }
kbd { font-family: var(--font-body); font-size: 12px; background: var(--color-raised);
      border-radius: 4px; padding: 0 var(--space-1); }

/* skip link: the first stop for keyboard users, visually hidden until it takes focus */
.skip { position: absolute; top: calc(-1 * var(--space-8)); left: var(--space-3); z-index: 10;
        display: inline-flex; align-items: center; min-height: 44px; padding: var(--space-2) var(--space-4);
        background: var(--color-card); color: var(--color-text); border-radius: var(--radius-control); font-weight: 500; }
.skip:focus { top: var(--space-3); text-decoration: none; }

/* --- header */
header.top { display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap;
             padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--color-divider); }
/* the lockup files carry their own clear space: 120x48 shows the artwork about 28px tall (BRAND.md minimum 24) */
.lockup { display: flex; align-items: center; color: var(--color-text); }
.lockup:hover { text-decoration: none; }
/* BRAND.md §1: the descriptor always sits next to the logo in headers */
.descriptor { margin-left: calc(-1 * var(--space-3)); padding-left: var(--space-3); border-left: 1px solid var(--color-divider);
              font-size: 12px; line-height: 1.45; color: var(--color-text-secondary); }
header nav { display: flex; gap: var(--space-1); flex-wrap: wrap; }
header nav a { color: var(--color-text-secondary); font-weight: 500; font-size: 14px;
               padding: var(--space-2) var(--space-3); border-radius: var(--radius-control); }
header nav a:hover { color: var(--color-text); background: var(--color-state-hover); text-decoration: none; }
header nav a:active { background: var(--color-state-pressed); }
header nav a[aria-current="page"] { color: var(--color-text); background: var(--color-state-selected); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.top-actions form { margin: 0; }

/* the logo variant matching the active theme */
.on-dark { display: none; }
:root[data-theme="dark"] .on-light { display: none; }
:root[data-theme="dark"] .on-dark { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .on-light { display: none; }
  :root:not([data-theme="light"]) .on-dark { display: inline; }
}

/* sun/moon toggle: show the theme you would switch to */
.icon-btn { width: 44px; height: 44px; padding: var(--space-2); display: inline-flex; align-items: center; justify-content: center;
            background: transparent; color: var(--color-text-secondary); }
.icon-btn:hover { color: var(--color-text); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-btn .moon { display: block; } .icon-btn .sun { display: none; }
:root[data-theme="dark"] .icon-btn .moon { display: none; }
:root[data-theme="dark"] .icon-btn .sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .moon { display: none; }
  :root:not([data-theme="light"]) .icon-btn .sun { display: block; }
}

main { max-width: 1040px; margin: var(--space-6) auto var(--space-7); padding: 0 var(--space-5); }
@media (max-width: 640px) {
  main { padding: 0 var(--space-4); margin-top: var(--space-5); }
  header.top { padding: var(--space-2) var(--space-4); gap: var(--space-2); }
  header nav { order: 3; width: 100%; }
  .descriptor { display: none; }
  h1 { font-size: 24px; }
}

/* --- surfaces: flat, no borders, no shadows; hierarchy from surface color */
.card { background: var(--color-card); border-radius: var(--radius-card); padding: var(--space-5); margin: 0 0 var(--space-4); }
.panel { border-radius: var(--radius-sheet); }

table { width: 100%; border-collapse: collapse; background: var(--color-card); border-radius: var(--radius-card); overflow: hidden; }
th, td { padding: var(--space-3) var(--space-4); text-align: left; border-bottom: 1px solid var(--color-divider); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { color: var(--color-text-secondary); font-weight: 500; font-size: 14px; }
td form { margin: 0; }
td.actions { text-align: right; white-space: nowrap; }
td.empty { padding: var(--space-6) var(--space-4); text-align: center; color: var(--color-text-secondary); }
@media (max-width: 640px) { th:nth-child(n+4):not(:last-child), td:nth-child(n+4):not(.actions):not(.empty) { display: none; } }
/* row titles stay quiet: the blue accent is reserved for the one primary action */
td a:not(.btn) { color: var(--color-text); font-weight: 500; }
td a:not(.btn):hover { color: var(--color-accent-text); }
tr:has(td a:not(.btn)):hover td { background: var(--color-state-hover); }
td.empty .court { display: block; width: 172px; margin: 0 auto var(--space-4); fill: none; stroke: var(--color-outline);
                  stroke-width: 1.5; stroke-linecap: round; }
td.empty .court .net { stroke: var(--color-text-secondary); stroke-width: 2; }
td.empty p { margin-bottom: var(--space-4); }

/* --- forms */
label { display: block; margin: var(--space-3) 0 var(--space-1); color: var(--color-text-secondary); font-size: 14px; font-weight: 500; }
label.check { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--color-text); font-weight: 400; }
input, select { min-height: 44px; padding: var(--space-2) var(--space-3); font: 16px/1.5 var(--font-body); color: var(--color-text);
                background: var(--color-bg); border: 1px solid var(--color-outline); border-radius: var(--radius-control); }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
input[type="checkbox"] { min-height: 0; width: 18px; height: 18px; accent-color: var(--color-button-bg); }
input[type="file"] { padding: var(--space-2); }
.field-wide { width: 100%; }
.form-grid { display: flex; gap: var(--space-4); flex-wrap: wrap; align-items: flex-end; }
.form-actions { margin-top: var(--space-4); }

/* --- buttons. Primary uses the brand button fill (volley blue): one per screen. */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
               min-height: 44px; padding: var(--space-2) var(--space-4); border: 0; border-radius: var(--radius-control);
               font: 500 14px/1.2 var(--font-body); cursor: pointer; text-decoration: none;
               background-color: var(--color-raised); color: var(--color-text); }
.btn:hover { text-decoration: none; }
button.primary, .btn.primary { background-color: var(--color-button-bg); color: var(--color-button-text); }
/* hover / pressed are overlays of the text color on the button's own surface */
button:not(:disabled):hover, .btn:hover { background-image: linear-gradient(var(--color-state-hover), var(--color-state-hover)); }
button:not(:disabled):active, .btn:active { background-image: linear-gradient(var(--color-state-pressed), var(--color-state-pressed)); }
button.danger { background-color: transparent; color: var(--color-danger); }
button:disabled { opacity: var(--opacity-disabled); cursor: not-allowed; }
.text-btn { background-color: transparent; color: var(--color-text-secondary); }
.text-btn:hover { color: var(--color-text); }
/* chips: outlined controls; the selected one takes the accent selection fill */
.chip { min-height: 36px; padding: var(--space-1) var(--space-3); font-variant-numeric: tabular-nums;
        background-color: transparent; box-shadow: inset 0 0 0 1px var(--color-outline); }
.chip[aria-pressed="true"], .chip[aria-current="true"] { background-color: var(--color-state-selected); box-shadow: inset 0 0 0 2px var(--color-accent-text); }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* --- feedback */
/* status colors always come with an icon and a word (BRAND.md §2); icons are masks filled with currentColor */
.flash, .tag.ready { --icon: var(--icon-check); }
.tag { --icon: var(--icon-clock); }
.flash::before, .tag::before { content: ""; flex: none; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
:root { --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
        --icon-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E");
        --icon-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.flash { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4);
         border-radius: var(--radius-control); margin-bottom: var(--space-5);
         background: var(--color-card); color: var(--color-success); font-weight: 500; }
.flash::before { width: 18px; height: 18px; }
.flash.err { color: var(--color-danger); --icon: var(--icon-alert); }

/* the worker's own error message sits behind a native disclosure: reachable by keyboard and touch,
   not only through a hover title */
.err-details { display: block; }
.err-details summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer;
                       color: var(--color-text-secondary); font-size: 12px; }
.err-details summary:hover { color: var(--color-text); }
.err-details p { margin: 0 0 var(--space-2); overflow-wrap: anywhere; }
.tag { display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px var(--space-2); border-radius: var(--radius-control);
       font-size: 12px; font-weight: 500; background: var(--color-raised); color: var(--color-text-secondary); }
.tag::before { width: 12px; height: 12px; }
.tag.failed { --icon: var(--icon-alert); }
.tag.ready { color: var(--color-success); }
.tag.failed { color: var(--color-danger); }
.tag.processing, .tag.uploaded, .tag.uploading { color: var(--color-warning); }

progress { width: 100%; height: 8px; appearance: none; border: 0; border-radius: 4px; background: var(--color-raised); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--color-raised); border-radius: 4px; }
progress::-webkit-progress-value { background: var(--color-accent); border-radius: 4px; }
progress::-moz-progress-bar { background: var(--color-accent); border-radius: 4px; }

/* --- page specifics */
.page-head { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-5); }
.page-head h1 { margin: 0; margin-right: auto; }
/* a heading with a subtitle under it (game page: pairs, then tournament, round and date) */
.title-block { margin-right: auto; min-width: 0; }
.title-block .lede { margin: var(--space-1) 0 0; color: var(--color-text-secondary); }
.team { white-space: nowrap; }
.stat-row { display: flex; gap: var(--space-6); flex-wrap: wrap; margin-bottom: var(--space-5); }
.stat { font-size: 32px; }
.stat-label { font-size: 12px; color: var(--color-text-secondary); }
video { display: block; width: 100%; max-height: 75vh; background: var(--color-card); border-radius: var(--radius-card); }
.player-bar { margin-top: var(--space-3); }

.login-wrap { max-width: 400px; margin: var(--space-7) auto; }
.login-wrap .marks { text-align: center; margin-bottom: var(--space-5); line-height: 0; }
.login-wrap h1 { text-align: center; font-size: 26px; }
.login-wrap .card { padding: var(--space-6); }
body.bare header.top nav { display: none; }

/* Archive: games grouped by season and tournament; game page metadata. Team A is blue, Team B yellow (BRAND.md 8.2):
   a swatch beside the name, never a team-colored text below 24px. */
.filters .form-grid > div { min-width: 160px; }
.season-head { margin-top: var(--space-6); }
table.group { margin-bottom: var(--space-4); }
table.group caption { text-align: left; padding: var(--space-3) var(--space-4); font-weight: 500; background: var(--color-card);
  border-bottom: 1px solid var(--color-divider); border-radius: var(--radius-card) var(--radius-card) 0 0; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: var(--space-1); }
.swatch.team-a { background: var(--color-team); }
.swatch.team-b { background: var(--color-opponent); }
dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-5); margin: 0; }
dl.meta dt { color: var(--color-text-secondary); font-size: 14px; font-weight: 500; }
dl.meta dd { margin: 0; }
td.actions.row { justify-content: flex-end; }
.library-video { display: flex; align-items: center; gap: var(--space-3); min-width: 260px; }
.library-thumb { width: 128px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-control); background: var(--color-raised); }

/* Dashboard: logistics only (archive contents, scouting backlog, files, account). The tournament board is the one
   visual element: a mark per game, filled when scouted, a ring when not, a dashed ring with no video. Marks stay
   neutral because blue and yellow mean Team A and Team B (BRAND.md 8.2); the one blue fill is "Upload match". */
.dash-head { margin-bottom: var(--space-2); }
.dash-head h1 { max-width: 22ch; letter-spacing: -0.5px; }
.fig { font-family: var(--font-body); font-weight: 500; font-variant-numeric: tabular-nums; }
.lede { color: var(--color-text-secondary); margin-bottom: var(--space-6); max-width: 62ch; }
.strong { font-weight: 500; }
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--space-6); align-items: start; }
.dash-side .card { padding: var(--space-4) var(--space-5); }
.dash-side h2 { font-size: 16px; margin-bottom: var(--space-3); }
@media (max-width: 860px) { .dash { grid-template-columns: minmax(0, 1fr); } }
main:has(.dash) { max-width: 1200px; }

.section-head { display: flex; align-items: baseline; gap: var(--space-4); flex-wrap: wrap; margin: var(--space-6) 0 var(--space-3); }
.section-head h2 { margin: 0; margin-right: auto; }
.dash-main > section:first-child .section-head { margin-top: 0; }

.attention { margin-bottom: 0; }
.attention + .attention { margin-top: var(--space-4); }
.attention > .caption { margin: calc(-1 * var(--space-2)) 0 var(--space-3); }
.attention ul { list-style: none; margin: 0; padding: 0; }
.attention li { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: var(--space-3); align-items: baseline;
                padding: var(--space-2) 0; border-top: 1px solid var(--color-divider); }
.attention li:first-child { border-top: 0; padding-top: 0; }
.attention .tag { justify-self: start; }

.legend { display: flex; gap: var(--space-4); list-style: none; margin: 0; padding: 0; }
.legend li { display: inline-flex; align-items: center; gap: var(--space-2); }

.board { background: var(--color-card); border-radius: var(--radius-card); padding: var(--space-2) var(--space-5) var(--space-3);
         margin-bottom: var(--space-4); }
.board h3 { display: flex; align-items: baseline; justify-content: space-between; margin: var(--space-2) 0 var(--space-1);
            font: 500 19px/1.3 var(--font-heading); }
.t-row { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr) max-content 84px; gap: var(--space-4);
         align-items: center; min-height: 44px; padding: var(--space-1) 0; border-top: 1px solid var(--color-divider); }
.t-row:first-of-type { border-top: 0; }
.t-name { color: var(--color-text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-count, .t-size { font-size: 14px; color: var(--color-text-secondary); }
.t-size { text-align: right; }
.game-marks { display: flex; flex-wrap: wrap; gap: 0; list-style: none; margin: 0; padding: 0; }
/* a 16px mark inside a 32px target (BRAND.md 4 allows 32px for mouse-driven desktop rows) */
.game-marks .mark { display: block; position: relative; width: 32px; height: 32px; border-radius: 50%; }
.game-marks .mark::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; box-sizing: border-box; }
.legend .mark { display: inline-block; width: 12px; height: 12px; border-radius: 50%; box-sizing: border-box; }
.legend .mark.scouted, .game-marks .mark.scouted::after { background: var(--color-text); }
.legend .mark.open, .game-marks .mark.open::after { border: 2px solid var(--color-outline); }
.legend .mark.novideo, .game-marks .mark.novideo::after { border: 2px dashed var(--color-outline); }
.game-marks .mark:hover { background: var(--color-state-hover); }
.game-marks .mark:hover::after { transform: scale(1.15); }
@media (prefers-reduced-motion: no-preference) { .game-marks .mark::after { transition: transform 120ms ease-out; } }
@media (max-width: 640px) {
  .board { padding: var(--space-2) var(--space-4) var(--space-3); }
  .t-row { grid-template-columns: minmax(0, 1fr) max-content; gap: 0 var(--space-3); padding: var(--space-2) 0; }
  .t-row .game-marks { grid-column: 1 / -1; order: 3; }
  .t-size { display: none; }
}
.empty-board { text-align: center; color: var(--color-text-secondary); padding: var(--space-6) var(--space-4); }
.empty-board .court { display: block; width: 172px; margin: 0 auto var(--space-4); fill: none; stroke: var(--color-outline);
                      stroke-width: 1.5; stroke-linecap: round; }
.empty-board .court .net { stroke: var(--color-text-secondary); stroke-width: 2; }
.empty-board p { margin-bottom: var(--space-4); }

table.recent td { vertical-align: top; }
table.recent .team { white-space: nowrap; }
table.recent td:nth-child(4), table.recent .scouting, table.recent td:nth-child(3) .caption { white-space: nowrap; }
@media (max-width: 640px) {
  /* match, result and scouting only; the base table rule would hide the scouting column */
  table.recent tr > :nth-child(3) { display: none; }
  table.recent tr .scouting:last-child { display: table-cell; }
  table.recent th, table.recent td { padding: var(--space-3); }
  .attention li { grid-template-columns: minmax(0, 1fr) auto; row-gap: var(--space-1); }
  .attention li > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
}
.attention li > span:nth-child(2) { overflow-wrap: anywhere; }
.h-size { font: 400 14px/1.4 var(--font-body); color: var(--color-text-secondary); }

.meter-label { display: flex; justify-content: space-between; gap: var(--space-3); font-size: 14px; margin-top: var(--space-3); }
.meter-label:first-of-type { margin-top: 0; }
.usage-bar { height: 6px; border-radius: 3px; background: var(--color-raised); margin-top: var(--space-1); overflow: hidden; }
.usage-bar > span { display: block; height: 100%; min-width: 6px; border-radius: 3px; background: var(--color-text-secondary); }
ul.plain { list-style: none; margin: var(--space-3) 0 0; padding: 0; font-size: 14px; }
ul.plain li { padding: var(--space-1) 0; }
.side-link { margin: var(--space-3) 0 0; font-size: 14px; font-weight: 500; }
.dash-side dl.meta { font-size: 14px; gap: var(--space-1) var(--space-4); }

/* Match report: neutral tonal steps for the Triangle (blue and yellow stay reserved for Team A and Team B). */
.report-head .headline { font: 500 24px/1.3 var(--font-heading); letter-spacing: -0.5px; margin-bottom: var(--space-2); }
.triangle { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; margin-bottom: var(--space-4); }
.triangle .seg-1, .key-1 { background: var(--color-text); }
.triangle .seg-2, .key-2 { background: var(--color-text-secondary); }
.triangle .seg-3, .key-3 { background: var(--color-outline); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.tri-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-5); }
.tri-item p { margin: var(--space-1) 0 0; }
.metric-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--space-3); }
.metric-vals { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); }
button.val { flex-direction: column; align-items: flex-start; gap: 2px; min-width: 150px; min-height: 44px; padding: var(--space-2) var(--space-3);
             background-color: transparent; box-shadow: inset 0 0 0 1px var(--color-outline); text-align: left; }
button.val .stat { font: 500 28px/1.2 var(--font-body); }
/* without a video the numbers can't play clips, but they are still the report: keep them at full contrast */
button.val:disabled { opacity: 1; cursor: default; }
button.val[aria-pressed="true"] { background-color: var(--color-state-selected); box-shadow: inset 0 0 0 2px var(--color-accent-text); }
.finding { margin: 0 0 var(--space-1); }
.clips { position: sticky; top: var(--space-2); z-index: 1; }
.clip-list { list-style: none; margin: var(--space-3) 0 0; padding: 0; max-height: 180px; overflow: auto; font-size: 14px; }
.clip-list button { width: 100%; justify-content: flex-start; min-height: 36px; background-color: transparent; font-weight: 400; }
.clip-list li[aria-current="true"] button { background-color: var(--color-state-selected); font-weight: 500; }
.clip-list .out { color: var(--color-text-secondary); }
.clips video { max-height: 50vh; }

/* Game page: each delete option says what it removes and what it keeps */
.danger-row { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) 0; border-top: 1px solid var(--color-divider); }
.danger-row:first-child { border-top: 0; padding-top: 0; }
.danger-row:last-child { padding-bottom: 0; }
.danger-row > div { margin-right: auto; }
.danger-row p { margin: var(--space-1) 0 0; }
@media (max-width: 640px) { .danger-row { flex-direction: column; align-items: flex-start; } }

/* Admin file explorer: video and scout file side by side, then storage, rename, compress and delete */
.file-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-4); }
@media (max-width: 640px) { .file-grid { grid-template-columns: minmax(0, 1fr); } }
.file-grid .card { margin: 0; }
.poster { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-control);
          background: var(--color-raised); margin-bottom: var(--space-4); }
.wrap { overflow-wrap: anywhere; }
.form-grid > .grow { flex: 1 1 280px; }
.form-grid > .grow .caption { margin: var(--space-1) 0 0; }
table.objects td:last-child, table.objects th:last-child { text-align: right; white-space: nowrap; }
@media (max-width: 640px) { table.files tr > :nth-child(4) { display: none; } }

/* Not available for this account (a viewer): shown faded, never clickable. */
.na { opacity: var(--opacity-disabled); cursor: not-allowed; }

/* --- plans and billing. The games meter is one tick per game: solid = used, pale = left, hatched = extra games. */
h3 { font-size: 14px; font-weight: 500; margin: var(--space-5) 0 var(--space-1); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.plan-head { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-2); }
.plan-name { font-family: var(--font-heading); font-weight: 500; font-size: 26px; line-height: 1.2; letter-spacing: -0.5px; }
.meter { display: flex; gap: var(--space-3); height: 28px; margin: var(--space-3) 0 var(--space-3); }
.meter-group { display: flex; flex-basis: 0; min-width: 0;
  --tick: repeating-linear-gradient(90deg, black 0 calc(100% / var(--n) - var(--gap)), transparent 0 calc(100% / var(--n)));
  -webkit-mask-image: var(--tick); mask-image: var(--tick); }
.meter-group span { flex-basis: 0; min-width: 0; }
.meter .used { background: var(--color-text); }
/* remaining ticks keep full-strength outline: at 0.4 opacity they fell below the 3:1 contrast floor
   for graphical parts, and the meter reads as an image */
.meter .open { background: var(--color-outline); }
.meter.full .used { background: var(--color-danger); }
.meter .extra .open { opacity: 1; background: repeating-linear-gradient(135deg, var(--color-outline) 0 2px, transparent 2px 6px); }
.meter-key { display: flex; gap: var(--space-4); flex-wrap: wrap; list-style: none; margin: 0 0 var(--space-3); padding: 0; }
.meter-key li { display: flex; align-items: center; gap: var(--space-2); }
.meter-key .k { width: 10px; height: 14px; border-radius: 2px; }
.meter-key .k.used { background: var(--color-text); }
.meter-key .k.open { background: var(--color-outline); }
.meter-key .k.extra { background: repeating-linear-gradient(135deg, var(--color-outline) 0 2px, transparent 2px 5px); }
#billing .meter { height: 20px; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
@media (max-width: 1000px) { .plans { grid-template-columns: minmax(0, 1fr); } }
.plan { background: var(--color-card); border-radius: var(--radius-card); padding: var(--space-5); display: flex; flex-direction: column; }
.plan.current { background: var(--color-bg); box-shadow: inset 0 0 0 2px var(--color-accent-text); }
.plan h2 { margin: 0; display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-family: var(--font-heading); }
.plan-price { font-size: 24px; margin: var(--space-1) 0 var(--space-4); }
.plan-price .muted { font-size: 14px; }
.plan dl { margin: 0; flex: 1; }
.plan dl > div { padding: var(--space-2) 0; border-top: 1px solid var(--color-divider); }
.plan dt { font-size: 12px; color: var(--color-text-secondary); }
.plan dd { margin: 0; font-size: 14px; }
.plan-ask { margin-top: var(--space-4); }
.plan-ask:empty { display: none; }

/* --- Admin: accounts. The roster nests each Coach owner's viewers under it; one account shows what it holds, the
   activity strip (one tick per day, height = actions that day; a tick filters the log), the log by day and the
   controls. Marks stay neutral: blue and yellow mean Team A and Team B (BRAND.md 8.2). */
.tag.role { color: var(--color-text); }
.tag.role::before { display: none; }
.roster-filter { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; margin-bottom: var(--space-4); }
.roster-filter input[type="search"] { flex: 1 1 220px; max-width: 320px; }
.roster-filter nav { margin-left: auto; }
table.roster td { vertical-align: top; }
table.roster tr.off td.who a { color: var(--color-text-secondary); }
/* a viewer hangs off its owner: no rule between them, a corner line from the owner's row to the viewer's name */
table.roster tr:has(+ tr.nested) td { border-bottom-color: transparent; }
table.roster tr.nested td { padding-top: 0; }
table.roster tr.nested td.who { position: relative; padding-left: calc(var(--space-4) + 22px); }
table.roster tr.nested td.who::before { content: ""; position: absolute; left: calc(var(--space-4) + 4px); top: 0; width: 10px; height: 12px;
  border-left: 1px solid var(--color-outline); border-bottom: 1px solid var(--color-outline); border-bottom-left-radius: 4px; }
td.store { min-width: 112px; }
td.store .usage-bar { max-width: 140px; margin-top: var(--space-2); }
td.when { white-space: nowrap; }
@media (max-width: 640px) {
  /* account and last active; the base table rule hides from the 4th column on */
  table.roster tr > :nth-child(2), table.roster tr > :nth-child(3) { display: none; }
  table.roster tr > .when:not(.empty) { display: table-cell; }
  .roster-filter nav { margin-left: 0; }
}

main:has(.console) { max-width: 1200px; }
.holdings { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-6); margin: 0 0 var(--space-6); padding: var(--space-4) 0;
            border-top: 1px solid var(--color-divider); border-bottom: 1px solid var(--color-divider); }
.holdings dt { font-size: 12px; line-height: 1.45; color: var(--color-text-secondary); }
.holdings dd { margin: var(--space-1) 0 0; }
.holdings .fig { font-size: 24px; line-height: 1.1; }
.console { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-6); align-items: start; }
.console .section-head { margin-top: 0; }
@media (max-width: 900px) { .console { grid-template-columns: minmax(0, 1fr); } }

.strip { list-style: none; margin: 0; padding: 0; height: 64px; display: grid; grid-template-columns: repeat(30, minmax(24px, 1fr));
         gap: 2px; align-items: end; overflow-x: auto; }
.strip li { height: 100%; }
.strip a { display: flex; align-items: flex-end; height: 100%; padding: 0 1px; border-radius: 4px; }
.strip a::after { content: ""; width: 100%; height: max(var(--h), 4px); border-radius: 2px; background: var(--color-text-secondary);
                  transform-origin: bottom; }
.strip a.zero::after { height: 2px; background: var(--color-outline); opacity: 0.5; }
.strip a:hover { background: var(--color-state-hover); text-decoration: none; }
.strip a:hover::after, .strip a[aria-current="true"]::after { background: var(--color-text); opacity: 1; }
.strip a[aria-current="true"] { background: var(--color-state-selected); }
@media (prefers-reduced-motion: no-preference) {
  .strip a::after { animation: tick-in 480ms cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--i) * 14ms); }
}
@keyframes tick-in { from { transform: scaleY(0); } }
.strip-axis { display: flex; justify-content: space-between; margin: var(--space-1) 0 var(--space-4); }
.log-filter { margin-bottom: var(--space-2); }
.log-filter .chip { gap: var(--space-1); }
.log-filter .ico { width: 16px; height: 16px; }
.log-day h3 { position: sticky; top: 0; z-index: 1; margin: 0; padding: var(--space-4) 0 var(--space-2); background: var(--color-bg);
              font: 500 14px/1.3 var(--font-body); color: var(--color-text-secondary); }
.log { list-style: none; margin: 0; padding: 0; background: var(--color-card); border-radius: var(--radius-card); }
.log li { display: grid; grid-template-columns: 44px 18px minmax(0, 1fr) auto; gap: var(--space-3); align-items: baseline;
          padding: var(--space-3) var(--space-4); border-top: 1px solid var(--color-divider); }
.log li:first-child { border-top: 0; }
.log time { font-size: 14px; color: var(--color-text-secondary); }
.log .ico { width: 18px; height: 18px; align-self: center; color: var(--color-text-secondary); }
.log p { margin: 0; overflow-wrap: anywhere; }
.log .caption { margin-top: 2px; }
.log .open { font-size: 14px; font-weight: 500; white-space: nowrap; }
.empty-log { color: var(--color-text-secondary); padding: var(--space-5) 0; }
@media (max-width: 640px) {
  .log li { grid-template-columns: 44px minmax(0, 1fr); }
  .log .ico { display: none; }
  .log .open { grid-column: 2; }
}

.side .card { padding: var(--space-4) var(--space-5); }
.side h2 { font-size: 16px; margin-bottom: var(--space-3); }
.side label { margin-top: var(--space-4); }
.side form + p.caption { margin-top: var(--space-3); }
.ctl { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--color-divider); }
.ctl:first-of-type { border-top: 0; padding-top: 0; }
.ctl > div { margin-right: auto; min-width: 0; }
.ctl p, ul.devices p { margin: 0; }
.grow-input { flex: 1 1 140px; min-width: 0; }
ul.devices { list-style: none; margin: 0 0 var(--space-3); padding: 0; }
ul.devices li { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; border-top: 1px solid var(--color-divider); }
ul.devices li:first-child { border-top: 0; padding-top: 0; }
ul.devices li > div { margin-right: auto; min-width: 0; }
.ctl button, ul.devices button { white-space: nowrap; }

/* --- coarse pointers (touch). BRAND.md 4 sets the minimum target at 44x44; the desktop sizes above stay
   tight and the hit areas grow here. This block sits last so it wins at equal specificity. */
@media (pointer: coarse) {
  .chip { min-height: 44px; }
  .clip-list button { min-height: 44px; }
  label.check { min-height: 44px; }
  header nav a { display: inline-flex; align-items: center; min-height: 44px; }
  .game-marks .mark { width: 44px; height: 44px; }
  .game-marks .mark::after { inset: 14px; }  /* the dot keeps its 16px size; only the target grows */
  .log .open { display: inline-flex; align-items: center; min-height: 44px; }
  .strip { grid-template-columns: repeat(30, minmax(44px, 1fr)); }
}

/* Public landing page: real product screens in a courtside editorial layout */
.public-sign-in { display: inline-flex; align-items: center; min-height: 44px; padding: var(--space-2) var(--space-3);
                 border-radius: var(--radius-control); font-size: 14px; font-weight: 500; }
.public-sign-in:hover { text-decoration: none; }
.marketing-main { max-width: 1440px; margin-top: 0; padding-right: var(--space-6); padding-left: var(--space-6); }
.landing { overflow: clip; }
.landing-hero { display: grid; grid-template-columns: minmax(300px, .7fr) minmax(0, 1.5fr); gap: var(--space-7);
                align-items: center; min-height: min(780px, calc(100vh - 80px)); padding: var(--space-7) 0 var(--space-8); }
.landing-hero-copy { position: relative; z-index: 1; min-width: 0; }
.landing-kicker { margin: 0 0 var(--space-3); color: var(--color-accent-text); font-size: 14px; font-weight: 500; }
.landing h1 { max-width: 12ch; margin: 0 0 var(--space-5); font-size: clamp(44px, 5vw, 68px); line-height: 1.08; letter-spacing: -2.5px; }
.landing-lede { max-width: 46ch; margin-bottom: var(--space-6); color: var(--color-text-secondary); font-size: 18px; line-height: 1.65; }
.landing-discover { min-height: 48px; }
.product-shot { min-width: 0; margin: 0; }
.product-shot picture { display: block; overflow: hidden; background: var(--color-card); border-radius: var(--radius-card); }
.product-shot img { display: block; width: 100%; height: auto; }
.product-shot figcaption { display: flex; justify-content: space-between; gap: var(--space-4); padding-top: var(--space-3);
                           color: var(--color-text-secondary); font-size: 12px; line-height: 1.45; }
.product-shot figcaption span:first-child { color: var(--color-text); font-weight: 500; }
.match-photo { position: relative; margin: 0 calc(-1 * var(--space-6)); }
.match-photo img { display: block; width: 100%; height: clamp(280px, 46vw, 620px); object-fit: cover; object-position: center 43%; }
.match-photo figcaption { position: absolute; right: var(--space-6); bottom: 0; max-width: 420px; padding: var(--space-4) var(--space-5);
                          background: var(--color-bg); color: var(--color-text); font: 500 18px/1.45 var(--font-heading); }
.landing-section { padding: var(--space-8) 0; scroll-margin-top: var(--space-5); }
.landing-feature { display: grid; grid-template-columns: minmax(250px, .65fr) minmax(0, 1.35fr); gap: var(--space-7); align-items: center; }
.landing-copy { min-width: 0; }
.landing-copy h2, .landing-workflow h2, .landing-register h2 { margin: 0 0 var(--space-4); font-size: clamp(28px, 3vw, 38px);
                                                              line-height: 1.2; letter-spacing: -1px; }
.landing-copy > p:not(.landing-kicker), .landing-register > p:not(.landing-kicker):not(.caption), .workflow-item p {
  color: var(--color-text-secondary); font-size: 17px; line-height: 1.65; }
.landing-checks { display: grid; gap: var(--space-3); list-style: none; margin: var(--space-5) 0 0; padding: 0; }
.landing-checks li { position: relative; padding-left: var(--space-5); color: var(--color-text-secondary); }
.landing-checks li::before { content: ""; position: absolute; top: 8px; left: 2px; width: 7px; height: 7px;
                             border: 2px solid var(--color-outline); border-radius: 50%; }
.landing-wide { border-top: 1px solid var(--color-divider); }
.landing-wide .landing-copy { display: grid; grid-template-columns: minmax(220px, .75fr) minmax(0, 1fr); column-gap: var(--space-7);
                              align-items: end; margin-bottom: var(--space-6); }
.landing-wide .landing-kicker { grid-column: 1 / -1; }
.landing-wide .landing-copy h2 { max-width: 18ch; margin-bottom: 0; }
.landing-wide .landing-copy > p:last-child { max-width: 58ch; margin-bottom: 0; }
.wide-shot { max-width: 1280px; margin: 0 auto; }
.landing-workflow { display: grid; grid-template-columns: 1.25fr repeat(3, minmax(0, 1fr)); gap: var(--space-6);
                    padding: var(--space-8) 0; border-top: 1px solid var(--color-divider); }
.workflow-intro h2 { max-width: 15ch; }
.workflow-item { padding-top: var(--space-4); border-top: 2px solid var(--color-outline); scroll-margin-top: var(--space-5); }
.workflow-item h3 { margin: 0 0 var(--space-3); font: 500 19px/1.35 var(--font-heading); }
.workflow-item p { margin: 0; font-size: 15px; }
.landing-register { margin: var(--space-6) 0 var(--space-8); padding: var(--space-8) var(--space-5); background: var(--color-card);
                    border-radius: var(--radius-sheet); text-align: center; }
.register-court { display: block; width: 172px; margin: 0 auto var(--space-5); fill: none; stroke: var(--color-outline); stroke-width: 1.5; }
.register-court path { stroke: var(--color-text-secondary); stroke-width: 2; }
.landing-register h2 { max-width: 22ch; margin-right: auto; margin-left: auto; }
.landing-register > p:not(.landing-kicker):not(.caption) { max-width: 54ch; margin-right: auto; margin-left: auto; }
.registration-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; margin: var(--space-4) 0 var(--space-2);
                       padding: var(--space-3) var(--space-6); background: var(--color-button-bg); border-radius: var(--radius-control);
                       color: var(--color-button-text); font-size: 14px; font-weight: 500; }
.landing-register .caption { margin-bottom: var(--space-4); }
.register-sign-in { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 500; }
.landing-footer { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-5) 0;
                  border-top: 1px solid var(--color-divider); color: var(--color-text-secondary); font-size: 12px; }
.landing-footer span:last-child { max-width: 70ch; text-align: right; }

/* "Coming soon" at / while PROMO_PUBLIC is off (the marketing page then lives at /promo, signed in only) */
.coming-soon { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100vh - 180px);
               padding: var(--space-8) 0; text-align: center; }
.coming-soon .soon-mark { width: clamp(112px, 18vw, 160px); height: auto; margin-bottom: var(--space-6); }
.coming-soon h1 { margin: 0 0 var(--space-5); font-size: clamp(40px, 5vw, 60px); line-height: 1.1; letter-spacing: -2px; }
.soon-footer { justify-content: center; }

@media (max-width: 1040px) {
  .landing-hero { grid-template-columns: minmax(260px, .75fr) minmax(0, 1.25fr); gap: var(--space-5); }
  .landing h1 { font-size: 48px; }
  .landing-feature { grid-template-columns: minmax(220px, .65fr) minmax(0, 1.35fr); gap: var(--space-5); }
  .landing-workflow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workflow-intro { grid-column: 1 / -1; }
  .workflow-intro h2 { max-width: 24ch; }
}
@media (max-width: 800px) {
  .landing-hero, .landing-feature { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .landing-hero { min-height: 0; padding-top: var(--space-7); }
  .landing h1 { max-width: 14ch; }
  .landing-hero-copy .landing-lede { max-width: 58ch; }
  .hero-shot, .feature-shot { width: 100%; margin-right: 0; }
  .hero-shot picture, .feature-shot picture { border-radius: var(--radius-card); }
  .landing-wide .landing-copy { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .landing-wide .landing-copy h2 { max-width: 24ch; }
  .landing-wide .landing-copy > p:last-child { margin-bottom: var(--space-2); }
}
@media (max-width: 640px) {
  .marketing-main { margin-top: 0; padding-right: var(--space-4); padding-left: var(--space-4); }
  .landing-hero, .landing-section, .landing-workflow { padding: var(--space-7) 0; }
  .landing h1 { font-size: 40px; letter-spacing: -1.5px; }
  .landing-lede { font-size: 16px; }
  .landing-copy h2, .landing-workflow h2, .landing-register h2 { font-size: 28px; }
  .landing-copy > p:not(.landing-kicker), .landing-register > p:not(.landing-kicker):not(.caption) { font-size: 16px; }
  .product-shot figcaption { flex-direction: column; gap: var(--space-1); }
  .match-photo { margin-right: calc(-1 * var(--space-4)); margin-left: calc(-1 * var(--space-4)); }
  .match-photo img { height: 340px; }
  .match-photo figcaption { position: static; max-width: none; padding: var(--space-4); font-size: 16px; }
  .landing-workflow { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .workflow-intro { grid-column: auto; }
  .landing-register { margin: var(--space-4) 0 var(--space-6); padding: var(--space-7) var(--space-4); }
  .landing-footer { flex-direction: column; gap: var(--space-2); }
  .landing-footer span:last-child { text-align: left; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .hero-shot { animation: landing-enter 600ms ease-out both; }
  @keyframes landing-enter { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
}

/* Shared clip link (/s/...): public page, no portal nav; video full width, clip list below */
.share { max-width: 960px; margin: 0 auto; }
.share video { width: 100%; max-height: 70vh; background: #000; border-radius: var(--radius-card); }
.share-list { max-height: none; margin-top: var(--space-3); }
@media (max-width: 640px) { .share video { border-radius: 0; } }
