/* ---- ScriptCue • Modern site ---- */
:root {
  --bg: #07070d;
  --bg-2: #0d0d18;
  --bg-3: #14141f;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f1f3fb;
  --text-dim: #a4a8bd;
  --text-mute: #6a6d80;
  --accent: #2bd4ff;     /* electric cyan — from logo */
  --accent-2: #5b6dff;   /* indigo — from logo */
  --accent-3: #8a5bff;   /* deep violet */
  --accent-glow: rgba(43, 212, 255, 0.45);
  --grad: linear-gradient(110deg, #2bd4ff 0%, #5b6dff 55%, #8a5bff 100%);
  --grad-soft: linear-gradient(110deg, rgba(43,212,255,0.18), rgba(138,91,255,0.18));
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --sans: 'Geist', 'Inter', system-ui, -apple-system, sans-serif;
  --display: 'Geist', 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: #000; }

/* layout */
.page { position: relative; isolation: isolate; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 32px; position: relative; }
@media (max-width: 720px) { .container { padding: 0 20px; } }

/* background canvas */
.bg-canvas { position: fixed; inset: 0; z-index: -2; background:
  radial-gradient(1200px 600px at 80% -10%, rgba(91,109,255,0.18), transparent 60%),
  radial-gradient(900px 600px at 0% 30%, rgba(43,212,255,0.12), transparent 60%),
  var(--bg);
}
.bg-grid { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 80%);
}
.bg-noise { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.04; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/></svg>");
}

/* nav */
.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: rgba(7,7,13,0.55); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-brand img { width: 26px; height: 26px; }
.nav-brand b { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; font-size: 16px; }
.nav-brand sub { font-family: var(--mono); font-size: 10px; color: var(--text-mute); margin-left: 6px; letter-spacing: 0.04em; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { font-size: 13.5px; color: var(--text-dim); transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta { display: flex; gap: 10px; align-items: center; }
@media (max-width: 940px) { .nav-links { gap: 16px; } .nav-brand sub { display: none; } }
@media (max-width: 720px) { .nav-links { display: none; } }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px;
  font-family: var(--sans); font-size: 13.5px; font-weight: 500; letter-spacing: -0.005em;
  border: 1px solid var(--line-strong); color: var(--text); background: rgba(255,255,255,0.03);
  transition: all 0.18s; cursor: pointer; }
.btn:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.28); }
.btn-primary { background: var(--grad); color: #060616; border: 0; font-weight: 600; box-shadow: 0 6px 30px -8px var(--accent-glow); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 40px -8px var(--accent-glow); }
.btn-lg { padding: 14px 22px; font-size: 14.5px; }
.btn-mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; }

.badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  font-family: var(--sans); font-size: 12.5px; font-weight: 500;
  border: 1px solid var(--line-strong); color: var(--text-dim); background: rgba(255,255,255,0.03);
  cursor: default; user-select: none; }
.badge-mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; }

/* utility */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px;
  color: var(--accent); letter-spacing: 0.18em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.gradient-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ============ HERO ============ */
.hero { position: relative; padding: 80px 0 120px; overflow: hidden; }
.hero-grid-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(700px 400px at 50% 30%, rgba(91,109,255,0.18), transparent 60%);
}
.script-rain { position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: 0.55;
  mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
}
.rain-col { position: absolute; top: 0; font-family: var(--mono); font-size: 11px; line-height: 1.7;
  color: rgba(160, 200, 255, 0.5); white-space: nowrap; writing-mode: vertical-rl; }
.rain-col span { display: inline-block; }
.rain-col .hot { color: var(--accent); text-shadow: 0 0 12px var(--accent-glow); }

.hero-inner { position: relative; z-index: 2; padding-top: 60px; }
.hero-tag { margin-bottom: 28px; }
.hero h1 { font-family: var(--display); font-weight: 600; letter-spacing: -0.035em; font-size: clamp(40px, 7vw, 92px);
  line-height: 0.95; max-width: 1100px; text-wrap: balance; }
.hero h1 .line { display: block; }
.hero h1 .swap { display: inline-block; min-width: 0.6ch; position: relative; }
.hero-sub { margin-top: 28px; max-width: 580px; font-size: 17px; color: var(--text-dim); line-height: 1.55; }
.hero-actions { margin-top: 36px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-meta { margin-top: 56px; display: flex; gap: 36px; align-items: flex-end; flex-wrap: wrap; }
.hero-meta-item { font-family: var(--mono); font-size: 11.5px; color: var(--text-mute); letter-spacing: 0.08em; text-transform: uppercase; }
.hero-meta-item b { display: block; font-family: var(--display); color: var(--text); font-size: 24px; letter-spacing: -0.02em; text-transform: none; margin-top: 6px; font-weight: 600; }

/* cycling word ticker */
.cycle-wrap { display: inline-grid; grid-template-columns: auto; vertical-align: baseline; position: relative; }
.cycle-wrap::before { content: ""; position: absolute; left: -6px; right: -6px; top: 0; bottom: 0;
  background: var(--grad-soft); border-radius: 14px; z-index: -1; opacity: 0.45; }
.cycle-word { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  display: inline-block; position: relative; }
.caret { display: inline-block; width: 0.06em; height: 0.85em; background: var(--accent);
  vertical-align: -0.08em; margin-left: 0.06em; box-shadow: 0 0 10px var(--accent-glow);
  animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ============ marquee logos ============ */
.marquee { position: relative; padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.015); overflow: hidden; }
.marquee-label { font-family: var(--mono); font-size: 10.5px; color: var(--text-mute); letter-spacing: 0.22em; text-transform: uppercase; margin-bottom: 12px; }
.marquee-track { display: flex; gap: 64px; animation: marquee 160s linear infinite; width: max-content; }
.marquee-item { font-family: var(--mono); font-size: 13px; color: var(--text-dim); white-space: nowrap; display: flex; align-items: center; gap: 10px; transition: all 0.3s ease; cursor: default; }
.marquee-item:hover { color: var(--text); filter: blur(0.6px); text-shadow: 0 0 10px var(--accent-glow), 0 0 20px var(--accent-glow); }
.marquee-item::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: 0.6; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============ many scripts grid ============ */
.section { padding: 120px 0; position: relative; }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: end; margin-bottom: 56px; }
@media (max-width: 860px) { .section-head { grid-template-columns: 1fr; gap: 24px; } }
.section-head h2 { font-family: var(--display); font-weight: 600; font-size: clamp(34px, 4.5vw, 60px); letter-spacing: -0.03em; line-height: 1.0; text-wrap: balance; }
.section-head p { color: var(--text-dim); font-size: 16px; line-height: 1.6; max-width: 480px; }
.section-head .eyebrow { margin-bottom: 18px; }

.script-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.script-card { grid-column: span 4; min-height: 360px; border: 1px solid var(--line); border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.005));
  padding: 22px; position: relative; overflow: hidden; display: flex; flex-direction: column;
  transition: border-color 0.3s, transform 0.3s; }
.script-card:hover { border-color: rgba(43,212,255,0.4); transform: translateY(-2px); }
.script-card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit;
  padding: 1px; background: linear-gradient(160deg, rgba(43,212,255,0.4), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.script-card:hover::before { opacity: 1; }
.script-card.wide { grid-column: span 8; }
.script-card.tall { min-height: 420px; }
@media (max-width: 1020px) { .script-card, .script-card.wide { grid-column: span 6; } }
@media (max-width: 680px) { .script-card, .script-card.wide { grid-column: span 12; } }

.script-card .label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.script-card .label .name { font-family: var(--mono); font-size: 11px; color: var(--text-mute); letter-spacing: 0.16em; text-transform: uppercase; }
.script-card .label .tag { font-family: var(--mono); font-size: 10.5px; color: var(--accent); padding: 3px 8px; border: 1px solid rgba(43,212,255,0.3); border-radius: 999px; }
.script-card .title { font-family: var(--display); font-weight: 500; font-size: 18px; letter-spacing: -0.012em; margin-bottom: 18px; color: var(--text); }
.script-card .body { flex: 1; font-family: var(--mono); font-size: 13px; line-height: 1.7; color: var(--text-dim); position: relative; overflow: hidden; }

.script-card.kind-typer .body { white-space: pre-wrap; }
.script-card.kind-typer .body .cursor { display: inline-block; width: 0.55ch; height: 1em; vertical-align: -2px;
  background: var(--accent); animation: blink 1s steps(2) infinite; margin-left: 2px; }

.script-card.kind-scramble .body { font-size: 14px; }
.script-card.kind-cascade .body { font-family: var(--display); font-size: 22px; line-height: 1.25; font-weight: 500; letter-spacing: -0.018em; }
.script-card.kind-cascade .body span { display: inline-block; }

.script-card.kind-reflow .body { font-family: var(--display); font-size: 18px; line-height: 1.4; letter-spacing: -0.01em; }
.script-card.kind-reflow .body em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.script-card.kind-marquee { padding: 0; }
.script-card.kind-marquee .label, .script-card.kind-marquee .title { padding-left: 22px; padding-right: 22px; }
.script-card.kind-marquee .label { padding-top: 22px; }
.script-card.kind-marquee .body { padding: 0; overflow: hidden; }
.scroll-col { position: absolute; left: 22px; right: 22px; }

/* big featured card (active teleprompter) */
.script-card.featured { background: radial-gradient(900px 400px at 30% 0%, rgba(91,109,255,0.18), transparent 60%), linear-gradient(180deg, #0d0e1a, #0a0a14); }
.featured-stage { position: relative; height: 280px; overflow: hidden; border-radius: 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0.4), transparent), #07070d;
  border: 1px solid var(--line); }
.featured-stage::before, .featured-stage::after { content: ""; position: absolute; left: 0; right: 0; height: 60px; pointer-events: none; z-index: 2; }
.featured-stage::before { top: 0; background: linear-gradient(to bottom, #0a0a14, transparent); }
.featured-stage::after { bottom: 0; background: linear-gradient(to top, #0a0a14, transparent); }
.featured-stage .reading { position: absolute; left: 0; right: 0; padding: 0 36px; will-change: transform; }
.featured-stage .reading p { font-family: var(--display); font-weight: 500; font-size: 24px; line-height: 1.5; letter-spacing: -0.015em; color: rgba(241,243,251,0.32); padding: 14px 0; transition: color 0.3s; }
.featured-stage .reading p.h { color: var(--accent); font-weight: 600; }
.featured-stage .reading p.live { color: var(--text); }
.featured-stage .scan { position: absolute; left: 0; right: 0; top: 50%; height: 70px; transform: translateY(-50%);
  pointer-events: none; z-index: 1; background: linear-gradient(180deg, transparent, rgba(43,212,255,0.07), transparent);
  border-top: 1px solid rgba(43,212,255,0.18); border-bottom: 1px solid rgba(43,212,255,0.18); }

/* ============================================================
   Demo replica — scoped under .scd-*  (see DEMO_REPLICATION_PLAN.md)
   ============================================================ */
.demo { padding: 100px 0 140px; }

/* §6.2 — faux-desktop backdrop so panel-opacity has something to bleed through */
.scd-stage {
  position: relative;
  padding: 28px;
  border-radius: 16px;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(60% 50% at 20% 30%, rgba(91,141,250,0.18), transparent 60%),
    radial-gradient(50% 40% at 80% 70%, rgba(138,91,255,0.16), transparent 60%),
    linear-gradient(180deg, #0a0c14 0%, #060810 100%);
}
.scd-stage::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    linear-gradient(0deg, rgba(255,255,255,0.04), transparent 30%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.018) 0 2px, transparent 2px 18px);
  mix-blend-mode: screen;
}

/* §6.1 — app shell tokens (dark default) */
.scd-app {
  --scd-bg-shell:         rgba(10, 10, 22, 0.035);
  --scd-bg-title:         rgba(30, 30, 45, 0.546);
  --scd-bg-panel:         rgba(20, 20, 35, 0.476);
  --scd-bg-control:       rgba(20, 20, 35, 0.518);
  --scd-bg-reading:       rgba(15, 15, 28, 0.266);
  --scd-bg-hover:         rgba(255, 255, 255, 0.065);
  --scd-bg-active:        rgba(59, 130, 246, 0.206);
  --scd-border-subtle:    rgba(255, 255, 255, 0.076);
  --scd-border-medium:    rgba(255, 255, 255, 0.134);
  --scd-text-primary:     #FFFFFF;
  --scd-text-secondary:   rgba(180, 180, 200, 0.85);
  --scd-text-dim:         rgba(140, 140, 160, 0.65);
  --scd-accent-blue:      #3B82F6;
  --scd-accent-blue-lt:   #60A5FA;
  --scd-accent-blue-glow: rgba(59, 130, 246, 0.5);
  --scd-accent-save:      #EF4444;
  --scd-guide-line:       rgba(0, 200, 255, 0.234);
  --scd-shell-shadow:     0 8px 32px rgba(0, 0, 0, 0.156), 0 0 0 1px rgba(255,255,255,0.038) inset;
  --scd-text-opacity:     1;
  --scd-focus-guide-opacity: 1;
  --scd-glass-blur:       20px;
  --scd-radius-outer:     12px;
  --scd-radius-inner:     8px;
  --scd-radius-sm:        6px;
  --scd-text-shadow:      2px 2px 4px rgba(0,0,0,0.9), -1px -1px 2px rgba(0,0,0,0.7);
  --scd-font-size:        24px;

  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 600px;
  border-radius: var(--scd-radius-outer);
  border: 1px solid var(--scd-border-subtle);
  background: var(--scd-bg-shell);
  backdrop-filter: blur(var(--scd-glass-blur));
  -webkit-backdrop-filter: blur(var(--scd-glass-blur));
  box-shadow: var(--scd-shell-shadow);
  overflow: hidden;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  color: var(--scd-text-primary);
  transition: border-color 0.2s ease, border-width 0.2s ease;
}

/* ----- Title Bar (§6.3, src index.css 86-169) ----- */
.scd-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  height: 36px; padding: 0 12px;
  background: var(--scd-bg-title);
  border-bottom: 1px solid var(--scd-border-subtle);
  flex-shrink: 0;
}
.scd-titlebar-left { display: flex; align-items: center; gap: 8px; }
.scd-app-icon { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex-shrink: 0; }
.scd-app-icon img { object-fit: contain; }
.scd-app-name { font-size: 13px; font-weight: 600; color: var(--scd-text-primary); letter-spacing: 0.01em; }
.scd-app-name sup { font-size: 9px; opacity: 0.6; vertical-align: super; margin-left: 1px; }

.scd-titlebar-right { display: flex; align-items: center; gap: 8px; }
.scd-save-btn {
  background: var(--scd-accent-save);
  color: white; border: none; border-radius: 12px;
  font-size: 12px; font-weight: 500; padding: 3px 12px; height: 24px;
  cursor: pointer; font-family: inherit;
  transition: background 0.15s ease, transform 0.1s ease;
}
.scd-save-btn:hover  { background: #DC2626; transform: scale(1.03); }
.scd-save-btn:active { transform: scale(0.97); }

.scd-title-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border: none; border-radius: 4px;
  background: none; color: var(--scd-text-secondary); cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.scd-title-icon-btn:hover { background: var(--scd-bg-hover); color: var(--scd-text-primary); }

.scd-window-controls { display: flex; align-items: center; gap: 7px; padding-left: 4px; }
.scd-wc-btn { width: 12px; height: 12px; border-radius: 50%; border: none; cursor: pointer; padding: 0;
  transition: filter 0.15s ease, transform 0.1s ease; }
.scd-wc-btn:hover  { filter: brightness(1.25); transform: scale(1.1); }
.scd-wc-btn:active { transform: scale(0.9); }
.scd-wc-close { background: #EF4444; }

/* ----- Body layout ----- */
.scd-body { display: flex; flex: 1; overflow: hidden; min-height: 0; }

/* ----- Sidebar (§6.6, src index.css 180-571) ----- */
.scd-sidebar {
  background: var(--scd-bg-panel);
  border-right: 1px solid var(--scd-border-subtle);
  display: flex; flex-direction: column; overflow: hidden; flex-shrink: 0;
  transition: width 300ms ease, opacity 200ms ease;
}
.scd-sidebar--expanded  { width: 180px; opacity: 1; }
.scd-sidebar--collapsed { width: 0; opacity: 0; }

.scd-sidebar-inner { width: 180px; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.scd-sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 8px;
}
.scd-sidebar-title { font-size: 13px; font-weight: 600; color: var(--scd-text-primary); }
.scd-sidebar-add-btn {
  background: none; border: 1px solid var(--scd-border-medium); color: var(--scd-text-secondary);
  width: 20px; height: 20px; border-radius: 4px; font-size: 15px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-family: inherit;
  transition: all 0.15s ease;
}
.scd-sidebar-add-btn:hover { background: var(--scd-accent-blue); border-color: var(--scd-accent-blue); color: white; }
.scd-sidebar-divider { height: 1px; background: var(--scd-border-subtle); }

.scd-sidebar-doc-list { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 0; }
.scd-sidebar-doc-list::-webkit-scrollbar { width: 3px; }
.scd-sidebar-doc-list::-webkit-scrollbar-track { background: transparent; }
.scd-sidebar-doc-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

.scd-folder-item { border-bottom: 1px solid var(--scd-border-subtle); }
.scd-folder-item:last-child { border-bottom: none; }
.scd-folder-header {
  display: flex; align-items: center; height: 30px;
  padding: 0 6px 0 8px; gap: 5px; cursor: pointer; user-select: none;
  transition: background 0.12s ease;
}
.scd-folder-header:hover { background: var(--scd-bg-hover); }
.scd-folder-collapse-icon { flex-shrink: 0; color: var(--scd-text-dim); display: flex; align-items: center; transition: transform 0.15s ease; }
.scd-folder-collapse-icon--collapsed { transform: rotate(-90deg); }
.scd-folder-name { font-size: 12px; font-weight: 600; color: var(--scd-text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.scd-folder-doc-count { font-size: 10px; color: var(--scd-text-dim); flex-shrink: 0; min-width: 12px; text-align: right; }
.scd-folder-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; opacity: 0; transition: opacity 0.12s ease; }
.scd-folder-header:hover .scd-folder-actions { opacity: 1; }
.scd-folder-add-doc-btn,
.scd-folder-menu-btn {
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border: none; border-radius: 3px;
  background: none; color: var(--scd-text-dim); cursor: pointer; font-family: inherit;
  font-size: 14px; line-height: 1;
  transition: background 0.12s ease, color 0.12s ease;
}
.scd-folder-add-doc-btn:hover { background: var(--scd-accent-blue); color: white; }
.scd-folder-menu-btn:hover    { background: rgba(255,255,255,0.1); color: var(--scd-text-primary); }

.scd-folder-docs { padding: 2px 0; }
.scd-doc-item {
  display: flex; align-items: center; justify-content: space-between;
  height: 32px; padding: 0 12px 0 20px; cursor: pointer; gap: 6px;
  transition: background 0.12s ease;
}
.scd-doc-item:hover         { background: var(--scd-bg-hover); }
.scd-doc-item--active       { background: var(--scd-bg-active); }
.scd-doc-item-name {
  font-size: 13px; color: var(--scd-text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.scd-doc-item--active .scd-doc-item-name { color: var(--scd-text-primary); }

.scd-sidebar-search { padding: 10px 12px 12px; border-top: 1px solid var(--scd-border-subtle); background: var(--scd-bg-panel); }
.scd-search-input-container { position: relative; display: flex; align-items: center; width: 100%; }
.scd-search-icon { position: absolute; left: 10px; color: var(--scd-text-dim); pointer-events: none; transition: color 0.15s ease; }
.scd-search-input {
  width: 100%; background: var(--scd-bg-hover);
  border: 1px solid var(--scd-border-medium); border-radius: 8px;
  height: 30px; padding: 0 10px 0 32px; font-size: 12px; color: var(--scd-text-primary);
  outline: none; font-family: inherit; transition: all 0.15s ease;
  user-select: text;
}
.scd-search-input::placeholder { color: var(--scd-text-dim); opacity: 0.7; }
.scd-search-input:focus { border-color: var(--scd-accent-blue); background: rgba(0,0,0,0.15); box-shadow: 0 0 0 2px var(--scd-accent-blue-glow); }
.scd-search-input:focus + .scd-search-icon { color: var(--scd-accent-blue-lt); }

/* ----- Reading pane wrapper + doc header ----- */
.scd-reading-pane-wrapper {
  position: relative; flex: 1;
  display: flex; flex-direction: column;
  background: var(--scd-bg-reading);
  overflow: hidden; min-width: 0;
}
.scd-doc-header {
  height: 28px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: var(--scd-bg-panel);
  border-bottom: 1px solid var(--scd-border-subtle);
  flex-shrink: 0;
}
.scd-doc-header-title {
  display: flex; align-items: center; gap: 8px;
  min-width: 0; font-size: 12px; color: var(--scd-text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scd-doc-header-part { color: var(--scd-text-dim); }

.scd-doc-header-actions { position: relative; display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.scd-export-btn {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border: none; border-radius: 4px;
  background: none; color: var(--scd-text-dim); cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.scd-export-btn:hover { background: var(--scd-bg-hover); color: var(--scd-text-primary); }

/* ----- Eye-line guide (§6.4) ----- */
.scd-eye-line {
  position: absolute;
  top: calc(50% + 14px);
  left: 0; right: 0;
  pointer-events: none;
  z-index: 10;
  transform: translateY(-50%);
  transition: top 80ms linear;
}
.scd-eye-line--line {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--scd-guide-line), transparent);
}
.scd-eye-line--swathe {
  min-height: 40px;
  opacity: var(--scd-focus-guide-opacity);
  background:
    linear-gradient(
      to bottom,
      transparent 0%,
      rgba(0, 200, 255, 0.055) 16%,
      rgba(0, 200, 255, 0.18) 50%,
      rgba(0, 200, 255, 0.055) 84%,
      transparent 100%
    );
  border-top: 1px solid rgba(0, 200, 255, 0.28);
  border-bottom: 1px solid rgba(0, 200, 255, 0.28);
  box-shadow:
    0 -12px 24px rgba(0, 0, 0, 0.18) inset,
    0 12px 24px rgba(0, 0, 0, 0.18) inset,
    0 0 18px rgba(0, 200, 255, 0.10);
}
.scd-eye-line--swathe::after {
  content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 3px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, var(--scd-guide-line), transparent);
  box-shadow: 0 0 12px rgba(0, 200, 255, 0.42);
}

/* ----- Reading pane scroll area with fading mask (§6.5, src index.css 1247-1283) ----- */
.scd-reading-pane {
  --reading-mask-top-edge:    0;
  --reading-mask-top-soft:    0.15;
  --reading-mask-top-mid:     0.6;
  --reading-mask-bottom-mid:  0.6;
  --reading-mask-bottom-soft: 0.15;
  --reading-mask-bottom-edge: 0;
  flex: 1;
  overflow-y: scroll; overflow-x: hidden;
  padding: 20px 24px 40px;
  min-height: 0;
  user-select: text;
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, var(--reading-mask-top-edge))    0%,
    rgba(0, 0, 0, var(--reading-mask-top-soft))    6%,
    rgba(0, 0, 0, var(--reading-mask-top-mid))     16%,
    #000 28%,
    #000 72%,
    rgba(0, 0, 0, var(--reading-mask-bottom-mid))  84%,
    rgba(0, 0, 0, var(--reading-mask-bottom-soft)) 94%,
    rgba(0, 0, 0, var(--reading-mask-bottom-edge)) 100%
  );
          mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, var(--reading-mask-top-edge))    0%,
    rgba(0, 0, 0, var(--reading-mask-top-soft))    6%,
    rgba(0, 0, 0, var(--reading-mask-top-mid))     16%,
    #000 28%,
    #000 72%,
    rgba(0, 0, 0, var(--reading-mask-bottom-mid))  84%,
    rgba(0, 0, 0, var(--reading-mask-bottom-soft)) 94%,
    rgba(0, 0, 0, var(--reading-mask-bottom-edge)) 100%
  );
}
.scd-reading-pane::-webkit-scrollbar { display: none; }
.scd-reading-pane { scrollbar-width: none; -ms-overflow-style: none; }

/* ----- Prompter text (§6.5) ----- */
.scd-prompter-text {
  color: var(--scd-text-primary);
  font-weight: 700;
  opacity: var(--scd-text-opacity);
  text-shadow: var(--scd-text-shadow);
  line-height: 1.7;
  text-align: left;
}
.scd-prompter-text .scd-h1 { font-size: 2.0em; margin-bottom: 0.5em; }
.scd-prompter-text .scd-h2 { font-size: 1.5em; margin-bottom: 0.4em; }
.scd-prompter-text .scd-p  { margin-bottom: 0.8em; }
.scd-prompter-text strong  { color: var(--scd-accent-blue-lt); }
.scd-end-marker {
  margin-top: 60px;
  color: var(--scd-text-dim);
  font-style: italic; font-weight: 500;
}

/* ----- Control bar (src index.css 1820-2107) ----- */
.scd-control-bar {
  display: flex; align-items: center;
  height: 40px; padding: 0 12px;
  background: var(--scd-bg-control);
  border-top: 1px solid var(--scd-border-subtle);
  gap: 12px;
  flex-shrink: 0;
}
.scd-ctrl-divider { width: 1px; height: 20px; background: var(--scd-border-subtle); flex-shrink: 0; }

.scd-ctrl-play-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  border: none; background: rgba(59,130,246,0.2);
  color: var(--scd-accent-blue-lt); cursor: pointer;
  flex-shrink: 0; transition: all 0.15s ease;
}
.scd-ctrl-play-btn:hover { background: rgba(59,130,246,0.4); transform: scale(1.1); }
.scd-ctrl-play-btn:active { transform: scale(0.93); }
.scd-ctrl-play-btn--playing { background: rgba(59,130,246,0.35); color: #93C5FD; }

.scd-control-item { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.scd-control-label {
  font-size: 12px; color: var(--scd-text-secondary);
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: color 0.15s ease;
}
.scd-control-label:hover { color: var(--scd-text-primary); }
.scd-control-label strong { color: var(--scd-text-primary); font-weight: 600; }

.scd-opacity-slider-wrapper { display: flex; align-items: center; }
.scd-opacity-slider {
  -webkit-appearance: none; appearance: none;
  width: 90px; height: 4px; border-radius: 4px;
  outline: none; cursor: pointer;
}
.scd-opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--scd-accent-blue);
  box-shadow: 0 0 6px var(--scd-accent-blue-glow);
  cursor: pointer;
}
.scd-opacity-slider--green::-webkit-slider-thumb {
  background: #10B981;
  box-shadow: 0 0 6px rgba(16,185,129,0.55);
}
.scd-opacity-slider::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; border: none;
  background: var(--scd-accent-blue);
  box-shadow: 0 0 6px var(--scd-accent-blue-glow);
  cursor: pointer;
}
.scd-opacity-slider--green::-moz-range-thumb {
  background: #10B981;
  box-shadow: 0 0 6px rgba(16,185,129,0.55);
}

.scd-ctrl-icon-group { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.scd-ctrl-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: none; border-radius: 6px;
  background: none; color: var(--scd-text-secondary); cursor: pointer;
  transition: all 0.15s ease;
}
.scd-ctrl-icon-btn:hover { background: var(--scd-bg-hover); color: var(--scd-text-primary); }
.scd-ctrl-icon-btn--active { background: rgba(59,130,246,0.2); color: var(--scd-accent-blue-lt); }
.scd-ctrl-icon-btn--clickthrough-active { background: rgba(239, 68, 68, 0.2); color: #EF4444; }
.scd-ctrl-icon-btn--glow { color: #22D3EE; text-shadow: 0 0 8px rgba(34, 211, 238, 0.8); }

/* ----- Expandable Speed / Size slider ----- */
.scd-control-slider {
  -webkit-appearance: none; appearance: none;
  width: 80px; height: 4px; outline: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.1); border-radius: 2px;
}
.scd-control-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--scd-accent-blue);
  box-shadow: 0 0 6px var(--scd-accent-blue-glow);
  cursor: pointer;
}
.scd-control-slider::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; border: none;
  background: var(--scd-accent-blue);
  box-shadow: 0 0 6px var(--scd-accent-blue-glow);
  cursor: pointer;
}

/* ----- End-of-script blue pill toast (src: index.css .end-of-script-banner) ----- */
.scd-end-of-script-banner {
  position: absolute;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(59, 130, 246, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(59,130,246,0.4);
  border-radius: 20px;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #93C5FD;
  pointer-events: none;
  animation: scd-fadeInOut 3s ease forwards;
  z-index: 20;
}
@keyframes scd-fadeInOut {
  0%   { opacity: 0; transform: translateX(-50%) translateY(8px); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ----- Compact drag tabs (visible when data-compact="true") ----- */
.scd-drag-tab {
  position: absolute;
  top: calc(50% - 36px);
  z-index: 120;
  width: 14px; height: 72px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: var(--scd-bg-title);
  border: 1px solid var(--scd-border-medium);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  cursor: grab;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}
.scd-drag-tab--left  { left: 0;  border-left:  none; border-radius: 0 7px 7px 0; }
.scd-drag-tab--right { right: 0; border-right: none; border-radius: 7px 0 0 7px; }
.scd-drag-tab span {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--scd-text-secondary); opacity: 0.8; pointer-events: none;
}
.scd-drag-tab:hover  { background: var(--scd-bg-hover); border-color: var(--scd-accent-blue); }
.scd-drag-tab--left:hover  { transform: translateX(1px); }
.scd-drag-tab--right:hover { transform: translateX(-1px); }
.scd-drag-tab:active { cursor: grabbing; }

/* ----- Status chip variants (Edit / Solid / Compact) ----- */
.scd-ctrl-status-message--edit,
.scd-ctrl-status-message--solid,
.scd-ctrl-status-message--compact {
  color: var(--scd-accent-blue-lt);
  animation: scd-pulse-blue 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes scd-pulse-blue {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* ----- Focus-guide popover ----- */
.scd-focus-guide-control { position: relative; display: flex; align-items: center; flex-shrink: 0; }
.scd-focus-guide-popover {
  position: absolute; bottom: calc(100% + 8px); right: 0;
  width: 220px; padding: 10px;
  background: var(--scd-bg-panel);
  border: 1px solid var(--scd-border-medium);
  border-radius: var(--scd-radius-sm);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  z-index: 130;
}
.scd-focus-guide-popover-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--scd-border-subtle);
  color: var(--scd-text-secondary); font-size: 12px;
}
.scd-focus-guide-popover-header strong { color: var(--scd-text-primary); text-transform: capitalize; }
.scd-focus-guide-mode-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 9px; }
.scd-focus-guide-mode-row button {
  height: 26px; border: 1px solid var(--scd-border-medium); border-radius: var(--scd-radius-sm);
  background: transparent; color: var(--scd-text-secondary);
  font: inherit; font-size: 11px; cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.scd-focus-guide-mode-row button:hover,
.scd-focus-guide-mode-btn--active {
  background: rgba(59, 130, 246, 0.16) !important;
  color: var(--scd-accent-blue-lt) !important;
  border-color: rgba(59, 130, 246, 0.42) !important;
}
.scd-focus-guide-height-row {
  display: grid; gap: 7px;
  margin-top: 10px; padding-top: 9px;
  border-top: 1px solid var(--scd-border-subtle);
  color: var(--scd-text-secondary); font-size: 12px;
}
.scd-focus-guide-height-row span { display: flex; align-items: center; justify-content: space-between; }
.scd-focus-guide-height-row strong { color: var(--scd-text-primary); font-weight: 600; }
.scd-focus-guide-height-row input { width: 100%; }

/* ----- Formatting toolbar (visual only) ----- */
.scd-formatting-toolbar {
  display: flex; align-items: center; gap: 2px;
  padding: 0 12px; height: 36px;
  background: var(--scd-bg-panel);
  border-bottom: 1px solid var(--scd-border-subtle);
  flex-shrink: 0;
}
.scd-fmt-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border: none; border-radius: 6px;
  background: none; color: var(--scd-text-secondary);
  cursor: pointer; font-family: inherit;
  transition: all 0.15s ease;
}
.scd-fmt-btn:hover { background: var(--scd-bg-hover); color: var(--scd-text-primary); }
.scd-fmt-btn--active { background: rgba(59, 130, 246, 0.2); color: var(--scd-accent-blue-lt); }
.scd-fmt-divider { width: 1px; height: 18px; background: var(--scd-border-subtle); margin: 0 4px; flex-shrink: 0; }
.scd-color-swatch {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer; flex-shrink: 0; padding: 0;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.scd-color-swatch:hover { border-color: rgba(255, 255, 255, 0.4); transform: scale(1.15); }
.scd-color-swatch--active { border-color: rgba(255, 255, 255, 0.7); }

/* ----- Dynamic glow keyframes (src: index.css 1322-1349) ----- */
.scd-prompter-text [data-dynamic-glow] {
  border-radius: 4px;
  transition: color 120ms ease, text-shadow 120ms ease, background 120ms ease;
}
.scd-prompter-text [data-dynamic-glow].dynamic-glow--active {
  color: #FFFFFF;
  background:
    linear-gradient(110deg, transparent 0%, transparent 30%, rgba(255,255,255,0.64) 48%, transparent 66%, transparent 100%),
    rgba(34, 211, 238, 0.10);
  background-size: 240% 100%, auto;
  text-shadow:
    0 0 4px rgba(255,255,255,0.95),
    0 0 10px rgba(34,211,238,0.95),
    0 0 20px rgba(59,130,246,0.8),
    var(--scd-text-shadow);
  animation: scd-glow-sweep 1.75s linear infinite, scd-glow-pulse 1.75s ease-in-out infinite;
}
@keyframes scd-glow-sweep {
  from { background-position: 140% 0, 0 0; }
  to   { background-position: -140% 0, 0 0; }
}
@keyframes scd-glow-pulse {
  0%, 100% { filter: saturate(1); }
  50%      { filter: saturate(1.45) brightness(1.05); }
}

/* ----- Timer control ----- */
.scd-timer-control {
  position: relative;
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.scd-timer-button { width: 28px; height: 28px; }
.scd-timer-readout {
  height: 24px; min-width: 48px; padding: 0 8px;
  border: 1px solid var(--scd-border-medium);
  border-radius: var(--scd-radius-sm);
  background: rgba(59, 130, 246, 0.12);
  color: var(--scd-text-primary);
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  cursor: pointer; font-family: inherit;
}
.scd-timer-popover {
  position: absolute; bottom: calc(100% + 8px); left: 0;
  width: 240px; padding: 10px;
  background: var(--scd-bg-panel);
  border: 1px solid var(--scd-border-medium);
  border-radius: var(--scd-radius-sm);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  z-index: 130;
}
.scd-timer-popover-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--scd-border-subtle);
  color: var(--scd-text-secondary); font-size: 12px;
}
.scd-timer-popover-header strong { color: var(--scd-text-primary); font-variant-numeric: tabular-nums; }
.scd-timer-duration-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 9px;
}
.scd-timer-duration-row label {
  display: grid; gap: 4px;
  color: var(--scd-text-dim);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em;
}
.scd-timer-duration-row input {
  width: 100%; height: 28px; padding: 0 8px;
  border: 1px solid var(--scd-border-medium); border-radius: var(--scd-radius-sm);
  background: var(--scd-bg-hover); color: var(--scd-text-primary);
  font: inherit; font-size: 12px;
}
.scd-timer-quick-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 8px;
}
.scd-timer-quick-row button,
.scd-timer-action-grid button,
.scd-timer-session-row button {
  height: 26px;
  border: 1px solid var(--scd-border-medium);
  border-radius: var(--scd-radius-sm);
  background: transparent; color: var(--scd-text-secondary);
  font: inherit; font-size: 11px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.scd-timer-quick-row button:hover,
.scd-timer-action-grid button:hover,
.scd-timer-session-row button:hover {
  background: var(--scd-bg-hover);
  color: var(--scd-text-primary);
  border-color: var(--scd-accent-blue);
}
.scd-timer-action-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px;
}
.scd-timer-action-grid button:last-child {
  grid-column: 1 / -1;
  color: var(--scd-accent-blue-lt);
}
.scd-timer-session-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--scd-border-subtle);
}

/* ----- Relaunch screen (close button → ScriptCue closed) ----- */
.scd-app--closed {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; padding: 40px;
  height: 600px;
}
.scd-closed-eyebrow {
  font-family: var(--mono);
  color: var(--scd-text-dim);
  font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
}
.scd-relaunch-btn {
  background: var(--scd-accent-blue);
  color: white; border: none; border-radius: 999px;
  padding: 10px 22px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(59,130,246,0.35);
  transition: filter 0.15s ease, transform 0.1s ease;
}
.scd-relaunch-btn:hover  { filter: brightness(1.1); transform: scale(1.03); }
.scd-relaunch-btn:active { transform: scale(0.97); }

/* ----- Folder "no matches" line (Phase 5 search) ----- */
.scd-folder-empty {
  font-size: 11px;
  color: var(--scd-text-dim);
  padding: 6px 12px 6px 24px;
  line-height: 1.4;
}

/* ============================================================
   Phase 6 — Doc-header dropdowns, settings, toast, responsive
   ============================================================ */

/* ----- Toast (Export-confirmation etc.) ----- */
.scd-toast {
  position: absolute;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.32);
  border: 1px solid rgba(59,130,246,0.5);
  color: #DBEAFE;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em;
  pointer-events: none;
  white-space: nowrap;
  animation: scd-fadeInOut 2s ease forwards;
}

/* ----- Active state for the title-bar gear button ----- */
.scd-title-icon-btn--active {
  background: rgba(59,130,246,0.2);
  color: var(--scd-accent-blue-lt);
}

/* ----- Settings popover (title bar) ----- */
.scd-settings-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  padding: 10px;
  background: var(--scd-bg-panel);
  border: 1px solid var(--scd-border-medium);
  border-radius: var(--scd-radius-sm);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.36);
  z-index: 150;
}
.scd-settings-panel-header h3 {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--scd-text-dim);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--scd-border-subtle);
}
.scd-settings-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 4px;
  font-size: 12px; color: var(--scd-text-primary);
  cursor: pointer;
  user-select: none;
}
.scd-settings-row input { accent-color: var(--scd-accent-blue); cursor: pointer; }
.scd-settings-row:hover { color: var(--scd-accent-blue-lt); }

/* ----- Doc-header dropdowns: Active state + Export dropdown + Help/About panels ----- */
.scd-export-btn--active {
  background: rgba(59,130,246,0.2);
  color: var(--scd-accent-blue-lt);
}
.scd-export-wrapper { position: relative; flex-shrink: 0; }
.scd-export-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--scd-bg-panel);
  border: 1px solid var(--scd-border-medium);
  border-radius: var(--scd-radius-sm);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  overflow: hidden;
  min-width: 140px;
}
.scd-export-dropdown-item {
  display: block;
  width: 100%;
  padding: 6px 12px;
  font-size: 12px;
  font-family: inherit;
  color: var(--scd-text-secondary);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s ease, color 0.1s ease;
}
.scd-export-dropdown-item:hover {
  background: var(--scd-bg-hover);
  color: var(--scd-text-primary);
}

/* About / Help panel */
.scd-help-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: min(280px, calc(100vw - 24px));
  max-height: 360px;
  overflow-y: auto;
  padding: 12px;
  background: var(--scd-bg-panel);
  border: 1px solid var(--scd-border-medium);
  border-radius: var(--scd-radius-sm);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.36);
  z-index: 120;
  user-select: text;
}
.scd-help-panel-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--scd-border-subtle);
}
.scd-help-panel-header h2 {
  font-size: 14px; line-height: 1.2; font-weight: 700;
  color: var(--scd-text-primary);
}
.scd-help-panel-header p {
  margin-top: 3px;
  font-size: 11px; line-height: 1.35;
  color: var(--scd-text-dim);
}
.scd-help-close-btn {
  width: 22px; height: 22px;
  border: none; border-radius: 4px;
  background: none; color: var(--scd-text-dim);
  cursor: pointer; flex-shrink: 0;
  font-size: 18px; line-height: 1;
  font-family: inherit;
  transition: background 0.12s ease, color 0.12s ease;
}
.scd-help-close-btn:hover { background: var(--scd-bg-hover); color: var(--scd-text-primary); }

.scd-help-section { padding-top: 11px; color: var(--scd-text-secondary); }
.scd-help-section p { font-size: 12px; }
.scd-help-section dl { display: grid; gap: 6px; }
.scd-help-section dl div {
  display: grid; grid-template-columns: 60px 1fr; gap: 10px; align-items: start;
}
.scd-help-section dt {
  font-size: 11px; font-weight: 700;
  color: var(--scd-accent-blue-lt);
  white-space: nowrap;
}
.scd-help-section dd { font-size: 11px; line-height: 1.4; color: var(--scd-text-secondary); }

/* ----- Mobile responsive (< 700 px viewport) ----- */
@media (max-width: 700px) {
  .scd-control-bar { flex-wrap: wrap; height: auto; min-height: 40px; padding: 6px 12px; gap: 8px; }
  .scd-ctrl-icon-group { margin-left: 0; flex-wrap: wrap; }
  .scd-stage { padding: 14px; }
  .scd-app { height: 540px; }
  .scd-prompter-text { line-height: 1.5; }
  .scd-doc-header { padding: 0 14px; }
  .scd-help-panel { width: calc(100vw - 40px); right: -20px; }
}

/* §6.1 — mode hooks (empty for now; later phases fill these in) */
/* Light + solid palette tokens are driven by the React effect — no static rules needed here.
   The data-attrs are kept on the element so future hard overrides (e.g. cursor swaps) hook in easily. */

/* Border ring */
.scd-app[data-border="on"] {
  border: 2px solid var(--scd-accent-blue) !important;
  box-shadow: var(--scd-shell-shadow), 0 0 0 1px var(--scd-accent-blue-glow);
}

/* Compact mode — collapse title bar and document header, reveal side drag tabs. */
.scd-titlebar { transition: height 220ms cubic-bezier(0.4,0,0.2,1), opacity 160ms ease, padding 220ms cubic-bezier(0.4,0,0.2,1), border-bottom-color 220ms ease; }
.scd-doc-header { transition: height 220ms cubic-bezier(0.4,0,0.2,1), opacity 160ms ease, padding 220ms cubic-bezier(0.4,0,0.2,1), border-bottom-color 220ms ease; }
.scd-app[data-compact="true"] .scd-titlebar,
.scd-app[data-compact="true"] .scd-doc-header {
  height: 0 !important;
  opacity: 0;
  overflow: hidden;
  padding-top: 0; padding-bottom: 0;
  border-bottom-color: transparent;
  pointer-events: none;
}
.scd-app[data-clickthrough="true"] {
  /* Inner blue ring so the user can see the mode is on. */
  box-shadow: var(--scd-shell-shadow), 0 0 0 1px rgba(91,141,250,0.4) inset, 0 0 60px -10px rgba(91,141,250,0.5);
}
.scd-app[data-clickthrough="true"] .scd-reading-pane {
  pointer-events: none;
  cursor: not-allowed;
}

/* ----- Pulsing red status chip ("Click-through active" / later: edit, solid, compact) ----- */
.scd-ctrl-status-message {
  font-size: 12px; font-weight: 600;
  color: #EF4444; letter-spacing: 0.5px;
  margin-right: 8px;
  white-space: nowrap;
  animation: scd-pulse-red 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes scd-pulse-red {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* features bento */
.features-section {
  padding-top: 104px;
  overflow: hidden;
}
.features-section::before {
  content: "";
  position: absolute;
  top: 8%;
  right: -10%;
  width: min(720px, 46vw);
  height: min(720px, 46vw);
  pointer-events: none;
  background: radial-gradient(circle, rgba(91,109,255,0.22), rgba(43,212,255,0.08) 38%, transparent 70%);
  filter: blur(10px);
  opacity: 0.75;
}
.features-section .section-head {
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.62fr);
  align-items: center;
  gap: clamp(36px, 6vw, 96px);
  margin-bottom: 38px;
  padding-bottom: 34px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.features-section .section-head .eyebrow {
  margin-bottom: 20px;
  padding: 7px 12px;
  border: 1px solid rgba(43,212,255,0.18);
  border-radius: 999px;
  background: rgba(43,212,255,0.045);
}
.features-section .section-head h2 {
  max-width: 820px;
  font-size: clamp(48px, 6vw, 82px);
  line-height: 0.96;
}
.features-section .section-head p {
  max-width: 540px;
  justify-self: end;
  padding: 22px 24px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.018)),
    rgba(7, 7, 13, 0.42);
  box-shadow: 0 18px 50px rgba(0,0,0,0.24), 0 0 46px rgba(43,212,255,0.055);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.features-section .bento {
  align-items: stretch;
}
.bento { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 164px; gap: 18px; }
.bento .cell { grid-column: span 2; border: 1px solid var(--line); border-radius: 14px; padding: 24px;
  background:
    radial-gradient(360px 180px at 18% 0%, rgba(43,212,255,0.055), transparent 68%),
    linear-gradient(180deg, rgba(255,255,255,0.032), rgba(255,255,255,0.007));
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 164px;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease; }
.bento .cell:hover {
  transform: translateY(-2px);
  border-color: rgba(43,212,255,0.28);
  box-shadow: 0 18px 50px rgba(0,0,0,0.24), 0 0 40px rgba(43,212,255,0.055);
}
.bento .cell.wide { grid-column: span 3; }
.bento .cell.xwide { grid-column: span 4; grid-row: span 2; }
.bento .cell.tall { grid-row: span 2; }
.bento .cell .ico { width: 32px; height: 32px; border-radius: 8px; background: var(--grad-soft);
  display: flex; align-items: center; justify-content: center; color: var(--accent); margin-bottom: auto;
  box-shadow: 0 0 24px rgba(43,212,255,0.12); }
.bento .cell h3 { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -0.012em; margin: 22px 0 8px; }
.bento .cell p { max-width: 560px; font-size: 13.5px; color: var(--text-dim); line-height: 1.55; }
.bento .cell .ornament { position: absolute; right: -10px; top: -10px; opacity: 0.6; pointer-events: none; }
@media (max-width: 980px) {
  .features-section .section-head { grid-template-columns: 1fr; gap: 24px; }
  .features-section .section-head p { justify-self: stretch; max-width: 680px; }
  .bento { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 170px; }
  .bento .cell, .bento .cell.wide, .bento .cell.xwide { grid-column: span 2; grid-row: span 1; }
}
@media (max-width: 560px) {
  .features-section { padding-top: 76px; }
  .features-section .section-head { margin-bottom: 28px; padding-bottom: 24px; }
  .features-section .section-head h2 { font-size: clamp(38px, 13vw, 56px); }
  .features-section .section-head p { padding: 18px; }
  .bento { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 14px; }
  .bento .cell, .bento .cell.wide, .bento .cell.xwide { grid-column: span 1; min-height: 156px; }
}

/* requirements */
.requirements-section { padding-top: 96px; }
.requirements-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 42px;
  align-items: start;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 42px;
  background:
    radial-gradient(620px 280px at 0% 0%, rgba(43,212,255,0.16), transparent 64%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
}
.requirements-copy h2 {
  margin-top: 18px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(34px, 4.3vw, 58px);
  letter-spacing: -0.03em;
  line-height: 1.02;
  text-wrap: balance;
}
.requirements-copy p {
  margin-top: 22px;
  max-width: 500px;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.6;
}
.requirements-list {
  display: grid;
  gap: 12px;
}
.requirement-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) minmax(0, 0.58fr);
  gap: 18px;
  align-items: start;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.requirement-row:last-child { border-bottom: 0; }
.requirement-row h3 {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent);
  letter-spacing: 0.13em;
  line-height: 1.45;
  text-transform: uppercase;
}
.requirement-row p {
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.55;
}
@media (max-width: 860px) {
  .requirements-shell { grid-template-columns: 1fr; padding: 30px; gap: 30px; }
}
@media (max-width: 620px) {
  .requirements-section { padding-top: 72px; }
  .requirements-shell { border-radius: 18px; padding: 24px 20px; }
  .requirement-row { grid-template-columns: 1fr; gap: 8px; padding: 16px 0; }
}

/* pricing */
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .pricing-grid { grid-template-columns: 1fr; } }
.plan { border: 1px solid var(--line); border-radius: 20px; padding: 30px; background: rgba(255,255,255,0.02); position: relative; overflow: hidden; }
.plan.featured { border-color: rgba(43,212,255,0.4); background: linear-gradient(180deg, rgba(43,212,255,0.05), rgba(91,109,255,0.02)); }
.plan .badge { position: absolute; top: 20px; right: 20px; font-family: var(--mono); font-size: 10.5px; color: var(--accent); padding: 4px 10px; border: 1px solid rgba(43,212,255,0.4); border-radius: 999px; letter-spacing: 0.1em; text-transform: uppercase; }
.plan h3 { font-family: var(--mono); font-size: 12px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 14px; }
.plan .price { display: flex; align-items: baseline; gap: 6px; font-family: var(--display); font-weight: 500; letter-spacing: -0.03em; }
.plan .price .num { font-size: 64px; line-height: 1; }
.plan .price .per { font-size: 14px; color: var(--text-mute); font-family: var(--mono); }
.plan .blurb { color: var(--text-dim); font-size: 14px; margin: 14px 0 22px; line-height: 1.5; }
.plan ul { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px; }
.plan li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text-dim); }
.plan li::before { content: ""; flex-shrink: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--grad-soft);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232bd4ff' stroke-width='3'><polyline points='20 6 9 17 4 12'/></svg>");
  background-size: 10px 10px; background-position: center; background-repeat: no-repeat; }

/* cta */
.cta { padding: 100px 0; }
.cta-card { border: 1px solid var(--line-strong); border-radius: 24px; padding: 80px 60px; text-align: center;
  background: radial-gradient(800px 400px at 50% 100%, rgba(43,212,255,0.18), transparent 60%),
              linear-gradient(180deg, #0d0e1a, #07070d);
  position: relative; overflow: hidden; }
.cta-card h2 { font-family: var(--display); font-weight: 600; font-size: clamp(34px, 5vw, 64px); letter-spacing: -0.03em; line-height: 1; max-width: 800px; margin: 0 auto 18px; text-wrap: balance; }
.cta-card p { color: var(--text-dim); font-size: 17px; max-width: 520px; margin: 0 auto 30px; line-height: 1.5; }
.cta-glyphs { position: absolute; inset: 0; pointer-events: none; opacity: 0.18; }

/* ============ SHORTCUTS PAGE ============ */
.shortcut-page { min-height: 100vh; }

.shortcut-hero {
  position: relative;
  padding: 92px 0 72px;
  overflow: hidden;
}

.shortcut-hero::before {
  content: "";
  position: absolute;
  inset: auto -10% 0 -10%;
  height: 320px;
  pointer-events: none;
  background: radial-gradient(640px 260px at 70% 45%, rgba(43,212,255,0.16), transparent 70%);
}

.shortcut-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  align-items: center;
  gap: 56px;
}

.shortcut-hero-copy h1 {
  margin-top: 18px;
  max-width: 780px;
  font-family: var(--display);
  font-size: clamp(42px, 7vw, 88px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.shortcut-hero-copy p {
  margin-top: 24px;
  max-width: 620px;
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1.6;
}

.shortcut-hero-demo {
  display: flex;
  justify-content: flex-end;
}

.shortcut-demo-shell {
  width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.028)),
    rgba(12, 13, 24, 0.84);
  box-shadow:
    0 28px 80px rgba(0,0,0,0.42),
    0 0 56px rgba(43,212,255,0.12);
  padding: 22px;
}

.shortcut-demo-top {
  display: flex;
  gap: 7px;
  margin-bottom: 30px;
}

.shortcut-demo-top span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
}

.shortcut-demo-line {
  width: 72%;
  height: 10px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(43,212,255,0.85), rgba(91,109,255,0.42));
}

.shortcut-demo-line--muted {
  width: 44%;
  background: rgba(255,255,255,0.1);
}

.shortcut-demo-keys {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 32px;
}

.shortcut-demo-caption {
  margin-top: 18px;
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.shortcut-section {
  padding: 8px 0 72px;
}

.shortcut-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 42px;
  align-items: start;
}

.shortcut-note {
  position: sticky;
  top: 96px;
  border-left: 1px solid var(--line-strong);
  padding-left: 20px;
}

.shortcut-note h2 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.018em;
}

.shortcut-note p {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
}

.shortcut-groups {
  display: grid;
  gap: 28px;
}

.shortcut-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.026);
  overflow: hidden;
}

.shortcut-group-head {
  padding: 24px 26px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
}

.shortcut-kicker {
  display: block;
  margin-bottom: 9px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.shortcut-group h2 {
  font-family: var(--display);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.028em;
}

.shortcut-list {
  display: grid;
}

.shortcut-row {
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(0, 1.08fr);
  gap: 28px;
  align-items: center;
  min-height: 104px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--line);
}

.shortcut-row:last-child {
  border-bottom: 0;
}

.shortcut-combo {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.shortcut-key {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(80, 184, 255, 0.38);
  border-bottom-color: rgba(171, 206, 255, 0.48);
  border-radius: 7px;
  background:
    radial-gradient(120px 42px at 50% 0%, rgba(43,212,255,0.20), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,0.13), rgba(255,255,255,0.035)),
    rgba(13, 15, 29, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -1px 0 rgba(43,212,255,0.12),
    0 10px 24px rgba(0,0,0,0.24),
    0 0 20px rgba(43,212,255,0.16),
    0 0 42px rgba(91,109,255,0.10);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.055em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow:
    0 0 10px rgba(43,212,255,0.58),
    0 0 24px rgba(91,109,255,0.28);
  white-space: nowrap;
}

.shortcut-key--scriptcue {
  min-width: 52px;
  padding: 0 13px;
  position: relative;
}

.shortcut-key--mono,
.shortcut-key--scriptcue:not(.is-rendered) {
  padding: 0 13px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.shortcut-plus,
.shortcut-or {
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.shortcut-or {
  padding: 0 2px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.shortcut-copy h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.shortcut-copy p {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.55;
}

.foot-grid a[aria-current="page"] {
  color: var(--text);
}

@media (max-width: 980px) {
  .shortcut-hero-inner,
  .shortcut-layout {
    grid-template-columns: 1fr;
  }

  .shortcut-hero-demo {
    justify-content: flex-start;
  }

  .shortcut-note {
    position: static;
    max-width: 640px;
  }

  .shortcut-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (max-width: 620px) {
  .shortcut-page .nav-brand sub,
  .shortcut-page .nav-cta .badge {
    display: none;
  }

  .shortcut-hero {
    padding: 64px 0 46px;
  }

  .shortcut-hero-inner {
    gap: 34px;
  }

  .shortcut-demo-shell,
  .shortcut-group-head,
  .shortcut-row {
    padding-left: 18px;
    padding-right: 18px;
  }

  .shortcut-combo {
    gap: 6px;
  }

  .shortcut-key {
    min-height: 34px;
  }

  .shortcut-key--scriptcue {
    min-width: 46px;
    padding: 0 10px;
  }

  .shortcut-key--mono,
  .shortcut-key--scriptcue:not(.is-rendered) {
    padding: 0 10px;
    font-size: 11px;
  }
}

/* footer */
footer { border-top: 1px solid var(--line); padding: 56px 0 40px; margin-top: 60px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
.foot-grid h5 { font-family: var(--mono); font-size: 11px; color: var(--text-mute); letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 14px; }
.foot-grid a { display: block; font-size: 13.5px; color: var(--text-dim); padding: 4px 0; }
.foot-grid a:hover { color: var(--text); }
.foot-end { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 24px; display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 11.5px; color: var(--text-mute); flex-wrap: wrap; gap: 12px; }

/* glitch / scramble */
.glitch { position: relative; display: inline-block; }

/* ============================================================
   AUTO-DEMO — scoped under .scda-* / --scda-*
   Self-running showcase floating on a CSS Zoom mockup.
   See auto-demo.jsx and the plan at
   ~/.claude/plans/based-on-the-current-starry-glade.md
   ============================================================ */

.scda-section { padding: 100px 0 60px; }

/* ----- Stage (holds the meeting backdrop + the app + the pointer shield) ----- */
.scda-stage {
  position: relative;
  padding: 0;
  border-radius: 16px;
  isolation: isolate;
  overflow: hidden;
  height: 640px;
  background: linear-gradient(180deg, #1a1c24, #0d0e16);
}

/* ----- Meeting backdrop (local looping video) ----- */
.scda-meeting {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden;
  background: #0d0e16;
}
.scda-meeting-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ----- Pointer shield: invisible, swallows all input ----- */
.scda-pointer-shield {
  position: absolute; inset: 0;
  z-index: 9999;
  pointer-events: auto;
  cursor: default;
  background: transparent;
}

/* ----- App shell tokens ----- */
.scda-app {
  --scda-bg-shell:         rgba(10, 10, 22, 0.035);
  --scda-bg-title:         rgba(30, 30, 45, 0.546);
  --scda-bg-panel:         rgba(20, 20, 35, 0.476);
  --scda-bg-control:       rgba(20, 20, 35, 0.518);
  --scda-bg-reading:       rgba(15, 15, 28, 0.266);
  --scda-bg-hover:         rgba(255, 255, 255, 0.065);
  --scda-bg-active:        rgba(59, 130, 246, 0.206);
  --scda-border-subtle:    rgba(255, 255, 255, 0.076);
  --scda-border-medium:    rgba(255, 255, 255, 0.134);
  --scda-text-primary:     #FFFFFF;
  --scda-text-secondary:   rgba(180, 180, 200, 0.85);
  --scda-text-dim:         rgba(140, 140, 160, 0.65);
  --scda-accent-blue:      #3B82F6;
  --scda-accent-blue-lt:   #60A5FA;
  --scda-accent-blue-glow: rgba(59, 130, 246, 0.5);
  --scda-accent-save:      #EF4444;
  --scda-guide-line:       rgba(0, 200, 255, 0.234);
  --scda-shell-shadow:     0 8px 32px rgba(0, 0, 0, 0.156), 0 0 0 1px rgba(255,255,255,0.038) inset;
  --scda-text-opacity:     1;
  --scda-focus-guide-opacity: 1;
  --scda-glass-blur:       20px;
  --scda-radius-outer:     12px;
  --scda-radius-sm:        6px;
  --scda-text-shadow:      2px 2px 4px rgba(0,0,0,0.9), -1px -1px 2px rgba(0,0,0,0.7);

  /* The app floats centered over the meeting backdrop. */
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  display: flex; flex-direction: column;
  width: min(1080px, calc(100% - 48px));
  height: 460px;
  border-radius: var(--scda-radius-outer);
  border: 1px solid var(--scda-border-subtle);
  background: var(--scda-bg-shell);
  backdrop-filter: blur(var(--scda-glass-blur));
  -webkit-backdrop-filter: blur(var(--scda-glass-blur));
  box-shadow: var(--scda-shell-shadow);
  overflow: hidden;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  color: var(--scda-text-primary);
  transition: border-color 0.2s ease, border-width 0.2s ease, backdrop-filter 0.35s ease, -webkit-backdrop-filter 0.35s ease;
}

/* ----- Title bar ----- */
.scda-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  height: 36px; padding: 0 12px;
  background: var(--scda-bg-title);
  border-bottom: 1px solid var(--scda-border-subtle);
  flex-shrink: 0;
  transition: height 220ms cubic-bezier(0.4,0,0.2,1), opacity 160ms ease, padding 220ms cubic-bezier(0.4,0,0.2,1), border-bottom-color 220ms ease;
}
.scda-titlebar-left { display: flex; align-items: center; gap: 8px; }
.scda-app-icon { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex-shrink: 0; }
.scda-app-icon img { object-fit: contain; }
.scda-app-name { font-size: 13px; font-weight: 600; color: var(--scda-text-primary); letter-spacing: 0.01em; }
.scda-app-name sup { font-size: 9px; opacity: 0.6; vertical-align: super; margin-left: 1px; }

.scda-titlebar-right { display: flex; align-items: center; gap: 8px; }
.scda-save-btn {
  background: var(--scda-accent-save);
  color: white; border: none; border-radius: 12px;
  font-size: 12px; font-weight: 500; padding: 3px 12px; height: 24px;
  cursor: default; font-family: inherit;
}
.scda-title-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border: none; border-radius: 4px;
  background: none; color: var(--scda-text-secondary); cursor: default;
}
.scda-window-controls { display: flex; align-items: center; gap: 7px; padding-left: 4px; }
.scda-wc-btn { width: 12px; height: 12px; border-radius: 50%; border: none; cursor: default; padding: 0; }
.scda-wc-close { background: #EF4444; }

/* ----- Body layout ----- */
.scda-body { display: flex; flex: 1; overflow: hidden; min-height: 0; }

/* ----- Sidebar ----- */
.scda-sidebar {
  background: var(--scda-bg-panel);
  border-right: 1px solid var(--scda-border-subtle);
  display: flex; flex-direction: column; overflow: hidden; flex-shrink: 0;
  transition: width 300ms ease, opacity 200ms ease;
}
.scda-sidebar--expanded  { width: 180px; opacity: 1; }
.scda-sidebar--collapsed { width: 0; opacity: 0; }

.scda-sidebar-inner { width: 180px; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.scda-sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 8px;
}
.scda-sidebar-title { font-size: 13px; font-weight: 600; color: var(--scda-text-primary); }
.scda-sidebar-add-btn {
  background: none; border: 1px solid var(--scda-border-medium); color: var(--scda-text-secondary);
  width: 20px; height: 20px; border-radius: 4px; font-size: 15px; line-height: 1; cursor: default;
  display: flex; align-items: center; justify-content: center; font-family: inherit;
}
.scda-sidebar-divider { height: 1px; background: var(--scda-border-subtle); }

.scda-sidebar-doc-list { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 0; }
.scda-sidebar-doc-list::-webkit-scrollbar { width: 3px; }
.scda-sidebar-doc-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

.scda-folder-item { border-bottom: 1px solid var(--scda-border-subtle); }
.scda-folder-item:last-child { border-bottom: none; }
.scda-folder-header {
  display: flex; align-items: center; height: 30px;
  padding: 0 6px 0 8px; gap: 5px; cursor: default; user-select: none;
}
.scda-folder-collapse-icon { flex-shrink: 0; color: var(--scda-text-dim); display: flex; align-items: center; transition: transform 0.15s ease; }
.scda-folder-collapse-icon--collapsed { transform: rotate(-90deg); }
.scda-folder-name { font-size: 12px; font-weight: 600; color: var(--scda-text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.scda-folder-doc-count { font-size: 10px; color: var(--scda-text-dim); flex-shrink: 0; min-width: 12px; text-align: right; }

.scda-folder-docs { padding: 2px 0; }
.scda-doc-item {
  display: flex; align-items: center; justify-content: space-between;
  height: 32px; padding: 0 12px 0 20px; cursor: default; gap: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}
.scda-doc-item--active { background: var(--scda-bg-active); }
.scda-doc-item-name {
  font-size: 13px; color: var(--scda-text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.scda-doc-item--active .scda-doc-item-name { color: var(--scda-text-primary); }

.scda-sidebar-search { padding: 10px 12px 12px; border-top: 1px solid var(--scda-border-subtle); background: var(--scda-bg-panel); }
.scda-search-input-container { position: relative; display: flex; align-items: center; width: 100%; }
.scda-search-icon { position: absolute; left: 10px; color: var(--scda-text-dim); pointer-events: none; }
.scda-search-input {
  width: 100%; background: var(--scda-bg-hover);
  border: 1px solid var(--scda-border-medium); border-radius: 8px;
  height: 30px; padding: 0 10px 0 32px; font-size: 12px; color: var(--scda-text-primary);
  outline: none; font-family: inherit;
}
.scda-search-input::placeholder { color: var(--scda-text-dim); opacity: 0.7; }

/* ----- Reading pane + doc header ----- */
.scda-reading-pane-wrapper {
  position: relative; flex: 1;
  display: flex; flex-direction: column;
  background: var(--scda-bg-reading);
  overflow: hidden; min-width: 0;
}
.scda-doc-header {
  height: 28px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: var(--scda-bg-panel);
  border-bottom: 1px solid var(--scda-border-subtle);
  flex-shrink: 0;
  transition: height 220ms cubic-bezier(0.4,0,0.2,1), opacity 160ms ease, padding 220ms cubic-bezier(0.4,0,0.2,1), border-bottom-color 220ms ease;
}
.scda-doc-header-title {
  display: flex; align-items: center; gap: 8px;
  min-width: 0; font-size: 12px; color: var(--scda-text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scda-doc-header-part { color: var(--scda-text-dim); }

.scda-doc-header-actions { position: relative; display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.scda-export-btn {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border: none; border-radius: 4px;
  background: none; color: var(--scda-text-dim); cursor: default;
}

/* ----- Eye-line guide ----- */
.scda-eye-line {
  position: absolute;
  top: calc(50% + 14px);
  left: 0; right: 0;
  pointer-events: none;
  z-index: 10;
  transform: translateY(-50%);
  transition: top 80ms linear, height 220ms ease;
}
.scda-eye-line--line {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--scda-guide-line), transparent);
}
.scda-eye-line--swathe {
  min-height: 40px;
  opacity: var(--scda-focus-guide-opacity);
  background:
    linear-gradient(to bottom,
      transparent 0%,
      rgba(0, 200, 255, 0.055) 16%,
      rgba(0, 200, 255, 0.18) 50%,
      rgba(0, 200, 255, 0.055) 84%,
      transparent 100%);
  border-top: 1px solid rgba(0, 200, 255, 0.28);
  border-bottom: 1px solid rgba(0, 200, 255, 0.28);
  box-shadow:
    0 -12px 24px rgba(0, 0, 0, 0.18) inset,
    0 12px 24px rgba(0, 0, 0, 0.18) inset,
    0 0 18px rgba(0, 200, 255, 0.10);
}
.scda-eye-line--swathe::after {
  content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 3px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, var(--scda-guide-line), transparent);
  box-shadow: 0 0 12px rgba(0, 200, 255, 0.42);
}

/* ----- Reading pane scroll area with fading mask ----- */
.scda-reading-pane {
  --reading-mask-top-edge:    0;
  --reading-mask-top-soft:    0.15;
  --reading-mask-top-mid:     0.6;
  --reading-mask-bottom-mid:  0.6;
  --reading-mask-bottom-soft: 0.15;
  --reading-mask-bottom-edge: 0;
  flex: 1;
  overflow-y: scroll; overflow-x: hidden;
  padding: 20px 24px 40px;
  min-height: 0;
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, var(--reading-mask-top-edge))    0%,
    rgba(0, 0, 0, var(--reading-mask-top-soft))    6%,
    rgba(0, 0, 0, var(--reading-mask-top-mid))     16%,
    #000 28%,
    #000 72%,
    rgba(0, 0, 0, var(--reading-mask-bottom-mid))  84%,
    rgba(0, 0, 0, var(--reading-mask-bottom-soft)) 94%,
    rgba(0, 0, 0, var(--reading-mask-bottom-edge)) 100%
  );
          mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, var(--reading-mask-top-edge))    0%,
    rgba(0, 0, 0, var(--reading-mask-top-soft))    6%,
    rgba(0, 0, 0, var(--reading-mask-top-mid))     16%,
    #000 28%,
    #000 72%,
    rgba(0, 0, 0, var(--reading-mask-bottom-mid))  84%,
    rgba(0, 0, 0, var(--reading-mask-bottom-soft)) 94%,
    rgba(0, 0, 0, var(--reading-mask-bottom-edge)) 100%
  );
}
.scda-reading-pane::-webkit-scrollbar { display: none; }
.scda-reading-pane { scrollbar-width: none; -ms-overflow-style: none; }

.scda-prompter-text {
  color: var(--scda-text-primary);
  font-weight: 700;
  opacity: var(--scda-text-opacity);
  text-shadow: var(--scda-text-shadow);
  line-height: 1.7;
  text-align: left;
  transition: opacity 200ms ease;
}
.scda-prompter-text .scda-h1 { font-size: 2.0em; margin-bottom: 0.5em; }
.scda-prompter-text .scda-h2 { font-size: 1.5em; margin-bottom: 0.4em; }
.scda-prompter-text .scda-p  { margin-bottom: 0.8em; }
.scda-prompter-text strong   { color: var(--scda-accent-blue-lt); }
.scda-end-marker {
  margin-top: 60px;
  color: var(--scda-text-dim);
  font-style: italic; font-weight: 500;
}

/* ----- Control bar ----- */
.scda-control-bar {
  display: flex; align-items: center;
  flex-wrap: wrap;                   /* safety net — at default app width (1080px) bar stays single-row */
  min-height: 40px; padding: 4px 12px;
  background: var(--scda-bg-control);
  border-top: 1px solid var(--scda-border-subtle);
  row-gap: 6px; column-gap: 8px;
  flex-shrink: 0;
}
.scda-ctrl-divider { width: 1px; height: 20px; background: var(--scda-border-subtle); flex-shrink: 0; }

.scda-ctrl-play-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  border: none; background: rgba(59,130,246,0.2);
  color: var(--scda-accent-blue-lt); cursor: default;
  flex-shrink: 0; transition: all 0.15s ease;
}
.scda-ctrl-play-btn--playing { background: rgba(59,130,246,0.35); color: #93C5FD; }

.scda-control-item { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.scda-control-label {
  font-size: 12px; color: var(--scda-text-secondary);
  cursor: default; white-space: nowrap; user-select: none;
}
.scda-control-label strong { color: var(--scda-text-primary); font-weight: 600; }

.scda-opacity-slider-wrapper { display: flex; align-items: center; }
.scda-fake-slider {
  position: relative;
  width: 90px; height: 4px; border-radius: 4px;
  cursor: default;
}
.scda-fake-slider-thumb {
  position: absolute; top: 50%;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--scda-accent-blue);
  box-shadow: 0 0 6px var(--scda-accent-blue-glow);
  transform: translate(-50%, -50%);
  transition: left 200ms ease;
}
.scda-fake-slider-thumb--green {
  background: #10B981;
  box-shadow: 0 0 6px rgba(16,185,129,0.55);
}

.scda-ctrl-icon-group {
  display: flex; align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;        /* stays right-aligned when wrapped to own row */
  gap: 4px;
  margin-left: auto;
}
.scda-ctrl-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: none; border-radius: 6px;
  background: none; color: var(--scda-text-secondary); cursor: default;
  transition: all 0.15s ease;
}
.scda-ctrl-icon-btn--active { background: rgba(59,130,246,0.2); color: var(--scda-accent-blue-lt); }
.scda-ctrl-icon-btn--clickthrough-active { background: rgba(239, 68, 68, 0.2); color: #EF4444; }
.scda-ctrl-icon-btn--glow { color: #22D3EE; text-shadow: 0 0 8px rgba(34, 211, 238, 0.8); }

/* ----- End-of-script pill ----- */
.scda-end-of-script-banner {
  position: absolute;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(59, 130, 246, 0.3);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(59,130,246,0.4);
  border-radius: 20px;
  padding: 6px 18px;
  font-size: 13px; font-weight: 600;
  color: #93C5FD;
  pointer-events: none;
  animation: scda-fadeInOut 3s ease forwards;
  z-index: 20;
}
@keyframes scda-fadeInOut {
  0%   { opacity: 0; transform: translateX(-50%) translateY(8px); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ----- Drag tabs (visible during compact mode) ----- */
.scda-drag-tab {
  position: absolute;
  top: calc(50% - 36px);
  z-index: 120;
  width: 14px; height: 72px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: var(--scda-bg-title);
  border: 1px solid var(--scda-border-medium);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  cursor: default;
}
.scda-drag-tab--left  { left: 0;  border-left:  none; border-radius: 0 7px 7px 0; }
.scda-drag-tab--right { right: 0; border-right: none; border-radius: 7px 0 0 7px; }
.scda-drag-tab span {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--scda-text-secondary); opacity: 0.8; pointer-events: none;
}

/* ----- Status chips ----- */
.scda-ctrl-status-message {
  font-size: 12px; font-weight: 600;
  color: #EF4444; letter-spacing: 0.5px;
  margin-right: 8px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: scda-pulse-red 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.scda-ctrl-status-message--edit,
.scda-ctrl-status-message--solid,
.scda-ctrl-status-message--compact {
  color: var(--scda-accent-blue-lt);
  animation: scda-pulse-blue 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes scda-pulse-red  { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes scda-pulse-blue { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ----- Formatting toolbar ----- */
.scda-formatting-toolbar {
  display: flex; align-items: center; gap: 2px;
  padding: 0 12px; height: 36px;
  background: var(--scda-bg-panel);
  border-bottom: 1px solid var(--scda-border-subtle);
  flex-shrink: 0;
}
.scda-fmt-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border: none; border-radius: 6px;
  background: none; color: var(--scda-text-secondary);
  cursor: default; font-family: inherit;
}
.scda-fmt-divider { width: 1px; height: 18px; background: var(--scda-border-subtle); margin: 0 4px; flex-shrink: 0; }
.scda-color-swatch {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid transparent; cursor: default; flex-shrink: 0; padding: 0;
}
.scda-color-swatch--active { border-color: rgba(255, 255, 255, 0.7); }

/* ----- Dynamic glow ----- */
.scda-glow-keyword {
  border-radius: 4px;
  padding: 0 0.035em;
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
  transition: color 120ms ease, text-shadow 120ms ease, background 120ms ease;
}
.scda-glow-keyword.scda-dynamic-glow--active {
  color: #FFFFFF;
  background:
    linear-gradient(110deg, transparent 0%, transparent 30%, rgba(255,255,255,0.64) 48%, transparent 66%, transparent 100%),
    rgba(34, 211, 238, 0.10);
  background-size: 240% 100%, auto;
  text-shadow:
    0 0 4px rgba(255,255,255,0.95),
    0 0 10px rgba(34,211,238,0.95),
    0 0 20px rgba(59,130,246,0.8),
    var(--scda-text-shadow);
  animation: scda-glow-sweep 1.75s linear infinite, scda-glow-pulse 1.75s ease-in-out infinite;
}
@keyframes scda-glow-sweep {
  from { background-position: 140% 0, 0 0; }
  to   { background-position: -140% 0, 0 0; }
}
@keyframes scda-glow-pulse {
  0%, 100% { filter: saturate(1); }
  50%      { filter: saturate(1.45) brightness(1.05); }
}

/* ----- Timer readout pill ----- */
.scda-timer-control { position: relative; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.scda-timer-button { width: 28px; height: 28px; }
.scda-timer-readout {
  height: 24px; min-width: 48px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--scda-border-medium);
  border-radius: var(--scda-radius-sm);
  background: rgba(59, 130, 246, 0.12);
  color: var(--scda-text-primary);
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  font-family: inherit;
}

/* ----- Borders & data-attr overrides ----- */
.scda-app[data-border="on"] {
  border: 2px solid var(--scda-accent-blue) !important;
  box-shadow: var(--scda-shell-shadow), 0 0 0 1px var(--scda-accent-blue-glow);
}
.scda-app[data-compact="true"] .scda-titlebar,
.scda-app[data-compact="true"] .scda-doc-header {
  height: 0 !important;
  opacity: 0;
  overflow: hidden;
  padding-top: 0; padding-bottom: 0;
  border-bottom-color: transparent;
  pointer-events: none;
}
.scda-app[data-clickthrough="true"] {
  box-shadow: var(--scda-shell-shadow), 0 0 0 1px rgba(91,141,250,0.4) inset, 0 0 60px -10px rgba(91,141,250,0.5);
}
.scda-app[data-clickthrough="true"] .scda-reading-pane {
  pointer-events: none;
  cursor: not-allowed;
}

/* ----- Narrator chip (announces current tour step) ----- */
.scda-narrator {
  position: absolute;
  bottom: -38px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 18px;
  border-radius: 999px;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  color: #cbd5e1;
  font: 11px ui-monospace, "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity 240ms ease, transform 240ms ease;
}
.scda-narrator--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ----- Per-step callout (pill + arrow that points at the active UI element) ----- */
.scda-callout {
  position: absolute;
  z-index: 60;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.96);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  border: 1.5px solid rgba(96, 165, 250, 0.65);
  color: #f0f9ff;
  font: 600 13px/1 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.50),
    0 0 0 1px rgba(96, 165, 250, 0.30),
    0 0 24px rgba(96, 165, 250, 0.22);
  --scda-arrow-shift: 0px;
  opacity: 0;
  transition: opacity 240ms ease;
}
.scda-callout--visible {
  opacity: 1;
  animation: scda-callout-pop 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes scda-callout-pop {
  0%   { opacity: 0; }
  40%  { opacity: 1; }
  100% { opacity: 1; }
}

/* Placement = where the callout sits relative to its target (the target is OPPOSITE the arrow). */
.scda-callout--above { transform: translate(-50%, -100%); }
.scda-callout--below { transform: translate(-50%, 0%); }
.scda-callout--left  { transform: translate(-100%, -50%); }
.scda-callout--right { transform: translate(0%, -50%); }

/* Arrow — CSS-rotated square half-bordered to look like a triangle.
   left/top use a --scda-arrow-shift variable so the arrow can re-anchor to the target
   when the pill itself was clamped to stay inside the app. */
.scda-callout-arrow {
  position: absolute;
  width: 12px; height: 12px;
  background: rgba(15, 23, 42, 0.96);
  border: 1.5px solid rgba(96, 165, 250, 0.65);
}
.scda-callout--above .scda-callout-arrow {
  bottom: -7px;
  left: calc(50% + var(--scda-arrow-shift));
  transform: translateX(-50%) rotate(45deg);
  border-top: none; border-left: none;
}
.scda-callout--below .scda-callout-arrow {
  top: -7px;
  left: calc(50% + var(--scda-arrow-shift));
  transform: translateX(-50%) rotate(45deg);
  border-bottom: none; border-right: none;
}
.scda-callout--left .scda-callout-arrow {
  right: -7px;
  top: calc(50% + var(--scda-arrow-shift));
  transform: translateY(-50%) rotate(45deg);
  border-bottom: none; border-left: none;
}
.scda-callout--right .scda-callout-arrow {
  left: -7px;
  top: calc(50% + var(--scda-arrow-shift));
  transform: translateY(-50%) rotate(45deg);
  border-top: none; border-right: none;
}

/* ----- Pulse ring on the currently-targeted UI element ----- */
.scda-target-active {
  position: relative;
  z-index: 1; /* keep the pulse above its siblings */
}
.scda-target-active::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  /* Many target elements have border-radius < 6 (control items / labels); fall back to 8px */
  pointer-events: none;
  box-shadow:
    0 0 0 2px rgba(96, 165, 250, 0.55),
    0 0 18px rgba(96, 165, 250, 0.35);
  animation: scda-target-pulse 1.6s ease-in-out infinite;
}
/* Square-ish targets — labels and tiles — round the ring */
.scda-target-active[data-cl="speed"]::after,
.scda-target-active[data-cl="size"]::after,
.scda-target-active[data-cl="panel-opacity"]::after,
.scda-target-active[data-cl="text-opacity"]::after { border-radius: 8px; }
/* Sidebar gets a slightly wider pulse so it's visible past its 180px width */
.scda-sidebar.scda-target-active::after { inset: -2px -4px; border-radius: 8px; }
/* Doc item already has padding, so a flush ring looks better */
.scda-doc-item.scda-target-active::after { inset: 0; border-radius: 0; }

@keyframes scda-target-pulse {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 1; }
}

/* ----- Responsive: shrink on narrow viewports ----- */
@media (max-width: 900px) {
  .scda-stage { height: 580px; }
  .scda-app { width: calc(100% - 32px); height: 420px; }
  .scda-callout { font-size: 11px; padding: 6px 12px; }
}
@media (max-width: 600px) {
  .scda-stage { height: 540px; }
  .scda-app { width: calc(100% - 20px); height: 400px; }
  .scda-control-bar { flex-wrap: wrap; height: auto; min-height: 40px; padding: 6px 10px; gap: 6px; }
  .scda-ctrl-icon-group { margin-left: 0; flex-wrap: wrap; }
  .scda-callout { display: none; } /* too cramped — narrator chip still tells the story */
}
