@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600;8..60,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --paper: #f5f1e8;
  --paper-warm: #efeadd;
  --paper-deep: #e8e1cf;
  --ink: #1d1c1a;
  --ink-soft: #3a3733;
  --ink-muted: #6b6760;
  --ink-faint: #9a958b;
  --rule: rgba(29, 28, 26, 0.12);
  --rule-strong: rgba(29, 28, 26, 0.2);
  --accent: #c2410c;       /* burnt orange — restrained */
  --accent-soft: rgba(194, 65, 12, 0.08);
  --tip: #5b6e4f;          /* muted olive/sage */
  --tip-soft: rgba(91, 110, 79, 0.07);
  --code-bg: #ede6d3;

  /* Context-window category palette (paper-friendly, all muted) */
  --cw-ink: #2e2c28;
  --cw-sage: #6b7e58;
  --cw-teal: #4f8079;
  --cw-blue: #4f7187;
  --cw-orange: #b75c2f;
  --cw-plum: #7c5e7c;
  --cw-amber: #c89b3c;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11';
}

/* Subtle paper grain — barely visible, just adds warmth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(194, 65, 12, 0.025), transparent 50%),
    radial-gradient(circle at 80% 90%, rgba(91, 110, 79, 0.02), transparent 50%);
  z-index: 0;
}

/* ─────────────────────────────────────────────
   SLIDE LAYOUT
   ───────────────────────────────────────────── */

.slide {
  min-height: calc(100vh - 3.25rem);
  display: flex;
  flex-direction: column;
  padding: 3rem 6rem 4rem;
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* The context-window slide is dense; trim the slide padding so the composer
   always has room below it for the popover. */
.slide:has(.cw) {
  padding: 2.5rem 6rem 3rem;
}
.slide:has(.cw) .slide-title {
  font-size: 2.4rem;
  margin-bottom: 1rem;
}
.slide:has(.cw) .slide-eyebrow {
  margin-bottom: 0.85rem;
}

.slide-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.slide-eyebrow::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--accent);
}

.slide-title {
  font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  font-size: 3.4rem;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: var(--ink);
}
.slide-title .accent {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

.slide-subtitle {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--ink-soft);
  margin-bottom: 2.5rem;
  max-width: 62ch;
  line-height: 1.5;
  letter-spacing: -0.005em;
}

h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 500;
  margin-bottom: 0.85rem;
  letter-spacing: -0.015em;
  color: var(--ink);
}

h3 {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
  color: var(--ink-muted);
}

p {
  margin-bottom: 0.95rem;
  color: var(--ink-soft);
  max-width: 68ch;
}

ul,
ol {
  padding-left: 1.25rem;
  margin-bottom: 0.95rem;
  color: var(--ink-soft);
  max-width: 68ch;
}
li {
  margin-bottom: 0.4rem;
}
li::marker {
  color: var(--ink-faint);
}

strong { color: var(--ink); font-weight: 600; }
em { font-style: italic; }

/* ─────────────────────────────────────────────
   COLUMNS / GRID HELPERS
   ───────────────────────────────────────────── */

.row {
  display: grid;
  gap: 2rem;
  margin-top: 1rem;
}
.row.cols-2 { grid-template-columns: 1fr 1fr; }
.row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.row.cols-2-1 { grid-template-columns: 2fr 1fr; }
.row.cols-1-2 { grid-template-columns: 1fr 2fr; }

/* Section divider */
.divider {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2rem 0;
}

/* ─────────────────────────────────────────────
   CODE
   ───────────────────────────────────────────── */

pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--ink-soft);
  margin-bottom: 0.95rem;
}
pre .role { color: var(--accent); font-weight: 600; }
pre .tool { color: var(--tip); }
pre .muted { color: var(--ink-faint); font-style: italic; }
pre .summary { color: #7c5e3c; font-style: italic; }

code {
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.88em;
}
:not(pre) > code {
  background: var(--code-bg);
  padding: 0.08rem 0.4rem;
  border-radius: 3px;
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 0.85em;
}

/* ─────────────────────────────────────────────
   CALLOUTS
   ───────────────────────────────────────────── */

.tip {
  border-left: 2px solid var(--tip);
  background: var(--tip-soft);
  padding: 0.85rem 1.2rem;
  font-size: 1rem;
  color: var(--ink-soft);
  margin: 0 0 1rem 0;
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  line-height: 1.55;
  border-radius: 0 4px 4px 0;
}
.tip:last-child {
  margin-bottom: 0;
}
.tip::before {
  content: 'Tip.';
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tip);
  margin-right: 0.6rem;
  font-style: normal;
  vertical-align: 0.08em;
}

/* Inline tips on slides are hidden — they only render inside the modal. */
main.slide .tip {
  display: none;
}

.callout {
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.1rem 1.35rem;
}
.callout-warn {
  border-color: rgba(194, 65, 12, 0.25);
  background: rgba(194, 65, 12, 0.04);
}

blockquote {
  border-left: 2px solid var(--rule-strong);
  padding: 0.4rem 0 0.4rem 1.2rem;
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 1rem 0;
  max-width: 60ch;
}

/* ─────────────────────────────────────────────
   MODULE CARDS (intro slide)
   ───────────────────────────────────────────── */

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.home-section-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 2.5rem 0 1rem;
}
.module-card {
  background: transparent;
  border-top: 1px solid var(--ink);
  padding: 1.4rem 0.25rem 0;
  position: relative;
}
a.module-card-link {
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
  padding: 1.4rem 1rem 1.2rem;
  border-radius: 0 0 6px 6px;
  cursor: pointer;
}
a.module-card-link:hover {
  background: var(--paper-warm);
}
.module-num {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: 0.7rem;
}
.module-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 500;
  margin-bottom: 0.7rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--ink);
}
.module-desc {
  font-size: 0.95rem;
  color: var(--ink-muted);
  line-height: 1.55;
}

/* ─────────────────────────────────────────────
   DASH LIST (editorial em-dash bullets)
   ───────────────────────────────────────────── */

.dash-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0.95rem;
}
.dash-list li {
  padding-left: 1.25rem;
  position: relative;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}
.dash-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--ink-faint);
}

/* ─────────────────────────────────────────────
   NEXT-TOKEN PREDICTION DEMO (real model, click-to-extend)
   ───────────────────────────────────────────── */

.ntp {
  margin-top: 2rem;
}

.ntp-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.ntp-status {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  color: var(--ink-muted);
  font-size: 0.95rem;
}
.ntp-status.error {
  color: var(--accent);
  font-style: normal;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}
.ntp-status.loading::after {
  content: '…';
  display: inline-block;
  margin-left: 0.15em;
  animation: ellipsis 1.2s steps(1) infinite;
}
@keyframes ellipsis {
  0% { content: '·'; }
  33% { content: '··'; }
  66% { content: '···'; }
}

.ntp-actions {
  display: flex;
  gap: 0.4rem;
}

.ntp-btn {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.78rem;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
}
.ntp-btn:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--paper-deep);
  color: var(--ink);
}
.ntp-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.ntp-btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.ntp-btn-primary:hover:not(:disabled) {
  background: var(--ink-soft);
  color: var(--paper);
}

.ntp-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.ntp-select-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.ntp-select {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.78rem;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  padding: 0.4rem 1.85rem 0.4rem 0.75rem;
  border-radius: 4px;
  color: var(--ink-soft);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%236b6760' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  transition: all 0.15s;
}
.ntp-select:hover:not(:disabled) {
  border-color: var(--ink);
  background-color: var(--paper-deep);
  color: var(--ink);
}
.ntp-select:focus {
  outline: none;
  border-color: var(--ink);
}
.ntp-select:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

textarea.ntp-prompt {
  display: block;
  width: 100%;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.1rem 1.4rem;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 1.35rem;
  color: var(--ink);
  min-height: 4.5rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  margin-bottom: 1.5rem;
  caret-color: var(--accent);
  letter-spacing: -0.005em;
  transition: border-color 0.15s;
}
textarea.ntp-prompt:focus {
  border-color: var(--ink);
}
textarea.ntp-prompt:read-only {
  opacity: 0.7;
  cursor: not-allowed;
}

.ntp-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.85rem;
}

.ntp-candidates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: stretch;
  min-height: 96px;
  transition: opacity 0.15s ease;
}
.ntp-candidate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.75rem 1.1rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  color: var(--ink);
  min-width: 80px;
  animation: candidate-in 0.3s ease both;
}
@keyframes candidate-in {
  from { opacity: 0; transform: translateY(3px); }
}
.ntp-candidate:hover {
  border-color: var(--accent);
  background: var(--paper-warm);
  transform: translateY(-1px);
}
.ntp-candidate-token {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  white-space: pre;
  letter-spacing: -0.01em;
}
.ntp-candidate-token.size-1 {
  font-size: 1.45rem;
  font-weight: 500;
  color: var(--ink);
}
.ntp-candidate-token.size-2 {
  font-size: 1.15rem;
  color: var(--ink-soft);
}
.ntp-candidate-token.size-3 {
  font-size: 0.95rem;
  color: var(--ink-soft);
  opacity: 0.78;
}
.ntp-candidate-prob {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* API key gate */
.key-gate {
  max-width: 540px;
  background: var(--paper-warm);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  padding: 1.4rem 1.5rem;
  margin-top: 2rem;
}
.key-gate h3 {
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  font-size: 1.15rem;
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 500;
  margin-bottom: 0.55rem;
}
.key-gate p {
  font-size: 0.92rem;
  margin-bottom: 1rem;
  color: var(--ink-muted);
}
.key-gate-form {
  display: flex;
  gap: 0.5rem;
}
.key-gate-input {
  flex: 1;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.85rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
  min-width: 0;
}
.key-gate-input:focus {
  border-color: var(--accent);
}

/* Inline notice on slides that need a key but don't have one */
.key-required {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: var(--paper-warm);
  border-left: 2px solid var(--accent);
  border-radius: 0 4px 4px 0;
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  color: var(--ink-soft);
  max-width: 540px;
}
.key-required p { margin: 0; color: inherit; }
.key-required a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Hidden-by-default key reset panel (Shift+K reveals on intro slide) */
.key-reset {
  margin-top: 2rem;
  padding: 0.75rem 1rem;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  color: var(--ink-muted);
  font-size: 0.92rem;
  max-width: 540px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* ─────────────────────────────────────────────
   FOOTER CHROME (nav.js injects)
   ───────────────────────────────────────────── */

/* ─────────────────────────────────────────────
   APP NAVIGATION
   ───────────────────────────────────────────── */

.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0 2rem;
  height: 3.25rem;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.app-nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex: 1;
  overflow-x: auto;
}
.app-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 5px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.12s;
}
.app-nav-link:hover {
  background: var(--paper-warm);
  color: var(--ink);
}
.app-nav-link.active {
  background: var(--paper-deep);
  color: var(--ink);
  font-weight: 600;
}
.app-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.app-nav-tip-btn {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: 0.8rem;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid var(--rule);
  padding: 0 0.65rem;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.app-nav-tip-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--paper-warm);
}
.app-nav-tip-dot {
  font-style: normal;
  color: var(--tip);
  font-family: 'Inter', sans-serif;
  font-size: 0.85em;
}

/* Tip modal */
.tip-modal {
  position: fixed;
  inset: 0;
  background: rgba(29, 28, 26, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.18s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.tip-modal.open {
  opacity: 1;
}
.tip-modal-content {
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  padding: 2.5rem 2.75rem 2rem;
  max-width: 640px;
  width: 100%;
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(8px);
  transition: transform 0.22s ease;
  box-shadow: 0 20px 60px rgba(29, 28, 26, 0.22);
}
.tip-modal.open .tip-modal-content {
  transform: translateY(0);
}
.tip-modal-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1.25rem;
}
.tip-modal-content .tip {
  display: block;
}
.tip-modal-close {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--ink-faint);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-family: inherit;
  line-height: 1;
}
.tip-modal-close:hover {
  color: var(--ink);
  background: var(--paper-warm);
}

/* ─────────────────────────────────────────────
   CONTEXT WINDOW DEMO (slide 03)
   ───────────────────────────────────────────── */

.cw {
  margin-top: 0.75rem;
}

.cw-models-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.cw-models {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}
.cw-models-trend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.cw-models-trend:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.cw-models-trend-glyph {
  width: 16px;
  height: 16px;
}
.cw-model-pill {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.78rem;
  background: transparent;
  border: 1px solid var(--rule);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}
.cw-model-pill:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.cw-model-pill[data-active="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.cw-model-pill .cw-model-window {
  margin-left: 0.45rem;
  opacity: 0.7;
  font-size: 0.75rem;
}

.cw-bar-wrap {
  position: relative;
  margin-bottom: 0.6rem;
}
.cw-bar {
  position: relative;
  height: 28px;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 3px;
  display: flex;
  align-items: stretch;
  overflow: visible;
}
.cw-segment {
  height: 100%;
  flex-shrink: 0;
  transition: width 0.3s ease, background-color 0.2s;
  border-right: 1px solid rgba(245, 241, 232, 0.35);
  position: relative;
}
.cw-segment:last-child {
  border-right: 0;
}
.cw-segment:hover {
  filter: brightness(1.08);
}

.cw-bar.over {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(194, 65, 12, 0.25);
}
.cw-bar.over::after {
  content: '⟩';
  position: absolute;
  right: -1.4rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  font-weight: 600;
}

/* Faint 50% tick on the bar */
.cw-bar-tick {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 1px;
  background: var(--rule-strong);
  pointer-events: none;
}

.cw-summary {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  color: var(--ink-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.cw-summary-count {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-style: normal;
  font-size: 0.92rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.cw-summary.over .cw-summary-count,
.cw-summary.over {
  color: var(--accent);
}

.cw-section-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.7rem;
}

.cw-section-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.7rem;
}
.cw-section-row .cw-section-label {
  margin-bottom: 0;
}

.cw-reset {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.74rem;
  background: transparent;
  border: 1px solid var(--rule);
  padding: 0.3rem 0.65rem;
  border-radius: 3px;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}
.cw-reset:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--paper-warm);
}

.cw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 2.4rem;
  margin-bottom: 1.75rem;
}
.cw-chips-empty {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  color: var(--ink-faint);
  font-size: 0.95rem;
}
.cw-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0.4rem 0.32rem 0;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  position: relative;
  font-family: 'Inter', sans-serif;
  animation: chip-in 0.25s ease both;
}
@keyframes chip-in {
  from { opacity: 0; transform: translateY(2px); }
}
.cw-chip-tab {
  width: 4px;
  align-self: stretch;
  border-radius: 4px 0 0 4px;
  margin-right: 0.55rem;
}
.cw-chip-name {
  color: var(--ink);
  font-weight: 500;
}
.cw-chip-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.cw-chip-x {
  background: transparent;
  border: 0;
  color: var(--ink-faint);
  cursor: pointer;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  font-family: inherit;
  padding: 0;
}
.cw-chip-x:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.cw-add-section {
  margin-bottom: 1.5rem;
}
.cw-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
}
.cw-add-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 5px;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  text-align: left;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.cw-add-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--cat-color, var(--ink-faint));
  opacity: 0.55;
}
.cw-add-btn:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--paper-warm);
  color: var(--ink);
  transform: translateY(-1px);
}
.cw-add-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.cw-add-btn-name {
  font-weight: 500;
  color: var(--ink);
  padding-left: 0.5rem;
}
.cw-add-btn:disabled .cw-add-btn-name {
  color: var(--ink-muted);
}
.cw-add-btn-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Reset / Compact buttons on the summary line */
.cw-summary {
  flex-wrap: wrap;
}
.cw-summary-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.cw-summary-cost {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-style: normal;
  font-size: 0.85rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.cw-summary.over .cw-summary-cost {
  color: var(--accent);
}
.cw-compact-btn {
  color: var(--accent);
  border-color: rgba(194, 65, 12, 0.35);
  background: rgba(194, 65, 12, 0.04);
}
.cw-compact-btn:hover {
  color: var(--paper);
  background: var(--accent);
  border-color: var(--accent);
}

/* Capability toggle pills (used inside Tools / Skills modals) */
.cw-cap-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.cw-cap-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.85rem 0.5rem 0.7rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--ink-soft);
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}
.cw-cap-toggle:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.cw-cap-mark {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1.5px solid var(--ink-faint);
  position: relative;
  flex-shrink: 0;
}
.cw-cap-toggle[data-on="true"] {
  background: var(--cw-sage);
  color: var(--paper);
  border-color: var(--cw-sage);
}
.cw-cap-toggle[data-on="true"] .cw-cap-mark {
  background: var(--paper);
  border-color: var(--paper);
}
.cw-cap-toggle[data-on="true"] .cw-cap-mark::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cw-sage);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}
.cw-cap-name {
  font-weight: 500;
}
.cw-cap-tokens {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  opacity: 0.65;
}

/* Tool action hint */
.cw-actions-hint {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  color: var(--ink-faint);
  font-size: 0.95rem;
  padding: 0.4rem 0;
}

/* Skill toggles use a different "on" color (ink) so they're distinct from tools (sage) */
.cw-skill-toggle[data-on="true"] {
  background: var(--cw-ink);
  color: var(--paper);
  border-color: var(--cw-ink);
}
.cw-skill-toggle[data-on="true"] .cw-cap-mark::after {
  color: var(--cw-ink);
}

/* ── Thread (chat-style log of context items) ── */
.cw-thread {
  margin-top: 1.1rem;
  padding: 0.7rem 1.1rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.cw-thread-empty {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  color: var(--ink-faint);
  text-align: center;
  padding: 1rem 0;
}
.cw-thread-divider {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.5rem 0;
  color: var(--ink-faint);
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.cw-thread-divider::before,
.cw-thread-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.cw-thread-row {
  display: grid;
  grid-template-columns: 64px 1fr auto auto;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.32rem 0.4rem;
  border-radius: 3px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  animation: thread-in 0.22s ease both;
  cursor: pointer;
  position: relative;
}
.cw-thread-row::after {
  content: 'view raw ›';
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: 0.78rem;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  background: var(--paper-warm);
  padding: 0 0.4rem;
  border-radius: 3px;
}
.cw-thread-row:hover::after {
  opacity: 0.85;
}
@keyframes thread-in {
  from { opacity: 0; transform: translateY(2px); }
}
.cw-thread-row:hover:not(.locked) {
  background: var(--paper-warm);
}
.cw-thread-row.locked {
  background: var(--paper-deep);
}
.cw-thread-row.kind-system {
  font-weight: 500;
  color: var(--ink);
}
.cw-thread-row.kind-tool_def {
  color: var(--ink-soft);
}
.cw-thread-row.kind-tool_call .cw-thread-content,
.cw-thread-row.kind-output .cw-thread-content {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.85rem;
  color: var(--ink);
}
.cw-thread-row.kind-user_msg .cw-thread-content,
.cw-thread-row.kind-assistant .cw-thread-content {
  color: var(--ink);
}

.cw-thread-tag {
  font-family: 'Inter', sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.cw-thread-content {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cw-thread-tokens {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cw-thread-x {
  background: transparent;
  border: 0;
  color: var(--ink-faint);
  cursor: pointer;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  font-family: inherit;
  padding: 0;
}
.cw-thread-x:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.cw-thread-locked-mark {
  cursor: default;
  pointer-events: none;
  color: var(--ink-faint);
}

/* Raw chat-format modal — opens when a thread row is clicked */
.cw-raw-modal {
  position: fixed;
  inset: 0;
  background: rgba(29, 28, 26, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 250;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.16s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.cw-raw-modal[hidden] { display: none; }
.cw-raw-modal.open { opacity: 1; }
.cw-raw-modal-content {
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  padding: 1.6rem 1.85rem 1.5rem;
  max-width: 760px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(8px);
  transition: transform 0.18s ease;
  box-shadow: 0 24px 60px rgba(29, 28, 26, 0.24);
}
.cw-raw-modal.open .cw-raw-modal-content {
  transform: translateY(0);
}
.cw-raw-modal-close {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--ink-faint);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-family: inherit;
  line-height: 1;
}
.cw-raw-modal-close:hover {
  color: var(--ink);
  background: var(--paper-warm);
}
.cw-raw-modal-header {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.85rem;
  padding-right: 2.5rem;
  border-bottom: 1px solid var(--rule);
}
.cw-raw-modal-tag {
  font-family: 'Inter', sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.cw-raw-modal-name {
  flex: 1;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.1rem;
  color: var(--ink);
  letter-spacing: -0.005em;
  word-break: break-word;
}
.cw-raw-modal-tokens {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.85rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cw-raw-modal-body {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink-soft);
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  overflow-x: auto;
}

/* Compaction summary row gets a dotted left tab to signal "not original content" */
.cw-thread-row.kind-compaction_summary {
  background: rgba(124, 94, 124, 0.06);
  border-left: 2px dotted var(--cw-plum);
  padding-left: 0.55rem;
}
.cw-thread-row.kind-compaction_summary .cw-thread-content {
  font-style: italic;
  color: var(--ink-soft);
}

/* ── Composer ── */
.cw-composer {
  margin-top: 1.25rem;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  position: relative;
}
.cw-composer-input {
  display: block;
  width: 100%;
  border: 0;
  outline: none;
  resize: vertical;
  background: transparent;
  padding: 0.65rem 1.1rem 0.45rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.5;
  min-height: 2.4rem;
}
.cw-composer-input::placeholder {
  color: var(--ink-faint);
}
.cw-composer-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem 0.55rem;
  border-top: 1px solid var(--rule);
}
.cw-composer-spacer { flex: 1; }
.cw-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.7rem;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 5px;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  transition: all 0.12s;
}
.cw-tool-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--paper-warm);
}
.cw-tool-btn[data-open="true"] {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--paper-warm);
}
.cw-tool-btn-glyph {
  font-size: 0.95rem;
}
.cw-tool-btn-caret {
  font-size: 0.75rem;
  opacity: 0.6;
}
.cw-est-tokens {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.76rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.cw-send-btn {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  padding: 0.45rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.12s;
}
.cw-send-btn:hover:not(:disabled) {
  background: var(--ink-soft);
}
.cw-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cw-popover-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0.25rem 0 0.55rem;
}
.cw-popover-label:first-child {
  margin-top: 0;
}

/* Header row for popovers that need an action button (e.g. Tools "All on/off") */
.cw-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}
.cw-popover-header .cw-popover-label {
  margin: 0;
}
.cw-toggle-all {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.72rem;
  background: transparent;
  border: 1px solid var(--rule);
  padding: 0.28rem 0.65rem;
  border-radius: 3px;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.12s;
  letter-spacing: 0.04em;
}
.cw-toggle-all:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--paper-warm);
}

/* Lucide icons — sizing and alignment within capability/skill pills, toolbar */
.cw-tool-btn-glyph {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cw-tool-btn-glyph svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
}
.cw-send-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.cw-send-btn-glyph svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}
.cw-cap-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cw-cap-icon svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.75;
}

/* Highlighted "Simulate request" items in the input quick popover */
.cw-quick-item-primary {
  background: var(--paper-deep);
  border-color: var(--ink-muted);
}
.cw-quick-item-primary:hover:not(:disabled) {
  background: var(--paper-warm);
  border-color: var(--ink);
}
.cw-quick-item-desc {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

/* ── Toolbar button badges (e.g. Tools (2), Memory ✓) ── */
.cw-tool-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.32rem;
  margin-left: 0.1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.cw-tool-badge[data-active="true"] {
  display: inline-flex;
}

/* ── Composer popovers (input quick-actions, attach, tools, skills) ── */
/* Popovers open BELOW the composer so they never cover the chat / bar / cost. */
.cw-composer {
  position: relative;
  overflow: visible;
}
.cw-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  padding: 0.95rem 1.1rem 1.05rem;
  box-shadow: 0 12px 32px rgba(29, 28, 26, 0.18);
  /* Maxed so nothing on the page ever obscures it. */
  z-index: 99999;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.13s ease, transform 0.13s ease;
}

/* When a composer popover is open, give the body extra bottom padding so the
   popover always falls inside the document's scrollable area. The user can
   scroll the page to bring the popover into view if it sits below the fold. */
body.cw-popover-open {
  padding-bottom: 600px;
}
.cw-popover[hidden] {
  display: none;
}
.cw-popover.open {
  opacity: 1;
  transform: translateY(0);
}
.cw-quick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
.cw-quick-list:last-child {
  margin-bottom: 0;
}
.cw-quick-item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.75rem;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--ink);
  transition: all 0.12s;
}
.cw-quick-item:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--paper-deep);
}
.cw-quick-item:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.cw-quick-item-tokens {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.74rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}


/* ─────────────────────────────────────────────
   CONTEXT WINDOW EVOLUTION (modal on slide 03)
   ───────────────────────────────────────────── */

.cw-evo-modal {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(29, 28, 26, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.16s ease;
}
.cw-evo-modal[hidden] { display: none; }
.cw-evo-modal.open { opacity: 1; }
body.cw-evo-modal-open { overflow: hidden; }

.cw-evo-modal-content {
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  width: 100%;
  max-width: 960px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.25rem 1.4rem 1rem;
  position: relative;
  transform: translateY(8px);
  transition: transform 0.18s ease;
  box-shadow: 0 24px 60px rgba(29, 28, 26, 0.24);
}
.cw-evo-modal.open .cw-evo-modal-content { transform: translateY(0); }

.cw-evo-modal-close {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.45rem;
  color: var(--ink-faint);
  cursor: pointer;
  border-radius: 6px;
  z-index: 2;
}
.cw-evo-modal-close:hover {
  color: var(--ink);
  background: var(--paper-warm);
}

.cw-evo-modal-head {
  margin-bottom: 0.85rem;
  padding-right: 2rem;
}
.cw-evo-modal-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
}

.cw-evo-chart-wrap {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.65rem 0.5rem 0.35rem;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-warm) 100%);
}

.cw-evo-chart {
  display: block;
  width: 100%;
  height: auto;
}

.cw-evo-grid-line {
  stroke: var(--rule);
  stroke-width: 1;
  stroke-dasharray: 4 6;
}
.cw-evo-grid-line-vert {
  stroke-dasharray: 3 8;
  opacity: 0.65;
}
.cw-evo-axis-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  fill: var(--ink-faint);
}
.cw-evo-axis-label-x {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  fill: var(--ink-muted);
}
.cw-evo-axis-title {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: var(--ink-faint);
}

.cw-evo-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  margin-bottom: 0.75rem;
  background: var(--paper-deep);
  border-radius: 7px;
}
.cw-evo-tab {
  padding: 0.35rem 0.85rem;
  border: none;
  background: transparent;
  border-radius: 5px;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.cw-evo-tab:hover { color: var(--ink); }
.cw-evo-tab.active {
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(29, 28, 26, 0.08);
}

.cw-evo-trend {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 6 5;
  opacity: 0.85;
  pointer-events: none;
}
.cw-evo-trend-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  fill: var(--accent);
  pointer-events: none;
}

.cw-evo-point { cursor: pointer; }
.cw-evo-dot { transition: r 0.12s ease, stroke-width 0.12s ease; }
.cw-evo-point:hover .cw-evo-dot {
  r: 7;
  stroke-width: 2.5;
}

.cw-evo-chart-wrap {
  position: relative;
}
.cw-evo-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  min-width: 180px;
  max-width: 240px;
  box-shadow: 0 8px 24px rgba(29, 28, 26, 0.18);
  font-size: 0.8rem;
  z-index: 10;
}
.cw-evo-tooltip[hidden] { display: none; }
.cw-evo-tt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
.cw-evo-tt-vendor {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  border: 1px solid;
}
.cw-evo-tt-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--ink-faint);
}
.cw-evo-tt-name {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 0.25rem;
}
.cw-evo-tt-ctx {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 0.18rem;
}
.cw-evo-tt-ctx strong {
  color: var(--accent);
  font-weight: 600;
}
.cw-evo-tt-cost {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--ink-muted);
}
.cw-evo-tt-cost-muted {
  font-style: italic;
  opacity: 0.7;
}

.cw-evo-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.75rem;
  justify-content: center;
}
.cw-evo-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--ink-muted);
}
.cw-evo-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.cw-evo-footnote {
  font-size: 0.68rem;
  color: var(--ink-faint);
  margin: 0.55rem 0 0;
  text-align: center;
}

/* ─────────────────────────────────────────────
   PROMPT COMPARISON PLAYGROUND
   ───────────────────────────────────────────── */

.slide:has(.lab) {
  padding: 2.5rem 4rem 4rem;
  max-width: 1500px;
}
.slide:has(.lab) .slide-title { font-size: 2.4rem; margin-bottom: 0.6rem; }
.slide:has(.lab) .slide-eyebrow { margin-bottom: 0.85rem; }
.slide:has(.lab) .slide-subtitle { margin-bottom: 1.6rem; }

.lab {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.lab-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.8rem;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.lab-preset { min-width: 22rem; }

.lab-run {
  min-width: 6.5rem;
  font-weight: 600;
}
.lab-run-stop {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}
.lab-run-stop:hover:not(:disabled) {
  background: var(--accent);
  filter: brightness(1.1);
}

.cmp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.cmp-side {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1rem 1.1rem;
}

.cmp-side-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.cmp-side-label {
  flex: 1;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.cmp-model-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.15rem 0.35rem 0.15rem 0.5rem;
}
.cmp-model-icon {
  width: 13px;
  height: 13px;
  color: var(--ink-faint);
}
.cmp-model {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.72rem;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0.15rem 1.1rem 0.15rem 0;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%236b6760' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0 center;
}
.cmp-model:focus { outline: none; }

.cmp-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  transition: all 0.15s;
}
.cmp-attach-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.cmp-attach-btn[data-open="true"] {
  border-color: var(--ink);
  background: var(--paper-deep);
}
.cmp-attach-glyph {
  width: 13px;
  height: 13px;
}
.cmp-attach-badge {
  display: none;
  min-width: 1.1rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.1rem;
}
.cmp-attach-badge[data-active="true"] {
  display: inline-block;
}

.cmp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 0;
}
.cmp-chips:empty { display: none; }

.cmp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.45rem 0.25rem 0.55rem;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  background: var(--paper);
  border: 1px solid var(--rule);
}
.cmp-chip i {
  width: 12px;
  height: 12px;
}
.cmp-chip-name {
  color: var(--ink-soft);
}
.cmp-chip-tokens {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--ink-faint);
}
.cmp-chip-x {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-faint);
  font-size: 0.95rem;
  line-height: 1;
  padding: 0 0.1rem;
}
.cmp-chip-x:hover { color: var(--ink); }

.cmp-chip-skill {
  border-color: rgba(91, 110, 79, 0.35);
  background: rgba(91, 110, 79, 0.06);
}
.cmp-chip-skill i { color: var(--cw-sage); }

.cmp-chip-doc {
  border-color: rgba(183, 92, 47, 0.35);
  background: rgba(183, 92, 47, 0.06);
}
.cmp-chip-doc i { color: var(--cw-orange); }

textarea.cmp-prompt {
  display: block;
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.5;
  resize: vertical;
  outline: none;
  caret-color: var(--accent);
  transition: border-color 0.15s;
}
textarea.cmp-prompt:focus {
  border-color: var(--ink);
}

.cmp-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--ink-faint);
  margin-top: -0.25rem;
}

.cmp-output {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  min-height: 14rem;
}
.cmp-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  background: var(--paper-warm);
  border-bottom: 1px solid var(--rule);
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
}
.cmp-output-status {
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}
.cmp-output[data-status="streaming"] .cmp-output-status {
  color: var(--accent);
}
.cmp-output[data-status="streaming"] .cmp-output-status::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-left: 0.4rem;
  background: var(--accent);
  animation: pulse-dot 1s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
.cmp-output[data-status="error"] .cmp-output-status {
  color: var(--accent);
}
.cmp-output[data-status="done"] .cmp-output-status {
  color: var(--cw-sage);
}
.cmp-output-tokens {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--ink-faint);
}
.cmp-output-body {
  flex: 1;
  margin: 0;
  padding: 0.85rem 1.1rem;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-soft);
  word-break: break-word;
  overflow-y: auto;
  max-height: 32rem;
}
.cmp-output-body:empty::before {
  content: '— output will stream here —';
  color: var(--ink-faint);
  font-style: italic;
}

/* Rendered-markdown spacing inside the streamed output. Tight so the panel
   feels packed, not spaced like a blog post. */
.cmp-output-body > *:first-child { margin-top: 0; }
.cmp-output-body > *:last-child { margin-bottom: 0; }
.cmp-output-body p {
  margin: 0 0 0.55rem;
}
.cmp-output-body h1,
.cmp-output-body h2,
.cmp-output-body h3,
.cmp-output-body h4 {
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  margin: 0.85rem 0 0.4rem;
  font-weight: 600;
  line-height: 1.25;
}
.cmp-output-body h1 { font-size: 1.05rem; }
.cmp-output-body h2 { font-size: 0.98rem; }
.cmp-output-body h3 { font-size: 0.92rem; }
.cmp-output-body h4 { font-size: 0.88rem; }
.cmp-output-body strong { color: var(--ink); font-weight: 600; }
.cmp-output-body em { font-style: italic; }
.cmp-output-body ul,
.cmp-output-body ol {
  margin: 0 0 0.55rem;
  padding-left: 1.25rem;
}
.cmp-output-body li {
  margin: 0.15rem 0;
}
.cmp-output-body li > p { margin: 0; }
.cmp-output-body code {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.82rem;
  background: var(--code-bg);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
}
.cmp-output-body pre {
  margin: 0 0 0.55rem;
  padding: 0.6rem 0.8rem;
  background: var(--code-bg);
  border-radius: 4px;
  overflow-x: auto;
}
.cmp-output-body pre code {
  background: none;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.5;
}
.cmp-output-body blockquote {
  margin: 0 0 0.55rem;
  padding-left: 0.8rem;
  border-left: 3px solid var(--rule-strong);
  color: var(--ink-muted);
}
.cmp-output-body hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0.7rem 0;
}
.cmp-output-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.cmp-output-body table {
  border-collapse: collapse;
  margin: 0 0 0.55rem;
  font-size: 0.85rem;
}
.cmp-output-body th,
.cmp-output-body td {
  border: 1px solid var(--rule);
  padding: 0.3rem 0.55rem;
  text-align: left;
}
.cmp-output-body th {
  background: var(--paper-warm);
  font-weight: 600;
}

/* ── Attach popover ─────────────────────────────────────── */

.lab-popover {
  position: absolute;
  z-index: 30;
  width: 22rem;
  max-height: 26rem;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(29, 28, 26, 0.12);
  padding: 0.85rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.12s, transform 0.12s;
}
.lab-popover.open {
  opacity: 1;
  transform: translateY(0);
}
.lab-popover-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.45rem;
}
.lab-popover-grid {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.lab-pop-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.45rem 0.55rem;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 5px;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
  transition: all 0.12s;
}
.lab-pop-item:hover {
  border-color: var(--ink);
}
.lab-pop-item[data-on="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.lab-pop-item[data-on="true"] .lab-pop-tokens {
  color: var(--paper);
  opacity: 0.7;
}
.lab-pop-item[data-kind="skill"][data-on="true"] {
  background: var(--cw-sage);
  border-color: var(--cw-sage);
}
.lab-pop-item[data-kind="doc"][data-on="true"] {
  background: var(--cw-orange);
  border-color: var(--cw-orange);
}
.lab-pop-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.lab-pop-name {
  flex: 1;
}
.lab-pop-tokens {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  color: var(--ink-faint);
}

/* ── Chip-as-button (clickable to preview) ──────────────── */

button.cmp-chip {
  font: inherit;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.06s;
}
button.cmp-chip:hover {
  border-color: var(--ink);
}
button.cmp-chip:active {
  transform: translateY(1px);
}

/* ── Attachment preview modal ───────────────────────────── */

.lab-view-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(29, 28, 26, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.16s;
}
/* `display: flex` above otherwise wins over the UA `[hidden]` rule and
   leaves an invisible (opacity: 0) overlay swallowing every click. */
.lab-view-modal[hidden] {
  display: none;
}
.lab-view-modal.open {
  opacity: 1;
}
.lab-view-modal-content {
  position: relative;
  width: min(880px, 100%);
  max-height: 80vh;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(29, 28, 26, 0.25);
  padding: 1.4rem 1.6rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.lab-view-modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.85rem;
  background: none;
  border: none;
  color: var(--ink-faint);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}
.lab-view-modal-close:hover { color: var(--ink); }
.lab-view-modal-head {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  padding-right: 2rem;
}
.lab-view-modal-kind {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.lab-view-modal-kind[data-kind="skill"] {
  background: rgba(91, 110, 79, 0.15);
  color: var(--cw-sage);
}
.lab-view-modal-kind[data-kind="doc"] {
  background: rgba(183, 92, 47, 0.15);
  color: var(--cw-orange);
}
.lab-view-modal-name {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
}
.lab-view-modal-tokens {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--ink-faint);
  white-space: nowrap;
}
.lab-view-modal-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-style: italic;
  margin-bottom: 0.5rem;
}
.lab-view-modal-body {
  flex: 1;
  margin: 0;
  padding: 1rem 1.1rem;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ink-soft);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
}

/* Markdown-rendered variant (applied when previewing a skill). Reuses the
   same visual language as the output body so skill instructions read like
   what the model will produce. */
.lab-view-modal-body--md {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 0.92rem;
  white-space: normal;
}
.lab-view-modal-body--md > *:first-child { margin-top: 0; }
.lab-view-modal-body--md > *:last-child { margin-bottom: 0; }
.lab-view-modal-body--md p { margin: 0 0 0.6rem; }
.lab-view-modal-body--md h1,
.lab-view-modal-body--md h2,
.lab-view-modal-body--md h3,
.lab-view-modal-body--md h4 {
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  margin: 0.95rem 0 0.45rem;
  font-weight: 600;
  line-height: 1.25;
}
.lab-view-modal-body--md h1 { font-size: 1.15rem; }
.lab-view-modal-body--md h2 { font-size: 1.02rem; }
.lab-view-modal-body--md h3 { font-size: 0.94rem; }
.lab-view-modal-body--md h4 { font-size: 0.88rem; }
.lab-view-modal-body--md strong { color: var(--ink); font-weight: 600; }
.lab-view-modal-body--md em { font-style: italic; }
.lab-view-modal-body--md ul,
.lab-view-modal-body--md ol {
  margin: 0 0 0.6rem;
  padding-left: 1.35rem;
}
.lab-view-modal-body--md li { margin: 0.15rem 0; }
.lab-view-modal-body--md li > p { margin: 0; }
.lab-view-modal-body--md code {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.82rem;
  background: var(--paper);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
}
.lab-view-modal-body--md pre {
  margin: 0 0 0.6rem;
  padding: 0.65rem 0.85rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow-x: auto;
}
.lab-view-modal-body--md pre code {
  background: none;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.5;
}
.lab-view-modal-body--md blockquote {
  margin: 0 0 0.6rem;
  padding-left: 0.85rem;
  border-left: 3px solid var(--rule-strong);
  color: var(--ink-muted);
}
.lab-view-modal-body--md hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0.85rem 0;
}
.lab-view-modal-body--md table {
  border-collapse: collapse;
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  width: 100%;
}
.lab-view-modal-body--md th,
.lab-view-modal-body--md td {
  border: 1px solid var(--rule);
  padding: 0.35rem 0.6rem;
  text-align: left;
}
.lab-view-modal-body--md th {
  background: var(--paper);
  font-weight: 600;
}

/* ─────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────── */

@media (max-width: 900px) {
  .slide { padding: 3.5rem 2rem 6rem; }
  .slide-title { font-size: 2.4rem; }
  .slide-subtitle { font-size: 1.15rem; }
  .row.cols-2, .row.cols-3, .row.cols-2-1, .row.cols-1-2 { grid-template-columns: 1fr; }
  .module-grid { grid-template-columns: 1fr; }
  
  .cw-evo-stage { grid-template-columns: 1fr; }
  .cw-evo-detail { min-height: auto; }

  .slide:has(.lab) { padding: 3rem 1.5rem 5rem; }
  .cmp-grid { grid-template-columns: 1fr; }
  .lab-preset { min-width: 0; flex: 1; }
  .lab-popover { width: 18rem; }
}
