/* ── Theme Variables ────────────────────────────────
   Dark theme (default) · Light theme via [data-theme="light"]
   Shared across all pages — extracted from inline :root blocks.
   ──────────────────────────────────────────────────── */

:root {
  /* Backgrounds */
  --bg: #0a0c10;
  --bg2: #111318;
  --bg3: #191c24;
  --bg4: #21252f;

  /* Borders */
  --border: rgba(255,255,255,.08);
  --border-subtle: rgba(255,255,255,.05);

  /* Text */
  --text: #e2e8f0;
  --text2: #94a3b8;
  --text3: #8494a7;

  /* Accent */
  --accent: #5b5ed6;
  --accent2: #818cf8;
  --accent-muted: rgba(91,94,214,.12);

  /* Status colors */
  --green: #22c55e;
  --green2: #4ade80;
  --red: #ef4444;
  --orange: #f59e0b;
  --purple: #a78bfa;
  --cyan: #06b6d4;

  /* Radii */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  /* Layout */
  --header-h: 52px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 2px 8px rgba(0,0,0,.4);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.5);

  /* Surfaces */
  --surface-hover: rgba(255,255,255,.04);
  --surface-active: rgba(255,255,255,.06);

  /* Glass */
  --glass: rgba(17,19,24,.72);
  --glass-light: rgba(17,19,24,.55);
  --glass-border: rgba(255,255,255,.1);

  /* Glows */
  --glow: 0 0 30px -8px rgba(99,102,241,.25);
  --glow-lg: 0 0 60px -12px rgba(99,102,241,.2);

  /* Theme meta */
  --theme-color: #0a0c10;
  --ambient-1: rgba(99,102,241,.12);
  --ambient-2: rgba(139,92,246,.08);
  --ambient-3: rgba(6,182,212,.06);
  --hero-gradient-start: #e2e8f0;
}

/* ── Light Theme ────────────────────────────────────
   WCAG AA compliant — all text/bg combos ≥ 4.5:1
   ──────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg: #f8f9fc;
  --bg2: #f0f2f7;
  --bg3: #e4e7ef;
  --bg4: #d8dce6;

  --border: rgba(0,0,0,.1);
  --border-subtle: rgba(0,0,0,.06);

  --text: #1a1d2d;
  --text2: #333b4d;
  --text3: #4c5568;

  --accent: #4f46e5;
  --accent2: #5b5ed6;
  --accent-muted: rgba(79,70,229,.1);

  --green: #16a34a;
  --green2: #15803d;
  --red: #dc2626;
  --orange: #b45309;
  --purple: #7c3aed;
  --cyan: #0e7490;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 2px 8px rgba(0,0,0,.07);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.1);

  --surface-hover: rgba(0,0,0,.03);
  --surface-active: rgba(0,0,0,.05);

  --glass: rgba(255,255,255,.82);
  --glass-light: rgba(255,255,255,.65);
  --glass-border: rgba(0,0,0,.08);

  --glow: 0 2px 16px -4px rgba(79,70,229,.12);
  --glow-lg: 0 4px 32px -8px rgba(79,70,229,.08);

  --theme-color: #f8f9fc;
  --ambient-1: rgba(99,102,241,.06);
  --ambient-2: rgba(139,92,246,.04);
  --ambient-3: rgba(6,182,212,.03);
  --hero-gradient-start: #1a1d2d;

  color-scheme: light;
}

/* ── Theme Toggle Button ────────────────────────────  */
.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
  flex-shrink: 0;
  padding: 0;
}
.theme-toggle:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: rgba(99,102,241,.25);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun  { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Landing page — fixed position toggle */
.theme-toggle--float {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
}

/* #99080 OWNER_V3 namespace — Phase 1 empty shell. Future Phase 4/5 rules go under .owner-v3 ... */
.owner-v3 .owner-v3-shell { display: block; min-height: 1px; }

/* #99067 — Coverage dimensions (OWNER_V3 only). Hidden by default; revealed inside .owner-v3. */
.owner-v3-only { display: none; }
.owner-v3 .owner-v3-only { display: block; }
.owner-v3 .coverage-dim-switcher { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.coverage-dim-pill {
  background: transparent; color: var(--text2); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 13px;
  transition: all .15s ease;
}
.coverage-dim-pill:hover { color: var(--text); border-color: var(--accent2); }
.coverage-dim-pill.active {
  background: var(--accent-muted); color: var(--accent2); border-color: var(--accent2);
}
.coverage-dim-pill:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
.coverage-rollup-tile {
  display: flex; align-items: baseline; gap: 16px; padding: 16px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 16px;
}
.coverage-rollup-tile .rollup-pct { font-size: 28px; font-weight: 600; color: var(--text); }
.coverage-rollup-tile .rollup-label { font-size: 13px; color: var(--text2); }
.coverage-rollup-tile .rollup-sub { font-size: 12px; color: var(--text3, var(--text2)); margin-left: auto; }
.coverage-procedure-grid {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden;
}
.coverage-procedure-row {
  display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr) auto;
  gap: 12px; align-items: center; padding: 10px 14px;
  border: 0; background: transparent; color: var(--text); text-align: left;
  cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--border);
}
.coverage-procedure-row:last-child { border-bottom: 0; }
.coverage-procedure-row:hover { background: var(--bg3); }
.coverage-procedure-row:focus-visible { outline: 2px solid var(--accent2); outline-offset: -2px; }
.coverage-procedure-row .proc-title { font-weight: 500; }
.coverage-procedure-row .proc-meta { color: var(--text2); font-size: 12px; }
.coverage-procedure-row .proc-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--bg3); color: var(--text2); border: 1px solid var(--border);
}
.coverage-procedure-row.gap .proc-badge { background: rgba(255,170,68,0.15); color: #c08830; border-color: rgba(255,170,68,0.4); }
.coverage-procedure-row.ready .proc-badge { background: rgba(64,180,120,0.15); color: #2f8f5b; border-color: rgba(64,180,120,0.4); }
.coverage-procedure-empty { padding: 24px; text-align: center; color: var(--text2); font-size: 13px; }


/* ── Task → Skill Draft chips ──────────────────────────
   Track C: per-procedure tasks table renders one chip per
   skill draft this task contributes to. Chip color encodes
   draft state. Deep-links to the Skills tab (Track B).
   ──────────────────────────────────────────────────── */
.col-skills { white-space: nowrap; }

.task-skill-chip {
  display: inline-block;
  padding: 2px 8px;
  margin: 1px 4px 1px 0;
  border-radius: var(--radius-xs);
  font-size: 11px;
  line-height: 1.4;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  transition: background .15s, color .15s, border-color .15s;
}
.task-skill-chip:hover {
  background: var(--bg4);
  color: var(--text);
  border-color: var(--accent);
}

.task-skill-chip--generated {
  background: rgba(148,163,184,.10);
  color: var(--text2);
  border-color: rgba(148,163,184,.25);
}
.task-skill-chip--under-review {
  background: rgba(245,158,11,.12);
  color: var(--orange);
  border-color: rgba(245,158,11,.30);
}
.task-skill-chip--ready-to-publish {
  background: rgba(34,197,94,.12);
  color: var(--green2);
  border-color: rgba(34,197,94,.30);
}
.task-skill-chip--stale {
  background: rgba(239,68,68,.10);
  color: var(--red);
  border-color: rgba(239,68,68,.25);
  opacity: .85;
}

.task-skill-empty,
.task-skill-na {
  color: var(--text3);
  font-size: 12px;
}
.task-skill-na { font-style: italic; }
