/* Golf Fellow — the coach workspace (`/coach`).
 *
 * Loaded AFTER `site.css`, whose `:root` holds the site's colours. The one
 * `:root` block below adds the chart roles the app's own charts draw with,
 * copied from `palette.light` (`src/theme/tokens.ts`) and pinned value for
 * value by `coachWorkspaceScreens.test.ts`; everything else is classes and
 * `var(--…)`. Golf green is the tint here, the sign-in card included — `sand`
 * belongs to the pre-account pages, and a coach signing in already has an
 * account. Errors are red. Light only.
 *
 * NO INLINE STYLE anywhere on this page: its CSP is `style-src 'self'`.
 *
 * Laptop-first (planning/coach-web/plan.md, decision 10): from 1024 px the hub
 * and the client page sit in two columns; from 640 to 1023 px (a tablet in the
 * bay) it is one column with rows at least 44 px tall; under 640 px the client
 * page takes the app's own tabs back and nothing scrolls sideways.
 */

/* `palette.light`'s chart and score roles, by name (`HandicapTimeline.tsx`,
   `LeakBars.tsx`, `Tag`, and `ScoreShape` via `scoreCell.ts::scoreCellColors`). */
:root {
  --chart-line: #1a7a45; /* tint */
  --separator: rgba(56, 62, 58, 0.29);
  --secondary-label: rgba(56, 62, 58, 0.6);
  --track: rgba(122, 114, 100, 0.12);
  --secondary-fill: rgba(122, 114, 100, 0.16);
  --warning: #ff9500;
  --success-subtle: rgba(52, 199, 89, 0.12);
  --success-text: #1f7c34;
  --label: #000000;
  --tertiary-label: rgba(56, 62, 58, 0.3);
  --score-achievement: #c3e4d1;
  --on-score-achievement: #0e3f23;
  --score-trouble-1: #f2e7cc;
  --score-trouble-2: #eedcac;
  --score-trouble-3: #e3c884;
  --score-trouble-1-border: #8f7f5b;
  --score-trouble-2-border: #85703f;
  --score-trouble-3-border: #745d2a;
}

[hidden] { display: none !important; }

body.ws { background: var(--ink-100); }
.ws-wide { max-width: 1200px; }
.ws-main { padding-top: 28px; padding-bottom: 72px; min-height: 60vh; }

.ws-card {
  background: var(--ground); border: 1px solid var(--ink-300);
  border-radius: var(--radius-lg); padding: 24px;
}
.ws-title { font-size: clamp(26px, 3.6vw, 34px); letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
.ws-lede { color: var(--ink-700); margin: 8px 0 20px; max-width: 52ch; }
.ws-loading { color: var(--ink-600); }
.ws-empty { color: var(--ink-700); margin: 0; padding: 16px 18px; }

/* ── buttons ─────────────────────────────────────────────── */
.ws-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 18px;
  font: inherit; font-size: 16px; font-weight: 600; text-decoration: none;
  border-radius: var(--radius); border: 1px solid var(--green-600);
  background: var(--ground); color: var(--green-600); cursor: pointer;
}
.ws-button:hover { color: var(--green-700); border-color: var(--green-700); }
.ws-primary { background: var(--green-600); color: var(--ground); }
.ws-primary:hover { background: var(--green-700); color: var(--ground); }
.ws-quiet { border-color: var(--ink-300); color: var(--ink-800); font-weight: 500; }
.ws-quiet:hover { border-color: var(--ink-600); color: var(--ink-900); }
.ws-button:disabled { opacity: 0.55; cursor: default; }
.ws-button:focus-visible, .ws-form input:focus-visible, .brand:focus-visible {
  outline: 2px solid var(--green-500); outline-offset: 2px;
}
.ws-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 0; }

/* ── status lines ────────────────────────────────────────── */
.ws-status {
  margin: 0 0 16px; padding: 12px 14px; border-radius: var(--radius);
  font-size: 16px; background: var(--ink-100); color: var(--ink-800);
}
.ws-status[data-kind="error"] { background: var(--error-subtle); color: var(--error-text); }

/* ── sign in, not a coach, failures ──────────────────────── */
.ws-signin, .ws-notcoach, .ws-failed { max-width: 480px; margin: 24px auto 0; }
.ws-form { display: flex; flex-direction: column; }
.ws-form label { font-weight: 600; font-size: 15px; margin: 0 0 6px; color: var(--ink-900); }
.ws-form input {
  display: block; width: 100%; margin: 0 0 18px;
  font: inherit; font-size: 17px; color: var(--ink-900);
  background: var(--ground); border: 1px solid var(--ink-300);
  border-radius: var(--radius); padding: 11px 14px; min-height: 44px;
}
.ws-form input[aria-invalid="true"] { border-color: var(--error-text); }
.ws-form .ws-button { width: 100%; margin-top: 4px; }

/* ── the hub ─────────────────────────────────────────────── */
.ws-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 20px; margin: 0 0 24px;
}
.ws-who { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--ink-700); font-size: 15px; }
.ws-who-name { overflow-wrap: anywhere; }

.ws-hub { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
/* `site.css` pads every <section> as a landing-page band; a hub section is a list. */
.ws-section { padding: 0; }
.ws-section h2 {
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-700); margin: 0 0 8px 4px;
}

.ws-list {
  list-style: none; margin: 0; padding: 0;
  background: var(--ground); border: 1px solid var(--ink-300); border-radius: var(--radius-lg);
  overflow: hidden;
}
.ws-row {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  min-height: 56px; padding: 10px 18px; /* ≥ 44 px at every width: a tablet in the bay */
  border-top: 1px solid var(--ink-100);
}
.ws-row:first-child { border-top: 0; }
.ws-row-title { font-weight: 600; color: var(--ink-900); overflow-wrap: anywhere; }
.ws-row-sub { font-size: 15px; color: var(--ink-700); overflow-wrap: anywhere; }
.ws-groups .ws-empty {
  background: var(--ground); border: 1px solid var(--ink-300); border-radius: var(--radius-lg);
}

/* A row that opens a page: the whole row is the link. */
.ws-row:has(> .ws-row-link) { padding: 0; }
.ws-row-link {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  min-height: 56px; padding: 10px 18px; color: inherit; text-decoration: none;
}
.ws-row-link:hover { background: var(--ink-100); }
.ws-row-link:hover .ws-row-title { color: var(--green-700); }
.ws-row-link:focus-visible, .ws-back:focus-visible, .ws-name-link:focus-visible, .ws-tab:focus-visible, .ws-nine:focus-visible {
  outline: 2px solid var(--green-500); outline-offset: -2px;
}

/* ── pages below the hub ─────────────────────────────────── */
.ws-back {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 17px; font-weight: 600; color: var(--green-600); text-decoration: none;
}
.ws-back::before { content: "‹"; font-size: 30px; line-height: 1; margin: -4px 6px 0 0; }
.ws-back:hover { color: var(--green-700); }
.ws-pagehead { margin: 0 0 24px; }
.ws-pagehead .ws-title { overflow-wrap: anywhere; }
.ws-pagehead .ws-lede { margin: 6px 0 0; }

.ws-panel {
  background: var(--ground); border: 1px solid var(--ink-300);
  border-radius: var(--radius-lg); padding: 16px 18px;
}
p.ws-panel { margin: 0; }
.ws-foot { margin: 8px 0 0; font-size: 15px; color: var(--ink-700); }
.ws-caption { margin: 4px 0 0; font-size: 13px; color: var(--ink-700); }

/* ── the group ───────────────────────────────────────────── */
.ws-group { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.ws-link-text { margin: 0; font-size: 16px; color: var(--ink-900); overflow-wrap: anywhere; user-select: all; }
.ws-actions-tight { margin-top: 12px; align-items: center; }
.ws-invite .ws-status { margin: 12px 0 0; }
/* the group's QR and code, to show or read out at a lesson (coach audit L6) */
.ws-invite-code { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 0 0 16px; padding: 0 0 16px; border-bottom: 1px solid var(--ink-100); }
.ws-invite-qr { flex: none; width: 112px; padding: 6px; border: 1px solid var(--ink-300); border-radius: var(--radius); background: var(--ground); }
/* beside the QR, or under it when the panel is too narrow for both */
.ws-invite-code-text { flex: 1 1 12em; min-width: 0; }
.ws-invite-code-value { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: 0.05em; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-900); }
.ws-copied { color: var(--green-600); font-weight: 600; }

.ws-table {
  width: 100%; border-collapse: separate; border-spacing: 0; table-layout: auto;
  background: var(--ground); border: 1px solid var(--ink-300); border-radius: var(--radius-lg);
  overflow: hidden;
}
.ws-table th {
  text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-700);
  padding: 10px 18px; border-bottom: 1px solid var(--ink-300);
}
.ws-table td {
  padding: 4px 18px; height: 52px; border-top: 1px solid var(--ink-100);
  color: var(--ink-800); overflow-wrap: anywhere;
}
.ws-table tbody tr:first-child td { border-top: 0; }
.ws-table .ws-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ws-name-link {
  display: inline-flex; align-items: center; min-height: 44px;
  font-weight: 600; color: var(--ink-900); text-decoration: none;
}
.ws-name-link:hover { color: var(--green-700); text-decoration: underline; }

/* the group's one Golfers table (0206's progress, sorted by the coach); it scrolls inside itself on a phone */
.ws-roster { margin: 0 0 24px; }
.ws-table-scroll { overflow-x: auto; border-radius: var(--radius-lg); }
.ws-table-scroll > .ws-table { min-width: 600px; }
/* a name or a figure never breaks mid-word: the region scrolls instead */
.ws-roster th, .ws-roster td { overflow-wrap: normal; }
.ws-roster td:first-child { white-space: nowrap; }
.ws-sort {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0; border: 0;
  background: none; font: inherit; color: inherit; text-align: inherit; cursor: pointer;
}
.ws-sort:hover, th[aria-sort] .ws-sort { color: var(--ink-900); }
.ws-sort:focus-visible, .ws-table-scroll:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }
.ws-cell-note { display: block; font-size: 13px; color: var(--ink-700); }

/* ── the client ──────────────────────────────────────────── */
.ws-tabs { display: none; }
.ws-client { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); align-items: start; }
/* minmax(0, 1fr) tracks: a drawn chart never props its column open */
.ws-client-side { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
.ws-pane { padding: 0; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.ws-pane > h2 {
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-700); margin: 0 0 -8px 4px;
}
.ws-card h3, .ws-practice-half h3 { font-size: 17px; margin: 0 0 10px; color: var(--ink-900); }
.ws-figure {
  margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; color: var(--ink-900);
}
.ws-last-active { margin: 0 4px; }

.ws-row-valued { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
.ws-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ws-row-value { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-900); white-space: nowrap; }
.ws-row-open .ws-row-text { margin-right: auto; }
/* a round's row wears the chevron; a range session has neither link nor chevron */
.ws-row-open::after { content: "›"; font-size: 24px; line-height: 1; color: var(--tertiary-label); margin: -2px 0 0 -4px; }
.ws-more { display: grid; justify-items: center; }
.ws-more .ws-status { margin: 12px 0 0; justify-self: stretch; }

.ws-practice-half { display: grid; gap: 0; }
.ws-practice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ws-practice {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--ground); border: 1px solid var(--ink-300); border-radius: var(--radius-lg);
  padding: 14px 18px;
}
.ws-practice-name { color: var(--ink-900); overflow-wrap: anywhere; }
.ws-chips { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ws-chip {
  font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.ws-chip[data-kind="pass"] { background: var(--success-subtle); color: var(--success-text); }
.ws-chip[data-kind="fail"] { background: var(--error-subtle); color: var(--error-text); }

/* the handicap curve — measured to its card by app.js, so it is drawn 1:1 */
.ws-curve-box { margin-top: 12px; overflow: hidden; }
.ws-curve { display: block; overflow: visible; font-family: var(--font); }
.ws-curve-grid { stroke: var(--separator); stroke-width: 0.5; }
.ws-curve-line { fill: none; stroke: var(--chart-line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ws-curve-dot { fill: var(--chart-line); }
.ws-curve-tick { fill: var(--secondary-label); font-size: 11px; font-variant-numeric: tabular-nums; }
.ws-tick-y { text-anchor: end; }
.ws-tick-x { text-anchor: middle; }

/* the leak bars — capsule tracks, the biggest in the warning role */
.ws-leak-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.ws-leak-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: baseline; }
.ws-leak-label { font-size: 15px; color: var(--ink-900); }
.ws-leak-value { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-900); }
.ws-leak-bar { grid-column: 1 / -1; display: block; width: 100%; height: 8px; }
.ws-leak-track { fill: var(--track); }
.ws-leak-fill { fill: var(--secondary-fill); }
.ws-leak-fill.ws-leak-biggest { fill: var(--warning); }
.ws-leak .ws-foot { margin-top: 16px; }

/* ── a round, hole by hole (`ScorecardGrid.tsx`'s read view) ── */
.ws-round, .ws-scorecard { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.ws-scorecard { gap: 12px; }
/* a card per nine: under 640 px it scrolls inside, the page never does */
.ws-nine { background: var(--ground); border: 1px solid var(--ink-300); border-radius: var(--radius-lg); overflow-x: auto; }
.ws-nine table { width: 100%; border-spacing: 0; font-variant-numeric: tabular-nums; font-size: 15px; color: var(--label); }
.ws-nine th, .ws-nine td { height: 44px; min-width: 36px; padding: 0 2px; text-align: center; white-space: nowrap; border-top: 1px solid var(--ink-100); background: var(--ground); }
.ws-nine thead th { border-top: 0; height: 36px; font-size: 13px; color: var(--secondary-label); }
.ws-nine .ws-sc-blank { color: var(--tertiary-label); }
/* the row names and the nine's totals hold still while the holes scroll */
.ws-nine .ws-sc-label { position: sticky; left: 0; text-align: left; padding: 0 12px 0 16px; font-weight: 400; color: var(--secondary-label); }
.ws-nine .ws-sc-total { position: sticky; right: 0; min-width: 48px; padding: 0 10px; border-left: 1px solid var(--ink-100); }
.ws-nine thead th, .ws-sc-strong { font-weight: 600; }
.ws-sc-summary { margin: 0 4px; }

/* `ScoreShape` at `cell` (28 px): a 1.5 px outline; doubled, a 1 px gap and a 1 px inner one */
.ws-score, .ws-score-inner { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; border: 0 solid; }
.ws-score { width: 28px; height: 28px; vertical-align: middle; line-height: 1; font-weight: 600; }
.ws-score-inner { width: 23px; height: 23px; border-width: 1px; }
.ws-score-disc, .ws-score-disc .ws-score-inner { border-radius: 50%; }
.ws-score-disc { padding: 1.5px; }
.ws-score-box { border-width: 1.5px; }
.ws-num-body { font-size: 17px; }
.ws-num-subhead { font-size: 15px; }
.ws-num-footnote { font-size: 13px; }
.ws-fill-score-achievement { background: var(--score-achievement); }
.ws-fill-score-trouble-1 { background: var(--score-trouble-1); }
.ws-fill-score-trouble-2 { background: var(--score-trouble-2); }
.ws-fill-score-trouble-3 { background: var(--score-trouble-3); }
.ws-border-on-score-achievement { border-color: var(--on-score-achievement); }
.ws-border-score-trouble-1-border { border-color: var(--score-trouble-1-border); }
.ws-border-score-trouble-2-border { border-color: var(--score-trouble-2-border); }
.ws-border-score-trouble-3-border { border-color: var(--score-trouble-3-border); }
.ws-ink-label { color: var(--label); }
.ws-ink-on-score-achievement { color: var(--on-score-achievement); }
.ws-ink-tertiary-label { color: var(--tertiary-label); }
.ws-no-holes { margin: 0; max-width: none; }

/* ── W2: the coach's writes ─────────────────────────────── */
.ws-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.ws-hub-side { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
.ws-section-foot { margin: 8px 4px 0; }
.ws-row-tinted { color: var(--green-600); font-weight: 600; }
.ws-row-tinted:hover { color: var(--green-700); }
.ws-pagehead-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
.ws-pagehead-text { min-width: 0; }
.ws-pagehead-action { flex: none; }
.ws-status[data-kind="success"] { background: var(--success-subtle); color: var(--success-text); }
.ws-notice { margin: -8px 0 24px; }

/* the app's segmented control, as native radios */
.ws-seg, .ws-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.ws-seg > legend, .ws-fieldset > legend { margin: 0 0 8px; padding: 0; }
.ws-seg-track { display: flex; gap: 2px; padding: 2px; background: var(--secondary-fill); border-radius: 10px; }
.ws-seg-option { flex: 1; position: relative; min-width: 0; }
.ws-seg-option input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; }
.ws-seg-text {
  display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 4px 8px;
  border-radius: 8px; font-size: 15px; font-weight: 500; text-align: center; color: var(--ink-900); cursor: pointer;
}
.ws-seg-option input:checked + .ws-seg-text { background: var(--ground); font-weight: 600; box-shadow: 0 1px 2px var(--separator); }
.ws-seg-option input:focus-visible + .ws-seg-text { outline: 2px solid var(--green-500); outline-offset: -2px; }

/* a drill to tick */
.ws-pick { flex-direction: row; align-items: center; gap: 14px; padding: 0 18px; }
.ws-pick:has(.ws-check:checked) { background: var(--green-100); }
.ws-check { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--green-600); cursor: pointer; }
.ws-pick-label { display: flex; flex-direction: column; justify-content: center; gap: 2px; flex: 1; min-width: 0; min-height: 56px; padding: 10px 0; cursor: pointer; }

/* the app's stepper */
.ws-steppers { padding: 4px 18px; }
.ws-steppers[data-invalid="true"] { border-color: var(--error-text); }
.ws-stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; border-top: 1px solid var(--ink-100); }
.ws-stepper:first-child { border-top: 0; }
.ws-stepper-title { color: var(--ink-900); }
.ws-stepper-controls { display: inline-flex; align-items: center; gap: 2px; padding: 2px; background: var(--secondary-fill); border-radius: 10px; flex: none; }
.ws-step-button {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 40px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-900); cursor: pointer;
}
.ws-step-button:hover { background: var(--ground); }
.ws-step-button[aria-disabled="true"] { color: var(--tertiary-label); background: transparent; cursor: default; }
.ws-step-value { min-width: 32px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-900); }
.ws-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* the assign page: drills on the left, the plan and Assign on the right */
.ws-assign { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.ws-assign-drills, .ws-assign-side { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.ws-assign-side { gap: 16px; }
.ws-assign-side .ws-status { margin: 0; }
.ws-assign-error { display: grid; gap: 12px; justify-items: start; }
.ws-assign-error .ws-status { margin: 0; justify-self: stretch; }
.ws-target { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ws-form-actions { margin: 0; }

/* the drill form */
.ws-drill-form { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.ws-form-col { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.ws-form-col > .ws-status { margin: 0; }
.ws-field { display: grid; gap: 6px; }
.ws-field-label { font-size: 15px; font-weight: 600; color: var(--ink-900); }
.ws-input {
  display: block; width: 100%; margin: 0; font: inherit; font-size: 17px; color: var(--ink-900);
  background: var(--ground); border: 1px solid var(--ink-300); border-radius: var(--radius);
  padding: 11px 14px; min-height: 44px;
}
textarea.ws-input { min-height: 76px; resize: vertical; field-sizing: content; }
.ws-input::placeholder { color: var(--ink-600); }
.ws-input[aria-invalid="true"] { border-color: var(--error-text); }
.ws-input:focus-visible, .ws-check:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }
.ws-field-error { margin: 0; font-size: 15px; color: var(--error-text); }
.ws-step-label { font-weight: 500; color: var(--ink-700); }
.ws-step-row { display: flex; align-items: flex-start; gap: 6px; }
.ws-step-row .ws-input { flex: 1; min-width: 0; }
.ws-icon-button {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--error-text); cursor: pointer;
}
.ws-icon-button .ws-icon { width: 20px; height: 20px; }
.ws-link-button {
  justify-self: start; min-height: 44px; padding: 0; border: 0; background: none;
  font: inherit; font-size: 17px; font-weight: 600; color: var(--green-600); cursor: pointer;
}
.ws-link-button:hover { color: var(--green-700); }
.ws-step-button:focus-visible, .ws-icon-button:focus-visible, .ws-link-button:focus-visible {
  outline: 2px solid var(--green-500); outline-offset: 2px;
}
.ws-destructive { background: var(--error-text); border-color: var(--error-text); color: var(--ground); }
.ws-destructive:hover { background: var(--error-text); border-color: var(--error-text); color: var(--ground); }
.ws-destructive-quiet { border-color: var(--ink-300); color: var(--error-text); }
.ws-destructive-quiet:hover { border-color: var(--error-text); color: var(--error-text); }
.ws-archive { display: grid; gap: 8px; justify-items: start; padding-top: 22px; border-top: 1px solid var(--ink-300); }
.ws-archive-confirm { border-top: 1px solid var(--ink-300); padding-top: 16px; }
.ws-archive-title { font-size: 17px; margin: 0; color: var(--ink-900); }
.ws-archive-confirm .ws-foot { margin: 0; }
.ws-archive-confirm .ws-status { margin: 4px 0 0; justify-self: stretch; }
.ws-archive-confirm .ws-actions { margin: 4px 0 0; }

/* ── W2 S8, S9 and lesson notes ──────────────────────────── */
.ws-hub-main, .ws-client-main { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-content: start; }
.ws-client-main { gap: 28px; }
.ws-groups-empty { margin: 0 0 12px; }
.ws-groups-empty p { margin: 0; }
.ws-groups-empty .ws-foot { margin-top: 4px; }

/* an action asked once, in place: the app's confirmation sheet */
.ws-confirm { display: grid; gap: 8px; justify-items: start; }
.ws-confirm-title { font-size: 17px; font-weight: 600; margin: 0; color: var(--ink-900); }
.ws-confirm .ws-foot { margin: 0; }
.ws-confirm > .ws-field, .ws-confirm > .ws-status { justify-self: stretch; }
.ws-confirm .ws-status { margin: 4px 0 0; }
.ws-confirm .ws-actions { margin: 4px 0 0; }
.ws-small { padding: 6px 14px; font-size: 15px; }
/* a quiet row action (Remove): text only, so it never outweighs the data beside it */
.ws-text-action {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; border: 0; background: none;
  font: inherit; font-size: 15px; color: var(--ink-700); text-decoration: underline; cursor: pointer;
}
.ws-text-action:hover:not(:disabled) { color: var(--error-text); }
.ws-text-action:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; border-radius: var(--radius); }
.ws-text-action:disabled { opacity: 0.5; cursor: default; }

/* a phone: the group's golfers as stacked rows, not a table that scrolls sideways */
@media (max-width: 599px) {
  .ws-table-scroll > .ws-table { min-width: 0; }
  .ws-roster .ws-table, .ws-roster .ws-table tbody { display: block; }
  .ws-roster .ws-table thead { display: block; }
  .ws-roster .ws-table thead:not(:has(.ws-sort)) { display: none; }
  .ws-roster .ws-table thead tr { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 4px 12px; border-bottom: 1px solid var(--ink-300); }
  .ws-roster .ws-table thead th, .ws-roster .ws-table thead td { display: none; border: 0; padding: 0; }
  .ws-roster .ws-table thead th:has(.ws-sort) { display: block; }
  .ws-roster .ws-table tbody tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; align-items: start;
    padding: 6px 12px 12px; border-top: 1px solid var(--ink-100);
  }
  .ws-roster .ws-table tbody tr:first-child { border-top: 0; }
  .ws-roster .ws-table tbody td { display: block; height: auto; padding: 2px 0; border: 0; text-align: left; white-space: normal; }
  .ws-roster .ws-table td[data-label]::before {
    content: attr(data-label); display: block; font-size: 13px; font-weight: 600; color: var(--ink-700);
  }
  .ws-roster .ws-table td.ws-cell-name { grid-column: 1; grid-row: 1; }
  .ws-roster .ws-table td.ws-row-action { grid-column: 2; grid-row: 1; justify-self: end; width: auto; }
  .ws-roster .ws-table td.ws-cell-club { grid-column: 1 / -1; grid-row: 2; font-size: 15px; color: var(--ink-700); }
}

/* the group's ⋯ menu, as rows */
.ws-row:has(> .ws-row-button) { padding: 0; }
.ws-row-button {
  display: flex; align-items: center; width: 100%; min-height: 56px; padding: 10px 18px;
  border: 0; background: none; font: inherit; font-size: 17px; color: var(--green-600); text-align: left; cursor: pointer;
}
.ws-row-button:hover { background: var(--ink-100); color: var(--green-700); }
.ws-row-destructive, .ws-row-destructive:hover { color: var(--error-text); }
.ws-row-button:focus-visible { outline: 2px solid var(--green-500); outline-offset: -2px; }
.ws-roster > .ws-confirm { margin: 0 0 12px; }
.ws-table .ws-row-action { width: 1%; text-align: right; white-space: nowrap; }
.ws-table thead .ws-row-action { height: auto; border-top: 0; border-bottom: 1px solid var(--ink-300); }
.ws-archived { max-width: 560px; margin: 0; display: grid; gap: 8px; }
.ws-archived .ws-actions { margin-top: 12px; }

/* the request inbox */
.ws-request { gap: 4px; padding: 12px 18px; }
.ws-request > .ws-row-valued { display: flex; align-items: flex-start; }
.ws-request > .ws-actions { margin: 6px 0 2px; }
.ws-request > .ws-confirm { margin: 8px 0 2px; }

/* lesson notes */
.ws-pagehead-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.ws-note-form { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.ws-note-form .ws-actions { margin: 0; }
.ws-note-form .ws-status { margin: 0; }
textarea.ws-note-text { min-height: 120px; }
.ws-note-count { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.ws-note { gap: 4px; padding: 14px 18px; }
.ws-note-body { margin: 2px 0 0; color: var(--ink-900); white-space: pre-line; overflow-wrap: anywhere; }
.ws-note > .ws-note-actions { margin: 8px 0 0; }
.ws-note > .ws-confirm { margin: 8px 0 0; }

/* W3: "Since joining" — the app's card, its MeasureList as label-value rows */
.ws-progress-slot { display: contents; }
.ws-progress { display: grid; gap: 16px; }
.ws-card.ws-progress h3 { margin: 0; }
.ws-progress-label { margin: 0; font-size: 15px; color: var(--ink-700); }
.ws-progress-figure { margin: 2px 0 0; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-900); }
.ws-progress-handicap .ws-foot { margin-top: 4px; }
.ws-progress-strokes { display: grid; gap: 8px; }
.ws-progress-head { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink-900); }
.ws-progress-strokes .ws-foot, .ws-progress-strokes .ws-caption { margin: 0; }
.ws-measure { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ws-measure-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline; font-size: 15px; }
.ws-measure-label { color: var(--ink-700); }
.ws-measure-value { color: var(--ink-900); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ws-measure-note { grid-column: 1 / -1; font-size: 13px; color: var(--ink-700); }

/* ── the poster (coaching ideas 8) ──────────────────────── */
.ws-poster-warning { max-width: 52ch; margin: 8px 0 0; }
/* sized in units of its own width (cqi): the preview is the printed page, scaled */
.ws-poster-frame { container-type: inline-size; max-width: 760px; margin: 0 auto; }
.ws-poster {
  aspect-ratio: 190 / 275; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 2.5cqi;
  padding: 6cqi; background: var(--ground); color: var(--ink-900);
  border: 1px solid var(--ink-300); border-radius: 4px; box-shadow: 0 10px 30px var(--track);
  print-color-adjust: exact; -webkit-print-color-adjust: exact;
}
.ws-poster p, .ws-poster h2 { margin: 0; }
.ws-poster-brand { display: flex; align-items: center; gap: 1.6cqi; font-size: 2.6cqi; font-weight: 800; letter-spacing: 0.08em; color: var(--green-600); }
.ws-poster-mark { flex: none; width: 5.2cqi; height: 4cqi; background: url(/img/mark.png) center / contain no-repeat; }
.ws-poster-head { display: grid; gap: 1.4cqi; }
.ws-poster-coach { font-size: 2.5cqi; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--green-600); overflow-wrap: anywhere; }
.ws-poster-group { font-size: 3.8cqi; font-weight: 600; line-height: 1.25; color: var(--ink-800); overflow-wrap: anywhere; }
.ws-poster h2.ws-poster-headline { margin-top: 2.4cqi; font-size: 9.6cqi; font-weight: 800; line-height: 1.02; letter-spacing: -0.03em; color: var(--ink-900); }
.ws-poster-body { margin-top: 0.6cqi; font-size: 3.2cqi; line-height: 1.4; color: var(--ink-700); }
.ws-poster-body strong { color: var(--green-600); }
.ws-poster-join { display: grid; grid-template-columns: 46cqi minmax(0, 1fr); gap: 5cqi; align-items: center; }
.ws-poster-qr { padding: 1.6cqi; border: 0.3cqi solid var(--ink-300); border-radius: 3cqi; background: var(--ground); }
.ws-qr { display: block; width: 100%; height: auto; shape-rendering: crispEdges; }
.ws-qr-light { fill: var(--ground); }
.ws-qr-dark { fill: var(--label); }
.ws-poster-how { display: grid; gap: 1.2cqi; }
.ws-poster-scan { font-size: 3.6cqi; font-weight: 700; line-height: 1.2; color: var(--ink-900); }
.ws-poster-or { margin-top: 2.4cqi; font-size: 2.6cqi; line-height: 1.35; color: var(--ink-700); }
.ws-poster-code { font-size: 6.2cqi; font-weight: 800; letter-spacing: 0.05em; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-900); }
.ws-poster-where { font-size: 2.6cqi; line-height: 1.35; color: var(--ink-700); }
.ws-poster-foot { display: grid; gap: 2cqi; padding-top: 2.6cqi; border-top: 0.3cqi solid var(--ink-100); }
.ws-poster-consent { font-size: 2.4cqi; color: var(--ink-700); }
.ws-poster-store { display: flex; align-items: center; gap: 2cqi; font-size: 2.8cqi; font-weight: 600; color: var(--ink-900); }
.ws-poster-icon { flex: none; width: 6.4cqi; height: 6.4cqi; border-radius: 22%; background: url(/img/icon-180.png) center / cover no-repeat; }
.ws-poster-site { margin-left: auto; font-weight: 400; color: var(--ink-700); }

/* ── W6: Getting started — a tick or an open circle, then the step ── */
.ws-step { flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; }
.ws-step-icon { flex: none; width: 22px; height: 22px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ws-step-done { stroke: var(--success-text); }
.ws-step-open { stroke: var(--secondary-label); }

/* ── the lesson sheet: on screen, the A4 page it prints ───── */
.ws-sheet-frame { max-width: 840px; margin: 0 auto; }
.ws-sheet {
  padding: 40px 44px; background: var(--ground); color: var(--ink-900);
  border: 1px solid var(--ink-300); border-radius: 4px; box-shadow: 0 10px 30px var(--track);
  print-color-adjust: exact; -webkit-print-color-adjust: exact;
}
.ws-sheet > * + * { margin-top: 22px; }
.ws-sheet p { margin: 0; }
.ws-sheet-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 24px; padding-bottom: 12px; border-bottom: 2px solid var(--ink-900); }
.ws-sheet-name { margin: 0; font-size: 28px; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.ws-sheet-club { margin-top: 2px; color: var(--ink-700); }
.ws-sheet-meta { text-align: right; font-size: 13px; color: var(--ink-700); }
.ws-sheet-brand { font-weight: 800; letter-spacing: 0.08em; color: var(--green-600); }
/* Since joining first, as on the golfer's page; beside it the handicap over strokes lost */
.ws-sheet-cards { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "since hcp" "since strokes"; align-items: start; }
.ws-sheet-cards:not(:has(.ws-progress)) { grid-template-areas: "hcp strokes"; }
.ws-sheet-cards .ws-handicap { grid-area: hcp; }
.ws-sheet-cards .ws-progress { grid-area: since; }
.ws-sheet-cards .ws-strokes { grid-area: strokes; }
.ws-sheet-cards .ws-card { padding: 14px 16px; border-radius: var(--radius); break-inside: avoid; }
.ws-sheet .ws-curve { width: 100%; height: auto; }
.ws-sheet .ws-figure { font-size: 28px; }
.ws-sheet-part { padding: 0; }
.ws-sheet-part > h2 { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-700); margin: 0 0 8px; }
.ws-sheet-table td { height: auto; padding: 6px 12px; }
.ws-sheet-table th { padding: 6px 12px; }
.ws-sheet-table td .ws-row-sub { display: block; font-size: 13px; }
.ws-sheet-table tr, .ws-sheet-drill, .ws-sheet-note { break-inside: avoid; }
.ws-sheet-rounds, .ws-sheet-today { break-inside: avoid; }
.ws-sheet-date { white-space: nowrap; }
.ws-sheet-drill-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ws-sheet-drill { padding: 10px 14px; border-radius: var(--radius); }
.ws-sheet-note-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ws-sheet-note { display: grid; gap: 2px; padding: 0 0 10px; border-bottom: 1px solid var(--ink-100); }
.ws-sheet-line { height: 30px; border-bottom: 1px solid var(--ink-300); }
@media (max-width: 639px) {
  .ws-sheet { padding: 20px 16px; }
  .ws-sheet-cards { grid-template-columns: minmax(0, 1fr); grid-template-areas: "since" "hcp" "strokes"; }
  .ws-sheet-cards:not(:has(.ws-progress)) { grid-template-areas: "hcp" "strokes"; }
  .ws-sheet-drill-list { grid-template-columns: minmax(0, 1fr); }
  .ws-sheet-meta { text-align: left; }
  /* the rounds keep their columns and scroll inside the sheet; the page never does */
  .ws-sheet-rounds { overflow-x: auto; }
  .ws-sheet-table { min-width: 600px; }
}

/* Printing: the poster or the lesson sheet alone — no header, no bar, no tools. */
@media print {
  @page { size: A4; margin: 10mm; }
  body.ws:has(.ws-poster), body.ws:has(.ws-sheet) { background: var(--ground); }
  body.ws:has(.ws-poster) .site-head, .ws-poster-page .ws-bar, .ws-poster-tools { display: none; }
  body.ws:has(.ws-sheet) .site-head, .ws-sheet-page .ws-bar, .ws-sheet-tools { display: none; }
  .ws-main:has(.ws-poster), .ws-main:has(.ws-sheet) { padding: 0; max-width: none; min-height: 0; }
  .ws-poster-frame, .ws-sheet-frame { max-width: none; }
  .ws-poster { border: 0; border-radius: 0; box-shadow: none; break-inside: avoid; }
  /* paper is dense: 9 pt type, tight lines, one-line rounds */
  .ws-sheet { border: 0; border-radius: 0; box-shadow: none; padding: 0; font-size: 12px; line-height: 1.35; }
  .ws-sheet > * + * { margin-top: 14px; }
  .ws-sheet .ws-row-sub, .ws-sheet .ws-foot, .ws-sheet .ws-leak-label, .ws-sheet .ws-leak-value, .ws-sheet .ws-measure-row, .ws-sheet-meta { font-size: 11px; }
  .ws-sheet .ws-caption, .ws-sheet .ws-chip { font-size: 10px; }
  .ws-sheet .ws-card h3 { font-size: 13px; margin-bottom: 4px; }
  .ws-sheet .ws-figure, .ws-sheet-name { font-size: 22px; }
  .ws-sheet .ws-progress-figure { font-size: 18px; }
  .ws-sheet .ws-progress-label, .ws-sheet .ws-progress-head { font-size: 12px; }
  .ws-sheet-drills > .ws-caption { break-before: avoid; }
  .ws-sheet .ws-progress { gap: 8px; }
  .ws-sheet .ws-leak-list { gap: 4px; }
  .ws-sheet .ws-leak .ws-foot { margin-top: 8px; }
  .ws-sheet-cards { gap: 10px; }
  .ws-sheet-cards .ws-card { padding: 10px 12px; }
  .ws-sheet-part > h2 { font-size: 11px; margin-bottom: 4px; break-after: avoid; }
  .ws-sheet-table td, .ws-sheet-table th { padding: 3px 10px; }
  .ws-sheet-table td .ws-row-sub { display: inline; margin-left: 6px; }
  .ws-sheet-drill-list { gap: 6px; }
  .ws-sheet-drill { padding: 6px 10px; gap: 2px; }
  .ws-sheet .ws-chips { margin-top: 4px; gap: 4px; }
  .ws-sheet .ws-chip { padding: 1px 6px; }
  .ws-sheet-note-list { gap: 6px; }
  .ws-sheet-note { padding-bottom: 6px; }
  .ws-sheet-line { height: 26px; }
}

/* A laptop: two columns — Needs you beside the groups; a group's invite
   beside its settings, under its golfers; the client's summary beside rounds
   and practice; a round's card beside its numbers. */
@media (min-width: 1024px) {
  .ws-hub { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-group { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-client { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-round { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  /* W2: the drills beside the plan, which stays in view while the list scrolls; the form in two columns */
  .ws-assign { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .ws-assign-side { position: sticky; top: 24px; }
  .ws-drill-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 639px) {
  .ws-main { padding-top: 20px; }
  .ws-card { padding: 18px 16px; }
  .ws-row { padding: 10px 14px; }
  .ws-row-link { padding: 10px 14px; }
  .ws-pick { padding: 0 14px; }
  .ws-steppers { padding: 4px 14px; }
  .ws-table th, .ws-table td { padding-left: 12px; padding-right: 12px; }

  /* a phone: the app's Summary / Rounds / Practice tabs, one pane at a time */
  .ws-tabs {
    display: flex; gap: 2px; padding: 2px; margin: 0 0 20px;
    background: var(--secondary-fill); border-radius: 10px;
  }
  .ws-tab {
    flex: 1; min-height: 36px; border: 0; border-radius: 8px; background: transparent;
    font: inherit; font-size: 15px; font-weight: 500; color: var(--ink-900); cursor: pointer;
  }
  .ws-tab[aria-selected="true"] { background: var(--ground); font-weight: 600; }
  .ws-pane > h2 { display: none; }
  .ws-request, .ws-note { padding: 12px 14px; }
  .ws-client[data-tab="summary"] .ws-client-side,
  .ws-client[data-tab="summary"] .ws-pane-notes,
  .ws-client[data-tab="rounds"] .ws-client-main,
  .ws-client[data-tab="rounds"] .ws-pane-practice,
  .ws-client[data-tab="practice"] .ws-client-main,
  .ws-client[data-tab="practice"] .ws-pane-rounds,
  .ws-client[data-tab="notes"] .ws-pane-summary,
  .ws-client[data-tab="notes"] .ws-client-side { display: none; }
}
