/* Review boards: one layout for every brand. Only the tokens below change per brand
   (data-brand on <html>); a board's accent colour arrives as --board-accent. */

:root,
[data-brand="cmpsw"],
[data-brand="neutral"] {
  color-scheme: dark;
  --bg: #0d0e10;
  --bar: #131518;
  --panel: #17191d;
  --panel-2: #1f2227;
  --line: rgb(255 255 255 / 0.08);
  --line-2: rgb(255 255 255 / 0.16);
  --text: #eceef0;
  --muted: #a3a9b1;
  --faint: #828993;
  --accent: var(--board-accent, #2ac0db);
  --on-accent: #0d0e10;
  --ok: #3ccf87;
  --on-ok: #06150d;
  --rev: #f2b544;
  --on-rev: #1a1203;
  --arch: #8d939c;
  --danger: #ff6b5e;
  --radius: 14px;
  --radius-btn: 10px;
  --stroke: 1px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.28);
  --scrim: rgb(5 6 8 / 0.94);
}

[data-brand="freebird"] {
  color-scheme: light;
  --bg: #fff8ee;
  --bar: #fff8ee;
  --panel: #f7ecda;
  --panel-2: #efe2cb;
  --line: rgb(23 19 14 / 0.16);
  --line-2: rgb(23 19 14 / 0.3);
  --text: #17130e;
  --muted: #5c5248;
  --faint: #6f655a;
  --accent: var(--board-accent, #ff4b1e);
  --on-accent: #17130e;
  --ok: #17803f;
  --on-ok: #fff8ee;
  --rev: #c26a00;
  --on-rev: #fff8ee;
  --arch: #74695e;
  --danger: #c4321b;
  --radius: 14px;
  --radius-btn: 999px;
  --stroke: 1.5px;
  --shadow: 0 1px 2px rgb(23 19 14 / 0.12), 0 10px 28px rgb(23 19 14 / 0.12);
  --scrim: rgb(23 19 14 / 0.94);
}

*,
*::before,
*::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.45 Archivo, "Helvetica Neue", Arial, sans-serif;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--accent);
  accent-color: var(--accent);
  scrollbar-color: var(--line-2) transparent;
}
::selection { background: color-mix(in srgb, var(--accent) 38%, transparent); color: var(--text); }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 8px 12px; background: var(--accent); color: var(--on-accent); font-weight: 700; border-radius: var(--radius-btn); }
.skip:focus { top: 8px; }

.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wrap { max-width: 1720px; margin: 0 auto; padding: 0 28px; }

/* ---- Masthead: identity + tools. Scrolls away. ---- */
.masthead { border-bottom: var(--stroke) solid var(--line); }
.masthead-row { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; margin-right: auto; }
.brand-logo { width: 30px; height: 30px; object-fit: contain; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.board-title {
  font-weight: 800; font-size: 16px; line-height: 1.15; letter-spacing: 0.03em; text-transform: uppercase;
  font-variation-settings: "wdth" 112; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.board-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mast-tools { display: flex; align-items: center; gap: 6px; }
.tool, .who {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px;
  background: none; border: var(--stroke) solid transparent; border-radius: var(--radius-btn);
  font-size: 13px; font-weight: 600; color: var(--muted);
  transition: background-color 150ms, color 150ms, border-color 150ms;
}
.tool:hover, .who:hover, .tool[aria-expanded="true"] { background: var(--panel); color: var(--text); }
.who { border-color: var(--line); color: var(--text); }
.who[data-guest] { color: var(--muted); border-style: dashed; }
.who .i { color: var(--muted); }
.caret { width: 14px; height: 14px; opacity: 0.7; }

/* ---- Navbar: rounds, views, save state. Sticky. ---- */
.navbar {
  position: sticky; top: 0; z-index: 20; background: var(--bar);
  border-bottom: var(--stroke) solid var(--line);
}
.navbar-row { display: flex; align-items: center; gap: 24px; min-height: 60px; }
.round-nav { display: flex; align-items: center; gap: 4px; min-width: 0; }
.nav-label {
  margin-right: 8px; font-size: 11px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap; cursor: pointer;
}
/* "View designs" cue: the text and three chevrons flash toward the round picker, which pulses, so
   nobody mistakes a board for a single page. A few cycles on arrival, then still; a couple more each
   time the visitor scrolls back to the top. Calms down once the visitor has opened a second round. */
.nav-label.cue { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 12px; font-weight: 800; }
.cue-arrows { display: inline-flex; }
.cue-arrows .i { width: 14px; height: 14px; margin-left: -6px; stroke-width: 3; }
.cue-arrows .i:first-child { margin-left: 0; }
.navbar[data-cue="on"] .cue-text { animation: cue-blink 1.2s ease-in-out var(--cue-n, 4); }
.navbar[data-cue="on"] .cue-arrows .i { animation: cue-chevron 1.2s ease-in-out var(--cue-n, 4); }
.navbar[data-cue="on"] .cue-arrows .i:nth-child(2) { animation-delay: 0.2s; }
.navbar[data-cue="on"] .cue-arrows .i:nth-child(3) { animation-delay: 0.4s; }
.navbar[data-cue="on"] .round-pick select { animation: cue-ring 1.6s ease-out var(--cue-n, 3); }
/* Back at the top after scrolling: a couple more cycles in case the first ones were missed. */
.navbar[data-cue-replay] { --cue-n: 2; }
.navbar[data-cue="none"] .cue-arrows { display: none; }
@keyframes cue-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes cue-chevron { 0%, 100% { opacity: 0.15; translate: 0 0; } 40% { opacity: 1; translate: 3px 0; } }
@keyframes cue-ring {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 65%, transparent); }
  70%, 100% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 0%, transparent); }
}
.round-pick { position: relative; display: block; min-width: 0; }
.round-pick select {
  appearance: none; height: 40px; width: auto; max-width: 340px; padding: 0 36px 0 14px;
  background: var(--panel); border: var(--stroke) solid var(--line-2); border-radius: var(--radius-btn);
  font-weight: 750; font-size: 13.5px; letter-spacing: 0.04em; text-transform: uppercase;
  font-variation-settings: "wdth" 108; text-overflow: ellipsis;
  transition: border-color 150ms;
}
.round-pick select {
  background: color-mix(in srgb, var(--accent) 18%, var(--panel));
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
}
.round-pick select:hover, .round-pick select:focus-visible {
  background: color-mix(in srgb, var(--accent) 28%, var(--panel)); border-color: var(--accent);
}
.round-pick .caret { color: var(--accent); }
.round-pick .caret { position: absolute; right: 12px; top: 50%; translate: 0 -50%; pointer-events: none; }
.round-pick option { background: var(--panel); color: var(--text); }
.step {
  display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 10px;
  background: none; border: 0; border-radius: var(--radius-btn); color: var(--muted);
  font-size: 12.5px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
  transition: background-color 150ms, color 150ms;
}
.step:hover:not(:disabled) { background: var(--panel); color: var(--text); }
.step:disabled { opacity: 0.32; cursor: default; }
.navbar[data-mode="list"] .round-nav { opacity: 0.55; }

.views { display: flex; align-items: stretch; gap: 2px; align-self: stretch; }
.views button {
  position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px;
  background: none; border: 0; color: var(--muted);
  font-size: 13px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
  transition: color 150ms;
}
.views button::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  background: var(--accent); transform: scaleX(0); transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.views button:hover { color: var(--text); }
.views button[aria-selected="true"] { color: var(--text); }
.views button[aria-selected="true"]::after { transform: scaleX(1); }
.count {
  min-width: 20px; padding: 1px 6px; border-radius: 99px; background: var(--panel-2);
  font-size: 11.5px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted);
}
.count:empty { display: none; }
.count[data-count="rev"][data-open]:not(:empty) { background: color-mix(in srgb, var(--rev) 22%, transparent); color: var(--rev); }

.save {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 6px 4px;
  background: none; border: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.save .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.save[data-state="saved"] .dot { background: var(--ok); }
.save[data-state="saving"] .dot { background: var(--accent); animation: pulse 900ms ease-in-out infinite alternate; }
.save[data-state="offline"] .dot { background: var(--rev); }
.save[data-state="error"] { color: var(--danger); }
.save[data-state="error"] .dot { background: var(--danger); }
@keyframes pulse { to { opacity: 0.25; } }

/* ---- Round header ---- */
#main { padding-top: 36px; padding-bottom: 96px; outline: none; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.view-title {
  margin: 0; font-size: 30px; line-height: 1.05; font-weight: 800; letter-spacing: 0.01em;
  text-transform: uppercase; font-variation-settings: "wdth" 115; text-wrap: balance;
}
.view-title .rid { color: var(--accent); }
.view-meta { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.view-meta b { color: var(--text); font-weight: 650; }
.round-note { max-width: 78ch; margin: 10px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.round-note[data-clamped] { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.more { padding: 0; margin-top: 4px; background: none; border: 0; color: var(--text); font-size: 12.5px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.head-actions { display: flex; gap: 8px; flex: none; }

/* ---- Grid + cards ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px 20px; }
.card {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--panel); border: var(--stroke) solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: border-color 200ms, box-shadow 200ms;
}
.card:hover { border-color: var(--line-2); }
.card.flash { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.card[data-status="arch"] .card-media img { opacity: 0.45; filter: grayscale(0.6); }
.card-media {
  position: relative; display: block; width: 100%; padding: 0; border: 0;
  aspect-ratio: var(--ratio, 1); background: var(--panel-2); cursor: zoom-in; overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: contain; transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1), opacity 200ms; }
.card-media:hover img { transform: scale(1.015); }
.card-media .zoom {
  position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: var(--radius-btn); background: var(--scrim); color: #fff; opacity: 0; transition: opacity 150ms;
}
.card-media:hover .zoom, .card-media:focus-visible .zoom { opacity: 0.9; }
.badge {
  position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px 4px 7px; border-radius: var(--radius-btn);
  font-size: 11px; font-weight: 750; letter-spacing: 0.07em; text-transform: uppercase;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.25), 0 4px 12px rgb(0 0 0 / 0.18);
}
.badge .i { width: 13px; height: 13px; stroke-width: 2.6; }
.badge[data-k="ok"] { background: var(--ok); color: var(--on-ok); }
.badge[data-k="rev"] { background: var(--rev); color: var(--on-rev); }
.badge[data-k="fixed"] { background: var(--panel); color: var(--text); }
.badge[data-k="arch"] { background: var(--panel); color: var(--muted); }

.card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.card-id { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.num {
  font-weight: 800; font-size: 15px; letter-spacing: 0.06em; font-variant-numeric: tabular-nums;
  font-variation-settings: "wdth" 112; text-transform: uppercase; white-space: nowrap;
}
.base { font-size: 11.5px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.title { margin: 0; font-size: 14px; line-height: 1.38; font-weight: 550; }
.desc { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.source { margin: 0; font-size: 12px; color: var(--faint); }
.source b, .lineage b { font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; font-size: 10.5px; margin-right: 4px; }
.lineage { margin: 0; font-size: 12.5px; color: var(--muted); }
.lineage a { color: var(--text); font-weight: 650; }

.decide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: auto; padding-top: 12px; }
.choice {
  display: inline-flex; align-items: center; justify-content: center; min-width: 0; height: 32px; padding: 0 6px;
  background: none; border: var(--stroke) solid var(--line-2); border-radius: 8px; color: var(--text);
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
  transition: background-color 150ms, color 150ms, border-color 150ms;
}
.choice[data-k="arch"]:not([aria-pressed="true"]) { color: var(--muted); }
.choice:hover { background: var(--panel-2); color: var(--text); border-color: var(--text); }
.choice[data-k="ok"][aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.choice[data-k="rev"][aria-pressed="true"] { background: var(--rev); border-color: var(--rev); color: var(--on-rev); }
.choice[data-k="arch"][aria-pressed="true"] { background: var(--panel-2); border-color: var(--line-2); color: var(--text); }
.card-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.card-tools .icon-btn { width: 32px; height: 32px; }
.card-tools .icon-btn .i { width: 15px; height: 15px; }
.id-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  background: none; border: var(--stroke) solid var(--line-2); border-radius: var(--radius-btn); color: var(--muted);
  transition: background-color 150ms, color 150ms;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn[aria-pressed="true"], .icon-btn[data-has] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--line-2)); }

.req {
  margin: 4px 0 0; padding: 10px 12px; border-radius: calc(var(--radius) - 1px);
  background: color-mix(in srgb, var(--rev) 12%, transparent); font-size: 13px; line-height: 1.45;
}
.req[data-state="done"] { background: color-mix(in srgb, var(--ok) 10%, transparent); }
.req[data-state="withdrawn"] { background: var(--panel-2); color: var(--muted); }
.req-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.req-meta { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }
.req-meta a { color: var(--text); font-weight: 650; }

.compose { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.compose label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
textarea {
  width: 100%; min-height: 72px; padding: 9px 11px; resize: vertical;
  background: var(--bg); border: var(--stroke) solid var(--line-2); border-radius: calc(var(--radius) - 1px);
  font-size: 13.5px; line-height: 1.45; transition: border-color 150ms;
}
textarea:focus { outline: none; border-color: var(--accent); }
textarea::placeholder, input::placeholder { color: var(--faint); }
.compose-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.compose-hint { font-size: 11.5px; color: var(--faint); }
.attrib { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }
.primary, .secondary, .link {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: var(--radius-btn); font-size: 12.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.primary { background: var(--accent); color: var(--on-accent); border: var(--stroke) solid var(--accent); }
.primary:hover { filter: brightness(1.08); }
.primary:disabled { opacity: 0.4; cursor: not-allowed; filter: none; }
.secondary { background: none; color: var(--text); border: var(--stroke) solid var(--line-2); }
.secondary:hover { background: var(--panel-2); }
.link { background: none; border: 0; padding: 0 4px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }

/* Approved / archived lists: small secondary actions, never the full decision row. */
.mini-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.mini {
  height: 28px; padding: 0 10px; background: none; border: var(--stroke) solid var(--line-2); border-radius: var(--radius-btn);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
}
.mini:hover { color: var(--text); background: var(--panel-2); }
.in-round { margin-left: auto; font-size: 11.5px; color: var(--faint); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.in-round:hover { color: var(--text); }

.group-head { display: flex; align-items: baseline; gap: 12px; margin: 40px 0 16px; padding-bottom: 10px; border-bottom: var(--stroke) solid var(--line); }
.group-head:first-of-type { margin-top: 8px; }
.group-head h2 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; font-variation-settings: "wdth" 112; }
.group-head span { color: var(--muted); font-size: 13px; }

.archived-fold { margin-top: 36px; }
.archived-fold > summary {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.archived-fold > summary::-webkit-details-marker { display: none; }
.archived-fold > summary .i { transition: rotate 200ms; }
.archived-fold[open] > summary .i { rotate: 90deg; }
.archived-fold .grid { margin-top: 18px; }

.next-round {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; margin-top: 48px; padding: 22px 24px;
  background: var(--panel); border: var(--stroke) solid var(--line); border-radius: var(--radius); text-align: left;
  transition: border-color 150ms, background-color 150ms;
}
.next-round { border-color: color-mix(in srgb, var(--accent) 60%, transparent); animation: cue-ring 1.8s ease-out infinite; }
.next-round:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
.next-round small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; }
.next-round strong { display: block; color: var(--accent); font-size: 20px; font-weight: 800; text-transform: uppercase; font-variation-settings: "wdth" 112; }
.next-round .i { width: 26px; height: 26px; color: var(--accent); animation: cue-nudge 1.2s ease-in-out infinite; }
@keyframes cue-nudge { 0%, 100% { translate: 0 0; } 50% { translate: 6px 0; } }

/* ---- Revisions queue + activity ---- */
.rows { display: flex; flex-direction: column; border-top: var(--stroke) solid var(--line); }
.row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 18px; align-items: start; padding: 16px 0; border-bottom: var(--stroke) solid var(--line); }
.row-thumb { width: 76px; aspect-ratio: 1; padding: 0; border: 0; border-radius: calc(var(--radius) - 1px); background: var(--panel-2); overflow: hidden; cursor: pointer; }
.row-thumb img { width: 100%; height: 100%; object-fit: contain; }
.row-main { min-width: 0; }
.row-main .num { font-size: 14px; }
.row-main .req-text { margin-top: 4px; font-size: 14px; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.state {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 750; letter-spacing: 0.07em; text-transform: uppercase; white-space: nowrap;
}
.state[data-s="open"] { background: color-mix(in srgb, var(--rev) 18%, transparent); color: var(--rev); }
.state[data-s="done"] { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.state[data-s="withdrawn"] { background: var(--panel-2); color: var(--muted); }
.activity { list-style: none; margin: 0; padding: 0; border-top: var(--stroke) solid var(--line); max-width: 920px; }
.activity li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; padding: 11px 0; border-bottom: var(--stroke) solid var(--line); font-size: 14px; }
.activity time { color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.activity q { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; quotes: "\201C" "\201D"; overflow-wrap: anywhere; }
.activity .who-name { font-weight: 700; }
.activity a { font-weight: 700; text-decoration: none; letter-spacing: 0.04em; }
.activity a:hover { text-decoration: underline; }

.empty { max-width: 520px; padding: 56px 0; }
.empty h2 { margin: 0 0 8px; font-size: 20px; font-weight: 800; text-transform: uppercase; font-variation-settings: "wdth" 112; }
.empty p { margin: 0 0 16px; color: var(--muted); }

/* ---- Popovers, drawer, viewer, toasts ---- */
.pop {
  position: fixed; inset: auto; margin: 0; padding: 0; width: max-content; max-width: min(360px, calc(100vw - 24px));
  background: var(--panel); color: var(--text); border: var(--stroke) solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow);
}
.who-pop form { display: flex; flex-direction: column; gap: 8px; padding: 16px; width: 320px; max-width: 100%; }
.who-pop label { font-weight: 750; font-size: 13px; letter-spacing: 0.05em; text-transform: uppercase; }
.pop-help { margin: 0; font-size: 12.5px; color: var(--muted); }
.who-pop input {
  height: 40px; padding: 0 12px; background: var(--bg); border: var(--stroke) solid var(--line-2); border-radius: calc(var(--radius) - 1px); font-size: 16px;
}
.who-pop input:focus { outline: none; border-color: var(--accent); }
.pop-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.menu { padding: 6px; min-width: 280px; }
.menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; background: none; border: 0;
  border-radius: calc(var(--radius) - 2px); font-size: 14px; font-weight: 550; text-align: left;
}
.menu button:hover, .menu button:focus-visible { background: var(--panel-2); outline: none; }
.menu small { margin-left: auto; color: var(--faint); font-size: 12px; }

dialog { color: var(--text); }
dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0; width: min(460px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh;
  padding: 0; border: 0; border-left: var(--stroke) solid var(--line-2); background: var(--panel); box-shadow: var(--shadow);
}
.drawer[open] { animation: slide-in 260ms cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes slide-in { from { translate: 40px 0; opacity: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: var(--stroke) solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.drawer-body { padding: 8px 22px 32px; overflow-y: auto; max-height: calc(100dvh - 70px); }
.facts { margin: 0; }
.facts div { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: var(--stroke) solid var(--line); }
.facts dt { font-size: 11.5px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.facts dd { margin: 0; font-size: 14px; line-height: 1.5; white-space: pre-line; }
.swatch { display: inline-block; width: 11px; height: 11px; margin-right: 6px; border-radius: 2px; vertical-align: -1px; box-shadow: inset 0 0 0 1px var(--line-2); }
.howto { margin: 26px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; color: var(--muted); }
.howto b { color: var(--text); }
.howto-title { margin: 28px 0 0; font-size: 11.5px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.viewer {
  width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; padding: 0; border: 0;
  background: var(--bg); display: none;
}
.viewer[open] { display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
.viewer::backdrop { background: transparent; }
.viewer-stage { position: relative; display: grid; place-items: center; padding: 32px 76px; min-height: 0; }
.viewer-stage img { max-width: 100%; max-height: calc(100dvh - 64px); object-fit: contain; }
.viewer .icon-btn { background: rgb(0 0 0 / 0.35); color: #fff; border-color: rgb(255 255 255 / 0.2); }
.viewer .icon-btn:hover { background: rgb(0 0 0 / 0.6); }
.v-prev, .v-next { position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 44px; }
.v-prev { left: 16px; }
.v-next { right: 16px; }
.v-close { position: absolute; right: 16px; top: 16px; width: 40px; height: 40px; }
.viewer-side { background: var(--panel); border-left: var(--stroke) solid var(--line); padding: 72px 24px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.viewer-side .num { font-size: 20px; }
.viewer-side .decide { margin-top: 12px; }
.viewer-side .counter { font-size: 12px; color: var(--faint); letter-spacing: 0.06em; text-transform: uppercase; }
.viewer-side .full { margin-top: 6px; font-size: 13px; color: var(--muted); }

.toasts { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: var(--radius);
  background: var(--text); color: var(--bg); font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); pointer-events: auto;
  animation: toast-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.toast button { background: none; border: 0; color: inherit; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
@keyframes toast-in { from { translate: 0 12px; opacity: 0; } }

.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; padding-top: 70px; }
.skeleton-grid i { aspect-ratio: 0.8; border-radius: var(--radius); background: linear-gradient(100deg, var(--panel) 40%, var(--panel-2) 50%, var(--panel) 60%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.fatal { padding: 80px 0; max-width: 560px; }
.fatal h1 { font-size: 24px; text-transform: uppercase; margin: 0 0 8px; }
.fatal p { color: var(--muted); }

/* ---- Narrow screens ---- */
@media (max-width: 1180px) {
  .navbar-row { flex-wrap: wrap; gap: 0 16px; min-height: 0; padding-top: 8px; }
  .round-nav { flex: 1; }
  .save { order: 2; }
  .views { order: 3; flex-basis: 100%; height: 44px; margin: 0 -12px; overflow-x: auto; scrollbar-width: none; }
  .views::-webkit-scrollbar { display: none; }
  html { scroll-padding-top: 116px; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .masthead-row { min-height: 56px; gap: 8px; }
  .brand-logo { width: 26px; height: 26px; }
  .board-title { font-size: 14px; }
  .board-sub { display: none; }
  .tool span:not(.sr), .tool .caret { display: none; }
  .tool { width: 40px; padding: 0; justify-content: center; }
  .who { width: 40px; padding: 0; justify-content: center; }
  .who span { display: none; }
  .who .i { color: inherit; }
  .nav-label { margin-right: 4px; max-width: 48px; font-size: 10px; line-height: 1.15; white-space: normal; }
  .nav-label.cue { max-width: 74px; gap: 3px; font-size: 10px; }
  .cue-arrows .i { width: 11px; height: 11px; margin-left: -5px; }
  .round-pick { flex: 1; min-width: 0; }
  .round-pick select { width: 100%; min-width: 0; max-width: none; height: 44px; padding: 0 30px 0 12px; font-size: 13px; letter-spacing: 0.02em; }
  .round-pick .caret { right: 9px; }
  .step { width: 34px; height: 44px; padding: 0; justify-content: center; }
  .navbar-row { gap: 0 8px; }
  .step-label { display: none; }
  .save .save-text { display: none; }
  .save { padding: 10px 2px; }
  #main { padding-top: 22px; }
  .view-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .view-title { font-size: 23px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px 14px; }
  .choice { height: 40px; font-size: 11.5px; }
  .card-tools .icon-btn { width: 40px; height: 40px; }
  .mini { height: 36px; }
  .row { grid-template-columns: 60px minmax(0, 1fr); gap: 12px; }
  .row-thumb { width: 60px; }
  .row-side { grid-column: 2; align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .activity li { grid-template-columns: 1fr; gap: 2px; }
  .viewer[open] { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .viewer-stage { padding: 56px 8px 8px; }
  .viewer-stage img { max-height: 58dvh; }
  .v-prev, .v-next { top: auto; bottom: 8px; translate: none; }
  .viewer-side { border-left: 0; border-top: var(--stroke) solid var(--line); padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 42dvh; }
  .next-round { margin-top: 32px; padding: 18px; }
  .next-round strong { font-size: 17px; }
  .facts div { grid-template-columns: 1fr; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
  .cue-text, .cue-arrows .i, .round-pick select, .next-round, .next-round .i { animation: none !important; }
  .cue-arrows .i { opacity: 1; }
}
