:root {
  /* Modern Obsidian & Warm Amber Gallery Palette (60-30-10 Balance) */
  --bg-stage: #09090b;
  --bg-surface: #0f1014;
  --bg-elevated: #16171d;
  --bg-card: #1b1d24;
  --bg-card-hover: #22252e;
  --bg-hud: rgba(15, 16, 20, 0.82);

  --text-primary: #f4f4f6;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-specular: rgba(255, 255, 255, 0.10);
  --border-focus: rgba(249, 115, 22, 0.65);

  --accent: #f97316;
  --accent-hover: #fb923c;
  --accent-soft: rgba(249, 115, 22, 0.14);
  --accent-border: rgba(249, 115, 22, 0.38);

  --video-accent: #60a5fa;
  --video-soft: rgba(96, 165, 250, 0.16);
  --header-accent: #f59e0b;
  --header-soft: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --success: #10b981;

  /* Typography */
  --font-display: 'Instrument Serif', 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Spatial Rhythm (8pt grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-elevated: 0 24px 60px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-stage);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
}

/* Subtle tactile archival grain */
.film-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  white-space: nowrap;
  flex-shrink: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Custom Modern Select Styling */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 26px !important;
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

body.mode-present .non-present-only {
  display: none !important;
}

body.mode-organize #hud-center-present,
body.mode-organize #present-controls,
body.mode-quicksort #hud-center-present,
body.mode-quicksort #present-controls {
  display: none !important;
}

/* ========================================================================= */
/* TOP HUD BAR                                                               */
/* ========================================================================= */
.top-hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  background: var(--bg-hud);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 120;
  transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out);
}

body.mode-present.hud-idle .top-hud {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}

body.mode-present.hud-idle .bottom-hud {
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
}

body.mode-present.hud-idle .stage-nav-btn {
  opacity: 0;
  pointer-events: none;
}

body.mode-present.hud-idle {
  cursor: none;
}

.hud-left,
.hud-center,
.hud-right,
.present-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms var(--ease-out);
}

.brand-lockup:hover {
  background: rgba(255, 255, 255, 0.05);
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.7);
  flex-shrink: 0;
}

.brand-title {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  white-space: nowrap;
}

.brand-sep {
  color: var(--text-muted);
  font-size: 12px;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

@media (max-width: 1520px) {
  body.mode-present .brand-sep,
  body.mode-present .brand-subtitle {
    display: none;
  }
}

@media (max-width: 1180px) {
  .brand-sep,
  .brand-subtitle {
    display: none;
  }
}

/* Segmented Mode Switcher */
.mode-switcher {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
  margin-left: 4px;
  gap: 2px;
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background-color 140ms ease, color 140ms ease;
}

.mode-btn:hover {
  color: var(--text-primary);
}

.mode-btn.active {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.mode-btn.active svg {
  color: var(--accent);
}

/* Category Pill in Top Center */
.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.category-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-strong);
}

.category-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.category-pill-label {
  font-weight: 500;
  font-size: 12.5px;
  color: var(--text-primary);
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-pill-count {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* HUD Buttons */
.hud-icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: background-color 140ms ease, color 140ms ease;
}

.hud-icon-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
}

.hud-icon-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.hud-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.hud-pill-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.hud-pill-btn.active {
  background: var(--accent-soft);
  color: var(--text-primary);
  border-color: var(--accent-border);
}

.hud-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
}

/* Tools Dropdown Popover */
.hud-dropdown-wrap {
  position: relative;
}

.hud-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  padding: 6px;
  border-radius: var(--radius-md);
  background: rgba(22, 23, 29, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 250;
}

.popover-section-label {
  padding: 4px 8px 2px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.popover-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

.popover-item {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background-color 120ms ease, color 120ms ease;
}

.popover-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
}

.popover-item.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.popover-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.popover-item kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

/* Autoplay Group */
.autoplay-group {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.autoplay-group .hud-pill-btn {
  border: none;
  background: transparent;
  border-radius: 0;
  height: 30px;
}

.autoplay-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background-color 150ms ease, box-shadow 150ms ease;
}

.autoplay-dot.playing {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.autoplay-select {
  height: 30px;
  background-color: rgba(0, 0, 0, 0.25);
  border: none;
  border-left: 1px solid var(--border-subtle);
  padding: 0 24px 0 8px !important;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  color: var(--text-secondary);
  cursor: pointer;
}

/* ========================================================================= */
/* VIEW 1: PRESENTATION STAGE VIEW                                           */
/* ========================================================================= */
.stage-view {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #13151b 0%, #09090b 100%);
}

.ambient-backdrop {
  position: absolute;
  inset: -14%;
  background-size: cover;
  background-position: center;
  filter: blur(90px) saturate(1.35) brightness(0.28);
  opacity: 0;
  transform: scale(1.12);
  transition: background-image 480ms var(--ease-out), opacity 480ms var(--ease-out);
  pointer-events: none;
  z-index: 1;
}

.ambient-backdrop.visible {
  opacity: 0.85;
}

.stage-canvas {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  padding: 66px 76px 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Floating Left / Right Stage Navigation Buttons */
.stage-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 42px;
  height: 64px;
  border-radius: var(--radius-md);
  background: rgba(15, 16, 20, 0.45);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  transition: opacity 200ms var(--ease-out), background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.stage-nav-btn:hover {
  background: rgba(24, 26, 33, 0.85);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.stage-nav-prev {
  left: var(--space-4);
}

.stage-nav-next {
  right: var(--space-4);
}

/* Media Slide (Photo & Video) */
.slide-media-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: slideFadeIn 220ms var(--ease-out);
}

@keyframes slideFadeIn {
  from {
    opacity: 0;
    transform: scale(0.99);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.stage-photo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72);
  transition: transform 240ms var(--ease-out);
  cursor: zoom-in;
}

.stage-photo.zoomed {
  transform: scale(1.75);
  cursor: zoom-out;
}

.stage-video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75);
  background: #050506;
}

/* Editorial Chapter Title Card & Inline Header Slide */
.slide-header-card {
  width: min(920px, 92%);
  padding: 44px 48px;
  background: rgba(18, 19, 24, 0.82);
  border: 1px solid var(--border-specular);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow: var(--shadow-elevated);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 40px;
  animation: slideFadeIn 260ms var(--ease-out);
}

.slide-header-card.single-col {
  grid-template-columns: 1fr;
  max-width: 680px;
  text-align: center;
}

.slide-header-card.single-col .header-slide-eyebrow {
  justify-content: center;
}

.slide-header-card.single-col .header-slide-eyebrow::after {
  display: none;
}

.slide-header-card.single-col .header-slide-meta {
  justify-content: center;
}

.header-slide-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.header-slide-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.header-slide-eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-border), transparent);
}

.header-slide-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(42px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.header-slide-subtitle {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 48ch;
}

.header-slide-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
}

.header-stat-pill {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

/* Clean 2x2 Mosaic Grid on Chapter Header Slides */
.header-preview-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.header-preview-thumb {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-specular);
  background: var(--bg-card);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.header-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 320ms var(--ease-out);
}

.header-preview-thumb:hover img {
  transform: scale(1.05);
}

/* ========================================================================= */
/* FLOATING BOTTOM HUD & MINI FILMSTRIP                                      */
/* ========================================================================= */
.bottom-hud {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1120px, calc(100vw - 32px));
  background: rgba(15, 16, 20, 0.84);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid var(--border-specular);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out);
}

.video-hud-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(9, 9, 11, 0.55);
}

.video-ctrl-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  transition: background-color 140ms ease;
}

.video-ctrl-btn:hover {
  background: var(--accent);
  color: #09090b;
}

.video-time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  color: var(--text-secondary);
  min-width: 38px;
}

.video-seek-slider {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
  cursor: pointer;
}

.bottom-hud-row {
  height: 54px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.slide-meta-left,
.slide-meta-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.slide-counter {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-primary);
  white-space: nowrap;
}

.type-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  white-space: nowrap;
}

.type-badge.badge-video {
  background: var(--video-soft);
  color: var(--video-accent);
}

.type-badge.badge-header {
  background: var(--header-soft);
  color: var(--header-accent);
}

.slide-filename {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slide-date {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .slide-date {
    display: none;
  }
}

/* Mini Filmstrip */
.mini-filmstrip {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  padding: 4px 0;
}

.filmstrip-item {
  width: 46px;
  height: 32px;
  border-radius: 5px;
  overflow: hidden;
  border: 1.5px solid transparent;
  background: var(--bg-card);
  opacity: 0.42;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: opacity 150ms ease, transform 150ms ease, border-color 150ms ease;
}

.filmstrip-item:hover {
  opacity: 0.85;
}

.filmstrip-item.active {
  opacity: 1;
  border-color: var(--accent);
  transform: scale(1.06);
}

.filmstrip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.filmstrip-hdr-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--header-accent);
  background: rgba(245, 158, 11, 0.14);
}

.hud-mini-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background-color 140ms ease, color 140ms ease;
}

.hud-mini-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.autoplay-progress-track {
  width: 100%;
  height: 2px;
  background: transparent;
  overflow: hidden;
}

.autoplay-progress-bar {
  width: 0%;
  height: 100%;
  background: var(--accent);
  transition: width 100ms linear;
}

/* ========================================================================= */
/* VIEW 2: QUICK SORT MODE — ONE-BY-ONE BUTTON FOLDER SORTER                 */
/* ========================================================================= */
.quicksort-view {
  position: fixed;
  inset: 52px 0 0 0;
  display: grid;
  grid-template-rows: 48px 1fr auto;
  background: var(--bg-stage);
  z-index: 60;
}

.qs-topbar {
  padding: 0 var(--space-4);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  overflow-x: auto;
  z-index: 10;
}

.qs-topbar-left,
.qs-topbar-right,
.qs-source-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.qs-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.qs-select-strong {
  font-weight: 600;
  border-color: var(--border-strong) !important;
  background-color: var(--bg-card) !important;
}

.qs-progress-pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

/* Quick Sort Stage Area */
.qs-stage-area {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 250px;
  overflow: hidden;
  background: radial-gradient(circle at 45% 50%, #14161d 0%, #09090b 100%);
  min-height: 0;
}

.qs-preview-pane {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-4) var(--space-5);
  overflow: hidden;
  gap: 12px;
  min-height: 0;
}

.qs-media-box {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qs-media-box img,
.qs-media-box video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-specular);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.68);
  animation: qsPopIn 140ms var(--ease-out);
}

@keyframes qsPopIn {
  from {
    opacity: 0.4;
    transform: scale(0.988);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.qs-meta-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: rgba(15, 16, 20, 0.85);
  border: 1px solid var(--border-specular);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.qs-dup-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--danger-soft);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* Right Sidebar: Upcoming Queue */
.qs-queue-sidebar {
  position: relative;
  z-index: 5;
  border-left: 1px solid var(--border-subtle);
  background: rgba(15, 16, 20, 0.86);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.qs-queue-header {
  height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.qs-queue-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qs-queue-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.qs-queue-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-strong);
}

.qs-queue-card.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.qs-queue-thumb {
  width: 52px;
  height: 38px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--bg-card);
  flex-shrink: 0;
}

.qs-queue-info {
  min-width: 0;
  flex: 1;
}

.qs-queue-name {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qs-queue-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

/* Bottom Tactile Folder Buttons Dock */
.qs-dock {
  position: relative;
  z-index: 10;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 12px var(--space-4) 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qs-dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.qs-dock-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qs-dock-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.qs-dock-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.qs-dock-hint kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text-secondary);
}

.qs-folder-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  grid-auto-rows: max-content;
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
}

/* Tactile Folder Target Button */
.qs-folder-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 50px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  text-align: left;
  transition: transform 120ms var(--ease-out), border-color 140ms ease, background-color 140ms ease;
}

.qs-folder-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-border);
  transform: translateY(-1px);
}

.qs-folder-btn:active,
.qs-folder-btn.just-triggered {
  transform: scale(0.97);
  background: var(--accent);
  border-color: var(--accent-hover);
  color: #09090b;
}

.qs-folder-btn-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.qs-keycap {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  color: var(--accent);
  flex-shrink: 0;
}

.qs-folder-btn.just-triggered .qs-keycap {
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  border-color: transparent;
}

.qs-folder-btn-text {
  min-width: 0;
  flex: 1;
}

.qs-folder-btn-title {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qs-folder-btn.just-triggered .qs-folder-btn-title,
.qs-folder-btn.just-triggered .qs-folder-btn-sub {
  color: #09090b;
}

.qs-folder-btn-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qs-folder-btn-count {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Clean Starter Folder Onboarding Row when no target folders exist yet */
.qs-empty-folders-box {
  grid-column: 1 / -1;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.qs-preset-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ========================================================================= */
/* OVERVIEW GRID DRAWER (G KEY)                                              */
/* ========================================================================= */
.overview-drawer {
  position: fixed;
  inset: 52px 0 0 0;
  background: rgba(11, 12, 15, 0.96);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  z-index: 150;
  display: flex;
  flex-direction: column;
  animation: drawerSlideUp 200ms var(--ease-out);
}

@keyframes drawerSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.drawer-header {
  padding: 14px var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-shrink: 0;
}

.drawer-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.drawer-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.drawer-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-search {
  width: 240px;
  height: 32px;
  padding: 0 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}

.drawer-filter-pills {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.filter-pill {
  height: 26px;
  padding: 0 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.filter-pill.active {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  font-weight: 600;
}

.drawer-close-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
}

.drawer-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.drawer-categories {
  padding: 10px var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.drawer-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-secondary);
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.drawer-cat-chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.drawer-cat-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--text-primary);
}

.drawer-cat-count {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--text-muted);
}

.drawer-grid {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  grid-auto-rows: max-content;
  gap: 14px;
  align-content: start;
}

.drawer-card {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  cursor: pointer;
  transition: transform 150ms var(--ease-out), border-color 150ms var(--ease-out);
}

.drawer-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.drawer-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.drawer-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.drawer-card-header-slide {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-3);
  background: linear-gradient(145deg, #211d17 0%, #141519 100%);
  border-color: rgba(245, 158, 11, 0.3);
}

.drawer-card-header-slide .hdr-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--header-accent);
  margin-bottom: 4px;
}

.drawer-card-header-slide .hdr-name {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.15;
  color: var(--text-primary);
}

.drawer-card-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 20px 8px 6px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.drawer-card-idx {
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

/* ========================================================================= */
/* VIEW 3: FOLDER & PHOTO ARRANGE STUDIO                                     */
/* ========================================================================= */
.organizer-view {
  position: fixed;
  inset: 52px 0 0 0;
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--bg-surface);
  z-index: 50;
}

.org-sidebar {
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-stage);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.org-sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.org-sidebar-title-wrap {
  min-width: 0;
  flex: 1;
}

.org-section-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.org-section-hint {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-folder-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.org-folder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.org-folder-item:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.org-folder-item.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.org-folder-item.drag-over {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--success);
}

.org-folder-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.folder-drag-handle {
  color: var(--text-muted);
  cursor: grab;
  font-size: 13px;
  line-height: 1;
  opacity: 0.6;
}

.org-folder-item:hover .folder-drag-handle {
  opacity: 1;
}

.org-folder-info {
  min-width: 0;
  flex: 1;
}

.org-folder-title {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-folder-diskname {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-folder-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.org-folder-count {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.folder-order-btns {
  display: flex;
  flex-direction: column;
  gap: 1px;
  opacity: 0;
  transition: opacity 120ms ease;
}

.org-folder-item:hover .folder-order-btns {
  opacity: 1;
}

.folder-move-btn {
  width: 18px;
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  color: var(--text-muted);
  font-size: 9px;
}

.folder-move-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.org-sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.org-tip-box {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}

.org-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-surface);
  min-height: 0;
}

.org-folder-banner {
  padding: 12px var(--space-5);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  flex-shrink: 0;
}

.org-folder-fields {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}

.field-input {
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-stage);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 12.5px;
  width: 210px;
}

.field-input-lg {
  font-weight: 600;
  width: 240px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.checkbox-label input {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}

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

/* Organizer Toolbar */
.org-toolbar {
  height: 46px;
  padding: 0 var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  overflow-x: auto;
  flex-shrink: 0;
}

.org-toolbar-left,
.org-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.toolbar-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 2px;
  white-space: nowrap;
}

.toolbar-divider {
  width: 1px;
  height: 18px;
  background: var(--border-subtle);
  margin: 0 4px;
  flex-shrink: 0;
}

.btn-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.btn-chip:hover:not(:disabled) {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-chip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-chip-accent {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--text-primary);
}

.btn-chip-accent:hover:not(:disabled) {
  background: var(--accent);
  color: #09090b;
}

.btn-chip-danger {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.btn-chip-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

.org-select,
.org-search-input {
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-primary);
}

.org-search-input {
  width: 160px;
}

/* Selection Action Bar */
.org-selection-bar {
  padding: 8px var(--space-5);
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.16) 0%, rgba(22, 23, 29, 0.96) 100%);
  border-bottom: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-shrink: 0;
  overflow-x: auto;
}

.sel-bar-left,
.sel-bar-center,
.sel-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sel-count-badge {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #09090b;
}

.sel-bar-label {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.sel-folder-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Organizer Draggable Items Grid — Fixed Grid Row Sizing! */
.org-items-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-auto-rows: max-content;
  gap: 14px;
  align-content: start;
}

.org-card {
  position: relative;
  height: auto;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: grab;
  transition: transform 140ms var(--ease-out), border-color 140ms ease, box-shadow 140ms ease;
}

.org-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.org-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.org-card.is-hidden {
  opacity: 0.42;
}

.org-card.drag-target-before {
  box-shadow: -4px 0 0 0 var(--accent);
}

.org-card.drag-target-after {
  box-shadow: 4px 0 0 0 var(--accent);
}

.org-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  flex-shrink: 0;
  background: #0c0d10;
  overflow: hidden;
}

.org-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.org-card-inline-header .org-card-thumb {
  background: linear-gradient(145deg, #251f17 0%, #15171c 100%);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid rgba(245, 158, 11, 0.22);
}

.org-inline-hdr-kicker {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--header-accent);
  margin-bottom: 4px;
}

.org-inline-hdr-title {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.15;
  color: var(--text-primary);
}

.org-inline-hdr-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.org-card-top-bar {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.org-select-checkbox {
  pointer-events: auto;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: rgba(9, 9, 11, 0.72);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease, background-color 120ms ease;
}

.org-card:hover .org-select-checkbox,
.org-card.selected .org-select-checkbox {
  opacity: 1;
}

.org-card.selected .org-select-checkbox {
  background: var(--accent);
  border-color: var(--accent);
  color: #09090b;
}

.org-order-badge {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(9, 9, 11, 0.75);
  backdrop-filter: blur(6px);
  color: var(--text-secondary);
}

.org-card-footer {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
}

.org-card-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.org-card-fname {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-card-row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: 20px;
}

.org-card-date {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
  color: var(--text-muted);
}

.org-card-btns {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 120ms ease;
}

.org-card:hover .org-card-btns {
  opacity: 1;
}

.card-mini-btn {
  width: 22px;
  height: 20px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 11px;
}

.card-mini-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* ========================================================================= */
/* BUTTONS, MODALS & TOASTS                                                  */
/* ========================================================================= */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #09090b;
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
  transition: background-color 140ms ease, transform 120ms ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary .hud-kbd {
  background: rgba(0, 0, 0, 0.2);
  color: #09090b;
}

.btn-sm {
  height: 30px;
  padding: 0 11px;
  font-size: 12px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.btn-xs {
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
}

.btn-danger-text:hover {
  color: #fca5a5;
  background: var(--danger-soft);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 8, 0.78);
  backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal-dialog {
  width: min(460px, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
}

.modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-body .field-input {
  width: 100%;
  height: 36px;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  align-items: center;
  font-size: 12.5px;
}

.shortcuts-grid kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  text-align: center;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 9px 14px;
  border-radius: var(--radius-md);
  background: rgba(22, 23, 29, 0.95);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  animation: drawerSlideUp 180ms var(--ease-out);
}

/* ========================================================================= */
/* KEN BURNS EFFECT & SPOTLIGHT POINTER                                      */
/* ========================================================================= */
@keyframes kenBurnsA {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.11) translate(-1.5%, -1.2%); }
}

@keyframes kenBurnsB {
  0% { transform: scale(1.02) translate(1%, 0.8%); }
  100% { transform: scale(1.12) translate(1.2%, -1.4%); }
}

.stage-photo.ken-burns-a {
  animation: kenBurnsA 11s ease-out forwards;
}

.stage-photo.ken-burns-b {
  animation: kenBurnsB 11s ease-out forwards;
}

.spotlight-mask {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  --spot-x: 50vw;
  --spot-y: 50vh;
  --spot-r: 135px;
  background: radial-gradient(
    circle var(--spot-r) at var(--spot-x) var(--spot-y),
    rgba(255, 248, 230, 0.04) 0%,
    rgba(255, 248, 230, 0.02) 72%,
    rgba(249, 115, 22, 0.55) 76%,
    rgba(6, 7, 9, 0.82) 80%
  );
  transition: opacity 180ms ease;
}

/* ========================================================================= */
/* MULTI-PHOTO COLLAGE SLIDES (STAGE & ORGANIZER)                            */
/* ========================================================================= */
.stage-collage {
  width: min(1320px, 96%);
  height: min(80vh, 820px);
  display: grid;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: rgba(18, 20, 25, 0.72);
  border: 1px solid var(--border-specular);
  box-shadow: var(--shadow-elevated);
  animation: slideFadeIn 240ms var(--ease-out);
}

.stage-collage.collage-2 {
  grid-template-columns: 1fr 1fr;
}

.stage-collage.collage-3 {
  grid-template-columns: 1.35fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.stage-collage.collage-3 .collage-cell:first-child {
  grid-row: 1 / span 2;
}

.stage-collage.collage-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.collage-cell {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #08090c;
  border: 1px solid var(--border-subtle);
  cursor: zoom-in;
}

.collage-cell img,
.collage-cell video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 280ms var(--ease-out);
}

.collage-cell:hover img {
  transform: scale(1.03);
}

.collage-cell.expanded-cell {
  position: fixed;
  inset: 60px 40px 80px;
  width: auto;
  height: auto;
  z-index: 90;
  background: rgba(8, 9, 12, 0.96);
  border-color: var(--accent);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.9);
  cursor: zoom-out;
}

.collage-cell.expanded-cell img {
  object-fit: contain;
}

.org-collage-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: #060709;
}

.org-collage-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ========================================================================= */
/* "CAMP WRAPPED" STATS OVERLAY                                              */
/* ========================================================================= */
.wrapped-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.wrapped-bento {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--space-4);
}

.wrapped-stat-card {
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wrapped-stat-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.wrapped-stat-number {
  font-family: var(--font-display);
  font-size: 48px;
  line-height: 1;
  color: var(--text-primary);
}

.wrapped-stat-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.wrapped-awards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-4);
}

.wrapped-award-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease;
}

.wrapped-award-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-border);
}

.wrapped-award-thumb {
  width: 100px;
  height: 76px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}

.wrapped-chart-box {
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.wrapped-bars {
  height: 180px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-top: 20px;
  overflow-x: auto;
}

.wrapped-bar-col {
  flex: 1;
  min-width: 30px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.wrapped-bar-fill {
  width: 100%;
  max-height: calc(100% - 54px);
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(249, 115, 22, 0.3) 100%);
  transition: filter 140ms ease, transform 140ms ease;
}

.wrapped-bar-col:hover .wrapped-bar-fill {
  filter: brightness(1.2);
  transform: scaleY(1.03);
}

.wrapped-bar-val {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.wrapped-bar-day {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

/* ========================================================================= */
/* 1-CLICK DUPLICATE CLEANER OVERLAY                                         */
/* ========================================================================= */
.duplicates-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  max-width: 1060px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dup-pair-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: var(--space-4);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.dup-side {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dup-thumb {
  width: 80px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}

.dup-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dup-fname {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dup-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.dup-vs-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ========================================================================= */
/* PHONE REMOTE QR MODAL                                                     */
/* ========================================================================= */
.qr-modal-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-4);
}

.qr-svg-wrap {
  width: 210px;
  height: 210px;
  padding: 10px;
  background: #f4f4f6;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.qr-svg-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-url-pill {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  user-select: all;
}

@media (max-width: 900px) {
  .organizer-view {
    grid-template-columns: 1fr;
    grid-template-rows: 200px 1fr;
  }
  .qs-stage-area {
    grid-template-columns: 1fr;
  }
  .qs-queue-sidebar {
    display: none;
  }
  .slide-header-card {
    grid-template-columns: 1fr;
  }
  .stage-canvas {
    padding: 60px 16px 76px;
  }
  .mini-filmstrip {
    display: none;
  }
}
