/* =========================================================================
   COL Org Design Studio — design system
   Carlo Orlando Leadership (COL) brand: tokens, themes, layout, components,
   utilities. Plain CSS custom properties, no build step, no external fonts.
   Themes: html[data-theme="light" | "dark" | "black"].
   ========================================================================= */

/* ---------------------------------------------------------------------
   1. Tokens — light theme (default / :root)
   --------------------------------------------------------------------- */
:root,
html[data-theme="light"] {
  color-scheme: light;

  --ink: #0b1220;
  --ink-soft: #141e2e;
  --cobalt: #315cff;
  --cobalt-deep: #1d3ed0;
  --paper: #fffdf8;
  --bone: #f3f0e8;
  --line: #cbc7bd;
  --line-soft: #e1ddd4;
  --muted: #58616c;
  --signal: #f2b84b;
  --signal-soft: #fff3d6;
  --success: #1f7a5a;
  --success-soft: #e8f4ef;
  --success-ink: #1f7a5a;
  --warning: #8a5a00;
  --warning-soft: #fff3d6;
  --warning-ink: #8a5a00;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --danger-ink: #b42318;
  --info-soft: #e9efff;
  --inverse-surface: #17191f;

  --surface: var(--paper);
  --surface-raised: #ffffff;
  --surface-inset: var(--bone);
  --focus: var(--signal);
  --button-background: var(--cobalt-deep);
  --button-ink: var(--paper);
  --overlay: rgb(11 18 32 / 68%);
  --shadow: 0 8px 28px rgb(11 18 32 / 7%);
  --shadow-raised: 0 16px 40px rgb(11 18 32 / 12%);

  --cadence-daily: var(--danger);
  --cadence-weekly: var(--cobalt-deep);
  --cadence-monthly: #6b4fc9;
  --cadence-event: var(--warning);
  --cadence-unspecified: var(--muted);
}

/* ---------------------------------------------------------------------
   2. Tokens — dark theme (navy COL dark)
   --------------------------------------------------------------------- */
html[data-theme="dark"] {
  color-scheme: dark;

  --ink: #f4f7fb;
  --ink-soft: #dbe2ee;
  --cobalt: #526be8;
  --cobalt-deep: #b5c5ff;
  --paper: #141a24;
  --bone: #0c1119;
  --line: #4a5566;
  --line-soft: #2a3342;
  --muted: #aab3c2;
  --signal: #f2c45c;
  --signal-soft: #3a2d14;
  --success-ink: #b9e5cc;
  --success-soft: #123527;
  --warning-ink: #f3d28a;
  --warning-soft: #3a2d14;
  --danger-ink: #f2bdb8;
  --danger-soft: #3d1c1c;
  --info-soft: #2c3543;
  --inverse-surface: #f4f7fb;

  --surface: #19212e;
  --surface-raised: #1e2735;
  --surface-inset: var(--bone);
  --focus: #8bb8ff;
  --button-background: #b1cdff;
  --button-ink: #102b50;
  --overlay: rgb(3 6 12 / 72%);
  --shadow: 0 8px 28px rgb(0 0 0 / 30%);
  --shadow-raised: 0 16px 40px rgb(0 0 0 / 40%);

  --cadence-daily: var(--danger-ink);
  --cadence-weekly: var(--cobalt-deep);
  --cadence-monthly: #c7b8ff;
  --cadence-event: var(--signal);
  --cadence-unspecified: var(--muted);
}

/* ---------------------------------------------------------------------
   3. Tokens — Founder mode (html[data-theme="black"])
   --------------------------------------------------------------------- */
html[data-theme="black"] {
  color-scheme: dark;

  --ink: #f5f7fb;
  --ink-soft: #d8dde6;
  --cobalt: #ffffff;
  --cobalt-deep: #ffffff;
  --paper: #000000;
  --bone: #000000;
  --line: #707070;
  --line-soft: #3b3b3b;
  --muted: #e0e0e0;
  --signal: #ffd166;
  --signal-soft: #3a2c08;
  --success-ink: #b9e5cc;
  --success-soft: #06150f;
  --warning-ink: #f3d28a;
  --warning-soft: #1f1608;
  --danger-ink: #f2bdb8;
  --danger-soft: #200806;
  --info-soft: #10141c;
  --inverse-surface: #ffffff;

  --surface: #000000;
  --surface-raised: #111111;
  --surface-inset: #000000;
  --focus: #ffd166;
  --button-background: #ffffff;
  --button-ink: #000000;
  --overlay: rgb(0 0 0 / 80%);
  --shadow: none;
  --shadow-raised: none;

  --cadence-daily: var(--danger-ink);
  --cadence-weekly: #ffffff;
  --cadence-monthly: #c7b8ff;
  --cadence-event: var(--signal);
  --cadence-unspecified: var(--muted);
}

/* ---------------------------------------------------------------------
   4. Reset + base
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bone);
  color: var(--ink);
}

body {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--cobalt-deep); text-underline-offset: 2px; }
a:hover { color: color-mix(in srgb, var(--cobalt-deep) 80%, black); }

h1, h2, h3, h4 {
  margin: 0 0 8px 0;
  font-weight: 650;
  line-height: 1.2;
  color: var(--ink);
}

h2:has(> .icon), h3:has(> .icon) {
  display: flex;
  align-items: center;
  gap: 8px;
}

h1 {
  font-size: clamp(1.8rem, 3vw, 2.125rem);
  letter-spacing: -0.035em;
  line-height: 1.2;
}

h2 { font-size: 1.3125rem; letter-spacing: -0.02em; }
h3 { font-size: 1.0625rem; }

.eyebrow {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cobalt-deep);
  margin-bottom: 6px;
}

.lede {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 720px;
  margin: 0 0 16px 0;
}

.hint { color: var(--muted); font-size: 0.9rem; margin: 4px 0 0 0; }

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  .button, .chip, .icon-button, .card, a { transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* Focus ring — 3px gold outline on base elements */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
.button:focus-visible, .icon-button:focus-visible, .chip:focus-visible {
  outline-offset: 3px;
}

/* ---------------------------------------------------------------------
   5. Layout
   --------------------------------------------------------------------- */
.page-shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 36px clamp(20px, 3.5vw, 48px) 56px;
}

@media (max-width: 560px) {
  .page-shell { padding: 20px 16px 40px; }
}

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-tight { display: flex; flex-direction: column; gap: 8px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------
   6. App bar + wordmark
   --------------------------------------------------------------------- */
.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}

.app-bar-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.app-bar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.wordmark { display: flex; align-items: center; gap: 12px; }

.wordmark-badge {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}
html[data-theme="black"] .wordmark-badge {
  background: #ffffff;
  color: #000000;
}

.wordmark-text { display: flex; flex-direction: column; line-height: 1.2; }
.wordmark-title { font-size: 0.9rem; font-weight: 700; color: var(--ink); }
.wordmark-subtitle { font-size: 0.72rem; color: var(--muted); }

.brand-mark-img { width: 36px; height: 36px; border-radius: 10px; }

/* ---------------------------------------------------------------------
   7. Cards
   --------------------------------------------------------------------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 20px;
  box-shadow: none;
}
html[data-theme="black"] .card { box-shadow: none; }

.card + .card { margin-top: 16px; }

.card-raised {
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------------
   8. Buttons
   --------------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--button-background);
  color: var(--button-ink);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.button:hover { background: color-mix(in srgb, var(--button-background) 90%, #000); }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: 0.5; cursor: default; transform: none; }

.button.secondary {
  background: var(--surface-inset);
  color: var(--ink);
  border-color: var(--line-soft);
}
.button.secondary:hover { background: color-mix(in srgb, var(--surface-inset) 90%, #000); }

.button.quiet {
  background: transparent;
  color: var(--cobalt-deep);
  border-color: transparent;
}
.button.quiet:hover { background: var(--info-soft); }

.button.danger {
  background: var(--danger);
  color: #fff;
}
html[data-theme="dark"] .button.danger,
html[data-theme="black"] .button.danger {
  background: var(--danger-soft);
  color: var(--danger-ink);
  border-color: var(--danger-ink);
}
.button.danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); }

.button.compact {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.8rem;
}

.button.full { width: 100%; }

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--surface-inset);
  color: var(--ink);
  cursor: pointer;
}
.icon-button:hover { background: var(--info-soft); }

/* ---------------------------------------------------------------------
   9. Forms / fields
   --------------------------------------------------------------------- */
form { display: flex; flex-direction: column; }

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--muted);
  margin: 16px 0 6px 0;
}
label:first-child { margin-top: 0; }

input[type="text"],
input[type="number"],
input[type="search"],
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  /* INC7-A11Y: --line is only ~1.7:1 against --surface-inset (== --bone,
     the SAME colour as the page's own background in every theme) --
     under WCAG 2.2 AA 1.4.11's 3:1 floor for a UI component's boundary,
     and this border is the field's ONLY visual edge (its own fill colour
     doesn't differ from the page behind it). --muted already clears 3:1
     (in fact 4.5:1+) against every theme's --surface-inset/--paper/--bone
     -- test/a11y-ui-boundary-contrast.test.js checks this. */
  border: 1px solid var(--muted);
  border-radius: 10px;
  background: var(--surface-inset);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
}
@media (max-width: 600px) {
  input[type="text"],
  input[type="number"],
  input[type="search"],
  textarea,
  select {
    min-height: 48px;
  }
}

textarea { min-height: 96px; resize: vertical; }

input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }

input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-color: var(--cobalt-deep);
}

.field-code {
  font-size: 1.6rem;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
  font-weight: 700;
  min-height: 64px;
}

.field-help { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }

/* ---------------------------------------------------------------------
   10. Alerts / errors / status text
   --------------------------------------------------------------------- */
.error {
  color: var(--danger);
  font-weight: 600;
  margin: 8px 0 0 0;
}
html[data-theme="dark"] .error, html[data-theme="black"] .error { color: var(--danger-ink); }
.error:empty { display: none; }

.ok-text { color: var(--success); font-weight: 600; }
html[data-theme="dark"] .ok-text, html[data-theme="black"] .ok-text { color: var(--success-ink); }

.alert {
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.92rem;
  border: 1px solid var(--line-soft);
  background: var(--info-soft);
  color: var(--ink);
}
.alert.warning { background: var(--warning-soft); color: var(--warning-ink); border-color: transparent; }
.alert.danger { background: var(--danger-soft); color: var(--danger-ink); border-color: transparent; }
.alert.success { background: var(--success-soft); color: var(--success-ink); border-color: transparent; }

/* ---------------------------------------------------------------------
   11. Badges / pills / chips
   --------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-inset);
  color: var(--ink);
}
.badge.success { background: var(--success-soft); color: var(--success-ink); }
.badge.warning { background: var(--warning-soft); color: var(--warning-ink); }
.badge.danger { background: var(--danger-soft); color: var(--danger-ink); }
.badge.info { background: var(--info-soft); color: var(--cobalt-deep); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 5px 12px 5px 9px;
  border-radius: 999px;
  background: var(--surface-inset);
  border: 1px solid var(--line-soft);
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--ink);
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
}
html[data-theme="dark"] .status-dot, html[data-theme="black"] .status-dot { background: var(--danger-ink); }
.status-dot.live { background: var(--success); }
html[data-theme="dark"] .status-dot.live, html[data-theme="black"] .status-dot.live { background: var(--success-ink); }

.counter-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 28px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-inset);
  border: 1px solid var(--line-soft);
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--ink);
}
.counter-pill strong { font-size: 0.95rem; font-weight: 800; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  /* INC7-A11Y: same --line -> --muted swap as the input/textarea/select
     rule above, and for the same reason -- an unpressed chip's own fill
     (--surface-inset) doesn't reliably differ from its surroundings, so
     its border is the boundary a low-vision user relies on. */
  border: 1px solid var(--muted);
  background: var(--surface-inset);
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
}
.chip[aria-pressed="true"] {
  background: var(--cobalt-deep);
  border-color: var(--cobalt-deep);
  color: var(--button-ink);
}

/* ---------------------------------------------------------------------
   12. Sticky notes / cadence
   --------------------------------------------------------------------- */
.note-card {
  background: var(--surface-raised);
  border: 1px solid var(--line-soft);
  border-left-width: 6px;
  border-left-style: solid;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.note-card.cadence-daily { border-left-color: var(--cadence-daily); }
.note-card.cadence-weekly { border-left-color: var(--cadence-weekly); }
.note-card.cadence-monthly { border-left-color: var(--cadence-monthly); }
.note-card.cadence-event { border-left-color: var(--cadence-event); }
.note-card.cadence-unspecified { border-left-color: var(--cadence-unspecified); }

.cadence-label {
  font-size: 0.71rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cadence-label.daily { color: var(--cadence-daily); }
.cadence-label.weekly { color: var(--cadence-weekly); }
.cadence-label.monthly { color: var(--cadence-monthly); }
.cadence-label.event { color: var(--cadence-event); }
.cadence-label.unspecified { color: var(--cadence-unspecified); }

.note-body { white-space: pre-wrap; word-break: break-word; margin-top: 4px; color: var(--ink); }

.note-status { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }
.note-status.pending { color: var(--warning-ink); }
.note-status.sent { color: var(--success-ink); }
.note-status.paused { color: var(--warning-ink); }
.note-status.blocked { color: var(--warning-ink); }
.note-status.error { color: var(--danger-ink); }

.participant-name-suffix { color: var(--muted); font-weight: 600; font-size: 0.8rem; margin-left: 4px; }

/* ---------------------------------------------------------------------
   13. Key rows (session keys, baseline rows)
   --------------------------------------------------------------------- */
.key-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  /* Controller-observed fix: the Review queue rows are rendered as full-
     width <button class="key-row"> elements -- without an explicit reset,
     a plain <button> keeps the browser's own border/background/font and
     (in some engines) center-aligned text, which read as the row's text
     "touching the left edge" next to every other brand card's 20px inset.
     Horizontal padding here matches the app's existing spacing scale
     (8/10/14/16/20px) rather than the card's own 20px, since a key-row
     nests one level inside a .card that already contributes that inset. */
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
}
.key-row:last-child { border-bottom: none; }
button.key-row { cursor: pointer; }
button.key-row:hover { background: var(--surface-inset); }

.key-row .key-value {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.88rem;
  word-break: break-all;
  flex: 1 1 260px;
  color: var(--ink);
}

.code-big {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  color: var(--ink);
}

/* ---------------------------------------------------------------------
   14. Empty state
   --------------------------------------------------------------------- */
.empty-state {
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--surface-inset);
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state strong { display: block; color: var(--ink); font-size: 1rem; margin-bottom: 4px; }

/* ---------------------------------------------------------------------
   15. Toast / tooltip / modal
   --------------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: var(--inverse-surface);
  color: var(--bone);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-raised);
  z-index: 60;
}

[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bone);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { opacity: 1; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal-dialog {
  background: var(--paper);
  border-radius: 14px;
  padding: 24px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-raised);
}

/* ---------------------------------------------------------------------
   16. Icons
   --------------------------------------------------------------------- */
.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon.icon-sm { width: 16px; height: 16px; }
.icon.icon-lg { width: 28px; height: 28px; }

/* ---------------------------------------------------------------------
   17. Steps explainer (index.html)
   --------------------------------------------------------------------- */
.step-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 20px 0 28px 0;
}
@media (max-width: 720px) {
  .step-grid { grid-template-columns: 1fr; }
}

.step-card {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface);
  padding: 16px;
}
.step-card .step-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--info-soft);
  color: var(--cobalt-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.step-card h3 { margin-bottom: 4px; }
.step-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* ---------------------------------------------------------------------
   18. Board layout
   --------------------------------------------------------------------- */
.board-shell { display: flex; flex-direction: column; gap: 20px; }

.qr-panel { background: var(--surface); }
.qr-panel summary {
  cursor: pointer;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
.qr-panel-body { text-align: center; padding-top: 12px; }
.qr-panel-body img, .qr-panel-body svg { width: 220px; height: 220px; margin: 0 auto 12px; background: #fff; border-radius: 12px; }

.board-columns {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
}

.board-column {
  min-width: 260px;
  max-width: 320px;
  flex: 0 0 auto;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 14px;
}
.board-column h3 { margin: 0 0 4px 0; font-size: 1.0625rem; }
.board-column .count { color: var(--muted); font-size: 0.85rem; margin-bottom: 10px; }

.timer { font-variant-numeric: tabular-nums; font-weight: 700; }

.synthetic-banner {
  background: var(--signal-soft);
  color: var(--warning-ink);
  font-weight: 750;
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--signal);
  margin-bottom: 16px;
}

/* ---------------------------------------------------------------------
   19. Appearance menu (built by theme.js)
   --------------------------------------------------------------------- */
.appearance-menu { position: relative; display: inline-block; }

.appearance-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--surface-inset);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
}
.appearance-menu-button:hover { background: var(--info-soft); }

.appearance-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 180px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  box-shadow: var(--shadow-raised);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 40;
}
.appearance-menu-list[hidden] { display: none; }

.appearance-menu-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
}
.appearance-menu-option:hover { background: var(--surface-inset); }
.appearance-menu-option[aria-checked="true"] { background: var(--info-soft); color: var(--cobalt-deep); font-weight: 700; }

/* ---------------------------------------------------------------------
   20. Footer
   --------------------------------------------------------------------- */
.app-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

/* ---------------------------------------------------------------------
   21. Styleguide-only helpers
   --------------------------------------------------------------------- */
.swatch-text { font-weight: 650; margin: 6px 0 0 0; }
.swatch-ink { color: var(--ink); }
.swatch-muted { color: var(--muted); }
.swatch-cobalt-deep { color: var(--cobalt-deep); }

.icon-swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
}
.icon-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}
.icon-swatch span { font-size: 0.72rem; color: var(--muted); text-align: center; word-break: break-all; }

/* ---------------------------------------------------------------------
   21b. Studio workspace shell (WALL-UX): the Wall/Org/Review canvas fills
   the remaining viewport height -- calc(100dvh - app bar - one compact
   toolbar row) via flexbox (never a guessed calc() pixel number: every
   ancestor down to the active view's own toolbar row is a plain flex
   column, so the browser computes "the rest" for us) -- with a single
   compact, wrapping toolbar row per view and a min height floor so it
   never collapses on a very short viewport.
   --------------------------------------------------------------------- */
.page-shell-studio {
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  min-height: 560px;
  margin: 0;
  padding: 14px clamp(14px, 2vw, 24px) 10px;
  display: flex;
  flex-direction: column;
}

.studio-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.studio-shell .app-bar { margin-bottom: 0; padding-bottom: 10px; }
.studio-shell #view-switcher { margin-top: 0; }

/* Each view (#view-wall/#view-org/#view-review) is itself a flex column:
   its own compact toolbar row (natural height) on top, its canvas/workspace
   (flex: 1) filling everything left over. Only the ACTIVE view (not
   [hidden]) participates -- switching views hands the freed height
   straight to whichever view is now showing. */
.studio-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.studio-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  flex: 0 0 auto;
}
.studio-toolbar-row .chip-row { margin-top: 0; }
.studio-toolbar-row input[type="search"] {
  width: auto;
  flex: 1 1 180px;
  min-width: 140px;
  max-width: 260px;
  min-height: 38px;
  padding: 6px 10px;
}
.studio-toolbar-divider { width: 1px; align-self: stretch; min-height: 24px; background: var(--line-soft); margin: 0 2px; }

/* The canvas/workspace box every view's toolbar row sits above -- fills
   whatever height .studio-view has left, with a floor so it is never
   unusably short (WALL-UX acceptance: "min 480 px"). */
.studio-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 480px;
  overflow: auto;
}

/* ---------------------------------------------------------------------
   Wall canvas (INC2-2c, WALL-UX full-height + readable zoom + labels)
   --------------------------------------------------------------------- */
#wall-canvas-wrap {
  overflow: hidden;
  border-radius: 14px;
}

.wall-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* An OUTLINE, not a border: getBoundingClientRect() on a bordered box
     still returns the border-box's outer edge, but #wall-world (position:
     absolute; left:0; top:0 inside this positioned ancestor) is placed at
     the PADDING edge -- with a border and no padding those two edges
     differ by exactly the border width, a small but real, avoidable
     contributor to zoom-anchor drift (WALL-UX controller finding: 14
     ctrl+wheel ticks landing off the content). An outline never
     participates in the box model, so the two edges coincide exactly. */
  outline: 1px solid var(--line-soft);
  outline-offset: -1px;
  border-radius: 14px;
  background: var(--surface-inset);
  touch-action: none;
  cursor: grab;
}
.wall-viewport:active { cursor: grabbing; }

.wall-world {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.wall-layer { position: absolute; left: 0; top: 0; }

/* Department bands (WALL-UX "Department grouping"): a visible tinted
   region spanning exactly the lanes INC2-2's layout-wall.js grouped under
   one department, with its own title bar -- drawn in #wall-bands, BEHIND
   #wall-lanes/#wall-frames/#wall-notes (layer order in studio.html). */
.wall-band-rect {
  position: absolute;
  border-radius: 18px;
  background: color-mix(in srgb, var(--cobalt) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--cobalt) 16%, transparent);
}
.wall-band-title {
  position: absolute;
  font-weight: 800;
  color: var(--cobalt-deep);
  white-space: nowrap;
  /* font-size is set from JS (lod.js's counterScaledLabelPx), never here --
     it must stay >= 20px/32px ON SCREEN at any zoom, which (since this
     element lives inside the scaled #wall-world) means its WORLD-space
     font-size has to change every time the camera scale does. */
}

.wall-lane {
  position: absolute;
  border-right: 1px dashed var(--line-soft);
}
.wall-lane-header {
  position: absolute;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Fallback only -- studio.js/stage.js always set an explicit inline
     font-size (counter-scaled to the INC2-SPEC LOD "Labels at least"
     floor) immediately after creating this element. */
  font-size: 20px;
}

.wall-note {
  position: absolute;
  background: var(--surface-raised);
  border: 1px solid var(--line-soft);
  border-left: 6px solid var(--cadence-unspecified);
  border-radius: 10px;
  padding: 8px 10px;
  /* 18px WORLD-space, matching lod.js's BASE_NOTE_TEXT_PX -- the INC2-SPEC
     "Effective text size is 18px * scale * textScale" formula this
     element's LOD state (full/chip/dot, toggled via classes below) is
     computed against describes THIS property, scaled by the camera
     transform on #wall-world, not a flat on-screen size. */
  font-size: 18px;
  line-height: 1.3;
  overflow: hidden;
  cursor: pointer;
  box-shadow: none;
}
.wall-note.cadence-daily { border-left-color: var(--cadence-daily); }
.wall-note.cadence-weekly { border-left-color: var(--cadence-weekly); }
.wall-note.cadence-monthly { border-left-color: var(--cadence-monthly); }
.wall-note.cadence-event { border-left-color: var(--cadence-event); }
.wall-note.cadence-unspecified { border-left-color: var(--cadence-unspecified); }
.wall-note.lod-chip { padding: 4px 8px; }
/* lod-dot: no width/height here -- studio.js/stage.js set both inline,
   counter-scaled (lod.js's dotWorldSize) so the block never renders under
   6x6 SCREEN px however far zoomed out (WALL-UX controller finding: "1px
   dots" at fit-all/0.1 scale). */
.wall-note.lod-dot { padding: 0; border-radius: 999px; }
.wall-note.is-selected { outline: 3px solid var(--focus); outline-offset: 1px; }
.wall-note.has-overlap { box-shadow: 0 0 0 2px var(--warning) inset; }
.wall-note.dragging { opacity: 0.6; }

.wall-frame {
  position: absolute;
  border: 2px dashed var(--cobalt);
  border-radius: 12px;
  background: color-mix(in srgb, var(--cobalt) 6%, transparent);
}
.wall-frame-label {
  position: absolute;
  top: -24px;
  left: 4px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--cobalt-deep);
}

/* Minimap (WALL-UX: "small, in a corner, semi-transparent, never covering
   more than ~15% of the canvas"): sized relative to its positioned
   ancestor (#wall-canvas-wrap) so it never approaches that 15% ceiling
   even in a narrow ~620px-wide pane, capped at 200x130 on a normal-sized
   canvas -- studio.js reads the ACTUAL rendered box (getBoundingClientRect)
   rather than assuming 200x130, so its dot/viewport-rect math (public/lib/
   camera.js's minimapScale/minimapViewportRect) always matches what is
   really on screen. */
.wall-minimap {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: min(200px, 15%);
  height: min(130px, 15%);
  /* No min-width/min-height floor here on purpose: this task's own
     acceptance scenario is an ~620px-wide pane, where 15% is only ~93px --
     a floor bigger than that would break the "never covering more than
     ~15% of the canvas" ceiling at exactly that width. studio.js reads the
     ACTUAL rendered box (getBoundingClientRect), so its dot/viewport-rect
     math always matches whatever size this resolves to. */
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
}
.wall-minimap-dot { position: absolute; width: 3px; height: 3px; border-radius: 999px; background: var(--cobalt); }
.wall-minimap-viewport { position: absolute; border: 1px solid var(--cobalt-deep); background: color-mix(in srgb, var(--cobalt) 12%, transparent); }

/* Right-side inspector: a static column (Org) or an overlay drawer (Wall,
   `.studio-drawer` added alongside) -- WALL-UX "the note inspector becomes
   a right-side drawer over the canvas (not stacked below)". */
.wall-inspector {
  flex: 0 0 320px;
  width: 320px;
  max-width: 45%;
  height: 100%;
  overflow: auto;
  position: relative;
}
.studio-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  height: auto;
  width: min(360px, 88%);
  max-width: 88%;
  flex: none;
  padding-top: 54px;
  box-shadow: var(--shadow-raised);
  transform: translateX(100%);
  transition: transform 200ms ease;
  z-index: 20;
}
.studio-drawer.is-open { transform: translateX(0); }
.studio-drawer-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
}

/* Shared Projector drawer/popover (WALL-UX: moved out of the Wall toolbar,
   shared by Wall/Org/Review, opened by a "Projector" button on each).
   Fixed to the viewport's own bottom-right corner rather than positioned
   under any one button, so it never depends on the exact height of the app
   bar / toolbar row above it. */
.projector-drawer {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(360px, calc(100vw - 32px));
  max-height: min(70vh, 640px);
  overflow: auto;
  background: var(--surface-raised);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  box-shadow: var(--shadow-raised);
  padding: 14px;
  z-index: 60;
}
.projector-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.marquee-box {
  position: absolute;
  border: 1px dashed var(--cobalt-deep);
  background: color-mix(in srgb, var(--cobalt) 10%, transparent);
  pointer-events: none;
}

/* ---------------------------------------------------------------------
   Org view (INC2-2d, WALL-UX full-height): "Each department is a column"
   -- department columns scroll HORIZONTALLY within the full-height
   workspace, each column's own team cards scrolling vertically within it.
   --------------------------------------------------------------------- */
.org-workspace {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 16px;
  overflow: hidden;
}
.org-columns {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  min-width: 0;
  height: 100%;
  padding-bottom: 10px; /* room for a horizontal scrollbar without clipping the last column */
}
.org-dept {
  flex: 0 0 340px;
  width: 340px;
  max-width: 82vw;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--paper);
  overflow: hidden;
}
.org-dept-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  background: var(--surface-inset);
  flex: 0 0 auto;
}
.org-dept-header h3 { margin: 0; font-size: 1rem; }
.org-dept-chevron {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
}
.org-dept-chevron .icon { transition: transform 160ms ease; }
.org-dept[data-expanded="false"] .org-dept-chevron .icon { transform: rotate(-90deg); }
.org-dept-body {
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 14px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.org-dept[data-expanded="false"] .org-dept-body { display: none; }

.org-team {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 12px 14px;
  min-width: 220px;
  flex: 1 1 240px;
  background: var(--surface);
}
.org-team h4 { margin: 0 0 6px 0; font-size: 0.92rem; }
.org-team-cards { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.org-person-card {
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--surface-raised);
  /* INC7-A11Y: this border carries real information (solid/dashed/dotted
     below encodes staff/contractor/volunteer), on top of it being the
     card's own visual edge -- same --line -> --muted swap as the two
     rules above. */
  border: 1.5px solid var(--muted);
  cursor: pointer;
}
.org-person-card.staff { border-style: solid; }
.org-person-card.contractor { border-style: dashed; }
.org-person-card.volunteer { border-style: dotted; background: transparent; }
.org-person-card.is-selected { outline: 3px solid var(--focus); outline-offset: 1px; }

.org-reporting-svg { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.org-reporting-svg path { fill: none; stroke: var(--cobalt-deep); stroke-width: 1.5; }
.org-reporting-svg path.dotted { stroke-dasharray: 2 3; }
.org-reporting-svg path.dashed { stroke-dasharray: 6 4; }

/* Review also sits inside the same full-height .studio-canvas-wrap (it
   keeps its existing two-column .grid-2 layout) -- each column scrolls
   internally rather than the whole page growing past the viewport. */
.studio-canvas-wrap.grid-2 > .card { height: 100%; overflow-y: auto; }

@media (max-width: 720px) {
  .org-dept { flex-basis: 88vw; width: 88vw; }
  .wall-inspector.studio-drawer { width: 100%; max-width: 100%; }
  .studio-canvas-wrap.grid-2 > .card { height: auto; max-height: 50%; }
}

/* ---------------------------------------------------------------------
   21c. Projector stage (INC2-2e). Light theme forced by NOT loading
   theme.js (see stage.html); no controls of any kind. At 1080p, body text
   is >= 24px and headlines >= 32px (INC2-SPEC "Projector").
   --------------------------------------------------------------------- */
.stage-body { margin: 0; background: var(--paper); color: var(--ink); font-size: 20px; overflow: hidden; }
.stage-root { position: relative; width: 100vw; height: 100vh; }
.stage-scene { position: absolute; inset: 0; }

/* INC7-A11Y: every .stage-scene is position:absolute/inset:0 (full-bleed,
   above normal document flow), so the shared .synthetic-banner rule
   (a normal-flow block with margin-bottom) would be painted over by
   whichever scene is showing. Pinned to a thin strip along the very top
   edge instead, above every scene (z-index), legible at 1080p+
   projector distance but never tall enough to reach into
   .stage-join's vertically-centered QR or any scene's own cue content. */
.stage-synthetic-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  margin: 0;
  border-radius: 0;
  font-size: 18px;
  padding: 8px;
}

.stage-blank { display: flex; align-items: center; justify-content: center; }
.stage-brand-mark { width: 96px; height: 96px; opacity: 0.5; }

.stage-join { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; }
.stage-qr img { width: min(46vh, 46vw); height: min(46vh, 46vw); background: #fff; border-radius: 16px; }
.stage-code { font-size: 64px; font-weight: 900; letter-spacing: 0.12em; margin: 0; }
.stage-join-url { font-size: 28px; color: var(--muted); margin: 0; }

.stage-wall-viewport { position: absolute; inset: 0; overflow: hidden; }
/* No font-size here: stage.js sets it inline, counter-scaled the same way
   as the console (WALL-UX: "verify the wall scene is readable on a
   1920x1080 stage -- labels >= 32px, notes legible when the cue fits a
   department"). A flat CSS size here (this element lives inside the
   scaled #stage-wall-world, same as the console's #wall-world) would
   shrink right along with a tall/narrow department-sized cue the same way
   the old flat ".wall-note.lod-dot" 14px did on the console. */
.stage-note { line-height: 1.35; padding-top: 34px; }
.stage-cadence-label {
  position: absolute;
  top: 6px;
  left: 10px;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
/* Cadence is always shown as text plus a pattern, never color alone
   (INC2-SPEC "Cadence is always shown as text plus a pattern."). */
.stage-cadence-pattern-daily { background-image: repeating-linear-gradient(45deg, color-mix(in srgb, var(--cadence-daily) 10%, transparent) 0 6px, transparent 6px 12px); }
.stage-cadence-pattern-weekly { background-image: repeating-linear-gradient(90deg, color-mix(in srgb, var(--cadence-weekly) 10%, transparent) 0 6px, transparent 6px 12px); }
.stage-cadence-pattern-monthly { background-image: radial-gradient(color-mix(in srgb, var(--cadence-monthly) 14%, transparent) 2px, transparent 2px); background-size: 10px 10px; }
.stage-cadence-pattern-event { background-image: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--cadence-event) 10%, transparent) 0 6px, transparent 6px 12px); }
.stage-cadence-pattern-unspecified { background-image: none; }

.stage-org-banner { font-size: 30px; font-weight: 800; padding: 28px 40px 0; }
/* The console's .org-columns/.org-dept (WALL-UX) became a horizontal-
   scrolling row of fixed-width columns -- exactly wrong for a projector
   nobody can scroll. Override back to a wrapping, auto-height flow so
   every department is visible at once on a fixed 1920x1080 stage. */
.stage-org-columns {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  overflow: visible;
  height: auto;
  padding: 20px 40px 40px;
  gap: 20px;
}
.stage-org-dept {
  flex: 1 1 420px;
  width: auto;
  max-width: 100%;
  height: auto;
  overflow: visible;
}
.stage-org-dept .org-dept-body { flex: none; overflow: visible; }
.stage-org-dept h3 { font-size: 30px; }
.stage-org-dept .org-team h4 { font-size: 26px; }
.stage-org-dept .org-team p.hint { font-size: 22px; }

.stage-review { padding: 40px 56px; overflow: auto; }
.stage-headline { font-size: 40px; margin: 0 0 24px; }
.stage-review-claims { display: flex; flex-wrap: wrap; gap: 16px; }
.stage-claim-card { min-width: 320px; flex: 1 1 320px; }
.stage-claim-card strong { font-size: 28px; }
.stage-claim-card .note-body { font-size: 26px; }
.stage-review-questions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.stage-question-chip { font-size: 24px; padding: 12px 20px; }
.stage-review-decision { margin-top: 24px; font-size: 26px; }

/* ---------------------------------------------------------------------
   22. Utilities
   --------------------------------------------------------------------- */
.u-hidden { display: none !important; }
.u-center { text-align: center; }
.u-mt-0 { margin-top: 0; }
.u-mt-sm { margin-top: 8px; }
.u-mt-md { margin-top: 16px; }
.u-mt-lg { margin-top: 28px; }
.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;
}

[hidden] { display: none !important; }
