/* Canonical Workshop Page theme — "Instrument Panel": cool-gray page, card sections with orange-dot
   uppercase labels, slate code plates, oklch token color system, variable system fonts.
   Winner of the 2026-07 template lab round 3b (undefeated in BOTH light and dark across 30 votes).
   Dark mode = the same hue/chroma tokens with the lightness ramp flipped; it follows
   prefers-color-scheme and can be forced with <html data-mode="light|dark">.
   Generated sites may extend below the marker but must keep this block intact. */
:root {
  color-scheme: light;
  /* oklch token system — hues + chroma below; the dark blocks only move lightness */
  --h: 250;           /* page hue (cool gray) */
  --ha: 45;           /* accent hue (signal orange) */
  --c: 0.006;         /* page chroma */
  --ca: 0.21;         /* accent chroma */
  --bg: oklch(93% var(--c) var(--h));
  --ink: oklch(16% var(--c) var(--h));
  --muted: oklch(55% calc(var(--c)*2) var(--h));
  --accent: oklch(60% var(--ca) var(--ha));
  --accent-ink: oklch(99% 0.005 var(--ha));
  --card: oklch(99.6% calc(var(--c)*.5) var(--h));
  --line: oklch(90% calc(var(--c)*1.5) var(--h));
  --good: oklch(50% 0.12 145);
  --cb-bg: oklch(27% 0.01 var(--h));
  --cb-ink: oklch(93% 0.008 var(--h));
  --cb-line: oklch(38% 0.012 var(--h));
  --cb-head-bg: oklch(31% 0.012 var(--h));
  --cb-head-ink: oklch(72% 0.012 var(--h));
  --out-bg: oklch(94% calc(var(--c)*1.5) var(--h));
  --out-ink: oklch(48% var(--c) var(--h));
  /* variable system fonts — zero network requests, axes as voice */
  --sans: system-ui, -apple-system, "Segoe UI Variable", "Segoe UI", "Roboto Flex", Roboto, sans-serif;
  --serif: ui-serif, "New York", Georgia, "Iowan Old Style", serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --w-body: 440;
  --w-head: 640;
  --collapse-after: 6;
}
/* dark ramp — keep this block and the data-mode block below byte-identical */
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) {
    color-scheme: dark;
    --bg: oklch(16% 0.012 var(--h));
    --ink: oklch(92% var(--c) var(--h));
    --muted: oklch(66% calc(var(--c)*2) var(--h));
    --accent: oklch(71% var(--ca) var(--ha));
    --accent-ink: oklch(19% 0.012 var(--ha));
    --card: oklch(21% 0.014 var(--h));
    --line: oklch(30% 0.016 var(--h));
    --good: oklch(76% 0.12 145);
    --cb-bg: oklch(12% 0.01 var(--h));
    --cb-line: oklch(28% 0.014 var(--h));
    --cb-head-bg: oklch(17% 0.012 var(--h));
    --out-bg: oklch(24% calc(var(--c)*1.6) var(--h));
    --out-ink: oklch(70% var(--c) var(--h));
  }
}
:root[data-mode="dark"] {
    color-scheme: dark;
    --bg: oklch(16% 0.012 var(--h));
    --ink: oklch(92% var(--c) var(--h));
    --muted: oklch(66% calc(var(--c)*2) var(--h));
    --accent: oklch(71% var(--ca) var(--ha));
    --accent-ink: oklch(19% 0.012 var(--ha));
    --card: oklch(21% 0.014 var(--h));
    --line: oklch(30% 0.016 var(--h));
    --good: oklch(76% 0.12 145);
    --cb-bg: oklch(12% 0.01 var(--h));
    --cb-line: oklch(28% 0.014 var(--h));
    --cb-head-bg: oklch(17% 0.012 var(--h));
    --out-bg: oklch(24% calc(var(--c)*1.6) var(--h));
    --out-ink: oklch(70% var(--c) var(--h));
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: var(--w-body);
  font-optical-sizing: auto;
  font-size: 16.5px;
  line-height: 1.6;
}
main { max-width: 46rem; margin: 0 auto; padding: 2.6rem 1.25rem 4rem; }
img { max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Header */
.kicker { font-family: var(--mono); font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 .35rem; }
h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); font-weight: var(--w-head); letter-spacing: -.015em; line-height: 1.08; margin: .4rem 0 .8rem; }
.deck { font-size: 1.05rem; color: var(--muted); margin: 0 0 2rem; }
h3 { font-size: 1.02rem; font-weight: calc(var(--w-head) + 10); margin: 1.5rem 0 .4rem; }

/* Sections: instrument cards with dot-labeled uppercase headings */
main > section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.4rem 1.6rem;
  margin: 1.2rem 0;
}
main > section > h2 {
  font-size: .82rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  margin: 0 0 1rem;
  display: flex; align-items: center; gap: .55rem;
}
main > section > h2:not(.has-icon)::before { content: ""; width: .62rem; height: .62rem; border-radius: 50%; background: var(--accent); flex: none; }

/* Inline Lucide icons (injected by app.js) */
.icn { width: 1em; height: 1em; flex: none; vertical-align: -.125em; }
.icn-h2 { width: 1.05rem; height: 1.05rem; color: var(--accent); }
.story h2 .icn-h2 { display: none; }
.icn-kind { width: .85rem; height: .85rem; opacity: .8; }
.cb-btn.primary .icn, .cb-expand .icn { width: .8rem; height: .8rem; margin-right: .35rem; vertical-align: -.1em; }
.icn-success { width: 1rem; height: 1rem; color: var(--good); float: left; margin: .2rem .5rem 0 0; }
.story h2 { font-size: 1.05rem; font-weight: var(--w-head); letter-spacing: 0; text-transform: none; margin: 1.8rem 0 .4rem; display: block; }
.story h2::before { content: none; }

/* TL;DR: numbered ledger list */
.tldr ul { list-style: none; margin: 0 0 .75rem; padding: 0; counter-reset: tl; }
.tldr li { margin: .7rem 0; padding-left: 2.4rem; position: relative; }
.tldr li::before {
  counter-increment: tl;
  content: counter(tl, decimal-leading-zero);
  position: absolute; left: 0; top: .1em;
  color: var(--accent); font-weight: 800; font-size: .9rem;
}
.bootstrap-label { font-size: .85rem; font-weight: 600; margin: .75rem 0 .25rem; }

/* Prompt cards */
.prompt-card { border-top: 1px solid var(--line); padding: 1.2rem 0 .4rem; margin: 1.2rem 0 0; }
.prompt-card h3 { margin: 0 0 .35rem; font-weight: calc(var(--w-head) + 10); font-size: 1.05rem; }
.prompt-meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-family: var(--mono); font-size: .74rem; color: var(--muted); margin: 0 0 .5rem; }
.prompt-meta span::before { content: attr(data-k) ": "; font-weight: 600; color: var(--ink); }

/* Agent guide */
.agent-guide ol { padding-left: 1.3rem; }
.agent-guide li { margin: .6rem 0; }
.success-check { background: color-mix(in oklch, var(--good) 8%, transparent); padding: .6rem 1rem; margin: 1.2rem 0; }
.success-check strong { color: var(--good); }

/* Code blocks (chrome built by app.js): slate plates, labeled head, line count, collapse */
pre {
  margin: 0;
  padding: .85rem 1rem;
  overflow-x: auto;
  background: var(--cb-bg);
  color: var(--cb-ink);
  font-family: var(--mono);
  font-size: .8rem;
  line-height: 1.55;
}
code { font-family: var(--mono); }
p code, li code, .appendix code { background: var(--out-bg); padding: .08em .3em; border-radius: 4px; font-size: .85em; overflow-wrap: anywhere; }
.cb { margin: 1rem 0; border: 1px solid var(--cb-line); border-radius: 8px; background: var(--cb-bg); overflow: hidden; }
.cb-head {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .8rem;
  font-family: var(--mono); font-size: .72rem;
  color: var(--cb-head-ink); background: var(--cb-head-bg);
  border-bottom: 1px solid var(--cb-line);
}
.cb-label { font-weight: 600; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-lines { margin-left: auto; white-space: nowrap; opacity: .7; }
.cb-btn {
  border: 1px solid var(--cb-line); background: transparent; color: inherit;
  font-family: inherit; font-size: inherit;
  padding: .15rem .55rem; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.cb-btn.primary {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
  font-weight: 700; text-transform: uppercase; font-size: .66rem; letter-spacing: .06em;
}
.cb-btn.primary:hover { filter: brightness(1.1); }
.cb-body { position: relative; }
.cb.is-collapsed .cb-body pre { max-height: calc(var(--collapse-after) * 1.55em + 1.8em); overflow: hidden; }
.cb.is-collapsed .cb-body::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3rem;
  background: linear-gradient(transparent, var(--cb-bg)); pointer-events: none;
}
.cb-expand {
  display: block; width: 100%;
  border: 0; border-top: 1px dashed var(--cb-line);
  background: var(--cb-head-bg); color: var(--cb-head-ink);
  font-family: var(--mono); font-size: .66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  padding: .5rem; cursor: pointer;
}
.cb-expand:hover { color: var(--accent); }
.cb-output, .cb-example { border-style: dashed; border-color: var(--line); }
.cb-output pre, .cb-example pre { background: var(--out-bg); color: var(--out-ink); }
.cb-output .cb-head, .cb-example .cb-head { background: var(--out-bg); color: var(--out-ink); border-color: var(--line); border-bottom-style: dashed; }

/* Story + appendix */
.story p { margin: .8rem 0; }
.appendix details { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .6rem 1rem; margin: .75rem 0; }
.appendix summary { cursor: pointer; font-weight: 600; }
.appendix table { border-collapse: collapse; width: 100%; font-size: .85rem; display: block; overflow-x: auto; }
.appendix th, .appendix td { border: 1px solid var(--line); padding: .35rem .6rem; text-align: left; }

footer { margin-top: 2.6rem; padding-top: 1.1rem; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }

@media (max-width: 400px) {
  body { font-size: 16px; }
  main { padding: 1.6rem .85rem 3rem; }
  main > section { padding: 1.1rem 1rem; }
}
/* ==== site-specific styles may be appended below this line ==== */
/* Scorecard table */
.scorecard .table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); margin: 1rem 0; }
.scorecard table { border-collapse: collapse; width: 100%; min-width: 40rem; font-size: .85rem; }
.scorecard th, .scorecard td { border-bottom: 1px solid var(--line); padding: .45rem .6rem; text-align: left; vertical-align: top; }
.scorecard th { font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.scorecard tbody tr:last-child td { border-bottom: 0; }
.scorecard td:first-child { font-family: var(--mono); color: var(--muted); }
.v { display: inline-block; white-space: nowrap; font-size: .75rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--line); }
.v-hard { color: var(--good); border-color: var(--good); }
.v-inv, .v-out { color: var(--accent); border-color: var(--accent); }
