/* ═══════════════════════════════════════════════════════════════
   GSX 2026 · Hands-On LLM Security Lab · Design System
   Dark theme matching the GSX 2026 speaker template:
   near-black warm ground #1A1D16, GSX cyan accent #48C5D9,
   logo navy #0C1625 as ink on cyan surfaces.
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────────── */
:root {
  /* Ground colors sampled from the GSX-2026 deck backgrounds. */
  --bg:          #1A1D16;
  --bg-surface:  #14160F;
  --bg-raised:   #242820;
  --bg-hover:    #1F2219;
  --border:      #3A3F33;
  --border-lit:  #4E5546;

  /* White with opacity for hierarchy — no grey text. */
  --text:        #FFFFFF;
  --text-muted:  rgba(255,255,255,.78);
  --text-dim:    rgba(255,255,255,.60);

  /* GSX cyan, from the deck's cyan color family and the logo X. */
  --accent:      #48C5D9;
  --accent-dim:  #48C5D926;
  --accent-glow: #48C5D955;
  --accent-light:#7BD8E8;
  /* Logo navy — dark ink on cyan buttons, matching how the deck
     places dark content on cyan circles. White on cyan fails contrast. */
  --accent-ink:  #0C1625;

  --success:     #1AB472;
  --success-dim: #1AB47222;
  --error:       #FF6B6B;
  --error-dim:   #FF6B6B22;
  --warning:     #f59e0b;   /* functional amber (admin timer, notices) */

  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   16px;

  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;

  --shadow:      0 4px 24px rgba(0,0,0,.5);
  --shadow-sm:   0 2px 8px rgba(0,0,0,.4);
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; }
button { cursor: pointer; font: inherit; border: none; background: none; }
input, select, textarea { font: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ═══════════════════════════════════════════════════════════════
   LANDING PAGE
   ═══════════════════════════════════════════════════════════════ */

.landing-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Login background: the cyan variant of the GSX deck title background
   (dark ground, cyan circles). A dark scrim keeps the card the brightest
   thing on the page and the form legible over the bright circle shapes. */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url('/img/gsx-login-bg.jpg') center/cover no-repeat;
  pointer-events: none;
}
.grid-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(26,29,22,.55) 0%, rgba(26,29,22,.45) 40%, rgba(26,29,22,.72) 100%);
  pointer-events: none;
}

/* Radial glow behind card */
.landing-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.landing-wrapper::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Landing card */
.landing-card {
  position: relative;
  z-index: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-lit);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow), 0 0 0 1px var(--accent-dim);
}

/* Logo */
.landing-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.logo-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1px solid var(--border-lit);
  display: flex;
  align-items: center;
  justify-content: center;
}
#workshop-logo {
  max-height: 90px;
  max-width: 340px;
  object-fit: contain;
}

/* Titles */
.landing-titles { text-align: center; margin-bottom: 1.75rem; }
.landing-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1.2;
  margin-bottom: .4rem;
}
.landing-subtitle {
  font-size: .95rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
}
.landing-location {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  color: var(--accent);
  font-weight: 500;
}

/* Divider */
.landing-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
  color: var(--text-dim);
  font-size: .84rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.landing-divider::before,
.landing-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Login form */
.login-form { display: flex; flex-direction: column; gap: 1rem; }

.input-label {
  display: block;
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: .4rem;
  font-weight: 500;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: .85rem;
  color: var(--text-dim);
  pointer-events: none;
}
.password-input {
  width: 100%;
  background: var(--bg-raised);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .7rem 2.8rem .7rem 2.5rem;
  font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.password-input::placeholder { color: var(--text-dim); }
.password-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.toggle-password {
  position: absolute;
  right: .75rem;
  color: var(--text-dim);
  padding: .25rem;
  transition: color .15s;
}
.toggle-password:hover { color: var(--text); }

/* Buttons */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: .95rem;
  padding: .75rem 1.5rem;
  border-radius: var(--radius-sm);
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-light); box-shadow: 0 4px 20px var(--accent-glow); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .5; pointer-events: none; }

.btn-ghost {
  display: flex;
  align-items: center;
  gap: .35rem;
  color: var(--text-muted);
  padding: .45rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  transition: background .15s, color .15s;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-sm { font-size: .82rem; padding: .35rem .65rem; }

/* Spinner. The [hidden] rule is load-bearing: a bare `display: flex` outranks
   the UA stylesheet's [hidden] { display: none }, so the spinner would sit next
   to the button label at rest. */
.btn-spinner { display: flex; }
.btn-spinner[hidden] { display: none; }
.spinner-svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Error */
.error-msg {
  font-size: .84rem;
  color: var(--error);
  background: var(--error-dim);
  border: 1px solid var(--error);
  border-radius: var(--radius-sm);
  padding: .55rem .85rem;
  display: none;
}
.error-msg.visible { display: block; }

/* Footer */
.landing-footer {
  position: relative;
  z-index: 1;
  margin-top: 2rem;
  font-size: .76rem;
  color: var(--text-dim);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
}

.footer-logo {
  height: 30px;
  width: auto;
  object-fit: contain;
  opacity: .85;
}

.ws-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

/* ═══════════════════════════════════════════════════════════════
   WORKSHOP PAGE
   ═══════════════════════════════════════════════════════════════ */

.workshop-body { min-height: 100vh; display: flex; flex-direction: column; }

/* Header */
.ws-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
.ws-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}
.ws-header-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.header-logo-img { height: 30px; object-fit: contain; }
.ws-header-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
}
.ws-header-right { display: flex; align-items: center; gap: .75rem; }

/* Layout.
   1680px leaves room for long monospace lines in the paste blocks; prose is
   held to a readable measure separately — see .chapter-prose. */
.ws-layout {
  flex: 1;
  display: flex;
  max-width: 1680px;
  margin: 0 auto;
  width: 100%;
}

/* Sidebar */
.ws-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  position: sticky;
  top: 57px;
  height: calc(100vh - 57px);
  overflow-y: auto;
}
.sidebar-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-dim);
  padding: 0 .5rem;
  margin-bottom: .75rem;
}
.chapter-list { display: flex; flex-direction: column; gap: .25rem; }

/* Chapter items */
.chapter-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
  border: 1px solid transparent;
  text-align: left;
  width: 100%;
}
.chapter-item:hover:not(.locked) { background: var(--bg-hover); }
.chapter-item.active {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.chapter-item.locked {
  opacity: .4;
  cursor: not-allowed;
}

.chapter-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1.5px solid var(--border-lit);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: border-color .15s, color .15s;
}
.chapter-item.active .chapter-item-icon {
  border-color: var(--accent);
  color: var(--accent);
}

.chapter-item-text { flex: 1; min-width: 0; }
.chapter-item-title {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chapter-item-sub {
  font-size: .72rem;
  color: var(--text-muted);
}

/* Divider before the extra resources at the foot of the sidebar */
.chapter-list-divider { height: 1px; background: var(--border); margin: .5rem; }
a.chapter-item { text-decoration: none; }

/* Main content */
.ws-main {
  flex: 1;
  padding: 2rem 2.5rem;
  overflow-y: auto;
}

/* Loading */
.ws-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  gap: 1rem;
  color: var(--text-muted);
}
.ws-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-lit);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Chapter header */
.chapter-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}
.chapter-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.chapter-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1.25;
}
/* The description is several distinct things — prose, prompts to copy, samples,
   and asides — so the container is a block and each part carries its own weight. */
.chapter-desc {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: .3rem;
}

/* Chapter footer */
.chapter-footer { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 200;
  background: var(--accent);
  color: var(--accent-ink);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px var(--accent-glow);
}

/* ── Chapter description parts ─────────────────────────────────── */
/* Hold prose and asides to a readable measure; paste blocks go full width. */
.chapter-prose {
  white-space: pre-wrap;
  margin: 0 0 .75rem;
  max-width: 82ch;
}

/* Step headings inside a chapter (### Step N - …). These carry the pacing —
   they must be findable from three rows back on a laptop screen. */
.chapter-step-head {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
  margin: 2rem 0 .75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  max-width: 82ch;
}
.chapter-step-head:first-child { margin-top: .5rem; padding-top: 0; border-top: none; }

/* The prompt to paste. A raised, bordered surface so the eye finds it without
   reading — this is the one thing on the page people came to copy. */
.chapter-code {
  margin: .9rem 0;
  border: 1px solid var(--border-lit);
  border-radius: var(--radius);
  background: var(--bg-surface);
  overflow: hidden;
}
.chapter-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .45rem .75rem;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  font-size: .8rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-dim);
}
/* Long labels must never push the Copy button out of the panel —
   a block you cannot copy is useless on a phone. */
.chapter-code-label {
  min-width: 0;
  overflow-wrap: anywhere;
}
.chapter-code-copy {
  flex: none;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--accent-light);
  font-size: .74rem;
  padding: .2rem .7rem;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.chapter-code-copy:hover { background: var(--accent); color: var(--accent-ink); }
.chapter-code pre {
  margin: 0;
  padding: .8rem .9rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: .88rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 22rem;
  overflow-y: auto;
}
/* The Exercise 2 sandbox report is one long paste — give it more room. */
.chapter-code.is-report pre { max-height: 30rem; }
.chapter-code.is-report { border-color: var(--warning); }
.chapter-code.is-report .chapter-code-bar { color: var(--warning); }

/* Quiet asides ("> …"). */
.chapter-note {
  white-space: pre-wrap;
  max-width: 82ch;
  margin: .75rem 0 1rem;
  padding: .6rem .85rem;
  border-left: 2px solid var(--border-lit);
  background: rgba(255,255,255,.03);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .95rem;
  color: var(--text-dim);
}
/* Checkpoints are the self-verification beat of the lab — same aside shape,
   but lifted in cyan so a scanning eye can jump checkpoint to checkpoint. */
.chapter-note.is-checkpoint {
  border-left-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text-muted);
}

/* Collapsed sample expected output — the self-rescue mechanism. One per step,
   collapsed by default so the page stays scannable, beside the step it saves. */
.chapter-sample {
  margin: .9rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  overflow: hidden;
}
.chapter-sample summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .9rem;
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color .15s, background .15s;
}
.chapter-sample summary::-webkit-details-marker { display: none; }
.chapter-sample summary::before {
  content: '';
  width: 0; height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform .15s;
  flex-shrink: 0;
}
.chapter-sample[open] summary::before { transform: rotate(90deg); }
.chapter-sample summary:hover { color: var(--accent-light); background: var(--bg-hover); }
.chapter-sample[open] summary { color: var(--accent); border-bottom: 1px solid var(--border); }
/* ── Sample output, rendered as a report ──────────────────────────
   These samples are what "good" looks like to a room of directors, so they are
   set as a document — proportional type, real tables, a bottom-line callout —
   not as a monospace dump. The panel gets a lighter ground than the page so it
   reads as a printed artifact lying on the desk. */
.chapter-sample-body {
  padding: 1.4rem 1.5rem 1.5rem;
  font-size: .95rem;
  line-height: 1.66;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(72,197,217,.04) 0%, transparent 22rem),
    var(--bg-raised);
}

.rep-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: .01em;
  color: var(--text);
  margin: 0 0 .2rem;
}

.rep-h1 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--accent);
  margin: 1.5rem 0 .5rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--border);
}
.rep-h1:first-child { margin-top: 0; }
.rep-h2 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.15rem 0 .4rem;
}
.rep-p { margin: 0 0 .7rem; max-width: 78ch; }
.rep-p:last-child { margin-bottom: 0; }
.rep-hr { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }

.rep-list { margin: 0 0 .8rem 1.1rem; max-width: 78ch; }
.rep-list li { margin-bottom: .3rem; padding-left: .2rem; }
.rep-list li::marker { color: var(--accent); font-weight: 700; }

/* The bottom line. A director who reads one thing reads this. */
.rep-callout {
  margin: 0 0 1rem;
  padding: .8rem 1rem;
  background: var(--accent-dim);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .97rem;
  white-space: pre-wrap;
  max-width: 78ch;
}
.rep-callout strong { color: var(--accent-light); }

/* Tables scroll inside their own box so a wide brief never makes the page
   scroll sideways on a laptop. */
.rep-table-wrap {
  overflow-x: auto;
  margin: 0 0 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.rep-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.rep-table th {
  text-align: left;
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-dim);
  background: var(--bg-surface);
  padding: .5rem .7rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.rep-table td {
  padding: .5rem .7rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}
.rep-table tbody tr:last-child td { border-bottom: none; }
.rep-table tbody tr:nth-child(even) td { background: rgba(255,255,255,.02); }

/* Confidence and basis read as status, so they are set as status. */
.rep-pill {
  display: inline-block;
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .12rem .45rem;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid;
}
.rep-pill-high,
.rep-pill-observed { color: var(--success); border-color: #1AB47266; background: var(--success-dim); }
.rep-pill-moderate { color: var(--warning); border-color: #f59e0b66; background: #f59e0b1a; }
.rep-pill-low,
.rep-pill-assessed { color: var(--text-dim); border-color: var(--border-lit); background: rgba(255,255,255,.03); }

.chapter-sample-body code {
  font-family: var(--font-mono);
  font-size: .84rem;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: .05rem .35rem;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

/* A full artifact rendered as the section itself, not collapsed beside it.
   Same typography as a sample panel, without the disclosure box around it. */
.chapter-brief {
  margin: .5rem 0 1rem;
  padding: 1.4rem 1.5rem 1.5rem;
  background:
    linear-gradient(180deg, rgba(72,197,217,.05) 0%, transparent 24rem),
    var(--bg-raised);
  border: 1px solid var(--border-lit);
  border-radius: var(--radius);
  font-size: .95rem;
  line-height: 1.66;
}
.rep-caption {
  margin-top: .6rem;
  font-size: .82rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.rep-figure img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); }

/* Diagrams inside a sample. Held to the text measure and centred. */
.rep-figure {
  margin: .5rem 0 1.1rem;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}
.rep-figure svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }

/* ── Chapter attachments — admin editor ────────────────────────── */
.ed-section-title { display: flex; align-items: center; gap: .5rem; }
.ed-section-meta {
  margin-left: auto;
  font-size: .7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}
.ed-attach-dropzone {
  display: block;
  border: 1.5px dashed var(--border-lit);
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  padding: 1.1rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: .65rem;
}
.ed-attach-dropzone:hover:not(.disabled) {
  border-color: var(--accent);
  background: var(--bg-hover);
}
.ed-attach-dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.ed-attach-dropzone.disabled {
  cursor: not-allowed;
  opacity: .55;
}
.ed-attach-dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  color: var(--text-muted);
}
.ed-attach-dropzone-inner svg { color: var(--accent); }
.ed-attach-prompt { font-size: .85rem; color: var(--text); }
.ed-attach-hint {
  font-size: .72rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.ed-attach-hint code {
  font-family: var(--font-mono);
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .7rem;
  color: var(--accent);
}
.ed-attach-list {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.ed-attach-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .4rem .6rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .82rem;
}
.ed-attach-icon { color: var(--accent); flex-shrink: 0; }
.ed-attach-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.ed-attach-size {
  font-size: .72rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.ed-attach-status {
  margin-top: .5rem;
  font-size: .75rem;
  min-height: 1em;
  color: var(--text-muted);
}
.ed-attach-status.ok  { color: var(--success); }
.ed-attach-status.err { color: var(--error); }

/* ── Chapter attachments — workshop view ───────────────────────── */
.chapter-attachments {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem 1rem;
  margin-bottom: 1.5rem;
}
.chapter-attachments-title {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: .55rem;
}
.chapter-attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.chapter-attachment-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .8rem;
  background: var(--bg-raised);
  border: 1px solid var(--border-lit);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .82rem;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.chapter-attachment-btn:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}
.chapter-attachment-btn.is-malware {
  border-color: var(--error);
  color: var(--error);
}
.chapter-attachment-btn.is-malware:hover {
  background: var(--error-dim);
}
.chapter-attachment-icon { color: inherit; flex-shrink: 0; }
.chapter-attachment-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 22ch;
}
.chapter-attachment-size {
  font-size: .7rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.chapter-attachment-btn.is-malware .chapter-attachment-size { color: var(--error); opacity: .8; }
.chapter-attachment-tag {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--error-dim);
  color: var(--error);
}

/* ── Malware-sample warning modal ──────────────────────────────── */
.mal-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  animation: malModalFade .15s ease-out;
}
@keyframes malModalFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.mal-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--error);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow), 0 0 0 1px var(--error-dim);
}
.mal-modal-icon {
  color: var(--error);
  margin-bottom: .75rem;
  display: flex;
  justify-content: center;
}
.mal-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: .85rem;
  letter-spacing: -.01em;
}
.mal-modal-body {
  font-size: .9rem;
  color: var(--text);
  text-align: center;
  margin-bottom: 1rem;
}
.mal-modal-body strong { word-break: break-all; }
.mal-modal-list {
  list-style: none;
  padding: .85rem 1rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}
.mal-modal-list li {
  font-size: .85rem;
  color: var(--text);
  padding: .25rem 0;
  line-height: 1.5;
}
.mal-modal-list li + li { border-top: 1px solid var(--border); margin-top: .25rem; padding-top: .5rem; }
.mal-modal-list code {
  font-family: var(--font-mono);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .8rem;
  color: var(--accent);
}
.mal-modal-actions {
  display: flex;
  gap: .65rem;
  justify-content: flex-end;
}
.mal-modal-btn {
  padding: .55rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid var(--border-lit);
  background: var(--bg-raised);
  color: var(--text);
  transition: background .15s, border-color .15s;
}
.mal-modal-cancel:hover { background: var(--bg-hover); border-color: var(--accent); }
.mal-modal-proceed {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}
.mal-modal-proceed:hover { background: #dc2626; }

/* ── Answer-option rows (admin chapter editor) ─────────────────── */
.options-list { display: flex; flex-direction: column; gap: .5rem; }
.option-label {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--bg-raised);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .7rem 1rem;
  cursor: pointer;
  transition: border-color .2s, background .15s;
  font-size: .9rem;
}
.option-label:hover { border-color: var(--border-lit); background: var(--bg-hover); }
.option-label.selected { border-color: var(--accent); background: var(--accent-dim); }
.option-label input[type="radio"],
.option-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .ws-sidebar {
    position: fixed;
    left: -280px;
    top: 57px;
    height: calc(100vh - 57px);
    z-index: 150;
    transition: left .25s ease;
    width: 260px;
  }
  .ws-sidebar.open { left: 0; }
  .sidebar-toggle { display: flex; }
  .ws-main { padding: 1.25rem 1rem; }
  .landing-card { padding: 2rem 1.5rem; }
  .chapter-title { font-size: 1.2rem; }
}

@media (max-width: 480px) {
  .ws-header-inner { padding: .65rem 1rem; }
  .ws-header-title { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════════ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-lit); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ═══════════════════════════════════════════════════════════════
   COOKIE BANNER
   ═══════════════════════════════════════════════════════════════ */

.cookie-banner {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.85rem;
  width: 300px;
  padding: 1rem 1.1rem;
  background: var(--bg-raised);
  border: 1px solid var(--border-lit);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.55), 0 0 0 1px var(--accent-dim);
  animation: cookie-slide-in .35s cubic-bezier(.22,1,.36,1) both;
}
.cookie-banner[hidden] { display: none; }

@keyframes cookie-slide-in {
  from { opacity: 0; transform: translateX(50px); }
  to   { opacity: 1; transform: translateX(0); }
}

.cookie-icon { flex-shrink: 0; margin-top: 3px; color: var(--accent); }

.cookie-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cookie-title { margin: 0 0 .3rem; font-size: .84rem; font-weight: 700; color: var(--accent); letter-spacing: .07em; text-transform: uppercase; }
.cookie-text  { margin: 0 0 .8rem; font-size: .84rem; color: var(--text); line-height: 1.5; }

.cookie-btn {
  align-self: stretch;
  padding: .38rem .75rem;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
.cookie-btn:hover { opacity: .85; }
