:root {
  color-scheme: light;
  --bg: #f4f1ea;          /* paper, from the workshop deck template */
  --surface: #fcfcfb;
  --ink: #1b1b1f;
  --ink-2: #52514e;
  --muted: #6b6a66;
  --line: #e2ded4;
  --accent: #e8664a;      /* coral */
  --accent-ink: #ffffff;
  --series-1: #2a78d6;    /* blue: counts */
  --series-2: #eb6834;    /* orange: "ask AI" answers (not on the skill scale) */
  --heat-0: #f0efec;
  --heat-1: #cde2fb; --heat-2: #9ec5f4; --heat-3: #5598e7; --heat-4: #256abf; --heat-5: #104281;
  --good: #0ca30c; --warning: #fab219; --critical: #d03b3b;
  --hatch: repeating-linear-gradient(45deg, #d9d6cd 0 4px, transparent 4px 8px);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #121211; --surface: #1a1a19; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #9a998f; --line: #2e2e2b;
    --accent: #ef7a5f; --accent-ink: #121211;
    --series-1: #3987e5; --series-2: #d95926;
    --heat-0: #262624;
    --heat-1: #184f95; --heat-2: #1c5cab; --heat-3: #2a78d6; --heat-4: #5598e7; --heat-5: #9ec5f4;
    --hatch: repeating-linear-gradient(45deg, #3a3a37 0 4px, transparent 4px 8px);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211; --surface: #1a1a19; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #9a998f; --line: #2e2e2b;
  --accent: #ef7a5f; --accent-ink: #121211;
  --series-1: #3987e5; --series-2: #d95926;
  --heat-0: #262624;
  --heat-1: #184f95; --heat-2: #1c5cab; --heat-3: #2a78d6; --heat-4: #5598e7; --heat-5: #9ec5f4;
  --hatch: repeating-linear-gradient(45deg, #3a3a37 0 4px, transparent 4px 8px);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: 1.35rem; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 4px; color: var(--accent); font-weight: 600; font-size: .9rem; }

.top { padding: 28px 0 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.top-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.icon-btn { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; width: 44px; height: 44px; cursor: pointer; font-size: 1.1rem; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 24px 0; }
.step { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--ink-2); }
.step .n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; }

.section-head { margin: 32px 0 14px; }
.section-head p { margin: 4px 0 0; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat .big { font-size: 2rem; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: .9rem; }

.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
.chart { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.chart.wide { grid-column: 1 / -1; }
.chart h3 { font-size: 1rem; margin-bottom: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 2.5em; gap: 8px; align-items: center; margin: 6px 0; font-size: .9rem; }
.bar-row .lab { color: var(--ink-2); overflow-wrap: anywhere; }
.bar-row .track { height: 12px; }
.bar-row .fill { height: 12px; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-row .fill.hidden { width: 100%; background: var(--hatch); border-radius: 4px; }
.bar-row .val { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }

.heat { width: 100%; border-collapse: separate; border-spacing: 2px; font-size: .85rem; }
.heat th { font-weight: 500; color: var(--muted); text-align: left; vertical-align: bottom; padding: 2px 4px; }
.heat thead th { text-align: center; font-size: .78rem; }
.heat td { text-align: center; border-radius: 4px; padding: 6px 2px; font-variant-numeric: tabular-nums; min-width: 2.6em; }
.heat td.h0 { background: var(--heat-0); color: var(--muted); }
.heat td.h1 { background: var(--heat-1); } .heat td.h2 { background: var(--heat-2); }
.heat td.h3 { background: var(--heat-3); color: #fff; } .heat td.h4 { background: var(--heat-4); color: #fff; } .heat td.h5 { background: var(--heat-5); color: #fff; }
:root[data-theme="dark"] .heat td.h1, :root[data-theme="dark"] .heat td.h2, :root[data-theme="dark"] .heat td.h3 { color: #fff; }
:root[data-theme="dark"] .heat td.h4, :root[data-theme="dark"] .heat td.h5 { color: #121211; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .heat td.h1, :root:where(:not([data-theme="light"])) .heat td.h2, :root:where(:not([data-theme="light"])) .heat td.h3 { color: #fff; }
  :root:where(:not([data-theme="light"])) .heat td.h4, :root:where(:not([data-theme="light"])) .heat td.h5 { color: #121211; }
}
.heat td.hidden { background: var(--hatch); color: var(--muted); }
.heat td.ai { box-shadow: inset 0 -3px 0 var(--series-2); }
.scroll { overflow-x: auto; }

.levels { display: grid; gap: 14px; }
.level { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.level-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.level-head h3 { font-size: 1.2rem; }
.level p { color: var(--ink-2); margin: 6px 0 12px; }
.chip { display: inline-flex; gap: 4px; align-items: center; font-size: .78rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; }
.chip.open { color: var(--good); } .chip.tentative { color: var(--warning); } .chip.full { color: var(--critical); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.slot { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 6px; background: var(--bg); }
.slot .when { font-weight: 600; }
.slot .where { color: var(--muted); font-size: .88rem; }
.seats { height: 6px; background: var(--heat-0); border-radius: 4px; overflow: hidden; }
.seats > div { height: 100%; background: var(--series-1); }
.slot a { color: var(--accent); font-size: .88rem; }
.empty { color: var(--muted); font-style: italic; }

.btn { border: 0; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; background: var(--accent); color: var(--accent-ink); }
.btn:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }

dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); width: min(440px, calc(100vw - 32px)); padding: 20px; }
dialog::backdrop { background: rgb(0 0 0 / .45); }
dialog label { display: block; margin: 14px 0 6px; font-weight: 600; }
dialog input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.error { color: var(--critical); margin: 10px 0 0; }
.foot { margin: 32px 0 40px; font-size: .9rem; }
