/* Shared styling for live in-browser demos (Pyodide / JS).
   Loaded after shared/custom.css and per-lecture custom.css. First used by L17.
   Interactive controls are hidden in print so the DeckTape PDF keeps the
   static fallback (.demo-fallback) that lives inside each .live-demo mount. */

.reveal .live-demo {
  max-width: 94%;
  margin: 0.3em auto 0;
  text-align: left;
}

/* The static fallback (shown before JS upgrade and in print/PDF). */
.reveal .live-demo .demo-fallback {
  color: #6b7280;
  font-size: 0.8em;
}
.reveal .live-demo.is-live .demo-fallback { display: none; }

/* The interactive layer (built by demo.js). Hidden until upgraded. */
.reveal .live-demo .demo-live { display: none; }
.reveal .live-demo.is-live .demo-live { display: block; }

/* Control bar: buttons + sliders. */
.reveal .demo-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5em 0.9em;
  margin: 0.2em 0 0.4em;
}
.reveal .demo-controls .demo-field {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.7em;
  color: #374151;
}
.reveal .demo-controls input[type="range"] { width: 120px; vertical-align: middle; }
.reveal .demo-controls .demo-val {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 600;
  color: #1d4ed8;
  min-width: 2.6em;
  display: inline-block;
}

.reveal .demo-btn {
  font: inherit;
  font-size: 0.72em;
  font-weight: 600;
  color: #fff;
  background: #1d4ed8;
  border: none;
  border-radius: 6px;
  padding: 0.32em 0.9em;
  cursor: pointer;
  transition: background 0.15s ease;
}
.reveal .demo-btn:hover { background: #1e40af; }
.reveal .demo-btn:disabled { background: #9ca3af; cursor: default; }
.reveal .demo-btn.ghost { background: #eef2ff; color: #1d4ed8; }
.reveal .demo-btn.ghost:hover { background: #e0e7ff; }
.reveal .demo-btn.warn { background: #b91c1c; }
.reveal .demo-btn.warn:hover { background: #991b1b; }

/* Status / progress line. */
.reveal .demo-status {
  font-size: 0.68em;
  color: #6b7280;
  min-height: 1.2em;
  margin: 0.1em 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.reveal .demo-status.err { color: #b91c1c; }
.reveal .demo-status.ok { color: #166534; }

/* Editable Python + output. */
.reveal .demo-editor {
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.5em;
  line-height: 1.35;
  background: #f6f8fa;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.5em 0.7em;
  color: #1f2937;
  resize: vertical;
  white-space: pre;
  overflow: auto;
}
.reveal .demo-output {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.56em;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 0.5em 0.7em;
  margin: 0.4em 0 0;
  min-height: 1.5em;
  max-height: 150px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.reveal .demo-output .out-err { color: #fca5a5; }

/* Canvas / plot area. */
.reveal .demo-stage {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8em;
  align-items: flex-start;
  justify-content: center;
}
.reveal .demo-canvas {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  max-width: 100%;
  height: auto;
}
.reveal .demo-readout {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.66em;
  color: #374151;
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}
.reveal .demo-readout b { color: #1d4ed8; }

/* Two-up layout for editor + result. */
.reveal .demo-split {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8em;
  align-items: flex-start;
}
.reveal .demo-split > * { flex: 1 1 320px; min-width: 0; }

/* Softmax-style bars reused inside the loss playground. */
.reveal .demo-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.7em;
  height: 120px;
  margin-top: 1em;
}
.reveal .demo-bars .db-bar {
  width: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}
.reveal .demo-bars .db-fill {
  width: 100%;
  background: #93c5fd;
  border: 1px solid #1d4ed8;
  border-radius: 4px 4px 0 0;
  transition: height 0.12s ease;
}
.reveal .demo-bars .db-bar.hot .db-fill { background: #86efac; border-color: #166534; }
.reveal .demo-bars .db-val { font-size: 0.66em; color: #374151; margin-bottom: 0.2em; }
.reveal .demo-bars .db-lab { font-size: 0.68em; font-weight: 600; margin-top: 0.25em; }

/* Free-text input (embedding explorer): wraps, slightly larger than the code editor. */
.reveal .demo-textbox {
  font-size: 0.62em;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: normal;
  resize: vertical;
}

/* One-line model description above a demo. */
.reveal .demo-note {
  font-size: 0.62em;
  color: #374151;
  margin: 0.1em 0 0.3em;
}
.reveal .demo-note code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.95em;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.05em 0.35em;
  color: #1e293b;
}

/* Small hint under a demo. */
.reveal .demo-hint {
  font-size: 0.62em;
  color: #6b7280;
  margin-top: 0.35em;
}

/* Clickable scatter canvas (embedding explorer). */
.reveal .demo-canvas.clickable { cursor: pointer; }
.reveal .demo-canvas.grabbable { cursor: grab; }
.reveal .demo-canvas.grabbable:active { cursor: grabbing; }

/* PCA 3D->2D demo panels. */
.reveal .pca-panel { text-align: center; }
.reveal .pca-panel .pca-cap { font-size: 0.6em; color: #6b7280; margin-bottom: 0.2em; }

/* WildVis scatter + hover tooltip. */
.reveal .wv-wrap { position: relative; width: max-content; margin: 0 auto; }
.reveal .wv-tip {
  position: absolute;
  display: none;
  pointer-events: none;
  max-width: 250px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  padding: 0.4em 0.55em;
  font-size: 0.5em;
  line-height: 1.35;
  color: #1f2937;
  z-index: 20;
}
.reveal .wv-tip b { color: #166534; text-transform: capitalize; }
.reveal .wv-link {
  font-size: 0.7em;
  font-weight: 600;
  color: #7c3aed;
  text-decoration: none;
  border-bottom: 1px dotted #c4b5fd;
}
.reveal .wv-link:hover { color: #5b21b6; }

/* Persistent one-line caption under a demo-slide title. Stays visible in the
   exported PDF (where the live UI has no results), unlike .demo-fallback. */
.reveal .demo-caption {
  font-size: 0.62em;
  color: #6b7280;
  margin: 0 0 0.25em;
}

/* A subtle "runs live in your browser" badge on demo slides. */
.reveal .demo-badge {
  display: inline-block;
  font-size: 0.55em;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #7c3aed;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: 999px;
  padding: 0.15em 0.7em;
  vertical-align: middle;
  margin-left: 0.4em;
}

/* Active/selected toggle button (sentence + head selectors, causal toggle). */
.reveal .demo-btn.primary { background: #1d4ed8; color: #fff; box-shadow: 0 0 0 2px #bfdbfe; }
.reveal .demo-btn.primary:hover { background: #1e40af; }
.reveal .demo-btn.primary:disabled,
.reveal .demo-btn.primary:disabled:hover { background: #9ca3af; color: #fff; box-shadow: none; cursor: default; }

/* Attention / causal-mask side panel (query -> weight bars). */
.reveal .attn-panel { min-width: 220px; max-width: 300px; font-size: 0.72em; color: #374151; }
.reveal .attn-panel .attn-q { margin: 0.1em 0 0.5em; font-size: 0.95em; }
.reveal .attn-panel .attn-q b { color: #b91c1c; }
.reveal .attn-panel .attn-hint { font-size: 0.82em; color: #6b7280; margin-top: 0.5em; }
.reveal .attn-bars2 { display: flex; flex-direction: column; gap: 0.28em; }
.reveal .attn-row { display: flex; align-items: center; gap: 0.5em; }
.reveal .attn-row.muted { opacity: 0.4; }
.reveal .attn-row .attn-lab { flex: 0 0 4.6em; text-align: right; font-family: ui-monospace, Menlo, monospace; }
.reveal .attn-row .attn-track { flex: 1 1 auto; height: 12px; background: #eef2ff; border-radius: 3px; overflow: hidden; }
.reveal .attn-row .attn-fill { height: 100%; background: #1d4ed8; border-radius: 3px; transition: width 0.12s ease; }
.reveal .attn-row .attn-num { flex: 0 0 2.4em; font-family: ui-monospace, Menlo, monospace; color: #1d4ed8; font-weight: 600; }

/* Text input used by the L20 tokenizer / LM demos. */
.reveal .demo-input {
  font: inherit; font-size: 0.7em;
  padding: 0.3em 0.55em; min-width: 20em;
  border: 1px solid #cbd5e1; border-radius: 6px;
  font-family: ui-monospace, Menlo, monospace;
}

/* Tokenizer chips: piece on top, id below, cycled colors. */
.reveal .tokchips { display: flex; flex-wrap: wrap; gap: 0.35em; justify-content: center; margin: 0.5em auto; max-width: 92%; }
.reveal .tokchip { display: flex; flex-direction: column; align-items: center; border-radius: 6px; padding: 0.22em 0.5em; border: 1px solid; }
.reveal .tokchip .tp { font-family: ui-monospace, Menlo, monospace; font-size: 0.8em; font-weight: 700; }
.reveal .tokchip .ti { font-size: 0.6em; color: #6b7280; }
.reveal .tokchip.c0 { background: #eff6ff; border-color: #bfdbfe; }
.reveal .tokchip.c1 { background: #ecfdf5; border-color: #a7f3d0; }
.reveal .tokchip.c2 { background: #fef3c7; border-color: #fde68a; }
.reveal .tokchip.c3 { background: #fae8ff; border-color: #f5d0fe; }
.reveal .tokchip.c4 { background: #ffe4e6; border-color: #fecdd3; }

/* L20 tokenizer / loss / one-step language-model demos. */
.reveal .tokenizer-readout {
  flex-direction: row;
  justify-content: center;
  gap: 1.1em;
  margin-top: 0.25em;
}

.reveal .loss-timeline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.28em;
  margin: 0.35em auto;
  max-width: 96%;
}
.reveal .loss-token {
  min-width: 4.1em;
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 0.28em 0.38em;
  font: inherit;
  cursor: pointer;
  color: #1f2937;
}
.reveal .loss-token span,
.reveal .loss-token small { display: block; }
.reveal .loss-token span { font-family: ui-monospace, Menlo, monospace; font-size: 0.82em; font-weight: 700; }
.reveal .loss-token small { margin-top: 0.08em; font-size: 0.58em; opacity: 0.8; }
.reveal .loss-token.low { background: #dcfce7; color: #166534; }
.reveal .loss-token.mid { background: #fef3c7; color: #92400e; }
.reveal .loss-token.high { background: #fee2e2; color: #b91c1c; }
.reveal .loss-token.selected { border-color: #1d4ed8; box-shadow: 0 0 0 2px #bfdbfe; }
.reveal .loss-token:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }

.reveal .loss-inspector {
  display: grid;
  grid-template-columns: 1.45fr 1fr auto;
  align-items: center;
  gap: 0.45em;
  max-width: 96%;
  margin: 0.4em auto;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
  padding: 0.42em 0.55em;
}
.reveal .loss-prefix {
  min-width: 0;
  text-align: left;
}
.reveal .loss-prefix > span {
  display: block;
  color: #64748b;
  font-size: 0.58em;
  margin-bottom: 0.12em;
}
.reveal .loss-prefix code {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.68em;
  color: #1e3a8a;
}
.reveal .loss-detail {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 0.45em;
  font-size: 0.66em;
  color: #475569;
  white-space: nowrap;
}
.reveal .loss-detail b { color: #1d4ed8; }
.reveal .loss-verdict {
  border-radius: 5px;
  padding: 0.28em 0.4em;
  font-size: 0.58em;
  line-height: 1.25;
  text-align: center;
}
.reveal .loss-verdict.low { background: #dcfce7; color: #166534; }
.reveal .loss-verdict.mid { background: #fef3c7; color: #92400e; }
.reveal .loss-verdict.high { background: #fee2e2; color: #b91c1c; }
.reveal .loss-summary {
  display: flex;
  justify-content: center;
  gap: 0.5em;
}
.reveal .loss-summary span {
  border-radius: 5px;
  background: #eef2ff;
  color: #475569;
  padding: 0.22em 0.42em;
  font-size: 0.62em;
}
.reveal .loss-summary b { color: #1d4ed8; }

.reveal .lm-step-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: start;
  gap: 0.7em;
  max-width: 96%;
  margin: 0 auto;
}
.reveal .lm-step-left,
.reveal .lm-step-right { min-width: 0; }
.reveal .lm-step-bars { display: grid; gap: 0.2em; }
.reveal .lm-step-row {
  display: grid;
  grid-template-columns: 5em 1fr 4.6em;
  align-items: center;
  gap: 0.4em;
  font-size: 0.67em;
}
.reveal .lm-step-token {
  font-family: ui-monospace, Menlo, monospace;
  text-align: right;
}
.reveal .lm-step-track {
  height: 11px;
  border-radius: 3px;
  background: #e2e8f0;
  overflow: hidden;
}
.reveal .lm-step-fill { height: 100%; border-radius: 3px; background: #60a5fa; }
.reveal .lm-step-row.top .lm-step-fill { background: #22c55e; }
.reveal .lm-step-prob { font-family: ui-monospace, Menlo, monospace; color: #1d4ed8; }
.reveal .lm-step-tail {
  display: flex;
  justify-content: space-between;
  margin: 0.18em 0 0 5.4em;
  border-top: 1px dashed #cbd5e1;
  padding-top: 0.18em;
  color: #64748b;
  font-size: 0.58em;
}
.reveal .lm-step-tail b { color: #475569; font-family: ui-monospace, Menlo, monospace; }
.reveal .lm-step-right .demo-controls { margin-top: 0; }
.reveal .lm-step-modes,
.reveal .lm-step-actions { justify-content: center; }
.reveal .lm-step-done {
  display: grid;
  place-items: center;
  min-height: 9em;
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  color: #64748b;
  font-size: 0.66em;
  text-align: center;
}
.reveal .lm-step-result {
  min-height: 8em;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
  padding: 0.45em 0.55em;
}
.reveal .lm-step-placeholder { display: block; color: #64748b; font-size: 0.65em; line-height: 1.35; }
.reveal .lm-step-method { color: #475569; font-size: 0.62em; line-height: 1.35; }
.reveal .lm-step-method b { color: #1d4ed8; }
.reveal .lm-step-context {
  display: flex;
  flex-wrap: wrap;
  margin-top: 0.45em;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.68em;
  line-height: 1.5;
}
.reveal .lm-step-context mark {
  border-radius: 3px;
  background: #dcfce7;
  color: #166534;
  font-weight: 750;
}

.reveal [data-demo="lm-chat"] .lm-next-left { font-size: 0.6em; }

/* lm-next layout + generation output. */
.reveal .lm-next-left { min-width: 300px; max-width: 380px; }
.reveal .lm-next-right { min-width: 260px; max-width: 340px; }
.reveal .lm-prompt { font-size: 0.72em; color: #374151; margin-bottom: 0.4em; }
.reveal .lm-prompt b { color: #1d4ed8; }
.reveal .lm-gen { margin-top: 0.5em; font-family: ui-monospace, Menlo, monospace; font-size: 0.66em; line-height: 1.5; color: #1f2937; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 6px; padding: 0.5em 0.7em; min-height: 3.2em; max-height: 300px; overflow: auto; white-space: pre-wrap; }
.reveal .attn-row.top .attn-fill { background: #16a34a; }
.reveal .attn-row .attn-fill.lo { background: #16a34a; }
.reveal .attn-row .attn-fill.mid { background: #1d4ed8; }
.reveal .attn-row .attn-fill.hi { background: #dc2626; }

/* RAG retrieval playground. */
.reveal .rag-left { min-width: 400px; max-width: 500px; }
.reveal .rag-right { min-width: 300px; max-width: 380px; }
.reveal .rag-chunks { display: flex; flex-direction: column; gap: 0.3em; }
.reveal .rag-row { display: flex; align-items: center; gap: 0.5em; font-size: 0.55em; opacity: 0.6; }
.reveal .rag-row.top { opacity: 1; }
.reveal .rag-src { flex: 0 0 5.2em; text-align: center; font-family: ui-monospace, Menlo, monospace; font-size: 0.85em; color: #6b21a8; background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 4px; padding: 0.1em 0.2em; }
.reveal .rag-txt { flex: 1 1 auto; }
.reveal .rag-tt { line-height: 1.25; }
.reveal .rag-bar { height: 5px; background: #eef2ff; border-radius: 3px; margin-top: 0.2em; }
.reveal .rag-fill { height: 100%; background: #1d4ed8; border-radius: 3px; }
.reveal .rag-row.top .rag-fill { background: #16a34a; }
.reveal .rag-score { flex: 0 0 2.2em; text-align: right; font-family: ui-monospace, Menlo, monospace; color: #1d4ed8; font-weight: 600; }
.reveal .rag-prompt { font-family: ui-monospace, Menlo, monospace; font-size: 0.58em; line-height: 1.4; text-align: left; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 6px; padding: 0.55em 0.7em; max-height: 250px; overflow: auto; }
.reveal [data-demo="rag"] .demo-controls .demo-btn { font-size: 0.62em; }
.reveal .rag-prompt .rp-line { margin: 0.15em 0; }
.reveal .rag-prompt .sys { color: #6b7280; }
.reveal .rag-prompt .ctx { color: #166534; }
.reveal .rag-prompt .q { color: #1d4ed8; font-weight: 600; }

/* Tool-use loop transcript. */
.reveal .tool-loop { display: flex; flex-direction: column; gap: 0.4em; max-width: 80%; margin: 0.3em auto; text-align: left; }
.reveal .tl-row { display: flex; gap: 0.6em; align-items: flex-start; font-size: 0.66em; }
.reveal .tl-role { flex: 0 0 5em; text-align: right; font-family: ui-monospace, Menlo, monospace; font-weight: 700; color: #6b7280; }
.reveal .tl-text { flex: 1 1 auto; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 6px; padding: 0.35em 0.6em; }
.reveal .tl-row.model .tl-role { color: #1d4ed8; }
.reveal .tl-row.call .tl-text, .reveal .tl-row.tool .tl-text { font-family: ui-monospace, Menlo, monospace; }
.reveal .tl-row.call .tl-role, .reveal .tl-row.tool .tl-role { color: #6b21a8; }
.reveal .tl-row.tool .tl-text { background: #f5f3ff; border-color: #ddd6fe; color: #6b21a8; font-weight: 700; }

/* LoRA low-rank visualizer. */
.reveal .lora-panel { text-align: center; }
.reveal .lora-panel .lora-cap { font-size: 0.62em; color: #6b7280; margin-bottom: 0.2em; font-family: ui-monospace, Menlo, monospace; }

/* VLM demos: image on the left, prompt/answer or CLIP bars on the right. */
.reveal .vlm-left { flex: 0 0 auto; }
.reveal .vlm-right { min-width: 300px; max-width: 420px; }
.reveal .vlm-img { max-width: 300px; max-height: 300px; border: 1px solid #e5e7eb; border-radius: 8px; display: block; }
.reveal .vlm-prompt { font-size: 0.72em; color: #1d4ed8; font-weight: 600; margin-bottom: 0.5em; }
.reveal .vlm-answer { font-size: 0.72em; color: #166534; line-height: 1.4; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 6px; padding: 0.5em 0.7em; }
.reveal .clip-lab { flex: 0 0 11em; font-size: 0.9em; }
.reveal [data-demo="clip-match"] .attn-bars2 { font-size: 0.7em; }

/* Chat-template inspector: show the templated model input with special tokens. */
.reveal .chat-tmpl {
  font-family: ui-monospace, Menlo, monospace; font-size: 0.56em; line-height: 1.5;
  text-align: left; white-space: pre-wrap; word-break: break-word;
  background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 6px;
  padding: 0.6em 0.8em; max-width: 88%; margin: 0.3em auto; max-height: 340px; overflow: auto;
}
.reveal .chat-tmpl .sp { color: #7c3aed; font-weight: 700; }
.reveal .chat-tmpl .sp.think { color: #b45309; }

/* Permutation demo: two side-by-side sentence groups + a verdict line. */
.reveal .attn-permute-wrap, .reveal [data-demo="attn-permute"] .demo-live > div > div:last-child { }
.reveal .permute-grp { display: inline-block; vertical-align: top; width: 46%; margin: 0 1.5% 0.5em; font-size: 0.72em; }
.reveal .permute-grp .attn-q { margin: 0 0 0.35em; }
.reveal .permute-verdict { font-size: 0.72em; margin: 0.4em 0 0; padding: 0.4em 0.6em; border-radius: 6px; }
.reveal .permute-verdict.same { background: #fef3c7; border: 1px solid #f59e0b; color: #92400e; }
.reveal .permute-verdict.diff { background: #dcfce7; border: 1px solid #16a34a; color: #166534; }

/* PAW compile -> hosted infer activity. */
.reveal [data-demo="paw-compile"] { max-width: 98%; margin-top: 0.18em; }
.reveal .paw-compile-demo { font-size: 0.94em; }
.reveal .paw-stages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  margin: 0 0 0.35em;
}
.reveal .paw-stage {
  min-width: 7em;
  padding: 0.22em 0.55em;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.58em;
  font-weight: 700;
  text-align: center;
}
.reveal .paw-stage.active { border-color: #2563eb; background: #dbeafe; color: #1d4ed8; }
.reveal .paw-stage.done { border-color: #86efac; background: #ecfdf5; color: #166534; }
.reveal .paw-stage-arrow { color: #94a3b8; font-size: 0.65em; }
.reveal .paw-demo-split { gap: 0.62em; flex-wrap: nowrap; }
.reveal .paw-demo-split > * { flex-basis: 50%; }
.reveal .paw-demo-panel {
  min-width: 0;
  padding: 0.42em 0.5em;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  background: #fff;
}
.reveal .paw-demo-label {
  display: block;
  margin: 0 0 0.25em;
  color: #1e3a8a;
  font-size: 0.61em;
  font-weight: 800;
}
.reveal .paw-spec {
  height: 252px;
  min-height: 252px;
  resize: none;
  font-size: 0.39em;
  line-height: 1.28;
}
.reveal .paw-input {
  height: 70px;
  min-height: 70px;
  resize: none;
  font-size: 0.48em;
  line-height: 1.3;
}
.reveal [data-demo="paw-compile"] .demo-controls {
  margin: 0.3em 0 0.25em;
  gap: 0.35em;
}
.reveal [data-demo="paw-compile"] .demo-btn { font-size: 0.58em; }
.reveal .paw-program-meta {
  padding: 0.25em 0.38em;
  border-radius: 5px;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.48em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reveal .paw-program-id { color: #166534; font-size: 0.98em; }
.reveal .paw-presets {
  display: flex;
  gap: 0.28em;
  margin-bottom: 0.3em;
}
.reveal .paw-presets .demo-btn { flex: 1; padding: 0.25em 0.32em; }
.reveal .paw-run-history {
  min-height: 130px;
  max-height: 130px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
}
.reveal .paw-empty { padding: 1.1em 0.7em; color: #94a3b8; font-size: 0.5em; text-align: center; }
.reveal .paw-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(4em, auto) auto;
  gap: 0.35em;
  align-items: center;
  padding: 0.36em 0.45em;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.49em;
}
.reveal .paw-result-row:last-child { border-bottom: 0; }
.reveal .paw-result-input { color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reveal .paw-result-arrow { color: #94a3b8; }
.reveal .paw-result-output { color: #166534; font-weight: 800; }
.reveal .paw-result-latency { color: #94a3b8; font-family: ui-monospace, Menlo, monospace; font-size: 0.86em; }
.reveal .paw-privacy-note {
  margin-top: 0.32em;
  color: #64748b;
  font-size: 0.45em;
  text-align: center;
}
.reveal [data-demo="paw-compile"] .demo-status { margin-top: 0.22em; font-size: 0.53em; }
.reveal [data-demo="paw-compile"] textarea:focus,
.reveal [data-demo="paw-compile"] button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

@media print {
  .reveal .live-demo .demo-live { display: none !important; }
  .reveal .live-demo .demo-fallback { display: block !important; }
  .reveal .demo-badge { display: none; }
}
