/* Grassroots Rugby — Coach's Studio. Uses the site tokens from news.css (with fallbacks). */
.cs {
  --cs-paper: var(--paper, #f5f6ef); --cs-surface: var(--surface, #fff); --cs-ink: var(--ink, #18271e); --cs-muted: var(--muted, #617065);
  --cs-line: var(--line, #d4ddd1); --cs-green: var(--green, #205c36); --cs-yellow: var(--yellow, #edbd23); --cs-board: var(--board, #111d16);
  --cs-head: var(--head, "Big Shoulders Display", "Arial Narrow", Impact, sans-serif); --cs-body: var(--body, "Libre Franklin", Arial, sans-serif);
  --cs-bad: #b74439; --cs-warn: #a86a00;
  --c-warm: #8aa39a; --c-handling: #3f8f5a; --c-attack: #e0a91b; --c-defence: #3b6fb6; --c-contact: #c4533b; --c-breakdown: #9a5a2f;
  --c-setpiece: #7a4fa3; --c-kicking: #2f9aa0; --c-game: #205c36; --c-speed: #d97b29; --c-matchprep: #5d6b62; --c-recovery: #9fb6a6; --c-cool: #c5d0c7;
  font-family: var(--cs-body); color: var(--cs-ink); display: grid; gap: 18px; margin: 8px 0 40px;
}
.cs *, .cs *::before, .cs *::after { box-sizing: border-box; }
.cs h3, .cs h4 { font-family: var(--cs-head); font-weight: 900; line-height: 1.02; margin: 0; text-wrap: balance; }
.cs h3 { font-size: 24px; } .cs h4 { font-size: 22px; }
.cs p { margin: 0; }
.cs .cs-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cs .cs-i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cs .cs-i path[d^="M7 4l13"], .cs .cs-i path[d^="M7 4h4"], .cs .cs-i path[d^="M5 4l10"], .cs .cs-i path[d^="M19 4L9"], .cs [data-tool="cone"] .cs-i path { fill: currentColor; }
.cs .cs-small { font-size: 12px; color: var(--cs-muted); line-height: 1.55; }
.cs .cs-kicker { font-size: 10px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--cs-muted); }
.cs .cs-empty { font-size: 13px; color: var(--cs-muted); padding: 10px 0; }
.cs label { font-size: 12px; font-weight: 600; display: grid; gap: 6px; margin: 0; }
.cs form { max-width: none; }
.cs input, .cs select, .cs textarea { font: inherit; font-size: 14px; color: inherit; width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid var(--cs-line); background: var(--cs-paper); border-radius: 3px; }
.cs input[type=checkbox] { width: auto; accent-color: var(--cs-green); }
.cs textarea { resize: vertical; line-height: 1.5; }
.cs :focus-visible { outline: 3px solid var(--cs-yellow); outline-offset: 2px; }
.cs [hidden] { display: none !important; }

/* buttons */
.cs .cs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--cs-line); background: var(--cs-surface); color: var(--cs-ink); border-radius: 3px; font: 700 13px/1.2 var(--cs-body); cursor: pointer; text-decoration: none; white-space: nowrap; }
.cs .cs-btn:hover:not(:disabled) { border-color: var(--cs-ink); }
.cs .cs-btn.primary { background: var(--cs-yellow); border-color: var(--cs-yellow); color: #17241b; }
.cs .cs-btn.primary:hover:not(:disabled) { filter: brightness(.95); border-color: var(--cs-yellow); }
.cs .cs-btn.danger { color: var(--cs-bad); border-color: currentColor; }
.cs .cs-btn.ghost { background: transparent; }
.cs .cs-btn:disabled { opacity: .45; cursor: default; }
.cs .cs-btn.cs-wide { width: 100%; min-height: 46px; font-size: 14px; }
.cs .cs-icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid transparent; background: transparent; color: var(--cs-muted); border-radius: 3px; cursor: pointer; font-size: 16px; font-weight: 700; flex: none; }
.cs .cs-icon-btn:hover:not(:disabled) { border-color: var(--cs-line); color: var(--cs-ink); }
.cs .cs-icon-btn:disabled { opacity: .3; cursor: default; }
.cs .cs-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.cs .cs-row > label { flex: 1 1 120px; }
.cs .cs-check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13px; }

/* tabs */
.cs-tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--cs-line); overflow-x: auto; scrollbar-width: none; }
.cs-tabs button { flex: none; background: none; border: 0; border-bottom: 4px solid transparent; margin-bottom: -2px; padding: 10px 16px 9px; font: 900 22px/1 var(--cs-head); color: var(--cs-muted); cursor: pointer; letter-spacing: .3px; }
.cs-tabs button[aria-selected="true"] { color: var(--cs-ink); border-bottom-color: var(--cs-yellow); }
.cs-tabs button:hover { color: var(--cs-ink); }

.cs .cs-card { background: var(--cs-surface); border: 1px solid var(--cs-line); border-radius: 4px; padding: 16px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.cs .cs-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* board header */
.cs-view { display: grid; gap: 14px; min-width: 0; }
.cs > *, .cs-view > *, .cs-board-main > *, .cs-planner-grid > * { min-width: 0; }
.cs-board-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.cs .cs-title-field { flex: 1 1 260px; }
.cs .cs-title-field input { font: 900 28px/1.1 var(--cs-head); padding: 6px 10px; background: transparent; border-color: transparent; }
.cs .cs-title-field input:hover, .cs .cs-title-field input:focus { border-color: var(--cs-line); background: var(--cs-surface); }
.cs .cs-compact { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--cs-muted); gap: 4px; }
.cs .cs-compact select { text-transform: none; letter-spacing: 0; color: var(--cs-ink); font-weight: 600; font-size: 13px; padding: 8px 30px 8px 10px; min-height: 40px; background-color: var(--cs-surface); }
.cs-seg { display: inline-flex; border: 1px solid var(--cs-line); border-radius: 3px; overflow: hidden; height: 40px; }
.cs-seg button { border: 0; background: var(--cs-surface); color: var(--cs-ink); padding: 0 14px; font: 700 13px var(--cs-body); cursor: pointer; }
.cs-seg button[aria-pressed="true"] { background: var(--cs-ink); color: var(--cs-paper); }
.cs-menu { position: relative; }
.cs-menu > summary { list-style: none; }
.cs-menu > summary::-webkit-details-marker { display: none; }
.cs-menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: min(290px, calc(100vw - 32px)); background: var(--cs-surface); border: 1px solid var(--cs-line); border-radius: 4px; box-shadow: 0 12px 34px rgba(0,0,0,.18); padding: 6px; display: grid; gap: 2px; }
.cs-menu-pop > button, .cs-menu-pop > .cs-file { text-align: left; background: none; border: 0; padding: 10px 12px; font: 600 13px var(--cs-body); color: var(--cs-ink); border-radius: 3px; cursor: pointer; display: block; }
.cs-menu-pop > button:hover, .cs-menu-pop > .cs-file:hover { background: var(--cs-paper); }
.cs-menu-pop .cs-file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cs-menu-pop hr { border: 0; border-top: 1px solid var(--cs-line); margin: 4px 0; width: 100%; }
.cs-menu-pop .cs-check { padding: 8px 12px; }
.cs-menu-pop .cs-inmenu { padding: 6px 12px 8px; }

/* board grid */
.cs-board-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1120px) { .cs-board-grid { grid-template-columns: minmax(0, 1fr) 290px; } }
.cs-board-main { display: grid; gap: 10px; min-width: 0; }
.cs-side { display: grid; gap: 16px; align-content: start; min-width: 0; }
.cs-toolbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; }
.cs-toolset { display: flex; gap: 4px; flex-wrap: wrap; }
.cs .cs-tool { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 54px; height: 50px; padding: 5px 6px; border: 1px solid var(--cs-line); background: var(--cs-surface); color: var(--cs-ink); border-radius: 3px; cursor: pointer; font: 600 10px/1 var(--cs-body); }
.cs .cs-tool:hover:not(:disabled) { border-color: var(--cs-ink); }
.cs .cs-tool[aria-pressed="true"] { background: var(--cs-yellow); border-color: var(--cs-yellow); color: #17241b; }
.cs .cs-tool:disabled { opacity: .4; cursor: default; }
.cs .cs-unit { margin-left: auto; }

.cs-stage { position: relative; background: #1d4a2a; border-radius: 4px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.cs-stage > svg { display: block; overflow: hidden; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.cs-stage.portrait > svg { max-height: 82vh; width: auto; max-width: 100%; margin: 0 auto; }
.cs-stage svg[data-tool="move"] .cs-mk { cursor: grab; }
.cs-stage svg[data-tool="run"], .cs-stage svg[data-tool="pass"], .cs-stage svg[data-tool="kick"], .cs-stage svg[data-tool="zone"], .cs-stage svg[data-tool="cone"], .cs-stage svg[data-tool="text"] { cursor: crosshair; }
.cs-stage svg[data-tool="erase"] [data-hit^="mark"] { cursor: not-allowed; }
.cs-stage svg .cs-mk:focus { outline: none; }
.cs-stage svg .cs-mk:focus-visible > circle:nth-last-of-type(1) { stroke: var(--cs-yellow); stroke-width: 4; }
.cs .cs-hint { font-size: 12px; color: var(--cs-muted); min-height: 1.5em; }

.cs-phasebar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; justify-content: space-between; }
.cs-phases { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.cs-phases [data-phase] { position: relative; width: 40px; height: 40px; border: 1px solid var(--cs-line); background: var(--cs-surface); color: var(--cs-ink); border-radius: 3px; font: 900 18px var(--cs-head); cursor: pointer; }
.cs-phases [data-phase][aria-selected="true"] { background: var(--cs-ink); color: var(--cs-paper); border-color: var(--cs-ink); }
.cs-phases [data-phase] i { position: absolute; right: 4px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--cs-yellow); }
.cs-phases .cs-phase-del { width: 32px; height: 32px; border: 0; background: none; color: var(--cs-muted); cursor: pointer; display: grid; place-items: center; }
.cs-phases .cs-phase-del:hover { color: var(--cs-bad); }
.cs-phase-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; }
.cs .cs-speed select { min-width: 92px; }
.cs .cs-note span { font-weight: 600; }
.cs .cs-note textarea { background: var(--cs-surface); }

/* side */
.cs .cs-steps { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.55; display: grid; gap: 4px; }
.cs-plays { display: grid; gap: 6px; max-height: 420px; overflow: auto; }
.cs-play-row { display: flex; align-items: center; gap: 4px; border: 1px solid var(--cs-line); border-radius: 3px; padding: 4px; background: var(--cs-paper); }
.cs-play-row.current { border-color: var(--cs-yellow); }
.cs-play-row.confirm { border-color: var(--cs-bad); }
.cs-play-row .cs-confirm-text { font-size: 12px; font-weight: 700; color: var(--cs-bad); }
.cs-play-open { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: center; text-align: left; background: none; border: 0; padding: 2px; cursor: pointer; color: var(--cs-ink); font: inherit; }
.cs-play-open b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-play-open small { display: block; font-size: 11px; color: var(--cs-muted); }
.cs-play-open span { min-width: 0; }
.cs .cs-thumb { width: 74px; height: auto; border-radius: 2px; flex: none; display: block; }

/* presentation */
.cs.cs-presenting .cs-stage { position: fixed; inset: 0; z-index: 2000; border-radius: 0; display: flex; flex-direction: column; background: #0b130e; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
.cs.cs-presenting .cs-stage > svg { flex: 1; min-height: 0; width: 100%; height: 100%; max-height: none; }
.cs-present-bar { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 14px max(16px, env(safe-area-inset-left, 0px)); background: #0b130e; color: #f4f1de; flex-wrap: wrap; }
.cs-present-note { flex: 1 1 320px; min-width: 0; }
.cs-present-note b { font: 900 26px/1 var(--cs-head); margin-right: 12px; }
.cs-present-note span { font-size: 11px; letter-spacing: 1.4px; color: var(--cs-yellow); font-weight: 700; text-transform: uppercase; }
.cs-present-note p { margin-top: 6px; font-size: clamp(15px, 1.6vw, 21px); line-height: 1.45; color: #dfe6da; max-width: 70ch; }
.cs-present-ctrl { display: flex; gap: 8px; }
.cs-present-ctrl .cs-btn { min-width: 52px; min-height: 52px; background: #1d2b22; color: #f4f1de; border-color: #33463a; }
.cs-present-ctrl .cs-btn.primary { background: var(--cs-yellow); color: #17241b; border-color: var(--cs-yellow); }
html.cs-lock, html.cs-lock body { overflow: hidden; }

/* planner */
.cs-planner-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .cs-planner-grid { grid-template-columns: 330px minmax(0, 1fr); } .cs-plan-form { position: sticky; top: 12px; } }
.cs .cs-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cs .cs-fields .cs-span2 { grid-column: 1 / -1; }
.cs .cs-gear { border: 1px dashed var(--cs-line); border-radius: 3px; padding: 10px 12px; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cs .cs-gear legend { font-size: 12px; font-weight: 600; padding: 0 4px; }
.cs-plan-out { display: grid; gap: 14px; min-width: 0; }
.cs-plan-empty p { color: var(--cs-muted); max-width: 60ch; }
.cs-plan-head .cs-title-field input { font-size: 32px; padding-left: 0; }
.cs-plan-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--cs-muted); }
.cs-plan-stats b { font: 900 24px var(--cs-head); color: var(--cs-ink); margin-right: 4px; font-variant-numeric: tabular-nums; }
.cs-plan-stats .warn b { color: var(--cs-warn); }
.cs-plan-stats .bad b { color: var(--cs-bad); }
.cs-timeline { display: flex; height: 12px; border-radius: 2px; overflow: hidden; gap: 2px; }
.cs-timeline span { min-width: 4px; background: var(--c-cool); }
.cs-warns { margin: 0; padding: 10px 12px 10px 28px; background: var(--cs-paper); border: 1px solid var(--cs-line); border-radius: 3px; font-size: 13px; line-height: 1.5; display: grid; gap: 4px; }
.cs-blocks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cs-block { display: grid; grid-template-columns: 64px minmax(0, 1fr); background: var(--cs-surface); border: 1px solid var(--cs-line); border-radius: 4px; }
.cs-block-time { padding: 16px 0 0 14px; font: 900 18px var(--cs-head); font-variant-numeric: tabular-nums; color: var(--cs-muted); }
.cs-block-body { padding: 14px 14px 14px 0; display: grid; gap: 10px; min-width: 0; }
.cs-block-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.cs-block-top .cs-kicker::before, .cs-drill-card .cs-kicker::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 0; background: var(--cat, var(--c-cool)); }
.cs-block-tools { display: flex; gap: 2px; }
.cs-block-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .cs-block-grid { grid-template-columns: 230px minmax(0, 1fr); } }
.cs-block-grid p, .cs-block-grid li { font-size: 13.5px; line-height: 1.6; }
.cs-block-grid > div { display: grid; gap: 8px; min-width: 0; }
.cs .cs-groups { font-weight: 700; }
.cs .cs-cues { font-style: italic; }
.cs .cs-cues b { font-style: normal; }
.cs .cs-safety { font-size: 12.5px; padding: 8px 10px; border-left: 3px solid var(--cs-warn); background: var(--cs-paper); }
.cs .cs-contact.c1 { color: var(--cs-warn); }
.cs .cs-contact.c2 { color: var(--cs-bad); }
.cs details summary { cursor: pointer; font-size: 13px; font-weight: 700; }
.cs details[open] summary { margin-bottom: 6px; }
.cs details p { font-size: 13px; line-height: 1.55; margin-bottom: 4px; }
.cs-diagram-btn { display: grid; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; color: var(--cs-muted); font: 600 11px var(--cs-body); align-self: start; }
.cs-diagram-btn:hover span { color: var(--cs-ink); text-decoration: underline; }
.cs .cs-diagram { width: 100%; height: auto; display: block; border-radius: 3px; max-height: 240px; }
.cs .cs-diagram.big { max-height: 340px; }
.cs-mins { display: flex; align-items: center; gap: 4px; font-size: 13px; justify-self: start; border: 1px solid var(--cs-line); border-radius: 3px; padding: 0 2px; }
.cs-mins b { font-variant-numeric: tabular-nums; }
.cs-plan-foot { max-width: 80ch; }
.cs-saved-sessions { margin-top: 4px; }
.cs-saved-sessions > div:not(.cs-card-head) { display: grid; gap: 6px; }
.cs .cs-log-h { font-size: 18px; margin-top: 8px; }
.cs .cs-log { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.cs-block.cat-cool .cs-block-body p { font-size: 13.5px; line-height: 1.6; color: var(--cs-muted); }

/* category colours */
.cat-warm { --cat: var(--c-warm); } .cat-handling { --cat: var(--c-handling); } .cat-attack { --cat: var(--c-attack); } .cat-defence { --cat: var(--c-defence); }
.cat-contact { --cat: var(--c-contact); } .cat-breakdown { --cat: var(--c-breakdown); } .cat-setpiece { --cat: var(--c-setpiece); } .cat-kicking { --cat: var(--c-kicking); }
.cat-game { --cat: var(--c-game); } .cat-speed { --cat: var(--c-speed); } .cat-matchprep { --cat: var(--c-matchprep); } .cat-recovery { --cat: var(--c-recovery); } .cat-cool { --cat: var(--c-cool); }
.cs-timeline span[class^="cat-"] { background: var(--cat); }

/* library */
.cs-lib-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.cs .cs-search { flex: 1 1 220px; }
.cs-chips { display: flex; gap: 6px; overflow-x: auto; flex: 1 1 100%; min-width: 0; max-width: 100%; padding-bottom: 2px; scrollbar-width: thin; order: 3; }
.cs .cs-chip { flex: none; border: 1px solid var(--cs-line); background: var(--cs-surface); color: var(--cs-ink); border-radius: 999px; padding: 6px 13px; font: 600 12px var(--cs-body); cursor: pointer; }
.cs .cs-chip[aria-pressed="true"] { background: var(--cs-ink); border-color: var(--cs-ink); color: var(--cs-paper); }
.cs-lib-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cs-drill-card { min-width: 0; }
.cs-drill-open { width: 100%; height: 100%; display: grid; gap: 7px; align-content: start; text-align: left; padding: 10px; border: 1px solid var(--cs-line); background: var(--cs-surface); border-radius: 4px; cursor: pointer; color: var(--cs-ink); font: inherit; }
.cs-drill-open:hover { border-color: var(--cs-ink); }
.cs-drill-open b { font: 900 21px/1.05 var(--cs-head); }
.cs-drill-open small { font-size: 12px; color: var(--cs-muted); }
.cs-drill-open .cs-diagram { aspect-ratio: 16 / 10; object-fit: contain; background: #1d4a2a; }

/* dialog */
.cs-dialog { position: fixed; inset: 0; z-index: 3000; background: rgba(10, 18, 13, .55); display: grid; place-items: center; padding: 16px; }
.cs-dialog-box { width: min(640px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--cs-surface); color: var(--cs-ink); border-radius: 6px; padding: 18px; display: grid; gap: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.cs-detail { display: grid; gap: 10px; }
.cs-detail p, .cs-detail li { font-size: 14px; line-height: 1.6; }
.cs-roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 12px; }
.cs-roster span { font-weight: 600; font-size: 11px; color: var(--cs-muted); }
.cs .cs-linkbox { font-size: 12px; word-break: break-all; }

/* run mode */
.cs-run { position: fixed; inset: 0; z-index: 2500; background: #0e1912; color: #f4f1de; overflow: auto; padding: max(14px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(18px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.cs-run-inner { max-width: 1000px; margin: 0 auto; display: grid; gap: 16px; }
.cs-run-top { display: flex; justify-content: space-between; align-items: center; }
.cs-run .cs-kicker { color: var(--cs-yellow); }
.cs-run h2 { font: 900 clamp(34px, 6vw, 64px)/.95 var(--cs-head); margin: 0; text-wrap: balance; }
.cs-run-clock { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.cs-run-clock output { font: 900 clamp(88px, 22vw, 210px)/.85 var(--cs-head); font-variant-numeric: tabular-nums; letter-spacing: -2px; }
.cs-run-interval { display: grid; gap: 2px; padding: 14px 20px; border-radius: 6px; min-width: 150px; }
.cs-run-interval.work { background: var(--cs-yellow); color: #17241b; }
.cs-run-interval.rest { background: #2c6a3c; color: #f4f1de; }
.cs-run-interval b { font: 900 30px/1 var(--cs-head); letter-spacing: 1px; }
.cs-run-interval span { font: 900 54px/1 var(--cs-head); font-variant-numeric: tabular-nums; }
.cs-run-interval small { font-weight: 700; font-size: 13px; }
.cs-run-ctrl { display: flex; flex-wrap: wrap; gap: 10px; }
.cs .cs-btn.light { background: #1d2b22; color: #f4f1de; border-color: #33463a; min-height: 56px; padding: 0 20px; font-size: 15px; }
.cs .cs-btn.big { min-height: 56px; padding: 0 28px; font-size: 16px; flex: 1 1 180px; }
.cs .cs-icon-btn.light { color: #f4f1de; border-color: #33463a; width: 44px; height: 44px; }
.cs-run-detail { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .cs-run-detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.cs-run-detail p, .cs-run-detail li { font-size: 17px; line-height: 1.55; color: #dfe6da; }
.cs-run-cues { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.cs-run .cs-safety { background: #1d2b22; color: #f4d48a; border-left-color: var(--cs-yellow); font-size: 14px; }
.cs-run-next { font-size: 15px; color: #b8c7bb; border-top: 1px solid #33463a; padding-top: 12px; }
.cs-run .cs-diagram { max-height: 300px; }

/* toast */
.cs-toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 3500; background: var(--cs-board); color: #f4f1de; padding: 11px 18px; border-radius: 4px; font-size: 13px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.3); max-width: calc(100vw - 32px); }

/* narrow screens */
@media (max-width: 700px) {
  .cs-tabs button { font-size: 19px; padding: 9px 11px 8px; }
  .cs .cs-title-field input { font-size: 24px; }
  .cs .cs-tool { min-width: 44px; height: 44px; }
  .cs .cs-tool span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cs-toolbar { gap: 8px; }
  .cs .cs-unit { margin-left: 0; flex: 1 1 140px; }
  .cs-phase-actions .cs-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cs-phase-actions .cs-btn { min-width: 44px; min-height: 44px; padding: 8px 10px; }
  .cs-phase-actions [data-act="playout"] span, .cs-phase-actions #csPlayBtn span { position: static; width: auto; height: auto; clip: auto; }
  .cs .cs-fields { grid-template-columns: 1fr; }
  .cs-block { grid-template-columns: 1fr; }
  .cs-block-time { padding: 12px 14px 0; font-size: 15px; }
  .cs-block-body { padding: 4px 14px 14px; }
  .cs-present-bar { padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) { .cs * { transition: none !important; } }

/* print */
@media print {
  .masthead, .news-footer, .edition, .draft-notice, .performance-heading, .performance-tabs, .site-skip { display: none !important; }
  .cs-tabs, .cs-board-top, .cs-toolbar, .cs-phase-actions, .cs-side, .cs-hint, .cs-toast, .cs-dialog, .cs-run, .cs-phases .cs-phase-del { display: none !important; }
  .cs-stage { break-inside: avoid; }
  .cs-note textarea { border: 0; }
  html.cs-print-session .cs-view[data-view="board"] { display: none !important; }
  html.cs-print-session .cs-view[data-view="planner"] { display: grid !important; }
  html.cs-print-session .cs-plan-form, html.cs-print-session .cs-saved-sessions, html.cs-print-session .cs-block-tools, html.cs-print-session .cs-plan-head .cs-row, html.cs-print-session .cs-mins button { display: none !important; }
  html.cs-print-session .cs-planner-grid { grid-template-columns: 1fr; }
  .cs-block { break-inside: avoid; }
  .cs details { display: block; } .cs details > * { display: block; }
}

/* ---- defence read, ball timing, HUD ---- */
.cs-analysis { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .cs-analysis { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.cs .cs-read { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cs .cs-read li { font-size: 13px; line-height: 1.5; padding: 7px 10px 7px 26px; border-radius: 3px; background: var(--cs-paper); position: relative; }
.cs .cs-read li::before { content: ""; position: absolute; left: 10px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--cs-muted); }
.cs .cs-read li.good::before { background: #3f8f5a; } .cs .cs-read li.warn::before { background: var(--cs-warn); } .cs .cs-read li.bad::before { background: var(--cs-bad); } .cs .cs-read li.ball::before { background: var(--cs-yellow); }
.cs .cs-read li.bad { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cs-bad) 35%, transparent); }
.cs-holds { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cs-holds li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.cs-hold-who { font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-hold-who b { font: 900 18px var(--cs-head); margin-right: 4px; }
.cs-hold-t { font: 900 20px var(--cs-head); font-variant-numeric: tabular-nums; text-align: right; }
.cs-hold-t small { font: 700 10px var(--cs-body); letter-spacing: 1px; text-transform: uppercase; margin-left: 4px; }
.cs-hold-out { grid-column: 1 / -1; font-size: 11.5px; color: var(--cs-muted); }
.cs-hold-bar { grid-column: 1 / -1; position: relative; display: block; height: 8px; background: var(--cs-paper); border-radius: 4px; }
.cs-hold-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--cs-muted); }
.cs-hold-bar em { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--cs-ink); opacity: .55; }
.cs .good { --tone: #3f8f5a; } .cs .warn { --tone: var(--cs-warn); } .cs .bad { --tone: var(--cs-bad); }
.cs-hold-bar i.good, .cs-hold-bar i.warn, .cs-hold-bar i.bad { background: var(--tone); }
.cs-hold-t.good, .cs-hold-t.warn, .cs-hold-t.bad, .cs-tt-avg b.good, .cs-tt-avg b.warn, .cs-tt-avg b.bad { color: var(--tone); }
.cs .cs-linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--cs-ink); text-decoration: underline; cursor: pointer; }
.cs-hud { position: absolute; left: max(10px, env(safe-area-inset-left, 0px)); top: 10px; z-index: 3; display: flex; align-items: center; gap: 10px; background: rgba(11, 19, 14, .86); color: #f4f1de; padding: 6px 12px; border-radius: 4px; font-size: 13px; pointer-events: none; }
.cs-hud output { font: 900 24px var(--cs-head); font-variant-numeric: tabular-nums; color: #f4f1de; }
.cs-hud output.good { color: #7fd39b; } .cs-hud output.warn { color: #f2c66a; } .cs-hud output.bad { color: #ff9b8a; }
.cs.cs-presenting .cs-hud { top: calc(10px + env(safe-area-inset-top, 0px)); font-size: 16px; }
.cs.cs-presenting .cs-hud output { font-size: 34px; }
.cs-scenario p { font-size: 13px; line-height: 1.55; }
.cs-scenario { border-color: var(--cs-yellow); }

/* ---- pass timer ---- */
.cs-timer-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .cs-timer-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.cs-tt-live { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; background: var(--cs-board); color: #f4f1de; border-radius: 4px; padding: 14px 18px; flex-wrap: wrap; }
.cs-tt-live span { font-size: 15px; font-weight: 600; }
.cs-tt-live output { font: 900 clamp(56px, 10vw, 96px)/.85 var(--cs-head); font-variant-numeric: tabular-nums; color: #f4f1de; }
.cs-tt-live output.good { color: #7fd39b; } .cs-tt-live output.warn { color: #f2c66a; } .cs-tt-live output.bad { color: #ff9b8a; }
.cs-tt-players { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cs .cs-tt-p { display: grid; gap: 2px; justify-items: center; padding: 10px 4px; min-height: 64px; border: 1px solid var(--cs-line); background: var(--cs-surface); color: var(--cs-ink); border-radius: 4px; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.cs .cs-tt-p b { font: 900 26px/1 var(--cs-head); }
.cs .cs-tt-p small { font-size: 10px; color: var(--cs-muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs .cs-tt-p.on { background: var(--cs-yellow); border-color: var(--cs-yellow); color: #17241b; }
.cs .cs-tt-p.on small { color: #3b3410; }
.cs-tt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-tt-actions .cs-btn.big { min-height: 60px; flex: 1 1 160px; font-size: 17px; }
.cs-tt-actions .cs-btn small { font-weight: 600; font-size: 11px; opacity: .7; }
.cs-tt-table { display: grid; font-size: 13px; }
.cs-tt-table > div { display: grid; grid-template-columns: minmax(0, 1.2fr) 0.8fr minmax(0, 1.6fr) 1fr; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--cs-line); }
.cs-tt-table > div.hd { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--cs-muted); }
.cs-tt-table small { color: var(--cs-muted); }
.cs-tt-avg { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.cs-tt-avg .cs-hold-bar { grid-column: auto; }
.cs-tt-avg b { font: 900 18px var(--cs-head); font-variant-numeric: tabular-nums; }
.cs-tt-log { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.7; max-height: 240px; overflow: auto; }
@media (max-width: 520px) { .cs-tt-players { grid-template-columns: repeat(4, minmax(0, 1fr)); } .cs-tt-table > div { grid-template-columns: minmax(0, 1fr) 0.6fr minmax(0, 1.4fr); } .cs-tt-table > div > :nth-child(4) { display: none; } }

/* ---- coaching ideas ---- */
.cs-ideas-head { display: grid; gap: 4px; max-width: 70ch; }
.cs-ideas-head p:last-child { color: var(--cs-muted); }
.cs-ideas { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .cs-ideas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cs-lens h3 { font-size: 34px; }
.cs-lens > p { font-size: 14px; line-height: 1.6; }
.cs-lens-ideas { display: grid; gap: 10px; }
.cs-lens-ideas b { font-size: 14px; }
.cs-lens-ideas p { font-size: 13px; line-height: 1.55; color: var(--cs-muted); }
.cs-lens-club { background: var(--cs-paper); border-radius: 3px; padding: 12px 14px; display: grid; gap: 6px; }
.cs-lens-club h4 { font-size: 18px; }
.cs-lens .cs-row { align-items: center; }
.cs-lens-note { grid-column: 1 / -1; }
.cs-lens-box { background: var(--cs-paper); border-radius: 3px; padding: 10px 12px; }
.cs-lens-box ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.55; }
.cs .cs-lens-cue { font-size: 13px; padding: 6px 10px; background: var(--cs-paper); border-radius: 3px; }
@media print { .cs-hud, .cs-analysis .cs-btn { display: none !important; } }
