/* =====================================================================
   LandMark-style Interactive Handout — site-shell CSS
   3-column layout: TOC (280px) | slide area (1fr) | prompt panel (380px)
   ===================================================================== */

/* ─────────────────────────────────────────────────────────────────────
   Design Tokens (aligned with docs/design/design.html)
   ───────────────────────────────────────────────────────────────────── */
:root {
  /* Brand — iter8 LandMark DNA two-tone palette */
  --brand:           #1B4FA8;   /* badges / banners / heavy elements */
  --brand-accent:    #2563EB;   /* icon strokes + colour-shifted key words */
  --brand-light:     #DCE7F8;   /* very light brand tint for chips */
  --brand-dark:      #143D84;
  --accent:          #2563EB;   /* alias kept for legacy references */

  /* Canvas / surface — LIGHT THEME */
  --canvas:          #EEF4FF;   /* pale blue-white — LandMark DNA */
  --canvas-2:        #ffffff;
  --surface:         #f1f5f9;
  --surface-2:       #e2e8f0;

  /* Ink / text — LIGHT THEME */
  --ink:             #0f172a;
  --ink-2:           #334155;
  --ink-muted:       #64748b;
  --ink-faint:       #94a3b8;

  /* Dividers */
  --line:            rgba(15, 23, 42, 0.08);
  --line-strong:     rgba(15, 23, 42, 0.14);

  /* Feedback */
  --success:         #16a34a;
  --warning:         #d97706;
  --danger:          #dc2626;

  /* Layout */
  --topbar-h:        92px;
  --sidebar-left-w:  280px;
  --sidebar-right-w: 380px;
  --radius:          8px;
  --radius-lg:       12px;

  /* Glass-morphism — LIGHT THEME */
  --glass-bg:        rgba(255, 255, 255, 0.82);
  --glass-border:    rgba(15, 23, 42, 0.08);
  --glass-blur:      blur(14px);

  /* Shadow — LIGHT THEME */
  --shadow-sm:       0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md:       0 4px 16px rgba(15, 23, 42, 0.10);

  /* Animation */
  --transition:      160ms ease;
}

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

/* Ensure [hidden] works even inside flex/grid containers */
[hidden] {
  display: none !important;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Noto Sans TC', 'Inter', -apple-system, BlinkMacSystemFont, "PingFang TC",
               "Helvetica Neue", sans-serif;
  font-size: 15px;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ─────────────────────────────────────────────────────────────────────
   Top Bar — course masthead + brand accent stripe
   ───────────────────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 20px 14px;
  background: rgba(255, 255, 255, 0.94);
  border-top: 3px solid var(--brand);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.topbar-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar-logo {
  font-size: 18px;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.topbar-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.topbar-client {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.topbar-context-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  white-space: nowrap;
  padding-left: 8px;
  border-left: 1px solid var(--line-strong);
}

.topbar-title {
  max-width: min(920px, 100%);
  font-size: 30px;
  line-height: 1.05;
  font-weight: 800;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────────
   Button styles
   ───────────────────────────────────────────────────────────────────── */
.btn-icon {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--canvas-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition);
}

.btn-icon:hover {
  background: var(--brand-light);
  border-color: rgba(27, 79, 168, 0.35);
  color: var(--brand);
}

.btn-export  { border-color: rgba(22, 163, 74, 0.45);  color: var(--success); background: rgba(22, 163, 74, 0.08); }
.btn-download{ border-color: rgba(37, 99, 235, 0.45);  color: var(--accent);  background: rgba(37, 99, 235, 0.08); }
.btn-pdf     { border-color: rgba(217, 119, 6, 0.45);  color: var(--warning); background: rgba(217, 119, 6, 0.08); }
.btn-package { border-color: rgba(27, 79, 168, 0.55); color: #fff; background: var(--brand); }

.btn-nav {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--canvas-2);
  color: var(--ink-muted);
  font-size: 12px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.btn-nav:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.view-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 30px;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--canvas-2);
}

.view-mode-btn {
  height: 24px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.view-mode-btn.active {
  background: var(--brand);
  color: #fff;
}

/* ─────────────────────────────────────────────────────────────────────
   3-Column Layout
   ───────────────────────────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-left-w) 1fr var(--sidebar-right-w);
  grid-template-rows: 1fr;
  height: 100vh;
  padding-top: var(--topbar-h);
  overflow: hidden;
}

/* ─────────────────────────────────────────────────────────────────────
   Sidebars — glass-morphism panels
   ───────────────────────────────────────────────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--canvas-2);
  overflow: hidden;
  transition: width var(--transition), opacity var(--transition);
}

.sidebar-left  { border-right:  1px solid var(--line); }
.sidebar-right { border-left:   1px solid var(--line); }

.sidebar-header {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toc-page-count {
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-faint);
  letter-spacing: 0;
  text-transform: none;
}

/* ─────────────────────────────────────────────────────────────────────
   Collapsed sidebar state
   ───────────────────────────────────────────────────────────────────── */
.sidebar-left.collapsed {
  width: 0;
  overflow: hidden;
  opacity: 0;
  border: none;
}

.sidebar-right.collapsed {
  width: 0;
  overflow: hidden;
  opacity: 0;
  border: none;
}

/* When left sidebar collapses, expand grid */
.layout:has(.sidebar-left.collapsed) {
  grid-template-columns: 0 1fr var(--sidebar-right-w);
}
.layout:has(.sidebar-right.collapsed) {
  grid-template-columns: var(--sidebar-left-w) 1fr 0;
}
.layout:has(.sidebar-left.collapsed):has(.sidebar-right.collapsed) {
  grid-template-columns: 0 1fr 0;
}

/* ─────────────────────────────────────────────────────────────────────
   Table of Contents
   ───────────────────────────────────────────────────────────────────── */
.toc {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-faint) transparent;
}

.toc-group {
  margin-bottom: 4px;
}

.toc-group-label {
  display: block;
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
}

.toc-group:first-child .toc-group-label {
  border-top: none;
}

.toc-entry {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 16px 7px 20px;
  background: transparent;
  border: none;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border-left: 2px solid transparent;
  line-height: 1.4;
}

.toc-entry:hover {
  background: rgba(37, 99, 235, 0.06);
  color: var(--ink);
}

.toc-entry.active {
  background: rgba(37, 99, 235, 0.10);
  color: var(--brand-accent);
  border-left-color: var(--brand-accent);
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────────
   Main Slide Area
   ───────────────────────────────────────────────────────────────────── */
.slide-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--canvas);
}

/* Slide navigation header */
.slide-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--canvas-2);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.slide-counter {
  font-size: 12px;
  color: var(--ink-muted);
  min-width: 80px;
  text-align: center;
  white-space: nowrap;
}

.slide-title-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 0 8px;
}

.slide-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.slide-id-badge {
  flex-shrink: 0;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-family: "SF Mono", "Fira Code", monospace;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.slide-title-bar {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slide-subtitle {
  font-size: 11px;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
  margin: 0;
  padding: 0;
}

/* Slide canvas — LandMark DNA: pale blue canvas with subtle aurora (iter8) */
.slide-canvas {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
  background-color: var(--canvas);
  background-image:
    radial-gradient(ellipse at top right, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(27, 79, 168, 0.04) 0%, transparent 50%);
  background-size: 200% 200%, 200% 200%;
  animation: aurora 18s ease-in-out infinite;
}

body[data-view-mode="theater"] .slide-canvas {
  background: #0b1520;
  background-image: none;
  animation: none;
}

body[data-view-mode="theater"] .slide-image {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.36);
}

body[data-view-mode="borderless"] .slide-canvas {
  background: var(--canvas);
  background-image: none;
  animation: none;
}

body[data-view-mode="borderless"] .slide-image {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.ink-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 60;
  pointer-events: none;
  touch-action: none;
}

.presenter-tools {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 120;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.presenter-tools.hidden {
  display: none !important;
}

.presenter-tool,
.presenter-color {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.presenter-hide {
  margin-left: 4px;
  color: var(--ink-muted);
}

.presenter-tool.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.presenter-color {
  padding: 0;
  background: var(--ink-color, #ef4444);
}

.presenter-color[data-ink-color="#ef4444"] { --ink-color: #ef4444; }
.presenter-color[data-ink-color="#2563eb"] { --ink-color: #2563eb; }
.presenter-color[data-ink-color="#16a34a"] { --ink-color: #16a34a; }

.presenter-color.active {
  outline: 3px solid rgba(15, 23, 42, 0.18);
  outline-offset: 2px;
}

.presenter-reveal {
  position: absolute;
  right: 28px;
  bottom: 24px;
  z-index: 120;
  display: none;
  height: 40px;
  min-width: 48px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.presenter-reveal.visible {
  display: block;
}

.laser-dot {
  position: fixed;
  left: -10px;
  top: -10px;
  width: 22px;
  height: 22px;
  z-index: 180;
  border-radius: 999px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(248, 113, 113, 0.96) 0 30%, rgba(239, 68, 68, 0.36) 45%, rgba(239, 68, 68, 0) 72%);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.9);
  margin-left: -11px;
  margin-top: -11px;
}

/* Brand-color emphasis utility — used in body content (iter8) */
.brand-emph, .accent {
  color: var(--brand-accent);
  font-weight: inherit;
}

.slide-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-lg);
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 40px -8px rgba(15, 23, 42, 0.14);
  cursor: zoom-in;
  margin: 0 auto;
}

.slide-body {
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  scrollbar-width: thin;
  scrollbar-color: var(--ink-faint) transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Notes panel */
.notes-panel {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: var(--canvas-2);
  display: flex;
  flex-direction: column;
  height: 190px;
}

.notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.notes-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.notes-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.notes-autosave {
  font-size: 11px;
  color: var(--success);
  opacity: 0;
  transition: opacity 0.4s;
}

.notes-autosave.visible {
  opacity: 1;
}

.notes-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.notes-tab {
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.notes-tab.active {
  background: var(--brand-light);
  border-color: rgba(27, 79, 168, 0.35);
  color: var(--brand);
}

.notes-area {
  flex: 1;
  padding: 10px 12px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: none;
}

/* ─────────────────────────────────────────────────────────────────────
   Right Panel — Prompt cards + key-takeaway
   ───────────────────────────────────────────────────────────────────── */
.prompt-panel {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-faint) transparent;
}

.prompt-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prompt-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
}

.prompt-card-desc {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.5;
}

.prompt-card-body {
  width: 100%;
  min-height: 120px;
  padding: 10px;
  background: var(--canvas);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: 'JetBrains Mono', "SF Mono", "Fira Code", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-faint) transparent;
}

.prompt-actions {
  display: flex;
  gap: 8px;
}

.prompt-actions button {
  flex: 1;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--canvas-2);
  color: var(--ink-muted);
  font-size: 12px;
  cursor: pointer;
  transition: background var(--transition);
}

.prompt-actions button:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.key-takeaway-card {
  background: rgba(27, 79, 168, 0.05);
  border: 1px solid rgba(27, 79, 168, 0.15);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.key-takeaway-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand);
  margin-bottom: 8px;
}

.key-takeaway-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.6;
}

.right-takeaway {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.6;
  margin: 0;
}

.key-takeaway-hint-card {
  background: var(--surface);
  border-color: var(--line);
}

.right-hint {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.5;
  margin: 0;
  font-style: italic;
}

/* ─────────────────────────────────────────────────────────────────────
   Zoom Modal — z-index 1000
   ───────────────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  cursor: pointer;
}

.modal-content {
  position: relative;
  z-index: 1001;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.modal-close {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  color: var(--ink);
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  transition: background var(--transition);
}

.modal-close:hover {
  background: rgba(255,255,255,0.25);
}

.modal-image {
  max-width: 90vw;
  max-height: calc(90vh - 52px);
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}

/* ─────────────────────────────────────────────────────────────────────
   RWD — 1280px: compress sidebars
   ───────────────────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  :root {
    --sidebar-left-w:  240px;
    --sidebar-right-w: 320px;
  }

  .layout {
    grid-template-columns: var(--sidebar-left-w) 1fr var(--sidebar-right-w);
  }
}

/* ─────────────────────────────────────────────────────────────────────
   RWD — 768px: sidebars collapse to overlay drawer
   ───────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
    position: relative;
  }

  .sidebar-left,
  .sidebar-right {
    position: fixed;
    top: var(--topbar-h);
    bottom: 0;
    z-index: 100;
    width: 280px;
    transform: translateX(-100%);
    transition: transform var(--transition);
  }

  .sidebar-left  { left: 0; }
  .sidebar-right {
    right: 0;
    transform: translateX(100%);
  }

  .sidebar-left.drawer-open  { transform: translateX(0); }
  .sidebar-right.drawer-open { transform: translateX(0); }

  /* drawer-mode: JS-managed overlay (F49) */
  .sidebar-left.drawer-mode,
  .sidebar-right.drawer-mode {
    position: fixed;
    top: 56px;
    height: calc(100vh - 56px);
    z-index: 200;
    transition: transform 0.25s ease;
  }
  .sidebar-left.drawer-mode {
    left: 0;
    transform: translateX(-100%);
  }
  .sidebar-left.drawer-mode:not(.collapsed) {
    transform: translateX(0);
  }
  .sidebar-right.drawer-mode {
    right: 0;
    transform: translateX(100%);
  }
  .sidebar-right.drawer-mode:not(.collapsed) {
    transform: translateX(0);
  }

  .slide-header {
    flex-wrap: wrap;
    gap: 6px;
  }
}

/* ─────────────────────────────────────────────────────────────────────
   RWD — 375px: single column, wrap top buttons
   ───────────────────────────────────────────────────────────────────── */
@media (max-width: 375px) {
  .topbar {
    height: var(--topbar-h);
    padding: 8px 12px;
    gap: 6px;
  }

  .topbar-title {
    font-size: 20px;
  }

  .topbar-actions {
    flex-wrap: wrap;
    gap: 4px;
  }

  .btn-icon {
    font-size: 11px;
    padding: 0 8px;
    height: 28px;
  }

  .layout {
    padding-top: calc(var(--topbar-h) + 32px);
  }
}

/* ─────────────────────────────────────────────────────────────────────
   Scrollbar styling (webkit)
   ───────────────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--ink-faint);
  border-radius: 3px;
}

/* ─────────────────────────────────────────────────────────────────────
   Aurora animated background (F53)
   ───────────────────────────────────────────────────────────────────── */
@keyframes aurora {
  0%, 100% {
    background-position: 0% 50%, 100% 50%;
  }
  50% {
    background-position: 100% 50%, 0% 50%;
  }
}

/* ─────────────────────────────────────────────────────────────────────
   Toast notification (clipboard.js)
   ───────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 1100;
  pointer-events: none;
  animation: toast-in 0.2s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ─────────────────────────────────────────────────────────────────────
   Body slide content — takeaway card (Issue 1 fix)
   ───────────────────────────────────────────────────────────────────── */
.body-content {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 60px 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
  justify-content: center;
}

.body-takeaway-card {
  background: var(--canvas-2);
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--brand);
  border-radius: 16px;
  padding: 28px 36px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  width: 100%;
}

.body-takeaway-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.body-takeaway-text {
  font-size: 20px;
  line-height: 1.65;
  color: var(--ink);
  font-weight: 500;
}

.body-empty {
  font-size: 14px;
  color: var(--ink-muted);
  text-align: center;
  font-style: italic;
  padding: 40px;
}

@media (max-width: 900px) {
  .body-content {
    padding: 40px 28px;
  }
  .body-takeaway-card {
    padding: 20px 24px;
  }
  .body-takeaway-text {
    font-size: 17px;
  }
}

/* ─────────────────────────────────────────────────────────────────────
   Presentation fullscreen mode — hide chrome, slide only (Issue 3 fix)
   ───────────────────────────────────────────────────────────────────── */
body.present-mode .topbar,
body.present-mode .sidebar-left,
body.present-mode .sidebar-right,
body.present-mode .notes-panel {
  display: none !important;
}

body.present-mode .layout {
  grid-template-columns: 1fr !important;
  padding-top: 0 !important;
  height: 100vh !important;
}

body.present-mode .slide-area {
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.present-mode .slide-header {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  padding: 8px 24px;
  border-radius: 999px;
  z-index: 100;
  gap: 12px;
  box-shadow: var(--shadow-md);
  flex-wrap: nowrap;
  width: auto;
  max-width: 90vw;
}

body.present-mode .slide-header .slide-nav { display: none !important; }

body.present-mode .slide-canvas {
  height: 100vh !important;
  max-width: 100vw !important;
  width: 100vw !important;
  border-radius: 0 !important;
  border: none !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b1520 !important;
  background-image: none !important;
  animation: none !important;
}

body.present-mode .ink-canvas {
  pointer-events: auto;
}

body.present-mode .ink-canvas.pen-mode {
  cursor: crosshair;
}

body.present-mode .presenter-tools {
  display: flex;
}

body.present-mode .presenter-reveal.visible {
  display: block;
}

body.present-mode #slide-image {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
}

body.present-mode .body-content {
  max-width: 1100px;
  padding: 100px 80px;
}

body.present-mode .body-takeaway-text {
  font-size: 36px;
}

body.present-mode::after {
  content: 'H 工具列 / L 雷射筆 / P 色筆 / C 清除 / F 或 Esc 退出';
  position: fixed;
  bottom: 24px;
  right: 28px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-family: inherit;
  pointer-events: none;
  z-index: 200;
  letter-spacing: 0.04em;
}

/* ─────────────────────────────────────────────────────────────────────
   Markdown block — formatted prompt content in right panel (iter4-F2)
   ───────────────────────────────────────────────────────────────────── */
.prompt-card-md-preview {
  background: var(--canvas);
  border-left: 3px solid var(--brand-accent);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 4px 0 8px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-2);
}

.md-block .md-p {
  margin: 0 0 8px 0;
}

.md-block .md-p:last-child {
  margin-bottom: 0;
}

.md-block .md-list {
  padding-left: 22px;
  margin: 6px 0;
}

.md-block .md-list li {
  margin-bottom: 4px;
}

.md-block .md-code {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 12px 16px;
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 12px;
  overflow-x: auto;
  margin: 10px 0;
  display: block;
}

.md-block strong {
  color: var(--ink);
  font-weight: 600;
}

.md-block code {
  background: rgba(37, 99, 235, 0.10);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 12px;
  color: var(--brand-accent);
}

.prompt-edit-details {
  margin-top: 8px;
}

.prompt-edit-details summary {
  cursor: pointer;
  color: var(--ink-muted);
  font-size: 12px;
  user-select: none;
  padding: 4px 0;
}

.prompt-edit-details .prompt-card-body {
  margin-top: 8px;
}
