/* ── Reset & tokens ──────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:              #040714;
  --surface-1:       rgba(255,255,255,.03);
  --surface-2:       rgba(255,255,255,.06);
  --border-subtle:   rgba(255,255,255,.07);
  --border:          rgba(255,255,255,.10);
  --border-strong:   rgba(255,255,255,.22);
  --text-primary:    #f9f9f9;
  --text-secondary:  #cacaca;
  --text-muted:      rgba(255,255,255,.55);
  --text-dim:        rgba(255,255,255,.25);
  --accent:          #0063e5;
  --accent-bright:   #0080ff;
  --warn:            #fbbf24;
  --danger:          #f87171;
  --success:         #34d399;
  --font:            'Avenir Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono:            'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  --radius-sm:       6px;
  --radius:          10px;
  --radius-lg:       15px;
  --dur:             200ms;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ──────────────────────────────────────────────────────────── */
.header-bar {
  background: linear-gradient(in oklch 135deg, #B015B0 0%, #3D0080 50%, #040714 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.07);
  padding: 0 24px;
  height: 68px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.header-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-logo-img { height: 36px; width: auto; flex-shrink: 0; filter: brightness(0) invert(1); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); display: block; }
.header-logo-img:hover { transform: scale(1.14) rotate(-9deg); }
.header-logo h1 { font-size: 1.2em; font-weight: 600; letter-spacing: 0.5px; }
.header-subtitle { font-size: 0.82em; color: rgba(255,255,255,0.72); font-weight: 500; margin-top: 3px; }

.header-home {
  margin-left: auto;
  display: flex; align-items: center; padding: 5px;
  color: rgba(255,255,255,0.9); text-decoration: none;
  border-radius: 6px; transition: color .2s, background .2s; flex-shrink: 0;
}
.header-home:hover { color: #fff; background: rgba(255,255,255,0.12); }
.header-home svg { width: 34px; height: 34px; display: block; }

/* ── Toolbar ─────────────────────────────────────────────────────────── */
.toolbar {
  height: 44px; flex-shrink: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-1);
  display: flex; align-items: center;
  padding: 0 16px; gap: 6px;
  overflow-x: auto;
}
.toolbar-label { font-size: .72rem; color: var(--text-muted); margin-right: 2px; }
.sep { width: 1px; height: 18px; background: var(--border-subtle); margin: 0 4px; flex-shrink: 0; }
.theme-select {
  height: 26px; padding: 0 8px;
  background: var(--surface-1); border: 1px solid var(--border);
  color: var(--text-secondary); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: .75rem; cursor: pointer;
}
.theme-select:focus { outline: 1px solid var(--accent); }

.btn {
  padding: 5px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-secondary);
  font-family: var(--font); font-size: .8rem;
  cursor: pointer; transition: all var(--dur);
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text-primary); }
.btn-primary {
  background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 600;
}
.btn-primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: .75rem; }
.btn-ghost {
  background: none; border-color: transparent; color: var(--text-muted);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border); color: var(--text-primary); }

/* ── Workspace ───────────────────────────────────────────────────────── */
.workspace {
  flex: 1; display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

/* ── Editor pane ─────────────────────────────────────────────────────── */
.editor-pane {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border-subtle);
  overflow: hidden;
}
.pane-header {
  height: 34px; flex-shrink: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 8px;
  font-size: .7rem; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-muted);
}
.pane-header .dot {
  width: 6px; height: 6px;
  border-radius: 50%; flex-shrink: 0;
}
.dot-blue  { background: var(--accent); }
.dot-green { background: var(--success); }

#yaml-input {
  flex: 1; resize: none;
  background: transparent; border: none; outline: none;
  color: var(--text-primary);
  font-family: var(--mono); font-size: .8rem;
  line-height: 1.65; padding: 14px 16px;
  overflow-y: auto;
}
#yaml-input::placeholder { color: var(--text-dim); }

/* ── Warnings bar ────────────────────────────────────────────────────── */
.warnings-bar {
  flex-shrink: 0; max-height: 130px; overflow-y: auto;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0,0,0,.15);
}
.warnings-bar.empty {
  padding: 8px 14px;
  font-size: .75rem; color: var(--success);
}
.warning-item {
  padding: 5px 14px;
  display: flex; align-items: baseline; gap: 8px;
  font-size: .75rem; line-height: 1.4;
  border-bottom: 1px solid rgba(255,255,255,.03);
}
.warning-item:last-child { border-bottom: none; }
.warning-item.lvl-error { color: var(--danger); }
.warning-item.lvl-warn  { color: var(--warn); }
.warning-item.lvl-info  { color: var(--text-muted); }
.warning-badge {
  font-size: .65rem; font-weight: 700; padding: 1px 5px;
  border-radius: 3px; flex-shrink: 0; white-space: nowrap;
}
.lvl-error .warning-badge { background: rgba(248,113,113,.15); color: var(--danger); }
.lvl-warn  .warning-badge { background: rgba(251,191,36,.12);  color: var(--warn); }
.lvl-info  .warning-badge { background: var(--surface-2);      color: var(--text-muted); }

/* ── Preview pane ────────────────────────────────────────────────────── */
.preview-pane {
  display: flex; flex-direction: column;
  overflow: hidden; background: #000;
}
.preview-header {
  height: 34px; flex-shrink: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255,255,255,.01);
  display: flex; align-items: center; gap: 8px;
  font-size: .7rem; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-muted);
}
.slide-nav {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
}
.nav-btn {
  width: 22px; height: 22px;
  background: none; border: 1px solid var(--border);
  color: var(--text-secondary); border-radius: 4px;
  cursor: pointer; font-size: .75rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur);
}
.nav-btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); }
.nav-btn:disabled { opacity: .3; cursor: default; }
#slide-counter { font-size: .75rem; color: var(--text-muted); min-width: 48px; text-align: center; }

.slide-stage {
  flex: 1; position: relative; overflow: hidden;
}

/* ── Slide canvas — fixed 960x540, JS scales it to fit the container ── */
.slide {
  position: absolute;
  width: 960px; height: 540px;
  transform-origin: top left;
  background: #080f20;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column;
  overflow: hidden;
  padding: 48px 60px;
}
.slide::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(0,99,229,.05) 0%, transparent 55%);
  pointer-events: none;
}
.slide-num {
  position: absolute; bottom: 14px; right: 18px;
  font-size: 11px; color: rgba(255,255,255,.18);
  font-family: var(--mono);
}
.slide-logo-watermark {
  position: absolute; top: 16px; right: 18px;
  max-height: 30px; max-width: 80px;
  object-fit: contain; opacity: .6; z-index: 2;
}
.title-logo {
  max-height: 52px; max-width: 140px;
  object-fit: contain; margin-bottom: 20px;
}

/* Title slide */
.slide-type-title {
  align-items: center; justify-content: center; text-align: center;
}
.slide-type-title .s-heading {
  font-size: 40px;
  font-weight: 700; color: #fff; line-height: 1.2;
}
.accent-bar {
  width: 48px; height: 4px; border-radius: 2px;
  background: var(--sl-accent, #0063e5); margin: 18px auto;
}
.slide-type-title .s-subtitle {
  font-size: 18px;
  color: rgba(255,255,255,.5); font-weight: 400;
}
.slide-type-title .s-meta {
  position: absolute; bottom: 22px; left: 60px; right: 60px;
  display: flex; justify-content: space-between;
  font-size: 12px; color: rgba(255,255,255,.25);
}

/* Bullets slide */
.slide-type-bullets { justify-content: flex-start; }
.s-heading {
  font-size: 26px;
  font-weight: 700; color: var(--sl-text, #fff); margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--sl-border, rgba(255,255,255,.07));
  flex-shrink: 0;
}
.s-bullets { list-style: none; overflow: hidden; }
.s-bullets li {
  padding: 7px 0 7px 22px; position: relative;
  font-size: 18px;
  color: var(--sl-ts, #cacaca); line-height: 1.4;
}
.s-bullets li::before {
  content: '';
  position: absolute; left: 0; top: 14px;
  width: 7px; height: 7px;
  border-radius: 50%; background: var(--sl-accent, #0063e5);
}

/* Split slide */
.slide-type-split { justify-content: flex-start; }
.split-cols {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 24px; flex: 1; overflow: hidden;
}
.split-col-head {
  font-size: 13px;
  font-weight: 700; color: var(--sl-accent, #0063e5);
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 10px;
}

/* Code slide */
.slide-type-code { justify-content: flex-start; }
.code-block {
  background: rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 8px; padding: 18px;
  flex: 1; overflow: hidden;
}
.code-lang {
  font-size: 11px; color: var(--sl-dim, rgba(255,255,255,.3));
  font-family: var(--mono); text-transform: uppercase;
  letter-spacing: .8px; margin-bottom: 10px;
}
.code-block pre {
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55; color: var(--sl-code-text, #a5f3fc);
  white-space: pre-wrap; word-break: break-word;
}

/* Quote slide */
.slide-type-quote {
  align-items: center; justify-content: center; text-align: center;
}
.quote-mark {
  font-size: 72px; line-height: .8;
  color: var(--sl-accent, #0063e5); opacity: .35;
  font-family: Georgia, serif;
}
.quote-text {
  font-size: 22px;
  color: var(--sl-text, #fff); font-style: italic; line-height: 1.6; margin-top: 10px;
}
.quote-source {
  margin-top: 18px;
  font-size: 14px;
  color: var(--sl-accent, #0063e5); font-weight: 600;
}

/* Divider slide */
.slide-type-divider {
  align-items: center; justify-content: center; text-align: center;
  background: linear-gradient(135deg, rgba(176,21,176,.12) 0%, rgba(61,0,128,.12) 50%, transparent 100%);
}
.slide-type-divider .s-heading {
  font-size: 44px;
  border-bottom: none; margin-bottom: 0; padding-bottom: 0;
}
.slide-type-divider .s-subtitle {
  font-size: 17px;
  color: rgba(255,255,255,.45); margin-top: 14px;
}

/* Q&A slide */
.slide-type-qa {
  align-items: center; justify-content: center; text-align: center;
}
.qa-icon { font-size: 48px; margin-bottom: 18px; }
.slide-type-qa .s-heading {
  font-size: 36px;
  border-bottom: none; margin-bottom: 0; padding-bottom: 0;
}
.slide-type-qa .s-subtext {
  font-size: 16px;
  color: rgba(255,255,255,.4); margin-top: 12px;
}

/* CTA slide */
.slide-type-cta {
  align-items: center; justify-content: center; text-align: center;
}
.slide-type-cta .s-heading {
  font-size: 30px;
  border-bottom: none; margin-bottom: 24px; padding-bottom: 0;
}
.cta-pill {
  background: var(--sl-accent, #0063e5); color: #fff;
  font-weight: 700; font-size: 18px;
  padding: 13px 32px; border-radius: 9px;
  display: inline-block;
}
.s-subtext {
  margin-top: 16px;
  font-size: 14px;
  color: rgba(255,255,255,.38);
}

/* Image slide */
.slide-type-image { justify-content: flex-start; }
.image-container {
  flex: 1; display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-radius: 6px;
}
.image-container.full { position: absolute; inset: 0; border-radius: 0; }
.slide-image { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.fit-cover .slide-image { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.image-caption {
  position: absolute; bottom: 28px; left: 60px; right: 60px;
  font-size: 13px; color: var(--sl-muted, rgba(255,255,255,.45));
  text-align: center;
}

/* Stats slide */
.slide-type-stats { justify-content: center; align-items: center; text-align: center; }
.stats-grid {
  display: flex; justify-content: center; gap: 48px; flex-wrap: wrap;
  margin-top: 10px;
}
.stat-item { min-width: 120px; }
.stat-value {
  font-size: 52px; font-weight: 800; line-height: 1.1;
  color: var(--sl-accent, #0063e5);
}
.stat-label {
  font-size: 14px; color: var(--sl-muted, rgba(255,255,255,.45));
  margin-top: 8px; line-height: 1.3;
}

/* Timeline slide */
.slide-type-timeline { justify-content: flex-start; }
.timeline-track {
  display: flex; gap: 8px; flex: 1; align-items: flex-start;
  padding-top: 10px;
}
.timeline-step {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  text-align: center; position: relative;
}
.timeline-step::after {
  content: ''; position: absolute; top: 16px; left: 55%; right: -45%;
  height: 2px; background: var(--sl-border, rgba(255,255,255,.07));
}
.timeline-step:last-child::after { display: none; }
.timeline-dot {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--sl-accent, #0063e5); color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1; flex-shrink: 0;
}
.timeline-label {
  font-size: 12px; font-weight: 700; color: var(--sl-accent, #0063e5);
  text-transform: uppercase; letter-spacing: .5px;
  margin-top: 10px;
}
.timeline-text {
  font-size: 14px; color: var(--sl-ts, #cacaca);
  margin-top: 6px; line-height: 1.4;
}

/* Columns (two-column text) slide */
.slide-type-columns { justify-content: flex-start; }
.col-text {
  font-size: 16px; color: var(--sl-ts, #cacaca);
  line-height: 1.55;
}

/* Error / empty state */
.slide-state {
  align-items: center; justify-content: center; text-align: center;
}
.slide-state .s-icon { font-size: 36px; margin-bottom: 14px; opacity: .4; }
.slide-state p {
  font-size: 16px; color: var(--text-muted); line-height: 1.6;
}
.slide-state.error p { color: var(--danger); font-family: var(--mono); font-size: 14px; }

/* Empty stage placeholder (not a slide) */
.stage-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  color: var(--text-dim);
}
.stage-empty .s-icon { font-size: 2rem; opacity: .4; }
.stage-empty p { font-size: .82rem; line-height: 1.6; text-align: center; }

/* Fullscreen overlay */
.fullscreen-stage {
  position: fixed; inset: 0; z-index: 500;
  background: #000;
  display: none;
}
.fullscreen-stage.active { display: block; }
.fullscreen-controls {
  position: fixed; bottom: 18px;
  display: flex; align-items: center; gap: 12px;
}
.fullscreen-controls .nav-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.06);
  font-size: 1rem;
}
#fs-counter { font-size: .82rem; color: rgba(255,255,255,.4); min-width: 60px; text-align: center; }
.fs-exit {
  position: fixed; top: 16px; right: 16px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.6); border-radius: 6px;
  padding: 6px 12px; cursor: pointer; font-size: .8rem;
  transition: all var(--dur);
}
.fs-exit:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ── Filmstrip ───────────────────────────────────────────────────────── */
.filmstrip {
  height: 76px; flex-shrink: 0;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0,0,0,.25);
  display: flex; align-items: center;
  gap: 7px; padding: 7px 10px;
  overflow-x: auto; overflow-y: hidden;
}
.filmstrip::-webkit-scrollbar { height: 4px; }
.filmstrip::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }
.film-thumb {
  flex-shrink: 0; width: 106px; height: 60px;
  border-radius: 5px; border: 1.5px solid var(--border);
  cursor: pointer; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  justify-content: flex-end; padding: 4px 6px;
  background: #080f20;
  transition: border-color var(--dur), transform var(--dur);
}
.film-thumb:hover { border-color: rgba(255,255,255,.3); transform: translateY(-2px); }
.film-thumb.active { border-color: var(--accent); }
.film-type {
  position: absolute; top: 4px; left: 5px;
  font-size: .52rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .3px; color: rgba(255,255,255,.3);
  background: rgba(0,0,0,.4); padding: 1px 4px; border-radius: 2px;
}
.film-num {
  position: absolute; top: 4px; right: 5px;
  font-size: .52rem; color: rgba(255,255,255,.22); font-family: var(--mono);
}
.film-text {
  font-size: .58rem; color: rgba(255,255,255,.5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;
}

/* ── Audit panel (below preview) ─────────────────────────────────────── */
.audit-panel {
  flex-shrink: 0; max-height: 0; overflow: hidden;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0,0,0,.2);
  transition: max-height .28s ease;
}
.audit-panel.open { max-height: 260px; overflow-y: auto; }
.audit-inner { padding: 14px 16px; }
.audit-title {
  font-size: .72rem; font-weight: 700; color: var(--text-primary);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 12px;
}
.audit-section { margin-bottom: 14px; }
.audit-section-head {
  font-size: .65rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px;
}
.audit-item {
  display: flex; align-items: baseline; gap: 8px;
  font-size: .72rem; line-height: 1.45; padding: 3px 0;
}
.audit-item.lvl-error { color: var(--danger); }
.audit-item.lvl-warn  { color: var(--warn); }
.audit-item.lvl-info  { color: var(--text-muted); }
.audit-badge {
  font-size: .6rem; font-weight: 700; padding: 1px 5px;
  border-radius: 3px; flex-shrink: 0;
}
.lvl-error .audit-badge { background: rgba(248,113,113,.15); color: var(--danger); }
.lvl-warn  .audit-badge { background: rgba(251,191,36,.12);  color: var(--warn); }
.lvl-info  .audit-badge { background: var(--surface-2);      color: var(--text-muted); }
.audit-question {
  font-size: .7rem; line-height: 1.5; color: var(--text-muted);
  padding: 3px 0 3px 14px; position: relative;
}
.audit-question::before { content: '\2192'; position: absolute; left: 0; color: var(--accent); opacity: .6; }
.audit-ok { font-size: .72rem; color: var(--success); }

/* ── Grid overview ───────────────────────────────────────────────────── */
.grid-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(2,4,14,.96);
  display: none; flex-direction: column;
}
.grid-overlay.active { display: flex; }
.grid-overlay-bar {
  height: 46px; flex-shrink: 0;
  background: rgba(255,255,255,.02); border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; padding: 0 20px; gap: 10px;
}
.grid-overlay-bar h2 { font-size: .85rem; font-weight: 600; }
.grid-overlay-bar span { font-size: .72rem; color: var(--text-muted); }
.grid-close {
  margin-left: auto;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.6); border-radius: 6px;
  padding: 5px 12px; cursor: pointer; font-family: var(--font); font-size: .77rem;
  transition: all var(--dur);
}
.grid-close:hover { background: rgba(255,255,255,.12); color: #fff; }
.grid-scroll {
  flex: 1; overflow-y: auto; padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; align-content: start;
}
.grid-cell {
  position: relative; width: 100%; aspect-ratio: 16/9;
  border-radius: 7px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--dur), transform var(--dur), box-shadow var(--dur);
}
.grid-cell:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.5); border-color: rgba(255,255,255,.22); }
.grid-cell.active { border-color: var(--accent); }
.grid-cell-inner { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.grid-idx {
  position: absolute; bottom: 5px; right: 7px;
  font-size: .58rem; color: rgba(255,255,255,.45); font-family: var(--mono);
  background: rgba(0,0,0,.5); padding: 1px 4px; border-radius: 3px;
  pointer-events: none; z-index: 5;
}

/* ── Presenter overlay ───────────────────────────────────────────────── */
.presenter-overlay {
  position: fixed; inset: 0; z-index: 700;
  background: #000; display: none; flex-direction: column;
}
.presenter-overlay.active { display: flex; }
.presenter-stage { flex: 1; position: relative; overflow: hidden; }
.pres-notes {
  flex-shrink: 0; padding: 10px 20px; max-height: 90px; overflow-y: auto;
  background: rgba(0,0,0,.7); border-top: 1px solid rgba(255,255,255,.06);
  font-size: .8rem; line-height: 1.55; color: rgba(255,255,255,.6);
}
.pres-notes-label {
  font-size: .62rem; text-transform: uppercase; letter-spacing: .5px;
  color: rgba(255,255,255,.3); margin-bottom: 3px;
}
.presenter-bar {
  height: 54px; flex-shrink: 0;
  background: rgba(0,0,0,.85); border-top: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: 10px; padding: 0 18px;
}
.pres-timer {
  font-family: var(--mono); font-size: 1rem; font-weight: 700;
  color: var(--success); min-width: 66px;
}
.pres-counter { font-size: .8rem; color: rgba(255,255,255,.4); }
.pres-nav { display: flex; gap: 6px; }
.pres-nav-btn {
  width: 34px; height: 34px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.7); border-radius: 6px;
  cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur);
}
.pres-nav-btn:hover:not(:disabled) { background: rgba(255,255,255,.12); }
.pres-nav-btn:disabled { opacity: .3; cursor: default; }
.pres-exit {
  margin-left: auto;
  background: none; border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.5); border-radius: 6px;
  padding: 5px 12px; cursor: pointer; font-family: var(--font); font-size: .78rem;
  transition: all var(--dur);
}
.pres-exit:hover { background: rgba(255,255,255,.08); color: #fff; }

/* ── Gallery overlay ─────────────────────────────────────────────────── */
.gallery-overlay {
  position: fixed; inset: 0; z-index: 650;
  background: rgba(2,4,14,.96);
  display: none; flex-direction: column;
}
.gallery-overlay.active { display: flex; }
.gallery-bar {
  height: 46px; flex-shrink: 0;
  background: rgba(255,255,255,.02); border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; padding: 0 20px; gap: 10px;
}
.gallery-bar h2 { font-size: .85rem; font-weight: 600; }
.gallery-bar .grid-close { margin-left: auto; }
.gallery-content {
  flex: 1; overflow-y: auto; padding: 24px;
  max-width: 640px; margin: 0 auto; width: 100%;
}
.gallery-actions {
  display: flex; align-items: flex-end; gap: 12px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.gallery-url-row {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 240px;
}
.gallery-url-input {
  flex: 1; height: 30px; padding: 0 10px;
  background: var(--surface-1); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: .75rem;
}
.gallery-url-input:focus { outline: 1px solid var(--accent); }
.gallery-list { display: flex; flex-direction: column; gap: 8px; }
.gallery-entry {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-1); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: 14px 16px;
  transition: border-color var(--dur);
}
.gallery-entry:hover { border-color: var(--border-strong); }
.gallery-entry-info { flex: 1; min-width: 0; }
.gallery-entry-title {
  font-size: .85rem; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gallery-entry-meta {
  font-size: .7rem; color: var(--text-muted); margin-top: 3px;
}
.gallery-remove {
  width: 28px; height: 28px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0; color: var(--text-dim);
}
.gallery-remove:hover { color: var(--danger); border-color: var(--danger); }
.gallery-empty {
  text-align: center; padding: 40px 20px;
  font-size: .82rem; color: var(--text-dim); line-height: 1.6;
}

/* ── Insert-slide dropdown ────────────────────────────────────────── */
.insert-slide-wrap { position: relative; }
.insert-menu {
  display: none; position: absolute; top: 100%; right: 0; z-index: 90;
  background: #12101f; border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0,0,0,.5);
  padding: 4px 0; min-width: 130px; margin-top: 4px;
}
.insert-menu.open { display: block; }
.insert-menu button {
  display: block; width: 100%; text-align: left;
  padding: 6px 14px; background: none; border: none;
  color: var(--text-secondary); font-family: var(--font); font-size: .78rem;
  cursor: pointer; transition: background var(--dur);
}
.insert-menu button:hover { background: var(--surface-2); color: var(--text-primary); }

/* Scrollbars */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); }

:focus-visible {
  outline: 2px solid var(--accent-bright, #0080ff);
  outline-offset: 2px;
}
.skip-link {
  position: absolute; top: -100%; left: 16px; z-index: 1000;
  padding: 8px 16px; background: var(--accent-bright, #0080ff); color: #000;
  font-weight: 600; font-size: .875rem; border-radius: 0 0 6px 6px;
  text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 0; }

/* ── Toast ──────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  background: #1a1730; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px; padding: 10px 16px;
  font-size: 0.84rem; color: var(--text-primary, #f9f9f9);
  box-shadow: 0 4px 20px rgba(0,0,0,0.55);
  pointer-events: none;
  transform: translateY(8px); opacity: 0;
  transition: opacity 0.18s, transform 0.18s;
}
.toast.visible { opacity: 1; transform: translateY(0); }

/* ── Button press feedback ────────────────────────────────────── */
button:active, .btn:active {
  transform: scale(0.97);
  transition-duration: 120ms;
}

/* ── Entrance animation ───────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Skeleton loading ─────────────────────────────────────────── */
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton {
  background: linear-gradient(90deg, var(--surface-1) 25%, var(--surface-2) 50%, var(--surface-1) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 10px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
