/*
 * ========================================================================
 * ANALYTIC ENDEAVORS - PRESENTATION MODE
 * Spotlight/step-through presentation layer for guide pages
 * Copyright (c) 2024-2025 Analytic Endeavors Inc. All Rights Reserved.
 * Origin: analyticendeavors.com
 * ========================================================================
 *
 * Usage: Add after guide-reveal.css in the CSS cascade.
 * Activated by body.present class (via ?present=true or P key).
 * Presenter View window uses body.presenter-view class.
 */

/* ===== CUSTOM PROPERTIES ===== */
:root {
  --present-blur: 8px;
  --present-upcoming-opacity: 0.3;
  --present-dim-opacity: 0.55;
  --present-transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --present-glow: 0 0 30px rgba(0, 153, 153, 0.12);
}

/* ===== PRESENTATION TOGGLE BUTTON ===== */
.present-toggle {
  position: fixed;
  bottom: 2rem;
  right: 6.5rem;
  z-index: 1000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  color: var(--text-secondary);
  opacity: 0;
  visibility: hidden;
}

.present-toggle.visible {
  opacity: 1;
  visibility: visible;
}

.present-toggle:hover {
  border-color: var(--teal);
  color: var(--teal-light);
  transform: scale(1.1);
}

.present-toggle svg {
  width: 20px;
  height: 20px;
}

body.present .present-toggle {
  border-color: var(--teal);
  background: rgba(0, 153, 153, 0.15);
  color: var(--teal-light);
  right: 2rem;
}

/* ===== PRESENTATION MODE: BODY & LAYOUT ===== */
body.present {
  overflow: hidden;
}

body.present .guide-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 2rem;
  box-sizing: border-box;
  scroll-snap-align: start;
}

/* When sections are already inside a .container, skip horizontal padding to avoid double-inset */
body.present .container > .guide-section {
  padding-left: 0;
  padding-right: 0;
}

/* Overflow sections: JS handles scroll positioning, CSS centering fights it */
body.present .guide-section.pres-overflow {
  justify-content: flex-start;
}

/* Override guide-section divider in presentation mode */
body.present .guide-section::after {
  opacity: 0.3;
}

/* Hide native slide counter in presentation mode (slide-navigation.js) */
body.present .slide-counter {
  display: none !important;
}

/* ===== STEP STATES ===== */

/* Default: all steps visible in guide mode, no step classes applied */

/* Upcoming: not yet revealed */
body.present .step.step--upcoming {
  filter: blur(var(--present-blur));
  opacity: var(--present-upcoming-opacity);
  pointer-events: none;
  transform: scale(0.98);
  transition: filter var(--present-transition),
              opacity var(--present-transition),
              transform var(--present-transition);
}

/* Revealed: previously shown */
body.present .step.step--revealed {
  filter: none;
  opacity: var(--present-dim-opacity);
  pointer-events: auto;
  transform: none;
  transition: filter var(--present-transition),
              opacity var(--present-transition),
              transform var(--present-transition);
}

/* Current: the spotlight */
body.present .step.step--current {
  filter: none;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition: filter var(--present-transition),
              opacity var(--present-transition),
              transform var(--present-transition);
  position: relative;
}

/* Ancestor pass-through: don't dim a step that wraps the current one */
body.present .step.step--revealed:has(.step--current) {
  opacity: 1;
  filter: none;
}
body.present .step.step--upcoming:has(.step--current) {
  opacity: 1;
  filter: none;
  pointer-events: auto;
  transform: none;
}

/* Tooltip stacking: revealed steps rise above current on hover */
body.present .step.step--revealed {
  position: relative;
  z-index: 1;
}
body.present .step.step--current {
  z-index: 10;
}
body.present .step.step--revealed:hover {
  z-index: 50;
}

/* Preview flash when clicking a step in the editor */
.step--preview-flash {
  animation: previewFlash 1.2s ease;
  border-radius: 8px;
}

@keyframes previewFlash {
  0%   { outline: 2px solid var(--teal); outline-offset: 6px; outline-style: solid; }
  70%  { outline: 2px solid var(--teal); outline-offset: 6px; }
  100% { outline: 2px solid transparent; outline-offset: 10px; }
}

/* Section headers & column headers: blur until their section is reached */
body.present .section-header,
body.present .col-header {
  filter: blur(var(--present-blur));
  opacity: var(--present-upcoming-opacity);
  transition: filter var(--present-transition),
              opacity var(--present-transition);
}

body.present .guide-section:has(.step--current) .section-header,
body.present .guide-section:has(.step--revealed) .section-header,
body.present .guide-section:has(.step--current) .col-header,
body.present .guide-section:has(.step--revealed) .col-header {
  filter: none;
  opacity: 1;
}

/* Hero sizing in presentation mode.
   The .step becomes the positioning context (position: relative via step--current).
   It must fill exactly 100vh so the absolute-positioned .scroll-indicator lands at
   the viewport bottom. The hero section's own padding and the step's default
   margin-bottom (3rem from guide-layout.css) must be zeroed to prevent the hero
   from exceeding 100vh and creating scrollable overflow. */
body.present .hero {
  padding: 0;
}
body.present .hero > .step {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 0;
}
body.present .scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  animation: none;
}

/* Outer containers: blur until their section is reached (upcoming only) */
body.present .guide-section:not(:has(.step--current)):not(:has(.step--revealed)) .tldr,
body.present .guide-section:not(:has(.step--current)):not(:has(.step--revealed)) .comparison-grid,
body.present .guide-section:not(:has(.step--current)):not(:has(.step--revealed)) .requirements-grid,
body.present .guide-section:not(:has(.step--current)):not(:has(.step--revealed)) .perf-grid,
body.present .guide-section:not(:has(.step--current)):not(:has(.step--revealed)) .pro-tips,
body.present .guide-section:not(:has(.step--current)):not(:has(.step--revealed)) .decision-grid,
body.present .guide-section:not(:has(.step--current)):not(:has(.step--revealed)) .tip-grid,
body.present .guide-section:not(:has(.step--current)):not(:has(.step--revealed)) .diff-table {
  filter: blur(var(--present-blur));
  opacity: var(--present-upcoming-opacity);
  transition: filter var(--present-transition),
              opacity var(--present-transition);
}

/* Glow border removed -- step dimming/blur provides sufficient focus */

/* ===== REVEAL OVERRIDE IN PRESENTATION MODE ===== */
/* Force all reveal elements visible -- step classes control visibility instead.
   Exclude .step elements (their transitions must stay alive) and
   .section-header/.col-header (managed by section-reached rules above). */
body.present .reveal:not(.step):not(.section-header):not(.col-header),
body.present .reveal-left:not(.step):not(.section-header):not(.col-header),
body.present .reveal-right:not(.step):not(.section-header):not(.col-header),
body.present .reveal-scale:not(.step):not(.section-header):not(.col-header) {
  opacity: 1;
  transform: none;
  transition: none;
}
/* .step.reveal elements: make visible but KEEP transitions alive */
body.present .step.reveal,
body.present .step.reveal-left,
body.present .step.reveal-right,
body.present .step.reveal-scale {
  opacity: 1;
  transform: none;
  /* no transition:none -- step state rules control transitions */
}

/* ===== SUB-ELEMENT CHOREOGRAPHY IN PRESENTATION MODE ===== */
/* Force all sub-elements visible so blurred previews look complete.
   Current-step elements get CSS animation entrance instead of transitions.
   Uses @keyframes (not transitions) so animations fire reliably when
   .step--current is added, regardless of .active class state. */

/* -- Force visible: all sub-elements in presentation mode -- */
body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .diagram-flow > *,
body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .badge,
body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .callout,
body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .icon-grid > .icon-card,
body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .checklist-grid > .checklist-card,
body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .feature-cards > .feature-card,
body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .comparison-panel > *,
body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .comparison-vs,
body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .cache-visual-diagram > *,
body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .cache-visual-label,
body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .cache-visual-caption,
body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .extended-flow-row > .step > *,
body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .pillars-grid > .step > *,
body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .extended-card,
body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .extended-arrow {
  opacity: 1;
  transform: none;
  transition: none;
}

body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .arrow-import .arrow-shaft,
body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .arrow-neutral .arrow-shaft {
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  transition: none;
}

body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .arrow-import .arrow-head,
body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .arrow-neutral .arrow-head {
  opacity: 1;
  transition: none;
}

/* Keep DQ/DL flow animation paused until step is current or revealed */
body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .arrow-dq svg,
body.present :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) .arrow-dl svg {
  animation-play-state: paused;
}

body.present :is(.step--current, .step--revealed) .arrow-dq svg,
body.present :is(.step--current, .step--revealed) .arrow-dl svg {
  animation-play-state: running;
}

/* -- Prevent choreography leaking into non-current steps -- */
/* When a .step is inside an ancestor .reveal.active, choreography transitions
   fire on the step's children even if the step is upcoming/blurred.
   :not(:has(.step--current)) excludes ancestor steps that contain a current
   nested step (e.g. outer comparison step wrapping the DL panel step),
   so the nested step's children can animate freely on entry. */
body.present .step:not(.step--current):not(:has(.step--current)) :is(
  .diagram-flow > *,
  .badge,
  .callout,
  .comparison-panel > *,
  .comparison-vs,
  .icon-grid > .icon-card,
  .checklist-grid > .checklist-card,
  .feature-cards > .feature-card,
  .cache-visual-diagram > *,
  .cache-visual-label,
  .cache-visual-caption
) {
  opacity: 1;
  transform: none;
  transition: none;
  animation: none;
}

/* Handle when the step element IS the component container (e.g. .step.comparison-panel) */
body.present .step:not(.step--current).comparison-panel > * {
  opacity: 1;
  transform: none;
  transition: none;
}

/* Arrow overrides for non-current steps */
body.present .step:not(.step--current) .arrow-import .arrow-shaft,
body.present .step:not(.step--current) .arrow-neutral .arrow-shaft {
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  transition: none;
}

body.present .step:not(.step--current) .arrow-import .arrow-head,
body.present .step:not(.step--current) .arrow-neutral .arrow-head {
  opacity: 1;
  transition: none;
}

/* -- Current step: choreographed entrance via @keyframes -- */
/* fill-mode: backwards -> during delay uses 'from' keyframe (hidden).
   After animation, CSS computed values (opacity:1 from force-visible) apply,
   so hover transforms work normally. */

body.present .step--current .diagram-flow > * {
  animation: presentFadeUp 0.45s ease backwards;
}

body.present .step--current .diagram-flow > :nth-child(1) { animation-delay: 0.15s; }
body.present .step--current .diagram-flow > :nth-child(2) { animation-delay: 0.3s; }
body.present .step--current .diagram-flow > :nth-child(3) { animation-delay: 0.45s; }
body.present .step--current .diagram-flow > :nth-child(4) { animation-delay: 0.6s; }
body.present .step--current .diagram-flow > :nth-child(5) { animation-delay: 0.75s; }
body.present .step--current .diagram-flow > :nth-child(6) { animation-delay: 0.9s; }
body.present .step--current .diagram-flow > :nth-child(7) { animation-delay: 1.05s; }

body.present .step--current .badge {
  animation: presentPop 0.3s ease backwards 0.05s;
}

body.present .step--current .callout {
  animation: presentFadeUp 0.5s ease backwards 0.65s;
}

/* Arrow shaft draw in current step */
body.present .step--current .arrow-import .arrow-shaft,
body.present .step--current .arrow-neutral .arrow-shaft {
  stroke-dasharray: 44;
  stroke-dashoffset: 0;
  animation: presentArrowDraw 0.5s ease backwards;
}

/* Coordinate arrow draw timing with diagram stagger position */
body.present .step--current .diagram-flow > :nth-child(2) .arrow-shaft { animation-delay: 0.3s; }
body.present .step--current .diagram-flow > :nth-child(4) .arrow-shaft { animation-delay: 0.6s; }
body.present .step--current .diagram-flow > :nth-child(6) .arrow-shaft { animation-delay: 0.9s; }

/* Arrow head appears near end of shaft draw */
body.present .step--current .arrow-import .arrow-head,
body.present .step--current .arrow-neutral .arrow-head {
  animation: presentFadeIn 0.25s ease backwards;
}

body.present .step--current .diagram-flow > :nth-child(2) .arrow-head { animation-delay: 0.65s; }
body.present .step--current .diagram-flow > :nth-child(4) .arrow-head { animation-delay: 0.95s; }
body.present .step--current .diagram-flow > :nth-child(6) .arrow-head { animation-delay: 1.25s; }

/* Icon grid in current step */
body.present .step--current .icon-grid > .icon-card {
  animation: presentScaleUp 0.35s ease backwards;
}

body.present .step--current .icon-grid > :nth-child(1) { animation-delay: 0.08s; }
body.present .step--current .icon-grid > :nth-child(2) { animation-delay: 0.16s; }
body.present .step--current .icon-grid > :nth-child(3) { animation-delay: 0.24s; }
body.present .step--current .icon-grid > :nth-child(4) { animation-delay: 0.32s; }
body.present .step--current .icon-grid > :nth-child(5) { animation-delay: 0.40s; }
body.present .step--current .icon-grid > :nth-child(6) { animation-delay: 0.48s; }

/* Checklist in current step */
body.present .step--current .checklist-grid > .checklist-card {
  animation: presentSlideIn 0.4s ease backwards;
}

body.present .step--current .checklist-grid > :nth-child(1) { animation-delay: 0.08s; }
body.present .step--current .checklist-grid > :nth-child(2) { animation-delay: 0.18s; }
body.present .step--current .checklist-grid > :nth-child(3) { animation-delay: 0.28s; }
body.present .step--current .checklist-grid > :nth-child(4) { animation-delay: 0.38s; }
body.present .step--current .checklist-grid > :nth-child(5) { animation-delay: 0.48s; }
body.present .step--current .checklist-grid > :nth-child(6) { animation-delay: 0.58s; }

/* Feature cards in current step */
body.present .step--current .feature-cards > .feature-card {
  animation: presentFadeUp 0.4s ease backwards;
}

body.present .step--current .feature-cards > :nth-child(1) { animation-delay: 0.1s; }
body.present .step--current .feature-cards > :nth-child(2) { animation-delay: 0.22s; }
body.present .step--current .feature-cards > :nth-child(3) { animation-delay: 0.34s; }
body.present .step--current .feature-cards > :nth-child(4) { animation-delay: 0.46s; }

/* Comparison panels in current step: children cascade downward */
/* Descendant selector: panel is inside a current step */
body.present .step--current .comparison-panel > * {
  animation: presentFadeUp 0.35s ease backwards;
}
/* Same-element: the step IS the comparison-panel (e.g. DL panel).
   Uses self-contained keyframe (presentPanelDown) with explicit from/to
   and fill-mode:both so animation is independent of cascade values.
   .step.step--current boosts specificity to 0-3-1. */
body.present .step.step--current.comparison-panel > * {
  animation: presentPanelDown 0.35s ease both;
}

body.present .step--current .comparison-panel > :nth-child(1) { animation-delay: 0.1s; }
body.present .step--current .comparison-panel > :nth-child(2) { animation-delay: 0.2s; }
body.present .step--current .comparison-panel > :nth-child(3) { animation-delay: 0.3s; }
body.present .step--current .comparison-panel > :nth-child(4) { animation-delay: 0.4s; }
body.present .step--current .comparison-panel > :nth-child(5) { animation-delay: 0.5s; }
body.present .step--current .comparison-panel > :nth-child(6) { animation-delay: 0.6s; }
body.present .step--current .comparison-panel > :nth-child(7) { animation-delay: 0.7s; }
body.present .step.step--current.comparison-panel > :nth-child(1) { animation-delay: 0.1s; }
body.present .step.step--current.comparison-panel > :nth-child(2) { animation-delay: 0.2s; }
body.present .step.step--current.comparison-panel > :nth-child(3) { animation-delay: 0.3s; }
body.present .step.step--current.comparison-panel > :nth-child(4) { animation-delay: 0.4s; }
body.present .step.step--current.comparison-panel > :nth-child(5) { animation-delay: 0.5s; }
body.present .step.step--current.comparison-panel > :nth-child(6) { animation-delay: 0.6s; }
body.present .step.step--current.comparison-panel > :nth-child(7) { animation-delay: 0.7s; }

/* VS divider */
body.present .step--current .comparison-vs {
  animation: presentPop 0.4s ease backwards 0.35s;
}

/* Cache visual in current step: left-to-right */
body.present .step--current .cache-visual-diagram > * {
  animation: presentSlideInX 0.4s ease backwards;
}

body.present .step--current .cache-visual-diagram > :nth-child(1) { animation-delay: 0.15s; }
body.present .step--current .cache-visual-diagram > :nth-child(2) { animation-delay: 0.4s; }
body.present .step--current .cache-visual-diagram > :nth-child(3) { animation-delay: 0.65s; }

body.present .step--current .cache-visual-label {
  animation: presentFadeIn 0.3s ease backwards 0.05s;
}

body.present .step--current .cache-visual-caption {
  animation: presentFadeUp 0.4s ease backwards 0.8s;
}

/* -- Choreography keyframes -- */
@keyframes presentFadeUp {
  from { opacity: 0; transform: translateY(10px); }
}

/* Blur-to-clear reveal: starts from upcoming state so there's no opacity flash */
@keyframes presentReveal {
  from { opacity: 0.15; filter: blur(3px); transform: scale(0.98); }
  to   { opacity: 1;    filter: none;      transform: none; }
}

@keyframes presentPop {
  from { opacity: 0; transform: scale(0.85); }
}

@keyframes presentScaleUp {
  from { opacity: 0; transform: scale(0.92) translateY(6px); }
}

@keyframes presentSlideIn {
  from { opacity: 0; transform: translateX(-12px); }
}

@keyframes presentArrowDraw {
  from { stroke-dashoffset: 44; }
}

@keyframes presentSlideInX {
  from { opacity: 0; transform: translateX(-15px); }
}

@keyframes presentFadeIn {
  from { opacity: 0; }
}

/* Self-contained keyframe for nested step panels (e.g. DL panel inside comparison).
   Explicit from/to so animation is fully independent of cascade values. */
@keyframes presentPanelDown {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Reduced motion in presentation mode */
@media (prefers-reduced-motion: reduce) {
  body.present .step--current .diagram-flow > *,
  body.present .step--current .badge,
  body.present .step--current .callout,
  body.present .step--current .icon-grid > .icon-card,
  body.present .step--current .checklist-grid > .checklist-card,
  body.present .step--current .feature-cards > .feature-card,
  body.present .step--current .comparison-panel > *,
  body.present .step--current.comparison-panel > *,
  body.present .step.step--current.comparison-panel > *,
  body.present .step--current .comparison-vs,
  body.present .step--current .cache-visual-diagram > *,
  body.present .step--current .cache-visual-label,
  body.present .step--current .cache-visual-caption,
  body.present .step--current .arrow-import .arrow-shaft,
  body.present .step--current .arrow-neutral .arrow-shaft,
  body.present .step--current .arrow-import .arrow-head,
  body.present .step--current .arrow-neutral .arrow-head {
    animation: none;
  }
}


/* ===== PRESENTATION UI ELEMENTS ===== */

/* Step counter (replaces slide counter text in presentation mode) */
.present-step-counter {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  background: var(--card-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  z-index: 1002;
  display: none;
  backdrop-filter: blur(10px);
}

/* step counter visibility controlled by JS preferences */

.present-step-counter .current-step {
  color: var(--teal-light);
  font-weight: 700;
}

/* Section label (absolutely centered in sticky nav) */
.present-section-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.95rem;
  color: var(--text-secondary);
  display: none;
  white-space: nowrap;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

body.present .present-section-label {
  display: block;
}

/* Presenter toolbar (Esc/Exit + Help + gear) -- ordered before nav-controls (right side) */
.present-exit-hint {
  background: var(--card-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.8rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  display: none;
  align-items: center;
  gap: 0.4rem;
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  order: 2;
  margin-left: auto;
}

.present-exit-hint:hover {
  color: var(--text-secondary);
  border-color: var(--teal);
}

body.present .present-exit-hint {
  display: flex;
}

/* In presentation mode, nav-controls (4 icons) stay rightmost */
body.present .nav-controls {
  order: 3;
  margin-left: 1rem;
}

.present-exit-hint kbd {
  background: var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-family: inherit;
}

/* ===== PRESENTER TIMER ===== */
.present-timer {
  position: fixed;
  top: 70px;
  left: 1rem;
  background: var(--card-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  color: var(--teal-light);
  z-index: 1002;
  display: none;
  backdrop-filter: blur(10px);
  font-weight: 600;
  align-items: center;
  gap: 0.5rem;
}

.present-timer.visible {
  display: flex;
}

.present-timer .timer-display {
  min-width: 3.2em;
  text-align: center;
}

.present-timer .timer-controls {
  display: flex;
  gap: 0.25rem;
}

.present-timer .timer-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: inherit;
  font-size: 0.65rem;
  font-family: inherit;
  padding: 0.15rem 0.4rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1.2;
}

.present-timer .timer-btn:hover {
  background: rgba(0, 153, 153, 0.15);
  border-color: var(--teal-light);
}

.present-timer.warn {
  color: var(--orange);
  border-color: var(--orange);
}

.present-timer.over {
  color: var(--danger);
  border-color: var(--danger);
}

/* ===== SECTION OVERVIEW (O key) ===== */
.present-overview {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(10, 22, 40, 0.95);
  backdrop-filter: blur(12px);
  display: none;
  padding: 3rem;
  overflow-y: auto;
}

.present-overview.visible {
  display: block;
  animation: fadeInOverlay 0.25s ease;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.present-overview-title {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2rem;
  background: linear-gradient(135deg, var(--teal-light), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.present-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  max-width: 1000px;
  margin: 0 auto;
}

.present-overview-card {
  background: var(--card-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.present-overview-card:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
}

.present-overview-card.visited {
  border-left: 3px solid var(--teal);
}

.present-overview-card.current-section {
  border-color: var(--teal);
  box-shadow: 0 0 20px rgba(0, 153, 153, 0.2);
}

.present-overview-card-num {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.present-overview-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.present-overview-card-steps {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Close hint for overlays */
.overlay-close-hint {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.overlay-close-hint kbd {
  background: var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-family: inherit;
}

/* ===== QUICK JUMP (G key) ===== */
.present-jump {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  width: 360px;
  max-height: 70vh;
  display: none;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.present-jump.visible {
  display: block;
  animation: fadeInOverlay 0.2s ease;
}

.present-jump-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1999;
  display: none;
}

.present-jump-backdrop.visible {
  display: block;
}

.present-jump-input {
  width: 100%;
  background: var(--card-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  margin-bottom: 1rem;
  box-sizing: border-box;
}

.present-jump-input:focus {
  border-color: var(--teal);
}

.present-jump-input::placeholder {
  color: var(--text-muted);
}

.present-jump-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 50vh;
  overflow-y: auto;
}

.present-jump-item {
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: background 0.15s ease;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.present-jump-item:hover,
.present-jump-item.highlighted {
  background: var(--card-surface);
  color: var(--text-primary);
}

.present-jump-item-num {
  color: var(--teal);
  font-weight: 700;
  font-size: 0.75rem;
  min-width: 20px;
}

/* ===== SHORTCUT HELP (? key) ===== */
.present-shortcuts-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1999;
  background: rgba(0, 0, 0, 0.35);
}
.present-shortcuts-backdrop.visible { display: block; }

.present-shortcuts {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  width: 400px;
  display: none;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.present-shortcuts.visible {
  display: block;
  animation: fadeInOverlay 0.2s ease;
}

.present-shortcuts-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
  text-align: center;
}

.shortcut-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(42, 58, 90, 0.3);
}

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

.shortcut-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.shortcut-keys {
  display: flex;
  gap: 0.3rem;
}

.shortcut-keys kbd {
  background: var(--card-surface);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: inherit;
  color: var(--teal-light);
  min-width: 24px;
  text-align: center;
}

/* Hidden notes source elements */
.presenter-notes {
  display: none !important;
}

/* ===== STEP GROUPING EDITOR (E key) ===== */
.present-group-editor {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  min-width: 320px;
  z-index: 2000;
  background: rgba(13, 13, 26, 0.95);
  border-left: 1px solid var(--border);
  display: none;
  overflow-y: auto;
  backdrop-filter: blur(12px);
}

.group-editor-resize-handle {
  position: absolute;
  top: 0;
  left: -4px;
  width: 8px;
  height: 100%;
  cursor: ew-resize;
  z-index: 2001;
}

.group-editor-resize-handle:hover,
.group-editor-resize-handle:active {
  background: linear-gradient(90deg, transparent, rgba(0, 153, 153, 0.3), transparent);
}

.present-group-editor.visible {
  display: block;
  animation: slideInEditor 0.3s ease;
}

@keyframes slideInEditor {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.group-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(13, 13, 26, 0.98);
  z-index: 1;
  backdrop-filter: blur(12px);
}

.group-editor-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--teal);
  font-weight: 600;
}

.group-editor-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.group-editor-save {
  padding: 5px 10px;
  background: var(--teal);
  color: #fff;
  border: 2px solid transparent;
  border-radius: 4px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, border-color 0.3s, box-shadow 0.3s;
  line-height: 1;
}

.group-editor-save:hover {
  background: var(--teal-light);
}

.group-editor-save--dirty {
  background: var(--orange-accent, #FF8C42);
  border-color: rgba(255, 140, 66, 0.5);
  box-shadow: 0 0 8px rgba(255, 140, 66, 0.3);
}

.group-editor-save--dirty:hover {
  background: #ff9d5c;
}

.group-editor-reset-all {
  padding: 5px 8px;
  background: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}

.group-editor-reset-all:hover {
  border-color: var(--orange-accent, #FF8C42);
  color: var(--orange-accent, #FF8C42);
}

.group-editor-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  line-height: 1;
}

.group-editor-close:hover {
  color: var(--text-primary);
}

.group-editor-info {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.group-editor-info p {
  margin: 0;
}

.group-editor-info strong {
  color: var(--teal-light);
}

/* No longer used -- info text is now plain text */

.group-editor-body {
  padding: 1rem 1.25rem;
}

.group-editor-guide-divider {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1rem 0 0.75rem;
  padding: 0.35rem 0;
}
.group-editor-guide-divider::before,
.group-editor-guide-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--teal);
  opacity: 0.35;
}
.group-editor-guide-divider span {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
  opacity: 0.7;
  white-space: nowrap;
}

/* ── Source provenance indicators (orchestrator mode) ── */
/* Pure CSS circles -- no Unicode glyphs, guaranteed identical sizing */
.section-source {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  cursor: help;
  transition: opacity 0.2s, background 0.2s, border-color 0.2s;
  vertical-align: middle;
}
.section-source--presenter {
  background: var(--orange);
  border: 1.5px solid var(--orange);
}
.section-source--guide {
  background: var(--teal);
  border: 1.5px solid var(--teal);
}
.section-source--default {
  background: transparent;
  border: 1.5px solid var(--text-muted);
  opacity: 0.45;
}

/* Source legend (inside group-editor-info) */
.source-legend {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.source-legend summary {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--teal-light, var(--teal));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.source-legend summary::marker,
.source-legend summary::-webkit-details-marker {
  display: none;
}
.source-legend summary::before {
  content: '\25B6';
  display: inline-block;
  margin-right: 4px;
  font-size: 0.5rem;
  transition: transform 0.2s;
}
.source-legend[open] summary::before {
  transform: rotate(90deg);
}
.source-legend p {
  margin: 0.25rem 0;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.source-legend-note {
  margin-top: 0.4rem !important;
  padding: 0.3rem 0.5rem;
  background: rgba(255, 140, 66, 0.08);
  border-left: 2px solid var(--orange);
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.6rem;
  line-height: 1.4;
}
.source-legend-layout {
  font-style: italic;
  opacity: 0.8;
}

/* Two-dot pair: left = groups, right = offset */
.section-source-pair {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-right: 5px;
  flex-shrink: 0;
}

.group-editor-section {
  margin-bottom: 1.25rem;
  border-left: 3px solid var(--teal);
  padding-left: 0.75rem;
}
/* Left border color reflects source */
.group-editor-section[data-source="presenter"] { border-left-color: var(--orange); }
.group-editor-section[data-source="guide"]     { border-left-color: var(--teal); }
.group-editor-section[data-source="default"]   { border-left-color: var(--text-muted); }

/* Wider step grouping pane in orchestrator/presenter mode */
body[data-ae-page="presentation-orchestrator"] .present-group-editor {
  width: 385px;
  min-width: 385px;
}

.group-editor-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  background: rgba(0, 153, 153, 0.06);
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
}

.group-editor-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal);
  cursor: default;
}

.section-label-input {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal);
  background: rgba(0, 153, 153, 0.1);
  border: 1px solid var(--teal);
  border-radius: 3px;
  padding: 0.1rem 0.3rem;
  font-family: inherit;
  outline: none;
  width: 100%;
  max-width: 200px;
}

.group-editor-reset {
  font-size: 0.6rem;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.group-editor-reset:hover {
  border-color: var(--teal);
  color: var(--teal);
}

/* Scroll offset control */
.group-editor-scroll-offset {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  margin-bottom: 0.3rem;
}

.scroll-offset-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-right: auto;
}

.scroll-offset-btn {
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
  line-height: 1;
  padding: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.scroll-offset-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.scroll-offset-input {
  width: 48px;
  text-align: center;
  font-size: 0.65rem;
  padding: 0.1rem 0.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: inherit;
  -moz-appearance: textfield;
}

.scroll-offset-input::-webkit-inner-spin-button,
.scroll-offset-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.scroll-offset-input:focus {
  outline: none;
  border-color: var(--teal);
}

.scroll-offset-unit {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* Step list container */
.group-editor-steplist {
  display: flex;
  flex-direction: column;
}

/* Individual step row */
.step-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  transition: background 0.15s, border-color 0.15s;
}

/* Step number badge */
.step-num {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 4px;
  background: var(--border);
  color: var(--teal);
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.step-row .step-label {
  /* Reset guide-layout.css pill styles */
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  background: none;
  text-transform: none;
  letter-spacing: normal;
  /* Actual editor label styles */
  display: block;
  min-width: 0;
  color: var(--text-secondary, var(--text-muted));
  font-size: 0.7rem;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Group wrapper -- clickable container for multi-step groups */
.step-group-wrap {
  border-left: 2px solid var(--teal);
  border-radius: 5px;
  background: rgba(0, 153, 153, 0.04);
  margin: 2px 0;
}

.step-group-parent {
  display: flex;
  align-items: center;
  padding: 0.15rem 0.5rem 0.1rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 153, 153, 0.12);
  transition: background 0.15s;
}

.step-group-parent:hover {
  background: rgba(0, 153, 153, 0.1);
}

.step-group-parent-label {
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
}

.step-group-parent:hover .step-group-parent-label {
  opacity: 1;
}

/* Grouped step styling -- subtle background, no individual border */
.step-row.grouped {
  background: rgba(0, 153, 153, 0.02);
  padding-left: 0.65rem;
}

.step-row.grouped .step-num {
  background: rgba(0, 153, 153, 0.2);
}

/* Current step/group highlight in group editor panel */
.step-row--current {
  background: rgba(0, 153, 153, 0.12);
  border-left: 2px solid var(--teal);
}
.step-row--current .step-num {
  background: var(--teal);
  color: #fff;
}
.step-row--current .step-label {
  color: var(--text-primary);
  font-weight: 600;
}
.step-group-wrap--current {
  border-left-color: var(--teal-light);
  background: rgba(0, 184, 184, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 184, 184, 0.15);
}

/* Brief flash on step change */
@keyframes editorStepFlash {
  0%   { background-color: rgba(0, 184, 184, 0.3); }
  100% { background-color: transparent; }
}
.step-editor-flash {
  animation: editorStepFlash 0.8s ease-out;
}

/* ===== GAP ZONES between steps ===== */
.step-gap {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0.5rem;
  font-family: inherit;
  width: 100%;
  transition: all 0.15s ease;
}

.gap-line {
  flex: 1;
  height: 0;
  transition: border-color 0.15s;
}

.gap-icon {
  font-size: 0.6rem;
  line-height: 1;
  padding: 0 0.3rem;
  pointer-events: none;
  transition: color 0.15s, background 0.15s;
}

/* Unlinked gap (between separate groups -- click to merge) */
.step-gap.unlinked {
  height: 22px;
  margin: 2px 0;
}

.step-gap.unlinked .gap-line {
  border-top: 1px dashed var(--border);
}

.step-gap.unlinked .gap-icon {
  color: var(--text-muted);
  background: var(--card-surface, rgba(13, 13, 26, 0.95));
  border-radius: 2px;
}

.step-gap.unlinked:hover .gap-line {
  border-color: var(--teal);
}

.step-gap.unlinked:hover .gap-icon {
  color: var(--teal-light);
}

/* Linked gap (within same group -- click to split) */
.step-gap.linked {
  height: 14px;
  margin: 0;
}

.step-gap.linked .gap-line {
  border-top: 1px solid var(--teal);
  opacity: 0.3;
}

.step-gap.linked .gap-icon {
  font-size: 0.55rem;
  color: var(--teal);
  opacity: 0.5;
  background: rgba(0, 153, 153, 0.05);
  border-radius: 2px;
  padding: 1px 0.25rem;
}

.step-gap.linked:hover .gap-line {
  border-color: var(--danger, #ff6b6b);
  opacity: 0.6;
}

.step-gap.linked:hover .gap-icon {
  color: #ff6b6b;
  opacity: 1;
  background: rgba(255, 107, 107, 0.1);
}

/* Reorder buttons */
.step-reorder {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-left: auto;
  flex-shrink: 0;
}

.step-reorder-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.55rem;
  width: 1.4rem;
  height: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  opacity: 0.7;
  transition: opacity 0.15s, color 0.15s, background 0.15s, border-color 0.15s;
  padding: 0;
  line-height: 1;
}

.step-reorder-btn:hover {
  opacity: 1;
  color: var(--teal);
  background: rgba(0, 153, 153, 0.18);
  border-color: var(--teal);
}

.step-reorder-btn:disabled {
  opacity: 0.12;
  cursor: default;
  pointer-events: none;
}

/* Reordered step indicator */
.step-num--moved {
  background: var(--orange-accent, #FF8C42);
  color: #fff;
}

/* Right-click context menu */
.connector-context-menu {
  position: fixed;
  z-index: 3000;
  background: var(--card-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0;
  min-width: 180px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.connector-context-menu .ctx-item {
  display: block;
  width: 100%;
  padding: 0.45rem 0.9rem;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.75rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}

.connector-context-menu .ctx-item:hover {
  background: rgba(0, 153, 153, 0.12);
  color: var(--teal-light);
}

/* ===== PROGRESS BREADCRUMB BAR ===== */
.present-breadcrumb {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  z-index: 1003;
  display: none;
  background: var(--card-bg);
}

body.present .present-breadcrumb {
  display: flex;
}

.present-breadcrumb-segment {
  flex: 1;
  height: 100%;
  background: var(--border);
  cursor: pointer;
  transition: background 0.3s ease;
  position: relative;
}

.present-breadcrumb-segment + .present-breadcrumb-segment {
  margin-left: 2px;
}

.present-breadcrumb-segment.completed {
  background: var(--teal);
  opacity: 0.5;
}

.present-breadcrumb-segment.active {
  background: var(--teal-light);
  opacity: 1;
}

.present-breadcrumb-segment:hover::before {
  content: attr(data-label);
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-surface);
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  white-space: nowrap;
  pointer-events: none;
}

/* ===== INFO TOOLTIPS (both modes) ===== */
.info-term {
  color: var(--teal-light);
  cursor: help;
  border-bottom: 1px dotted rgba(0, 184, 184, 0.4);
  position: relative;
  transition: color 0.2s ease;
}

.info-term:hover,
.info-term:focus-visible {
  color: var(--teal);
}

.info-term::after {
  content: attr(data-info);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary);
  width: 240px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  text-align: left;
  font-weight: 400;
}

.info-term:hover::after,
.info-term:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

/* Info card (expandable) */
.info-card {
  cursor: pointer;
  transition: all 0.2s ease;
}

.info-card:hover {
  border-color: var(--teal);
}

.info-card-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
  padding: 0 0.8rem;
}

.info-card.expanded .info-card-detail {
  max-height: 300px;
  padding: 0.6rem 0.8rem;
}

/* ===== PRESENTER VIEW WINDOW ===== */
body.presenter-view {
  background: var(--navy);
  overflow: hidden;
}

.pv-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto 1fr auto;
  height: 100vh;
  gap: 1px;
  background: var(--border);
}

.pv-header {
  grid-column: 1 / -1;
  background: var(--card-bg);
  padding: 0.8rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pv-header-title {
  font-size: 1.05rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--teal-light), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pv-timer-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pv-timer {
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--teal-light);
}

.pv-timer.warn { color: var(--orange); }
.pv-timer.over { color: var(--danger); }

.pv-timer-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}

.pv-timer-btn:hover {
  background: rgba(0, 153, 153, 0.15);
  border-color: var(--teal);
}

.pv-timer-play { color: var(--teal-light); }
.pv-timer-pause { color: var(--orange); }
.pv-timer-reset { color: var(--text-muted); font-size: 1rem; }

.pv-current {
  background: var(--card-bg);
  padding: 1.5rem;
  overflow-y: auto;
}

.pv-current-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--teal);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.pv-notes {
  background: var(--card-bg);
  padding: 1.5rem;
  overflow-y: auto;
}

.pv-notes-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--orange);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.pv-notes-content {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.pv-notes-content em {
  color: var(--teal-light);
  font-style: normal;
}

.pv-footer {
  grid-column: 1 / -1;
  background: var(--card-bg);
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pv-progress {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.pv-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  transition: width 0.3s ease;
  border-radius: 3px;
}

.pv-section-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pv-section-btn {
  background: var(--card-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pv-section-btn:hover {
  border-color: var(--teal);
  color: var(--text-secondary);
}

.pv-section-btn.active {
  border-color: var(--teal);
  color: var(--teal-light);
  background: rgba(0, 153, 153, 0.1);
}

.pv-section-btn.visited {
  color: var(--text-secondary);
}

/* Next step preview in presenter view */
.pv-next {
  background: var(--card-surface);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-top: 1rem;
}

.pv-next-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.pv-next-content {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* ===== AUTH BAR (Presenter View) ===== */
.pv-auth {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pv-auth-btn {
  background: var(--card-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.pv-auth-btn:hover {
  border-color: var(--teal);
  color: var(--teal-light);
}

.pv-auth-btn--subtle {
  background: transparent;
  border-color: transparent;
  font-size: 0.75rem;
}

.pv-auth-btn--subtle:hover {
  border-color: var(--border);
  color: var(--text-secondary);
}

.pv-auth-user {
  font-size: 0.85rem;
  color: var(--teal-light);
  font-weight: 600;
}

.pv-auth-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* ===== EDITABLE PACING ===== */
.pv-pacing-segment.editable {
  cursor: pointer;
  position: relative;
}

.pv-pacing-segment.editable:hover {
  border-color: var(--teal-light);
  background: rgba(0, 153, 153, 0.08);
}

.pv-pacing-segment.has-override .pv-pacing-seg-label {
  color: var(--teal-light);
}

.pv-pacing-segment.has-override::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 2px;
  background: var(--teal);
  border-radius: 1px;
}

.pv-pacing-target {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.6;
}

.pv-pacing-edit-input {
  width: 50px;
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--teal);
  border-radius: 3px;
  color: var(--teal-light);
  font-size: 0.8rem;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  padding: 0.15rem 0.2rem;
  outline: none;
}

.pv-pacing-reset {
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0.65;
  transition: opacity 0.2s, color 0.2s, background 0.2s;
  position: absolute;
  top: 1px;
  right: 2px;
  line-height: 1;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.pv-pacing-reset:hover {
  opacity: 1;
  color: var(--orange);
  background: rgba(255, 140, 66, 0.15);
}

/* Modified time indicator */
.pv-pacing-modified {
  color: var(--teal-light);
  font-weight: 700;
  margin-left: 1px;
}

/* Reset All dropdown */
.pv-pacing-reset-all-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
  font-size: 0.65rem;
  cursor: pointer;
  padding: 0.1rem 0.35rem;
  transition: color 0.2s, border-color 0.2s;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  white-space: nowrap;
}

.pv-pacing-reset-all-btn:hover {
  color: var(--orange);
  border-color: var(--orange);
}

.pv-reset-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0;
  min-width: 145px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pv-reset-menu-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.pv-reset-menu-item:hover {
  background: rgba(0, 153, 153, 0.1);
}

.pv-reset-menu-item.pv-reset-danger {
  color: var(--orange);
}

.pv-reset-menu-item.pv-reset-danger:hover {
  background: rgba(255, 140, 66, 0.1);
}

.pv-reset-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 0.2rem 0;
}

/* ===== EDITABLE NOTES ===== */
.pv-notes-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.pv-notes-edit-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: inherit;
  transition: all 0.2s;
  display: none;
}

.pv-notes-edit-btn:hover {
  border-color: var(--teal);
  color: var(--teal-light);
}

.pv-notes-reset-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-family: inherit;
  transition: all 0.2s;
  display: none;
}

.pv-notes-reset-btn:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.pv-notes-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-weight: 600;
  display: none;
}

.pv-notes-badge.default {
  background: rgba(42, 58, 90, 0.3);
  color: var(--text-muted);
  display: inline-block;
}

.pv-notes-badge.custom {
  background: rgba(0, 153, 153, 0.15);
  color: var(--teal);
  display: inline-block;
}

.pv-notes-textarea {
  width: 100%;
  min-height: 120px;
  background: var(--card-surface);
  border: 1px solid var(--teal);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
  font-family: inherit;
  padding: 0.6rem 0.8rem;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

.pv-notes-textarea:focus {
  border-color: var(--teal-light);
  box-shadow: 0 0 8px rgba(0, 153, 153, 0.2);
}

.pv-notes-save-btn {
  background: rgba(0, 153, 153, 0.15);
  border: 1px solid var(--teal);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  color: var(--teal-light);
  font-size: 0.75rem;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s;
}

.pv-notes-save-btn:hover {
  background: rgba(0, 153, 153, 0.3);
}

/* Show edit controls when authenticated */
body.pv-authenticated .pv-notes-edit-btn {
  display: inline-block;
}

/* ===== PACING BAR (Presenter View) ===== */
.pv-pacing {
  grid-column: 1 / -1;
  background: var(--card-bg);
  padding: 0.5rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.pv-pacing-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
  width: 90px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.pv-pacing-bar {
  display: flex;
  flex: 1;
  gap: 3px;
  overflow-x: auto;
}

.pv-pacing-segment {
  flex: 1;
  min-width: 55px;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  background: var(--card-surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  transition: all 0.3s ease;
}

.pv-pacing-segment.in-progress {
  border-color: var(--teal);
  background: rgba(0, 153, 153, 0.12);
}

.pv-pacing-segment.on-time {
  border-color: var(--teal);
  opacity: 0.7;
}

.pv-pacing-segment.over-time {
  border-color: var(--orange);
  background: rgba(255, 140, 66, 0.1);
  opacity: 0.7;
}

.pv-pacing-segment.over-budget {
  border-color: var(--danger, #ff6b6b);
  background: rgba(255, 107, 107, 0.1);
}

.pv-pacing-seg-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.pv-pacing-seg-time {
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pv-pacing-segment.in-progress .pv-pacing-seg-time { color: var(--teal-light); }
.pv-pacing-segment.over-budget .pv-pacing-seg-time { color: var(--danger, #ff6b6b); }
.pv-pacing-segment.on-time .pv-pacing-seg-time { color: var(--teal); }
.pv-pacing-segment.over-time .pv-pacing-seg-time { color: var(--orange); }

.pv-pacing-status {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}

.pv-pacing-status.on-pace { color: var(--teal-light); }
.pv-pacing-status.ahead { color: var(--teal-light); }
.pv-pacing-status.behind { color: var(--danger, #ff6b6b); }

.pv-pacing-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.65;
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.3;
  margin-top: 3px;
}

/* ===== CONFIG PANEL (, key) ===== */

/* Gear button -- lives inside the exit hint pill */
.present-config-btn {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-left: 0.15rem;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  flex-shrink: 0;
  line-height: 1;
}
.present-config-btn:hover {
  color: var(--teal, #009999);
}
.present-config-btn svg { width: 14px; height: 14px; }

/* Exit hint -- Esc Exit (clickable text) */
.exit-hint-exit {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.15s;
}
.exit-hint-exit:hover { color: var(--text-primary); }

/* Vertical separator between Exit and Help/gear */
.exit-hint-sep {
  width: 1px;
  height: 0.85rem;
  background: var(--border);
  margin: 0 0.25rem;
  flex-shrink: 0;
}

/* Help button -- single unified frame around "? Help" */
.exit-hint-help {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: inherit;
  font-family: inherit;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: color 0.15s, border-color 0.15s;
}
.exit-hint-help:hover {
  color: var(--orange);
  border-color: var(--orange);
}

/* Config panel */
.present-config-panel {
  position: fixed;
  top: 0;
  right: -380px;
  width: 360px;
  height: 100vh;
  z-index: 10010;
  background: rgba(10, 15, 20, 0.96);
  border-left: 1px solid rgba(0, 153, 153, 0.2);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  overflow: hidden;
}
.present-config-panel.visible { right: 0; }

.config-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.config-panel-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--teal-light, #00b8b8);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.config-panel-actions { display: flex; gap: 8px; align-items: center; }
.config-panel-reset {
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.config-panel-reset:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.config-panel-close {
  font-size: 20px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.config-panel-close:hover { color: #fff; }

.config-panel-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 0;
}

/* Section headers */
.config-section { border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.config-section-header {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.config-section-header:hover { background: rgba(255, 255, 255, 0.03); }
.config-section-title {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.config-section-reset {
  font-size: 10px;
  padding: 2px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  margin-right: 8px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.config-section-header:hover .config-section-reset { opacity: 1; }
.config-section-reset:hover { color: var(--teal-light, #00b8b8); border-color: var(--teal, #009999); }
.config-section-chevron {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  transition: transform 0.2s;
}
.config-section.collapsed .config-section-chevron { transform: rotate(-90deg); }
.config-section.collapsed .config-section-controls { display: none; }

/* Control rows */
.config-section-controls { padding: 4px 0 8px; }
.config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 20px;
  min-height: 32px;
}
.config-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  flex: 1;
  min-width: 0;
  margin-right: 12px;
  display: flex;
  align-items: center;
}

/* Toggle switch */
.config-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.config-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.config-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  transition: background 0.2s;
}
.config-toggle-slider::before {
  content: '';
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.config-toggle input:checked + .config-toggle-slider {
  background: rgba(0, 153, 153, 0.5);
}
.config-toggle input:checked + .config-toggle-slider::before {
  transform: translateX(16px);
  background: var(--teal-light, #00b8b8);
}

/* Range slider */
.config-range-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.config-range {
  width: 100px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  outline: none;
}
.config-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--teal, #009999);
  cursor: pointer;
  border: none;
}
.config-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--teal, #009999);
  cursor: pointer;
  border: none;
}
.config-range-value {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Custom dropdown (single-select) */
.config-dropdown {
  position: relative;
  flex-shrink: 0;
}
.config-dropdown-btn {
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  outline: none;
  min-width: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.config-dropdown-btn:hover { border-color: var(--teal, #009999); }
.config-dropdown-arrow { font-size: 10px; opacity: 0.5; }
.config-dropdown-panel {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  min-width: 100%;
  background: #1a2030;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.config-dropdown.open .config-dropdown-panel { display: block; }
.config-dropdown-item {
  padding: 6px 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  white-space: nowrap;
}
.config-dropdown-item:hover {
  background: var(--teal, #009999);
  color: #fff;
}
.config-dropdown-item.selected {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

/* Number input */
.config-number-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.config-number {
  width: 60px;
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  outline: none;
  text-align: center;
}
.config-number:focus { border-color: var(--teal, #009999); }
.config-unit {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

/* Sync status */
.config-sync-status {
  padding: 12px 20px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  background: rgba(13, 13, 26, 0.98);
  backdrop-filter: blur(12px);
}
.config-sync-cloud { color: var(--teal, #009999); }
.config-sync-local { color: rgba(255, 255, 255, 0.3); }

.config-auth-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
  font-size: 0.65rem;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.config-auth-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.config-auth-btn--sign-in {
  color: var(--teal);
  border-color: var(--teal);
}

.config-auth-btn--sign-in:hover {
  color: var(--teal-light);
  border-color: var(--teal-light);
}

/* Group editor footer */
.group-editor-footer {
  padding: 10px 1.25rem;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 6px;
  position: sticky;
  bottom: 0;
  background: rgba(13, 13, 26, 0.98);
  backdrop-filter: blur(12px);
  z-index: 1;
}

/* Tooltip indicators on config labels */
.config-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.35);
  font-size: 9px;
  font-weight: 700;
  margin-left: 5px;
  cursor: help;
  position: relative;
  vertical-align: middle;
  flex-shrink: 0;
}
.config-tip:hover {
  background: rgba(0, 153, 153, 0.2);
  color: var(--teal, #009999);
}
/* JS-rendered tooltip popup (appended to body, escapes overflow) */
.config-tip-popup {
  position: fixed;
  display: none;
  background: rgba(10, 15, 20, 0.95);
  border: 1px solid rgba(0, 153, 153, 0.3);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  width: 210px;
  line-height: 1.4;
  z-index: 10020;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Dropdown-checks (multi-select with checkboxes) */
.config-dropchecks {
  position: relative;
  flex-shrink: 0;
}
.config-dropchecks-btn {
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  outline: none;
  min-width: 90px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.config-dropchecks-btn:hover { border-color: var(--teal, #009999); }
.config-dropchecks-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: rgba(15, 20, 30, 0.98);
  border: 1px solid rgba(0, 153, 153, 0.2);
  border-radius: 6px;
  padding: 6px 0;
  z-index: 10015;
  min-width: 120px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.config-dropchecks.open .config-dropchecks-panel { display: block; }
.config-dropchecks-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  white-space: nowrap;
}
.config-dropchecks-item:hover { background: rgba(0, 153, 153, 0.1); }
.config-dropchecks-item input[type="checkbox"] {
  accent-color: var(--teal, #009999);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* Number input improvements */
.config-number {
  -moz-appearance: textfield;
}
.config-number::-webkit-inner-spin-button,
.config-number::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
/* +/- stepper buttons */
.config-number-btn {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.config-number-btn:hover {
  border-color: var(--teal, #009999);
  color: var(--teal, #009999);
}

/* Timer position variants */
.present-timer.timer-top-right { left: auto; right: 2rem; }
.present-timer.timer-bottom-left { top: auto; bottom: 5rem; }

/* ===== NOTES FOOTER (teleprompter bar) ===== */
.present-notes-footer {
  position: fixed;
  bottom: 6px;
  left: 0;
  right: 0;
  z-index: 10001;
  background: rgba(10, 15, 20, 0.92);
  border-top: 1px solid rgba(0, 153, 153, 0.2);
  backdrop-filter: blur(12px);
  padding: 0.6rem 2rem;
  display: none;
  transition: bottom 0.2s ease;
}
.present-notes-footer-text {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
  max-height: 3.2em;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Forced reduce motion */
.ae-reduce-motion *,
.ae-reduce-motion *::before,
.ae-reduce-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

/* ===== LIGHT MODE ===== */
[data-theme="light"] .present-toggle {
  background: var(--card-bg);
}

[data-theme="light"] .present-step-counter,
[data-theme="light"] .present-exit-hint,
[data-theme="light"] .present-timer {
  background: rgba(255, 255, 255, 0.9);
}
[data-theme="light"] .present-overview {
  background: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] .present-overview-card {
  background: var(--card-bg);
}

[data-theme="light"] .present-jump,
[data-theme="light"] .present-shortcuts {
  background: var(--card-bg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .present-group-editor {
  background: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] .group-editor-header {
  background: rgba(255, 255, 255, 0.98);
}

[data-theme="light"] .group-editor-section-header {
  background: rgba(0, 153, 153, 0.05);
}

[data-theme="light"] .step-group-wrap {
  background: rgba(0, 153, 153, 0.03);
}

[data-theme="light"] .step-group-parent:hover {
  background: rgba(0, 153, 153, 0.08);
}

[data-theme="light"] .step-row--current {
  background: rgba(0, 153, 153, 0.1);
}
[data-theme="light"] .step-group-wrap--current {
  background: rgba(0, 153, 153, 0.06);
}

[data-theme="light"] .scroll-offset-input {
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .step-gap.unlinked .gap-icon {
  background: #fff;
}

[data-theme="light"] .section-source--default { opacity: 0.35; }
[data-theme="light"] .source-legend { border-top-color: rgba(0, 0, 0, 0.06); }
[data-theme="light"] .source-legend-note {
  background: rgba(255, 140, 66, 0.06);
  color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .connector-context-menu {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .present-config-btn {
  color: var(--text-muted);
}
[data-theme="light"] .present-config-btn:hover {
  color: var(--teal, #009999);
}
[data-theme="light"] .present-config-panel {
  background: rgba(255, 255, 255, 0.96);
  border-left-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .config-panel-header {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .config-section { border-bottom-color: rgba(0, 0, 0, 0.04); }
[data-theme="light"] .config-section-header:hover { background: rgba(0, 0, 0, 0.02); }
[data-theme="light"] .config-section-title { color: rgba(0, 0, 0, 0.6); }
[data-theme="light"] .config-label { color: rgba(0, 0, 0, 0.6); }
[data-theme="light"] .config-toggle-slider { background: rgba(0, 0, 0, 0.12); }
[data-theme="light"] .config-toggle-slider::before { background: rgba(0, 0, 0, 0.35); }
[data-theme="light"] .config-range { background: rgba(0, 0, 0, 0.1); }
[data-theme="light"] .config-range-value { color: rgba(0, 0, 0, 0.45); }
[data-theme="light"] .config-dropdown-btn {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.03);
  color: rgba(0, 0, 0, 0.7);
}
[data-theme="light"] .config-dropdown-panel {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
[data-theme="light"] .config-dropdown-item { color: rgba(0, 0, 0, 0.6); }
[data-theme="light"] .config-dropdown-item:hover { background: var(--teal, #009999); color: #fff; }
[data-theme="light"] .config-dropdown-item.selected { color: rgba(0, 0, 0, 0.85); }
[data-theme="light"] .config-number {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.03);
  color: rgba(0, 0, 0, 0.7);
}
[data-theme="light"] .config-sync-status {
  color: rgba(0, 0, 0, 0.35);
  border-top-color: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .config-panel-reset {
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.4);
}
[data-theme="light"] .config-panel-close { color: rgba(0, 0, 0, 0.35); }
[data-theme="light"] .config-tip {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.35);
}
[data-theme="light"] .config-tip:hover {
  background: rgba(0, 153, 153, 0.12);
  color: var(--teal, #009999);
}
[data-theme="light"] .config-tip-popup {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.65);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .config-dropchecks-btn {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.03);
  color: rgba(0, 0, 0, 0.7);
}
[data-theme="light"] .config-dropchecks-panel {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .config-dropchecks-item { color: rgba(0, 0, 0, 0.6); }
[data-theme="light"] .config-dropchecks-item:hover { background: rgba(0, 153, 153, 0.06); }
[data-theme="light"] .config-number-btn {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.03);
  color: rgba(0, 0, 0, 0.4);
}
[data-theme="light"] .config-number-btn:hover {
  border-color: var(--teal, #009999);
  color: var(--teal, #009999);
}
[data-theme="light"] .config-unit { color: rgba(0, 0, 0, 0.4); }
[data-theme="light"] .present-notes-footer {
  background: rgba(255, 255, 255, 0.94);
  border-top-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .present-notes-footer-text {
  color: rgba(0, 0, 0, 0.65);
}

[data-theme="light"] .info-term::after {
  background: var(--card-bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] body.present .step.step--upcoming {
  filter: blur(var(--present-blur));
  opacity: var(--present-upcoming-opacity, 0.1);
}

[data-theme="light"] body.present .step.step--revealed {
  opacity: var(--present-dim-opacity, 0.5);
}

/* ===== ZOOM-FRIENDLY (130-150% on typical monitors) ===== */
@media (max-width: 1100px) and (min-width: 769px) {
  body.present .guide-section {
    padding: 3rem 1.5rem;
  }
  body.present .container > .guide-section {
    padding-left: 0;
    padding-right: 0;
  }

  .present-section-label {
    font-size: 0.75rem;
    max-width: 50vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pv-pacing-bar { flex-wrap: wrap; }
  .pv-pacing-segment { min-width: 50px; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  /* Presentation mode falls back to guide scroll on mobile */
  .present-toggle {
    display: none !important;
  }

  body.present {
    overflow: auto;
  }

  body.present .guide-section {
    min-height: auto;
    padding: 2rem 1rem;
  }
  body.present .container > .guide-section {
    padding-left: 0;
    padding-right: 0;
  }

  body.present .step.step--upcoming,
  body.present .step.step--revealed,
  body.present .step.step--current {
    filter: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .present-overview,
  .present-jump,
  .present-shortcuts,
  .present-notes-footer,
  .present-breadcrumb,
  .present-step-counter,
  .present-section-label,
  .present-exit-hint,
  .present-timer,
  .present-config-panel {
    display: none !important;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  body.present .step,
  body.present .step.step--upcoming,
  body.present .step.step--revealed,
  body.present .step.step--current {
    transition: none;
  }

  /* Glow border removed */

  .present-overview.visible,
  .present-jump.visible,
  .present-shortcuts.visible,
  .present-group-editor.visible {
    animation: none;
  }
}

/* ===== PRINT ===== */
@media print {
  .present-toggle,
  .present-step-counter,
  .present-section-label,
  .present-exit-hint,
  .present-timer,
  .present-overview,
  .present-jump,
  .present-shortcuts,
  .present-notes-footer,
  .present-breadcrumb,
  .present-group-editor,
  .present-config-panel {
    display: none !important;
  }

  body.present .step,
  body.present .step.step--upcoming,
  body.present .step.step--revealed {
    filter: none;
    opacity: 1;
    pointer-events: auto;
  }
}