/* Club workspace design preview. Standalone: it repeats the site's fonts and Design A colour tokens
   so nothing in the public stylesheet can leak into the workspace layout. */
@font-face {
  font-family: "Inter";
  src: url("../../assets/Inter-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../../assets/Inter-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --card: #ffffff;
  --raised: #f7f7f7;
  --soft: #f2f2f2;
  --line: #e5e5e5;
  --outline: #d4d4d4;
  --ink: #0a0a0a;
  --muted: #6b6b6b;
  --accent: #0f7a45;
  --on-accent: #ffffff;
  --accent-soft: #e3f3ea;
  --accent-ink: #0b5e35;
  --accent-line: #b7dcc6;
  --highlight: #f3faf6;
  --gold-soft: #fbf0c7;
  --gold-line: #e3c96a;
  --warn-ink: #6b4f00;
  --red-soft: #fde7e4;
  --red-line: #f0b3ab;
  --danger-ink: #b42318;
  --shadow: rgba(0, 0, 0, 0.18);
  /* Target-face colours, the same in both modes. */
  --gold: #f4ce46;
  --red: #bc3034;
  --blue: #2161b4;
  --black: #202322;
  --face-white: #fafaf5;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000;
    --card: #111111;
    --raised: #1c1c1e;
    --soft: #262626;
    --line: #262626;
    --outline: #3a3a3a;
    --ink: #ffffff;
    --muted: #a3a3a3;
    --accent: #3ccb7f;
    --on-accent: #000000;
    --accent-soft: #12301f;
    --accent-ink: #3ccb7f;
    --accent-line: #1f5236;
    --highlight: #0e2318;
    --gold-soft: #332a0c;
    --gold-line: #6b5a1c;
    --warn-ink: #f4ce46;
    --red-soft: #3a1512;
    --red-line: #6b2a25;
    --danger-ink: #ff8a7a;
    --shadow: rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --card: #111111;
  --raised: #1c1c1e;
  --soft: #262626;
  --line: #262626;
  --outline: #3a3a3a;
  --ink: #ffffff;
  --muted: #a3a3a3;
  --accent: #3ccb7f;
  --on-accent: #000000;
  --accent-soft: #12301f;
  --accent-ink: #3ccb7f;
  --accent-line: #1f5236;
  --highlight: #0e2318;
  --gold-soft: #332a0c;
  --gold-line: #6b5a1c;
  --warn-ink: #f4ce46;
  --red-soft: #3a1512;
  --red-line: #6b2a25;
  --danger-ink: #ff8a7a;
  --shadow: rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.5; margin: 0; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
button, textarea { font: inherit; }
ul, ol { padding: 0; list-style: none; }
small { display: block; color: var(--muted); font-size: 0.8rem; line-height: 1.35; }
kbd { background: var(--card); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; font: 700 0.8rem "Inter", sans-serif; padding: 1px 6px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.sr-only { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; white-space: nowrap; width: 1px; }
.skip { background: var(--card); color: var(--ink); border-radius: 8px; left: 12px; padding: 8px 14px; position: absolute; top: -60px; z-index: 30; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.noscript { padding: 24px; }

/* top bar and banner */
.wk-top { align-items: center; background: var(--bg); border-bottom: 1px solid var(--line); color: var(--ink); display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 12px 24px; }
.wk-brand img { display: block; height: auto; width: 150px; }
.wk-brand .logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wk-brand .logo-light { display: none; }
  :root:not([data-theme="light"]) .wk-brand .logo-dark { display: block; }
}
:root[data-theme="dark"] .wk-brand .logo-light { display: none; }
:root[data-theme="dark"] .wk-brand .logo-dark { display: block; }

/* Theme switch, matching the public site. Hidden until ../../theme.js has loaded. */
.theme-toggle { align-items: center; background: var(--soft); border: 1px solid var(--outline); border-radius: 999px; color: var(--ink); cursor: pointer; display: none; flex-shrink: 0; height: 34px; padding: 0; position: relative; width: 62px; }
.js .theme-toggle { display: inline-flex; }
.theme-toggle svg { height: 16px; position: absolute; top: 8px; width: 16px; z-index: 1; }
.theme-toggle .icon-sun { left: 8px; }
.theme-toggle .icon-moon { right: 8px; }
.theme-toggle::after { background: var(--card); border: 1px solid var(--outline); border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); content: ""; height: 26px; left: 3px; position: absolute; top: 3px; width: 26px; }
.theme-toggle[aria-checked="true"]::after { transform: translateX(28px); }
@media (prefers-reduced-motion: no-preference) { .theme-toggle::after { transition: transform 160ms ease; } }
.wk-context { align-items: center; display: flex; flex: 1; flex-wrap: wrap; gap: 8px; min-width: 220px; }
.wk-context strong { margin-right: 4px; }
.wk-user { font-weight: 700; text-align: right; }
.wk-user small { color: var(--muted); font-weight: 400; }
.chip { border: 1px solid var(--line); border-radius: 999px; font-size: 0.75rem; font-weight: 700; padding: 3px 10px; }
.chip-dark { border-color: var(--outline); color: var(--muted); }

.wk-banner { align-items: center; background: var(--gold-soft); border-bottom: 1px solid var(--gold-line); display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; padding: 10px 24px; }
.wk-banner p { flex: 1; min-width: 260px; }

/* shell */
.wk-shell { margin: 0 auto; max-width: 1680px; min-height: calc(100vh - 150px); }
.wk-side { align-items: center; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 24px; padding: 10px 24px; }
.wk-side ul { display: flex; flex-wrap: wrap; gap: 6px; }
.wk-side button { align-items: center; background: transparent; border: 0; border-radius: 999px; color: var(--ink); cursor: pointer; display: flex; font-weight: 700; gap: 10px; min-height: 44px; padding: 8px 18px; text-align: left; white-space: nowrap; }
.wk-side button:hover { background: var(--soft); }
.wk-side button[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.side-note { color: var(--muted); font-size: 0.82rem; }
.wk-main { min-width: 0; outline: none; }

.count { background: var(--accent-soft); border-radius: 999px; color: var(--accent-ink); font-size: 0.75rem; font-weight: 700; min-width: 22px; padding: 1px 7px; text-align: center; }
[aria-current="page"] .count { background: var(--on-accent); color: var(--accent-ink); }
.chipbtn[aria-pressed="true"] .count { background: var(--on-accent); color: var(--accent-ink); }

.split { align-items: start; display: grid; gap: 24px; grid-template-columns: minmax(0, 1.4fr) minmax(400px, 0.9fr); padding: 24px; }
.page-wide { padding: 24px; }
.pane-list { min-width: 0; }
.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 2rem; font-weight: 750; letter-spacing: -0.035em; line-height: 1.1; margin-bottom: 4px; }
.page-head p { color: var(--muted); max-width: 720px; }

/* filters and batch bar */
.chiprow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chipbtn { align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 999px; color: var(--ink); cursor: pointer; display: inline-flex; font-size: 0.85rem; font-weight: 700; gap: 8px; min-height: 36px; padding: 4px 14px; }
.chipbtn:hover { border-color: var(--accent); }
.chipbtn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.bulkbar { align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: space-between; margin-bottom: 14px; padding: 12px 16px; }
.bulkbar p { color: var(--muted); flex: 1; font-size: 0.88rem; min-width: 220px; }

/* tables */
.tablewrap { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
.rows th { background: var(--raised); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.72rem; letter-spacing: 0.08em; padding: 10px; text-align: left; text-transform: uppercase; white-space: nowrap; }
.rows td { border-bottom: 1px solid var(--line); padding: 10px; vertical-align: top; }
.rows td[data-label="Round"] { min-width: 172px; }
.rows td[data-label="Shot"] { min-width: 112px; }
.rows td[data-label="Archer"] { min-width: 112px; }
.nw { white-space: nowrap; }
.rows tbody tr:last-child td { border-bottom: 0; }
.rows tbody tr[data-row] { cursor: pointer; }
.rows tbody tr[data-row]:hover { background: var(--highlight); }
.rows tr.is-selected { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }
.rows tr.is-selected:hover { background: var(--accent-soft); }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.c-check { padding-right: 0; width: 30px; }
.c-check input { height: 20px; margin: 2px 0 0; width: 20px; }
.under { display: block; margin-top: 4px; }
.row-link { white-space: nowrap; background: none; border: 0; color: var(--ink); cursor: pointer; font-weight: 700; padding: 0; text-align: left; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.row-link:hover { text-decoration-color: currentColor; }

.pill { border: 1px solid transparent; border-radius: 999px; display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 2px 10px; white-space: nowrap; }
.pill-submitted { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.pill-needs-info { background: var(--gold-soft); border-color: var(--gold-line); color: var(--warn-ink); }
.pill-accepted { background: var(--accent); color: var(--on-accent); }
.pill-rejected { background: var(--red-soft); border-color: var(--red-line); color: var(--danger-ink); }
.pill-withdrawn { background: transparent; border-color: var(--line); color: var(--muted); }

.flag { font-size: 0.82rem; font-weight: 700; white-space: nowrap; }
.flag-pass { color: var(--accent); }
.flag-look { color: var(--warn-ink); }
.flag-fail { color: var(--danger-ink); }

/* review pane */
.pane-review { background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.review { padding: 0; }
.review > header, .review > section { padding: 18px 22px 0; }
.review > section:last-of-type { padding-bottom: 18px; }
.eyebrow { color: var(--accent); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; margin-bottom: 6px; }
.rv-title-row { align-items: flex-start; display: flex; gap: 16px; justify-content: space-between; }
.rv-title-row h2 { font-size: 1.7rem; font-weight: 750; letter-spacing: -0.035em; line-height: 1.1; }
.rv-score { text-align: right; }
.rv-score strong { display: block; font-size: 2.6rem; font-variant-numeric: tabular-nums; letter-spacing: -0.06em; line-height: 1; }
.rv-score span { color: var(--muted); font-size: 0.8rem; }
.facts { display: grid; gap: 10px 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
.facts dt { color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.facts dd { font-size: 0.92rem; }
.facts div:nth-child(3) { grid-column: 1 / -1; }
.review h3 { color: var(--accent); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.14em; margin-bottom: 10px; text-transform: uppercase; }

.checks { display: grid; gap: 8px; }
.check { align-items: start; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 10px; grid-template-columns: 26px 1fr auto; padding: 10px 12px; }
.check-icon { align-items: center; border-radius: 50%; display: inline-flex; font-size: 0.8rem; font-weight: 800; height: 24px; justify-content: center; width: 24px; }
.check-pass .check-icon { background: var(--accent); color: var(--on-accent); }
.check-attention .check-icon { background: var(--gold); color: #26210c; }
.check-fail .check-icon { background: var(--red); color: #ffffff; }
.check-info .check-icon { background: var(--soft); color: var(--ink); }
.check-title { font-size: 0.92rem; font-weight: 700; }
.check-detail { color: var(--muted); font-size: 0.86rem; }
.check-tag { color: var(--muted); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.check-fail { background: var(--red-soft); border-color: var(--red-line); }
.check-attention { background: var(--gold-soft); border-color: var(--gold-line); }

.card-table { font-size: 0.9rem; }
.card-table th, .card-table td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: middle; }
.card-table thead th { color: var(--muted); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
.card-table tbody th { color: var(--muted); font-weight: 700; width: 44px; }
.card-table tfoot th { color: var(--muted); }
.card-table .num { text-align: right; }
.card-table .sighters td, .card-table .sighters th { background: var(--raised); }
.arrows { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.a { align-items: center; border-radius: 50%; display: inline-flex; font-size: 0.82rem; font-variant-numeric: tabular-nums; font-weight: 800; height: 28px; justify-content: center; min-width: 28px; }
.a-gold { background: var(--gold); color: #26210c; }
.a-red { background: var(--red); color: #ffffff; }
.a-blue { background: var(--blue); color: #ffffff; }
.a-black { background: var(--black); border: 1.5px solid var(--outline); color: #ffffff; }
.a-white { background: var(--face-white); border: 1.5px solid #a6aaa4; color: #202322; }
.a-miss { background: var(--soft); border: 1.5px dashed var(--muted); color: var(--ink); }
.a-empty { border: 1.5px dashed var(--muted); color: var(--muted); }

.target { display: block; height: auto; margin: 4px auto 8px; max-width: 320px; width: 100%; }
.plot-bg { fill: #202322; }
.dot { fill: #111111; stroke: #ffffff; stroke-width: 1.4; }
.paper { background: repeating-linear-gradient(135deg, var(--raised), var(--raised) 10px, var(--soft) 10px, var(--soft) 20px); border: 2px dashed var(--line); border-radius: 12px; color: var(--muted); margin-top: 8px; padding: 28px 16px; text-align: center; }
.paper span { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.history { display: grid; gap: 8px; }
.history li { display: grid; font-size: 0.88rem; gap: 2px 12px; grid-template-columns: 130px 1fr; }
.history time { color: var(--muted); }

.decision { background: var(--card); border-top: 1px solid var(--line); bottom: 0; border-radius: 0 0 18px 18px; padding: 16px 22px; position: sticky; z-index: 2; }
.decision-done { background: var(--raised); }
.hint { color: var(--muted); font-size: 0.86rem; margin-bottom: 10px; }
.waiting { color: var(--warn-ink); font-size: 0.86rem; font-weight: 700; margin-bottom: 4px; }
.gate { color: var(--danger-ink); font-weight: 700; }

.btn { background: transparent; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent-ink); cursor: pointer; font-weight: 700; min-height: 44px; padding: 8px 18px; }
.btn:hover:not(:disabled) { background: var(--soft); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); }
.btn-quiet { border-color: var(--outline); color: var(--danger-ink); }
.btn-small { font-size: 0.85rem; min-height: 36px; padding: 4px 14px; }
.btn:disabled { cursor: not-allowed; opacity: 0.45; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.linkbtn { background: none; border: 0; color: var(--accent-ink); cursor: pointer; font-weight: 700; padding: 0; text-decoration: underline; text-underline-offset: 3px; }

.composer label { display: block; font-weight: 700; margin-bottom: 8px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.quick .chipbtn { font-weight: 400; text-align: left; }
.composer textarea { background: var(--card); border: 1px solid var(--muted); color: var(--ink); border-radius: 12px; display: block; margin-bottom: 10px; padding: 10px 12px; resize: vertical; width: 100%; }
.form-error { color: var(--danger-ink); font-weight: 700; margin-bottom: 10px; }

/* awards and ledger */
.scheme { background: var(--raised); border-radius: 16px; margin-bottom: 16px; padding: 16px 20px; }
.scheme h2 { font-size: 1.05rem; margin-bottom: 4px; }
.scheme p { color: var(--muted); max-width: 820px; }
.toolbar { align-items: center; display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; }
.toolbar p { flex: 1; max-width: 640px; min-width: 220px; }
.warn { color: var(--warn-ink); font-weight: 700; }
.stages { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.stages li { border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 0.75rem; font-weight: 700; padding: 2px 10px; white-space: nowrap; }
.stages li.done { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.stages li[aria-current="step"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
details { margin-top: 4px; }
summary { color: var(--accent-ink); cursor: pointer; font-size: 0.82rem; font-weight: 700; }
.attempts { display: grid; font-size: 0.85rem; gap: 4px; margin-top: 6px; }

.empty { color: var(--muted); padding: 32px 22px; }

.bulk-list { display: grid; gap: 6px; margin: 12px 0 18px; }
dialog { background: var(--card); border: 1px solid var(--outline); border-radius: 20px; box-shadow: 0 25px 60px var(--shadow); color: var(--ink); max-width: 540px; padding: 24px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
dialog h2 { font-size: 1.4rem; letter-spacing: -0.03em; margin-bottom: 6px; }

.toast { background: var(--ink); border-radius: 12px; bottom: 16px; box-shadow: 0 10px 30px var(--shadow); color: var(--bg); font-size: 0.92rem; left: 50%; max-width: min(560px, calc(100vw - 32px)); opacity: 0; padding: 12px 18px; pointer-events: none; position: fixed; transform: translateX(-50%); z-index: 40; }
.toast.show { opacity: 1; }
@media (prefers-reduced-motion: no-preference) { .toast { transition: opacity 0.2s; } }
.toast:empty { display: none; }

@media (pointer: coarse) { .btn-small, .chipbtn { min-height: 44px; } }

@media (max-width: 1199px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 1200px) and (min-height: 640px) {
  /* Workspace mode: the header stays put and each pane scrolls, so the decision bar is always in view. */
  body { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
  .wk-shell { display: flex; flex: 1; flex-direction: column; min-height: 0; width: 100%; }
  .wk-main { flex: 1; min-height: 0; overflow: hidden; }
  .split { align-items: stretch; height: 100%; overflow: hidden; padding-bottom: 16px; padding-top: 16px; }
  .pane-list { height: 100%; overflow-y: auto; padding-right: 6px; }
  .pane-review { height: 100%; overflow-y: auto; }
  .page-wide { height: 100%; overflow-y: auto; }
}

@media (min-width: 1200px) and (max-height: 639px) {
  .pane-review { align-self: start; max-height: calc(100vh - 32px); overflow-y: auto; position: sticky; top: 16px; }
}

@media (max-width: 899px) {
  .wk-side { padding: 8px 16px; }
  .side-note { display: none; }
  .split, .page-wide { padding: 16px; }
}

@media (max-width: 760px) {
  .wk-top, .wk-banner { padding-left: 16px; padding-right: 16px; }
  .wk-user { display: none; }
  .rows thead { display: none; }
  .rows tbody tr { border-bottom: 1px solid var(--line); display: grid; gap: 8px 14px; grid-template-columns: 1fr 1fr; padding: 12px 14px; }
  .rows tbody tr:last-child { border-bottom: 0; }
  .rows td { border: 0; display: block; padding: 0; }
  .rows td[data-label]::before { color: var(--muted); content: attr(data-label); display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
  .rows td.c-check { grid-column: 1 / -1; }
  .rows td.c-check:empty { display: none; }
  .rows tr.is-selected { box-shadow: inset 4px 0 0 var(--accent); }
  .num { text-align: left; }
  .claims td[data-label="Progress"], .claims td[data-label="Stage"] { grid-column: 1 / -1; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .history li { grid-template-columns: minmax(0, 1fr); }
  .review > header, .review > section { padding-left: 16px; padding-right: 16px; }
  .decision { padding: 14px 16px; }
  .rv-score strong { font-size: 2.2rem; }
}

@media (max-width: 560px) {
  .wk-context .chip:nth-of-type(n + 2) { display: none; }
  .wk-top { gap: 8px 16px; padding-bottom: 10px; padding-top: 10px; }
  .wk-brand img { width: 130px; }
  .wk-top .theme-toggle { margin-left: auto; order: 1; }
  .wk-context { flex-basis: 100%; order: 2; }
  .wk-banner { font-size: 0.88rem; padding-bottom: 8px; padding-top: 8px; }
  .wk-side { padding: 6px 12px; }
  .wk-side ul { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; }
  .wk-side button { gap: 6px; padding: 8px 12px; }
  .page-head h1 { font-size: 1.7rem; }
}

@media (pointer: coarse) { .kbd-hint { display: none; } }
