/* =============================================================================
   CSPSHIVAM Playground — theme
   Pure-black terminal · single electric-cyan accent · monospace-forward chrome.
   Identity comes from console motifs (prompts, cursor block, bracket labels,
   hairline cyan rules, faint scanline grid) rather than gradients or shadow.
   ============================================================================= */

:root {
  --bg:            #000000;
  --surface-1:     #050d12;
  --surface-2:     #08131a;
  --surface-3:     #0b1a22;
  --border:        #103038;
  --border-strong: #17414f;

  --text:      #dbf4ff;
  --text-dim:  #82abbb;
  --text-mute: #4d6b78;

  --accent:      #38d9ff;   /* electric cyan — the single accent */
  --accent-hi:   #7ee9ff;
  --accent-dim:  rgba(56, 217, 255, 0.10);
  --accent-line: rgba(56, 217, 255, 0.34);
  --accent-glow: rgba(56, 217, 255, 0.45);

  --ok:     #3ce0a0;
  --ok-dim: rgba(60, 224, 160, 0.12);
  --warn:   #ffce5c;
  --danger: #ff5c7a;        /* fail / error / wrong — kept off the cyan ramp */

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;

  --r-sm: 3px;
  --r-md: 5px;
  --r-lg: 8px;

  --wrap: 1120px;
  --ease: cubic-bezier(0.4, 0.1, 0.2, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14.5px;
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: 0.1px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* faint cyan wash from the top + a hairline console grid — no glow spill */
  background-image:
    radial-gradient(1100px 460px at 50% -8%, rgba(56,217,255,0.055), transparent 62%),
    linear-gradient(rgba(56,217,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,217,255,0.018) 1px, transparent 1px);
  background-size: 100% 100%, 46px 46px, 46px 46px;
  background-attachment: fixed;
  min-height: 100vh;
}

/* Long-form reading text switches to sans; the terminal chrome stays mono. */
.hero-lede, .lab-objective, .foot-note, .about-card p,
.wt-body p, .wt-body li, .wt-lock-card p, .modal-desc { font-family: var(--font-sans); }

h1, h2, h3, h4 {
  font-family: var(--font-mono); font-weight: 600; line-height: 1.24;
  letter-spacing: -0.2px; margin: 0 0 0.5em;
}
h1 { font-size: 1.85rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--accent-hi); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--text-mute); }
.dim { color: var(--text-dim); }

.skip {
  position: absolute; left: -999px; top: 0; background: var(--accent); color: #001318;
  padding: 8px 14px; border-radius: var(--r-sm); z-index: 100; font-weight: 600;
}
.skip:focus { left: 12px; top: 12px; }

/* mono micro-label — category tags, kickers; prefixed with a console prompt */
.mono-label {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent);
}
.mono-label::before { content: "> "; color: var(--accent); opacity: 0.75; }

/* --------------------------------------------------------------------------
   Header / nav
   -------------------------------------------------------------------------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: rgba(0,0,0,0.8);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.head-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 10px; height: 17px; border-radius: 1px; background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow); animation: cursor-blink 1.15s steps(1) infinite;
}
@keyframes cursor-blink { 0%,55% { opacity: 1; } 56%,100% { opacity: 0.15; } }
.brand-text { font-family: var(--font-mono); font-size: 0.95rem; letter-spacing: 0.04em; color: var(--text); text-transform: lowercase; }
.brand-sep { color: var(--accent); margin: 0 2px; }
.brand-sub { color: var(--text-dim); }
.brand:hover .brand-text { color: var(--accent-hi); }

.site-nav { display: flex; gap: 4px; align-items: center; }
.site-nav a {
  padding: 8px 14px; border-radius: var(--r-sm); font-size: 0.85rem; color: var(--text-dim);
  font-family: var(--font-mono);
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a.active { color: var(--accent); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--accent); }
.site-nav a.burp {
  color: var(--warn); border: 1px solid rgba(255,206,92,0.32); margin-left: 4px;
}
.site-nav a.burp::before { content: "⌘ "; opacity: 0.8; }
.site-nav a.burp:hover { color: #ffe39a; border-color: rgba(255,206,92,0.6); background: rgba(255,206,92,0.08); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { padding: 74px 0 40px; border-bottom: 1px solid var(--border); }
.hero-kicker { margin-bottom: 18px; }
.hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.05rem); font-weight: 600; letter-spacing: -0.6px;
  max-width: 18ch; margin-bottom: 18px; text-transform: uppercase;
}
.hero h1 .accent { color: var(--accent); text-shadow: 0 0 22px var(--accent-glow); }
.hero-lede { max-width: 60ch; color: var(--text-dim); font-size: 1.05rem; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

.hero-stats { display: flex; gap: 32px; margin-top: 44px; flex-wrap: wrap; }
.hero-stat .n { font-size: 1.6rem; font-family: var(--font-mono); color: var(--accent); }
.hero-stat .l { display: block; }

/* --------------------------------------------------------------------------
   Buttons / pills
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: inherit; font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.04em;
  padding: 9px 16px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-strong);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.btn:hover { border-color: var(--accent-line); color: var(--accent-hi); }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #001318; font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); color: #001318; box-shadow: 0 0 18px var(--accent-glow); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }

.pill {
  display: inline-block; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 3px 8px; border-radius: var(--r-sm); border: 1px solid var(--border-strong);
  color: var(--text-dim);
}
.diff-easy   { color: var(--ok);   border-color: rgba(60,224,160,0.35); }
.diff-medium { color: var(--warn); border-color: rgba(255,206,92,0.35); }
.diff-hard   { color: var(--danger); border-color: rgba(255,92,122,0.4); }

/* --------------------------------------------------------------------------
   Category sections + lab grid
   -------------------------------------------------------------------------- */
.cat-section { padding: 44px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 76px; }
.cat-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.cat-head-left { max-width: 62ch; }
.cat-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.cat-title h2 { margin: 0; font-weight: 600; text-transform: uppercase; letter-spacing: 0.01em; }
.cat-desc { color: var(--text-dim); margin: 0; }
.cat-progress { text-align: right; min-width: 130px; }
.cat-progress .frac { font-family: var(--font-mono); font-size: 0.95rem; color: var(--text-dim); }
.cat-progress .frac .done { color: var(--accent); }
.progress-track { height: 3px; background: var(--surface-3); border-radius: 999px; margin-top: 8px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); transition: width 0.5s var(--ease); }
.cat-badge-earned { color: var(--ok); font-size: 0.8rem; margin-top: 6px; display: none; }

.lab-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.lab-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 16px 16px 14px;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.lab-card:hover { border-color: var(--accent-line); background: var(--surface-2); box-shadow: 0 0 0 1px var(--accent-dim), 0 0 22px rgba(56,217,255,0.06); }
.lab-card:hover .lab-card-go { color: var(--accent-hi); }
.lab-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.lab-card-lvl { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; color: var(--accent); }
.lab-card-lvl::before { content: "["; color: var(--text-mute); }
.lab-card-lvl::after { content: "]"; color: var(--text-mute); }
.lab-card h3 { font-size: 0.98rem; font-weight: 600; margin: 0 0 6px; }
.lab-card p { font-size: 0.85rem; color: var(--text-dim); margin: 0 0 14px; flex: 1; font-family: var(--font-sans); }
.lab-card-foot { display: flex; align-items: center; justify-content: space-between; }
.lab-card-status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.76rem; color: var(--text-mute); font-family: var(--font-mono); }
.lab-card-go { font-size: 0.8rem; color: var(--text-dim); font-family: var(--font-mono); }
.lab-card.is-solved { border-color: rgba(60,224,160,0.32); }
.lab-card.is-solved .lab-card-status { color: var(--ok); }
.lab-card .check { width: 14px; height: 14px; display: none; }
.lab-card.is-solved .check { display: inline-block; }
.lab-card-link { position: absolute; inset: 0; border-radius: var(--r-md); }

/* --------------------------------------------------------------------------
   About / prose panels
   -------------------------------------------------------------------------- */
.panel { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px; }
.about { padding: 48px 0; }
.about-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin-top: 22px; }
.about-card { border-left: 2px solid var(--border); padding-left: 16px; }
.about-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.about-card p { color: var(--text-dim); font-size: 0.9rem; margin: 0; }
.about-card .mono-label { display: block; margin-bottom: 10px; color: var(--accent); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-foot { border-top: 1px solid var(--border); margin-top: 40px; }
.foot-inner { display: flex; justify-content: space-between; gap: 20px; padding: 26px 0; flex-wrap: wrap; }
.foot-note { margin: 0; font-size: 0.86rem; color: var(--text-dim); max-width: 60ch; }
.foot-meta { margin: 0; font-size: 0.8rem; font-family: var(--font-mono); }

/* --------------------------------------------------------------------------
   Forms / inputs
   -------------------------------------------------------------------------- */
input[type="text"], input[type="search"], input[type="password"], input[type="email"],
input[type="url"], input[type="number"], textarea, select {
  width: 100%; font: inherit; font-family: var(--font-mono); font-size: 0.9rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); padding: 9px 12px; transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-dim); }
textarea { min-height: 92px; resize: vertical; }
.poc-input { font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.5; min-height: 120px; white-space: pre; }
.field { margin-bottom: 14px; }
.field-label { display: block; font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-mute); margin-bottom: 6px; }
::placeholder { color: var(--text-mute); }

/* --------------------------------------------------------------------------
   Lab chrome
   -------------------------------------------------------------------------- */
.lab-body { background: var(--bg); }
.lab-topbar { border-bottom: 1px solid var(--border); background: rgba(0,0,0,0.7); }
.lab-topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.lab-back { font-size: 0.83rem; color: var(--text-dim); font-family: var(--font-mono); }
.lab-back:hover { color: var(--accent-hi); }
.lab-id-meta { display: flex; align-items: center; gap: 12px; }
.lab-level { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-mute); }

.lab-head { padding: 34px 0 22px; }
.lab-title { font-size: 1.5rem; font-weight: 600; margin-bottom: 8px; }
.lab-title::before { content: "$ "; color: var(--accent); opacity: 0.7; }
.lab-objective { color: var(--text-dim); max-width: 72ch; margin-bottom: 20px; }

.lab-controls {
  padding: 16px; background: var(--surface-1); border: 1px solid var(--border);
  border-left: 2px solid var(--accent-line); border-radius: var(--r-md);
}
.flag-form { width: 100%; }
.flag-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.flag-row input { flex: 1 1 240px; min-width: 0; font-family: var(--font-mono); }
.flag-row .btn { flex: 0 0 auto; white-space: nowrap; }
.flag-status { margin: 8px 0 0; font-size: 0.85rem; min-height: 1.2em; font-family: var(--font-mono); }
.flag-status.ok { color: var(--ok); }
.flag-status.err { color: var(--danger); }

.lab-main { padding: 20px 0 40px; }
.lab-stage {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 26px;
}
.lab-stage h2 { font-weight: 600; }
.lab-sandbox-note { font-size: 0.8rem; margin-top: 18px; }

/* generic in-lab UI atoms reused by many labs */
.app-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; margin: 0 0 16px; }
.app-card:last-child { margin-bottom: 0; }
.result-box {
  font-family: var(--font-mono); font-size: 0.85rem; white-space: pre-wrap; word-break: break-word;
  background: #01080b; border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 14px; color: var(--text-dim); margin-top: 12px;
}
.result-box .flagline { color: var(--accent-hi); text-shadow: 0 0 14px var(--accent-glow); }
.hint-none { display: none; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.tag-open { color: var(--ok); } .tag-closed { color: var(--text-mute); }

/* --------------------------------------------------------------------------
   Per-lab hint card — deliberately-wrong sample inputs + a thinking nudge,
   an optional "where to intercept" Burp note, and the stuck-after-N-tries CTA.
   Never the solution: that lives only in the Walkthrough.
   -------------------------------------------------------------------------- */
.lab-hint {
  margin-top: 22px; background: var(--surface-1); border: 1px solid var(--border);
  border-left: 2px solid var(--accent-line); border-radius: var(--r-md); padding: 18px 20px;
}
.lab-hint-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.lab-hint-tag {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent-line); border-radius: var(--r-sm); padding: 2px 9px;
}
.lab-hint-sub { font-size: 0.84rem; color: var(--text-mute); }
.lab-samples { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.lab-samples li {
  font-family: var(--font-mono); font-size: 0.84rem; color: var(--text-dim);
  background: #01080b; border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 8px 12px; display: flex; align-items: baseline; gap: 10px; word-break: break-word;
}
.lab-samples li::before { content: "\2717"; color: var(--danger); flex: 0 0 auto; }
.lab-nudge { color: var(--text-dim); font-size: 0.9rem; margin: 0; }

/* "This exploit requires request manipulation" — Burp intercept location note */
.lab-burp {
  display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; font-size: 0.86rem;
  color: var(--warn); background: rgba(255,206,92,0.06);
  border: 1px solid rgba(255,206,92,0.28); border-radius: var(--r-sm); padding: 10px 12px;
}
.lab-burp-tag {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--warn); border: 1px solid rgba(255,206,92,0.4); border-radius: var(--r-sm);
  padding: 2px 8px; flex: 0 0 auto;
}
.lab-burp-link { font-size: 0.82rem; margin: 4px 0 0; }

.lab-cta { margin-top: 16px; }
.lab-cta[hidden] { display: none; }
.lab-cta-inner {
  background: var(--accent-dim); border: 1px solid var(--accent-line); border-radius: var(--r-md);
  padding: 16px 18px;
}
.lab-cta-inner p { margin: 0 0 12px; font-size: 0.88rem; color: var(--text-dim); }

/* --------------------------------------------------------------------------
   Walkthrough gate — shown until the learner has solved at least 3 labs.
   -------------------------------------------------------------------------- */
#wt-gated[hidden] { display: none; }
.wt-lock { padding: 20px 0 48px; }
.wt-lock[hidden] { display: none; }
.wt-lock-card {
  max-width: 620px; margin: 8px auto 0; text-align: center;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 40px 32px;
}
.wt-lock-mark {
  width: 46px; height: 46px; margin: 0 auto 18px; display: grid; place-items: center;
  border: 1px solid var(--accent-line); border-radius: var(--r-md); background: var(--accent-dim);
  color: var(--accent-hi); font-size: 1.3rem; box-shadow: 0 0 18px var(--accent-dim);
}
.wt-lock-card h2 { font-weight: 600; margin-bottom: 10px; }
.wt-lock-card p { color: var(--text-dim); max-width: 46ch; margin: 0 auto 8px; }
.wt-lock-progress { font-family: var(--font-mono); font-size: 0.95rem; color: var(--text-dim); margin-top: 18px; }
.wt-lock-progress b { color: var(--accent); }
.wt-lock-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

/* Second unlock path: enter a secret instead of solving 3 labs. */
.wt-unlock { max-width: 360px; margin: 28px auto 0; }
.wt-unlock-or {
  display: flex; align-items: center; gap: 12px; margin: 0 0 14px;
  color: var(--text-mute); font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
}
.wt-unlock-or::before, .wt-unlock-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.wt-unlock-form .flag-row { justify-content: center; }
.wt-unlock-form .flag-status { text-align: center; min-height: 1.2em; }

/* --------------------------------------------------------------------------
   Walkthrough pages
   -------------------------------------------------------------------------- */
.wt-hero { padding: 56px 0 28px; border-bottom: 1px solid var(--border); }
.wt-warn {
  display: flex; gap: 12px; align-items: flex-start; margin-top: 20px;
  background: var(--accent-dim); border: 1px solid var(--accent-line);
  border-radius: var(--r-md); padding: 14px 16px; font-size: 0.9rem; color: var(--text-dim);
}
.wt-cat-nav { display: flex; flex-wrap: wrap; gap: 8px; padding: 24px 0; border-bottom: 1px solid var(--border); }
.wt-cat-nav a { font-family: var(--font-mono); font-size: 0.78rem; padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text-dim); }
.wt-cat-nav a:hover { border-color: var(--accent-line); color: var(--accent-hi); }

.wt-list { padding: 24px 0 48px; }
.wt-group { margin-bottom: 40px; scroll-margin-top: 76px; }
.wt-group > h2 { font-weight: 600; display: flex; align-items: baseline; gap: 10px; text-transform: uppercase; }
.wt-item {
  border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 10px; overflow: hidden;
  background: var(--surface-1);
}
.wt-item > summary {
  cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 12px; list-style: none;
}
.wt-item > summary::-webkit-details-marker { display: none; }
.wt-item > summary:hover { background: var(--surface-2); }
.wt-item[open] > summary { border-bottom: 1px solid var(--border); }
.wt-item .wt-lvl { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent); min-width: 58px; }
.wt-item .wt-name { flex: 1; }
.wt-body { padding: 6px 18px 20px; }
.wt-body h4 { font-weight: 600; color: var(--accent); margin: 18px 0 6px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; }
.wt-body h4::before { content: "// "; opacity: 0.55; }
.wt-body p, .wt-body li { color: var(--text-dim); }
.wt-body ol, .wt-body ul { padding-left: 20px; }
.wt-body a { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 2px; }

/* Server-gated flag placeholder. Ships as "locked"; app.js fills it only for a
   secret-unlocked client (fetched from api/reveal.php). The 3-lab path never
   receives a flag — it stays masked, and the flag is never in the HTML source. */
.wt-flag {
  font-family: var(--font-mono); background: var(--surface-3); border: 1px dashed var(--border-strong);
  border-radius: 4px; padding: 1px 8px; font-size: 0.85em; color: var(--text-mute); letter-spacing: 0.04em;
}
.wt-flag[data-filled="1"] {
  border-style: solid; border-color: var(--accent-line); color: var(--accent-hi);
  background: var(--accent-dim); text-shadow: 0 0 12px var(--accent-glow);
}

/* code blocks (terminal) */
pre, code, .code { font-family: var(--font-mono); }
.wt-body pre, pre.code {
  background: #01080b; border: 1px solid var(--border); border-left: 2px solid var(--accent-line);
  border-radius: var(--r-sm); padding: 14px 16px; overflow-x: auto; font-size: 0.84rem;
  color: #cfe9f2; margin: 10px 0 16px; line-height: 1.55;
}
:not(pre) > code {
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 6px; font-size: 0.85em; color: var(--accent-hi);
}
.wt-open-lab { display: inline-flex; margin-top: 8px; }

/* --------------------------------------------------------------------------
   Modal / badge
   -------------------------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.78); backdrop-filter: blur(3px); }
.modal-card {
  position: relative; z-index: 1; width: 100%; max-width: 560px;
  background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  padding: 28px; box-shadow: 0 30px 90px rgba(0,0,0,0.7), 0 0 0 1px var(--accent-dim);
}
.modal-close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: var(--text-mute); font-size: 1.4rem; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--accent-hi); }
.modal-kicker { color: var(--accent); }
.modal-title { font-weight: 600; margin: 4px 0 8px; }
.modal-desc { color: var(--text-dim); font-size: 0.92rem; }
.badge-preview-wrap { margin: 16px 0; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: #01080b; }
#badge-canvas { display: block; width: 100%; height: auto; }
.modal-actions { display: flex; gap: 10px; }
.modal-hint { margin-top: 14px; font-size: 0.82rem; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--surface-3); border: 1px solid var(--border-strong); border-left: 2px solid var(--accent);
  color: var(--text); padding: 12px 18px; border-radius: var(--r-sm); font-size: 0.9rem; font-family: var(--font-mono);
  opacity: 0; pointer-events: none; transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); z-index: 70;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --------------------------------------------------------------------------
   Self-test page
   -------------------------------------------------------------------------- */
.check-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.check-row .st { font-family: var(--font-mono); font-size: 0.8rem; }
.st-pass { color: var(--ok); } .st-fail { color: var(--danger); } .st-warn { color: var(--warn); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  body { font-size: 14px; }
  .wrap { padding: 0 16px; }
  .head-inner { height: 56px; }
  .site-nav a { padding: 7px 10px; }
  .hero { padding: 48px 0 32px; }
  .cat-head { flex-direction: column; align-items: flex-start; }
  .cat-progress { text-align: left; width: 100%; }
  .flag-row input { flex-basis: 100%; }
}

@media (max-width: 560px) {
  .head-inner { flex-wrap: wrap; height: auto; padding: 8px 0; gap: 4px 0; }
  .site-nav { width: 100%; flex-wrap: wrap; }
  .hero-stats { gap: 20px; }
  .modal-actions { flex-direction: column; }
  .lab-topbar-inner { flex-wrap: wrap; height: auto; padding: 8px 0; gap: 6px 14px; }
  .lab-topbar-right { gap: 10px; }
  .lab-topbar .lab-level { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .brand-mark { animation: none; }
}

/* --------------------------------------------------------------------------
   Utilities — used by the trusted shell pages (home, walkthrough, selftest)
   so their markup carries NO inline style attributes, keeping the strict
   Content-Security-Policy (style-src 'self', no 'unsafe-inline') intact.
   -------------------------------------------------------------------------- */
.u-accent    { color: var(--accent); }
.u-accent-hi { color: var(--accent-hi); }
.u-medium    { font-weight: 600; }
.u-measure   { max-width: 70ch; }
.u-flex1     { flex: 1; }
.u-mono-sm   { font-family: var(--font-mono); font-size: 0.8rem; }
.u-fs-sm     { font-size: 0.88rem; }
.u-fs-xs     { font-size: 0.82rem; }
.u-mb-14     { margin-bottom: 14px; }
.u-mt-20     { margin-top: 20px; }
.u-mt-22     { margin-top: 22px; }
.u-mt-26     { margin-top: 26px; }
.u-pb-20     { padding-bottom: 20px; }
.u-no-border { border-bottom: none; }

/* Claim-badge button starts hidden; app.js reveals it via the CSSOM (allowed
   by CSP) once a whole track is complete — no inline style needed. */
.cat-claim { display: none; margin-top: 10px; }

/* -----------------------------------------------------------------------------
   Branding + navigation (text wordmark on every page; in-lab "next lab").
   -------------------------------------------------------------------------- */
.lab-topbar-right { display: flex; align-items: center; gap: 18px; }
.lab-topbar-right .lab-back { white-space: nowrap; }

/* "next lab" is server-rendered hidden, revealed by lab.js after capture. */
.lab-next[hidden] { display: none; }

/* Footer brand block, shared by shell + lab pages via site_footer.php. */
.foot-brand { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
