:root {
  --font-serif: "Georgia", "Baskerville", "Didot", "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --bg-dark: #09090b;
  --bg-surface: #101014;
  --bg-card: rgba(18, 18, 24, 0.65);
  --bg-card-solid: #121217;
  --bg-card-hover: rgba(26, 26, 34, 0.8);
  
  --accent-warm: #d8cbb8;
  --accent-gold: #c5a880;
  --accent-linen: #ece9e2;
  --accent-green: #9fb89e;
  --accent-red: #c26d6d;
  
  --text-main: #ece9e2;
  --text-dim: #8e8c85;
  --text-muted: #585754;
  
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-card: rgba(255, 255, 255, 0.09);
  --border-active: rgba(236, 233, 226, 0.45);
  
  --glass-specular: inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-dark);
}

body {
  font-family: var(--font-sans);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

/* =============================================================================
   1. HEADER & TOP NAVIGATION
   ============================================================================= */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background-color: rgba(9, 9, 11, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.brand-main {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  color: var(--text-main);
  text-transform: uppercase;
}

.brand-sub {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.brand-glyph {
  display: none;
}

.connection-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
}

.connection-pill:active {
  background: rgba(255, 255, 255, 0.08);
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.status-dot.online {
  background-color: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

.status-dot.offline {
  background-color: var(--accent-red);
}

/* =============================================================================
   2. TAB BAR NAVIGATION
   ============================================================================= */
nav.tab-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: rgba(12, 12, 16, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 4px 8px;
  flex-shrink: 0;
  gap: 6px;
  z-index: 90;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  padding: 8px 6px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-btn span:first-child {
  font-size: 0.95rem;
  opacity: 0.8;
}

.tab-btn.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

/* =============================================================================
   3. MAIN VIEW CONTAINER & SHARED EDITORIAL STYLES
   ============================================================================= */
main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px max(24px, env(safe-area-inset-bottom, 24px)) 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

.tab-view {
  display: none;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-view.active {
  display: flex;
  opacity: 1;
}

/* Editorial Chapter Cards */
.editorial-chapter,
.control-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--glass-shadow);
}

.chapter-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
}

.chapter-title-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chapter-eyebrow,
.panel-section-title {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 500;
  margin-bottom: 0;
}

.chapter-title {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-style: italic;
  font-weight: 400;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

/* Editorial Link / Action Buttons */
.editorial-link-btn {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 4px 6px 4px;
  position: relative;
  cursor: pointer;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s ease;
}

.editorial-link-btn::before {
  content: '';
  position: absolute;
  inset: -10px -12px;
  min-height: 44px;
  min-width: 44px;
}

.editorial-link-btn:hover,
.editorial-link-btn:active {
  color: var(--text-main);
  border-color: var(--text-main);
}

.editorial-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 16px;
  min-height: 38px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.editorial-btn:active {
  transform: scale(0.97);
}

.editorial-btn.active {
  background: var(--text-main);
  color: var(--bg-dark);
  border-color: var(--text-main);
  font-weight: 600;
}

/* =============================================================================
   4. TAB 1: CALIBRATE (MADMAPPER OPTICAL KEYSTONING & GEOMETRY)
   ============================================================================= */

/* Interactive Touch Quad Canvas */
.canvas-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 28vh;
  border-radius: var(--radius-md);
  background: #000000;
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glass-shadow);
  flex-shrink: 0;
}

#warpCanvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  touch-action: none;
}

.canvas-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-dim);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  pointer-events: none;
  white-space: nowrap;
}

/* Projection Overlays Grid */
.button-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.pill-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 8px 4px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill-btn:active {
  transform: scale(0.97);
}

.pill-btn.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--text-main);
  color: var(--text-main);
  font-weight: 600;
}

.flash-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.flash-btn:active {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--text-main);
}

/* Micro D-Pad & Corner Selectors */
.dpad-container {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.corner-selector-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  flex: 1;
}

.corner-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 9px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.corner-btn:active {
  transform: scale(0.97);
}

.corner-btn.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--text-main);
  color: var(--text-main);
  font-weight: 600;
}

.dpad-cross {
  display: grid;
  grid-template-columns: repeat(3, 40px);
  grid-template-rows: repeat(3, 40px);
  gap: 4px;
  align-items: center;
  justify-items: center;
  flex-shrink: 0;
}

.dpad-btn {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.dpad-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--text-main);
}

.dpad-up {
  grid-column: 2;
  grid-row: 1;
}

.dpad-left {
  grid-column: 1;
  grid-row: 2;
}

.dpad-center {
  grid-column: 2;
  grid-row: 2;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(236, 233, 226, 0.3);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--text-main);
  pointer-events: none;
}

.dpad-right {
  grid-column: 3;
  grid-row: 2;
}

.dpad-down {
  grid-column: 2;
  grid-row: 3;
}

/* Optical Tuning Sliders */
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.slider-label span:last-child {
  font-family: var(--font-mono);
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.74rem;
}

/* Minimalist Hairline Range Slider with 44px Touch Envelope */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 38px;
  background: transparent;
  outline: none;
  cursor: pointer;
  margin: -6px 0;
  touch-action: none;
  display: flex;
  align-items: center;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 2px;
  transition: background 0.2s ease;
}

input[type="range"]:active::-webkit-slider-runnable-track {
  background: rgba(236, 233, 226, 0.35);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7.5px;
  border-radius: 50%;
  background: var(--text-main);
  border: 2px solid var(--bg-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.3);
}

input[type="range"]::-moz-range-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 2px;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-main);
  border: 2px solid var(--bg-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

/* One-Tap Room Lighting Presets */
.room-presets-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}

.room-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 6px;
  background: rgba(18, 18, 24, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.room-preset-btn .preset-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.room-preset-btn .preset-name {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.room-preset-btn .preset-desc {
  font-size: 0.58rem;
  color: var(--text-dim);
  line-height: 1.2;
}

.room-preset-btn:active {
  transform: scale(0.97);
}

.room-preset-btn.active {
  background: rgba(236, 233, 226, 0.12);
  border-color: var(--text-main);
  box-shadow: 0 0 16px rgba(236, 233, 226, 0.12);
}

.room-preset-btn.active .preset-name {
  color: #ffffff;
}

/* Safety & Quick Actions Grid (2x2 Balanced Layout) */
.safety-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  box-sizing: border-box;
}

.safety-grid .safety-btn {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  box-sizing: border-box;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.safety-grid .safety-btn.secondary-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.safety-grid .safety-btn.secondary-btn:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.1);
}

.safety-grid .safety-btn.save-btn {
  background: var(--text-main);
  color: var(--bg-dark);
  font-weight: 600;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.safety-grid .safety-btn.save-btn:active {
  background: #dfdbd2;
  transform: scale(0.98);
}

/* Advanced Calibrate Collapsible Container */
.advanced-calibrate-details {
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}

.pro-section-group {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.primary-btn {
  background: var(--text-main);
  color: var(--bg-dark);
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 18px;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

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

.secondary-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-pill);
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.secondary-btn:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.1);
}

/* =============================================================================
   5. TAB 1: CREATE (HERO STAGE ARCHITECTURE & VIBE CHIPS)
   ============================================================================= */

/* Hero Stage Layout */
.hero-stage {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.hero-top-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 2px;
}

.surface-badge-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 14px;
  min-height: 36px;
  position: relative;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.surface-badge-btn::before {
  content: '';
  position: absolute;
  inset: -6px -8px;
  min-height: 44px;
  min-width: 44px;
}

.surface-badge-btn:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.12);
}

.surface-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

.badge-caret {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-left: 2px;
}

.hero-outline-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-dim);
  padding: 6px 14px;
  min-height: 36px;
  position: relative;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.hero-outline-btn::before {
  content: '';
  position: absolute;
  inset: -6px -8px;
  min-height: 44px;
  min-width: 44px;
}

.hero-outline-btn:active,
.hero-outline-btn:hover {
  color: var(--text-main);
  border-color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

/* Ambient Hero Viewport with Dynamic Framing & Portrait Expansion */
.hero-viewport {
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 280px;
  max-height: 46vh;
  background: #000000;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.hero-viewport:active {
  cursor: grabbing;
}

.hero-viewport.subject-focused {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.92);
}

@media (min-width: 600px) {
  .hero-viewport {
    aspect-ratio: 16 / 9;
  }
}

.hero-stage-inner {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  z-index: 1;
  transition: opacity 0.25s ease;
}

.hero-img.fade-out {
  opacity: 0.2;
}

.hero-ambient-glow {
  position: absolute;
  inset: -15px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  filter: blur(35px);
  transition: background 0.5s ease, opacity 0.5s ease;
}

/* Floating Controls Header (Look Indicator & Auto-Focus Zoom Toggle) */
.hero-viewport-controls {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  pointer-events: none;
}

.hero-look-badge {
  pointer-events: auto;
  background: rgba(9, 9, 11, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.hero-zoom-toggle {
  pointer-events: auto;
  background: rgba(9, 9, 11, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-muted);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.hero-zoom-toggle:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.15);
}

.hero-zoom-toggle.focus-active {
  border-color: rgba(0, 245, 212, 0.4);
  color: #00f5d4;
  background: rgba(0, 245, 212, 0.1);
  box-shadow: 0 0 12px rgba(0, 245, 212, 0.2);
}

.zoom-toggle-icon {
  font-size: 0.72rem;
}

.hero-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(9, 9, 11, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-main);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  line-height: 1;
  padding: 0 0 2px 0;
}

.hero-nav-arrow.prev {
  left: 8px;
}

.hero-nav-arrow.next {
  right: 8px;
}

.hero-nav-arrow:active {
  transform: translateY(-50%) scale(0.92);
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--text-main);
}

/* =============================================================================
   HERO STAGE SYNTHESIZING HUD OVERLAY
   ============================================================================= */
.hero-synthesizing-hud {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(9, 9, 12, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  gap: 8px;
  text-align: center;
  animation: hudFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes hudFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.hud-spinner-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent-cyan);
  border-right-color: var(--accent-green);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: hudSpin 1.4s linear infinite;
  box-shadow: 0 0 16px rgba(0, 245, 212, 0.25);
}

@keyframes hudSpin {
  to { transform: rotate(360deg); }
}

.hud-spinner-icon {
  font-size: 1.1rem;
  animation: hudPulseIcon 1.8s ease-in-out infinite alternate;
}

@keyframes hudPulseIcon {
  from { transform: scale(0.85); opacity: 0.7; }
  to { transform: scale(1.15); opacity: 1; }
}

.hud-phase-title {
  font-family: var(--font-serif);
  font-size: 1.02rem;
  font-style: italic;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.hud-phase-sub {
  font-size: 0.7rem;
  color: var(--accent-cyan);
  letter-spacing: 0.04em;
  font-weight: 500;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-progress-wrap {
  width: 100%;
  max-width: 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.hud-progress-track {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.hud-progress-fill {
  height: 100%;
  width: 10%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
  box-shadow: 0 0 8px var(--accent-cyan);
}

.hud-progress-pct {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-main);
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hud-eta {
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Meta Information & 3-Dot Pagination */
.hero-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 4px 4px 0 4px;
}

.hero-look-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hero-look-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--text-main);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.hero-look-sub {
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.hero-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  position: relative;
  touch-action: manipulation;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-dot::before {
  content: '';
  position: absolute;
  inset: -12px -10px;
}

.hero-dot.active {
  background: var(--text-main);
  transform: scale(1.35);
  box-shadow: 0 0 8px rgba(236, 233, 226, 0.4);
}

/* Curated Vibe Section */
.vibe-section {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--glass-shadow);
  margin-top: 2px;
}

.vibe-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vibe-eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 500;
}

.vibe-chips-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 -4px;
  padding: 2px 4px;
}
.vibe-chips-scroll::-webkit-scrollbar { display: none; }

.vibe-chips-row {
  display: flex;
  gap: 8px;
  width: max-content;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  min-height: 38px;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.preset-chip:active {
  transform: scale(0.97);
}

.preset-chip.active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(236, 233, 226, 0.7);
  color: var(--text-main);
  box-shadow: 0 0 14px rgba(236, 233, 226, 0.12);
}

.surprise-chip {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.12) 0%, rgba(59, 130, 246, 0.12) 100%);
  border-color: rgba(168, 85, 247, 0.3);
}

.surprise-chip.active {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.3) 0%, rgba(59, 130, 246, 0.3) 100%);
  border-color: rgba(192, 132, 252, 0.8);
}

/* Collapsible Custom Directive Accordion */
.editorial-details {
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
  margin-top: 4px;
}

.editorial-summary {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  outline: none;
  user-select: none;
}
.editorial-summary::-webkit-details-marker { display: none; }
.editorial-summary::marker { display: none; }

.summary-caret {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.editorial-details[open] .summary-caret {
  transform: rotate(180deg);
}

.custom-prompt-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(10, 10, 14, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-top: 8px;
}

.custom-prompt-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  line-height: 1.45;
  padding: 8px 10px;
  resize: none;
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.custom-prompt-textarea:focus {
  border-color: rgba(236, 233, 226, 0.4);
  background: rgba(255, 255, 255, 0.07);
}

.mini-select {
  background: #181822;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
}

/* Surface Picker Bottom Sheet Modal */
.surface-picker-sheet {
  background: #111116;
  gap: 14px;
}

.surface-list-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 42vh;
  overflow-y: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}

.surface-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.surface-picker-item:active {
  transform: scale(0.99);
  background: rgba(255, 255, 255, 0.08);
}

.surface-picker-item.active {
  border-color: rgba(236, 233, 226, 0.6);
  background: rgba(255, 255, 255, 0.08);
}

.surface-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.surface-item-thumb {
  width: 48px;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #000;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: block;
}

.surface-item-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.surface-item-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.surface-item-desc {
  font-size: 0.65rem;
  color: var(--text-dim);
}

.surface-item-check {
  color: var(--accent-warm);
  font-size: 0.95rem;
  font-weight: 700;
}

/* Primary Action Button Row */
.create-action-row {
  margin-top: 4px;
  width: 100%;
}

.editorial-dock-btn {
  width: 100%;
  min-height: 50px;
  background: var(--text-main);
  color: var(--bg-dark);
  border: none;
  border-radius: var(--radius-pill);
  padding: 14px 22px;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.65), 0 2px 10px rgba(236, 233, 226, 0.12);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.editorial-dock-btn:active {
  transform: scale(0.98);
  background: #dfdbd2;
}

.dock-arrow {
  font-size: 0.95rem;
  transition: transform 0.2s ease;
}

.editorial-dock-btn:hover .dock-arrow {
  transform: translateX(3px);
}

/* Live Render Telemetry */
.telemetry-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: none;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--glass-specular);
}

.telemetry-card.visible {
  display: flex;
}

.progress-track {
  width: 100%;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: var(--text-main);
  transition: width 0.3s ease;
}

.telemetry-status {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
}

/* =============================================================================
   6. TAB 3: CINEMA (REMOTE TRANSPORT DECK & PLAYLIST REPERTOIRE)
   ============================================================================= */
.cinema-stage {
  align-items: center;
  text-align: center;
}

.clip-preview-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 240px;
  max-height: 38vh;
  border-radius: var(--radius-md);
  background: #000000;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  position: relative;
  box-shadow: var(--glass-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 600px) {
  .clip-preview-thumb {
    aspect-ratio: 16 / 9;
  }
}

.cinema-stage-inner {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.cinema-mirror-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000000;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.clip-preview-thumb.blackout .cinema-mirror-video {
  opacity: 0;
}

.cinema-mirror-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 65%, rgba(0, 0, 0, 0.6) 100%);
  border-radius: var(--radius-md);
  z-index: 3;
}

.cinema-visualizer {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.04) 0%, transparent 70%);
}

.visualizer-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  height: 40px;
  z-index: 2;
}

.vbar {
  width: 4px;
  height: 12px;
  background: var(--text-main);
  opacity: 0.8;
  border-radius: 2px;
  animation: bounce-bar 1.2s ease-in-out infinite alternate;
}

.bar-1 { animation-delay: 0.1s; height: 14px; }
.bar-2 { animation-delay: 0.4s; height: 24px; }
.bar-3 { animation-delay: 0.2s; height: 32px; }
.bar-4 { animation-delay: 0.6s; height: 18px; }
.bar-5 { animation-delay: 0.3s; height: 28px; }
.bar-6 { animation-delay: 0.7s; height: 20px; }
.bar-7 { animation-delay: 0.15s; height: 26px; }
.bar-8 { animation-delay: 0.5s; height: 12px; }

.cinema-visualizer.paused .vbar {
  animation-play-state: paused;
  opacity: 0.3;
  height: 6px !important;
}

@keyframes bounce-bar {
  0% { transform: scaleY(0.35); opacity: 0.4; }
  100% { transform: scaleY(1.0); opacity: 0.9; }
}

.cinema-status-tag {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-green);
  font-weight: 500;
}

.now-playing-subtitle {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  margin-top: -4px;
}

.transport-scrubber {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timecode-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.transport-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding-top: 2px;
}

.circle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}

.circle-btn:active {
  transform: scale(0.92);
}

.circle-btn.play-btn {
  width: 58px;
  height: 58px;
  background: var(--text-main);
  color: var(--bg-dark);
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.circle-btn.play-btn:active {
  transform: scale(0.94);
  background: #dfdbd2;
}

.circle-btn.blackout-btn {
  color: var(--text-dim);
}

.circle-btn.blackout-btn:active,
.circle-btn.blackout-btn.active {
  background: rgba(194, 109, 109, 0.2);
  border-color: var(--accent-red);
  color: #ffffff;
}

.circle-btn.nav-btn {
  color: var(--text-dim);
}

.circle-btn.nav-btn:active {
  color: var(--text-main);
}

.circle-btn.loop-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.circle-btn.loop-btn.active {
  border-color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.circle-btn.loop-btn.active.single {
  border-color: #00f5d4;
  color: #00f5d4;
  background-color: rgba(0, 245, 212, 0.12);
  box-shadow: 0 0 10px rgba(0, 245, 212, 0.25);
}

.loop-mode-badge {
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-gold);
  line-height: 1;
}

.circle-btn.loop-btn.active.single .loop-mode-badge {
  color: #00f5d4;
}

/* Playlist Deck */
.playlist-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.playlist-counter {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.playlist-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clip-library-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clip-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.clip-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.clip-row.in-playlist {
  border-color: rgba(236, 233, 226, 0.25);
  background: rgba(255, 255, 255, 0.04);
}

.clip-row.active {
  border-color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.custom-checkbox-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.custom-checkbox svg {
  width: 12px;
  height: 12px;
  stroke: var(--bg-dark);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.15s ease;
}

.clip-row.in-playlist .custom-checkbox {
  background: var(--text-main);
  border-color: var(--text-main);
}

.clip-row.in-playlist .custom-checkbox svg {
  opacity: 1;
  transform: scale(1);
}

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

.clip-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

.clip-sub {
  font-size: 0.66rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.clip-badge-tag {
  font-size: 0.58rem;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}

.clip-status-pill {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.clip-status-pill.playing {
  background: rgba(159, 184, 158, 0.2);
  color: var(--accent-green);
  border: 1px solid rgba(159, 184, 158, 0.4);
}

.clip-status-pill.queued {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.clip-status-pill.standby {
  background: transparent;
  color: var(--text-muted);
}

/* =============================================================================
   7. EDITORIAL PAIRING SHEET & MODAL DIALOGS
   ============================================================================= */
.modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-scrim.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  width: 100%;
  max-width: 500px;
  background: #111116;
  border: 1px solid var(--border-card);
  border-radius: 24px 24px 0 0;
  padding: 24px 20px max(24px, env(safe-area-inset-bottom, 24px)) 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.8);
}

.modal-scrim.open .modal-sheet {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--text-main);
}

.editorial-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.editorial-input:focus {
  border-color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

/* Camera Guidance Bottom Sheet Modal */
.guidance-sheet {
  gap: 16px;
  background: #111116;
}

.guidance-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guidance-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 14px;
}

.guidance-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(236, 233, 226, 0.08);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guidance-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guidance-card-title {
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.guidance-card-text {
  font-size: 0.74rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.guidance-card-text strong {
  color: var(--text-main);
  font-weight: 500;
}

.guidance-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.guidance-primary-btn {
  flex: 2;
  font-size: 0.82rem;
  padding: 12px 18px;
  justify-content: center;
}

.guidance-actions .editorial-btn:not(.guidance-primary-btn) {
  flex: 1;
  font-size: 0.78rem;
  padding: 12px 14px;
  justify-content: center;
}

/* =============================================================================
   8. SURFACE PICKER BOTTOM SHEET & SCROLL FADE MASK
   ============================================================================= */
.surface-picker-sheet {
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}

.surface-list-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 48vh;
  padding: 8px 4px 16px 4px;
  margin: 0 -4px;
  mask-image: linear-gradient(to bottom, transparent 0%, black 14px, black calc(100% - 18px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 14px, black calc(100% - 18px), transparent 100%);
}

.surface-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 54px;
}

.surface-picker-item:hover,
.surface-picker-item:active {
  background: rgba(255, 255, 255, 0.07);
  transform: scale(0.99);
}

.surface-picker-item.active {
  border-color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 16px rgba(236, 233, 226, 0.08);
}

.surface-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.surface-item-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: #000;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

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

.surface-item-name {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.surface-item-desc {
  font-size: 0.66rem;
  color: var(--text-dim);
}

.surface-item-check {
  color: var(--accent-green);
  font-size: 0.95rem;
  font-weight: 700;
  padding-right: 4px;
}

/* Surface Switch Micro-Animations */
@keyframes surfacePulse {
  0% { transform: scale(1); filter: brightness(1); }
  40% { transform: scale(0.985); filter: brightness(1.25); box-shadow: 0 0 24px rgba(236, 233, 226, 0.35); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes badgeGlow {
  0% { transform: scale(1); background: rgba(255, 255, 255, 0.05); }
  50% { transform: scale(1.04); background: rgba(236, 233, 226, 0.2); border-color: var(--text-main); }
  100% { transform: scale(1); background: rgba(255, 255, 255, 0.05); }
}

.hero-viewport.surface-swapped {
  animation: surfacePulse 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.surface-badge-btn.badge-swapped {
  animation: badgeGlow 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =============================================================================
   9. DEDICATED SURFACE SCANNER STUDIO MODAL & COLOR HIGHLIGHT OVERLAYS
   ============================================================================= */
.modal-scrim#aiCameraModal {
  align-items: stretch;
  justify-content: center;
  background: rgba(9, 9, 11, 0.98);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

.scanner-modal-sheet {
  width: 100%;
  max-width: 540px;
  height: 100%;
  max-height: 100dvh;
  border-radius: 0;
  border: none;
  background: transparent;
  padding: max(16px, env(safe-area-inset-top, 16px)) 16px max(18px, env(safe-area-inset-bottom, 18px)) 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: none;
  overflow: hidden;
}

.modal-scrim#aiCameraModal.open .scanner-modal-sheet {
  transform: translateY(0);
}

.scanner-viewport-wrap {
  width: 100%;
  flex: 1 1 auto;
  min-height: 260px;
  max-height: 52vh;
  background: #000000;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.85);
}

.scanner-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  z-index: 1;
}

.scanner-tap-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: auto;
  cursor: crosshair;
  touch-action: none;
}

.scanner-controls-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  flex-shrink: 0;
}

.scanner-retake-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  background: rgba(9, 9, 11, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s ease;
}

.scanner-retake-btn:active {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(0.95);
}

.tap-hint-pill {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-main);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  transition: all 0.2s ease;
}

.tap-hint-pill.extracting {
  border-color: var(--accent-gold);
  color: #fbbf24;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.3);
}

/* Identified Surfaces Section */
.detected-surfaces-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.detected-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2px;
}

.detected-section-hint {
  font-size: 0.66rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.detected-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  max-height: 18vh;
  overflow-y: auto;
  padding: 2px;
}

.surface-detect-chip {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--chip-border, rgba(255, 255, 255, 0.12));
  color: var(--text-main);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 38px;
}

.surface-detect-chip:active {
  transform: scale(0.97);
}

.surface-detect-chip.active {
  background: var(--chip-bg, rgba(0, 245, 212, 0.16));
  border-color: var(--chip-color, #00f5d4);
  box-shadow: 0 0 18px var(--chip-glow, rgba(0, 245, 212, 0.35));
  color: #ffffff;
  font-weight: 600;
}

.chip-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.chip-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.chip-label {
  white-space: nowrap;
}

/* Shimmer Loading State */
.chip-shimmer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 0.74rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-pill);
}

.pulse-icon {
  display: inline-block;
  animation: pulse-spin 1.4s infinite ease-in-out;
}

@keyframes pulse-spin {
  0% { transform: rotate(0deg) scale(0.9); opacity: 0.4; }
  50% { transform: rotate(180deg) scale(1.15); opacity: 1; }
  100% { transform: rotate(360deg) scale(0.9); opacity: 0.4; }
}

/* Mask Confirmation Card */
.mask-confirmation-card {
  background: rgba(18, 18, 24, 0.75);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: cardFadeIn 0.25s ease;
}

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

.mask-beamed-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--accent-green);
  font-weight: 500;
}

.mask-action-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.scanner-privacy-note {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  padding-top: 2px;
}

/* =============================================================================
   10. ADVANCED MODE: FINE-TUNE PRECISION DECK
   ============================================================================= */
.fine-tune-deck {
  background: rgba(18, 18, 24, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65);
  animation: fineTuneSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}

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

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

.fine-tune-title-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.fine-tune-surface-name {
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

/* 3-Segment Selector */
.fine-tune-segments {
  display: flex;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 2px;
  gap: 2px;
  width: 100%;
}

.fine-tune-seg-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  color: var(--text-dim);
  font-size: 0.70rem;
  font-weight: 500;
  padding: 6px 4px;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.fine-tune-seg-btn.active {
  background: rgba(236, 233, 226, 0.12);
  color: var(--text-main);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.fine-tune-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: panelFade 0.2s ease;
  min-height: 72px;
}

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

/* Sliders & Value Rows */
.fine-tune-slider-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fine-tune-slider-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.fine-tune-val {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #00f5d4;
  font-weight: 600;
}

.fine-tune-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  margin: 4px 0;
}

.fine-tune-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-main);
  border: 2px solid #00f5d4;
  box-shadow: 0 0 10px rgba(0, 245, 212, 0.6);
  cursor: pointer;
}

/* Quick Pills */
.fine-tune-quick-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0;
}

.quick-pill-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-dim);
  font-size: 0.66rem;
  font-weight: 500;
  padding: 4px 8px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.18s ease;
  white-space: nowrap;
  text-align: center;
}

.quick-pill-btn:active {
  transform: scale(0.96);
}

.quick-pill-btn.active {
  background: rgba(0, 245, 212, 0.12);
  border-color: #00f5d4;
  color: #ffffff;
  font-weight: 600;
}

/* Nudge & Scale Grid */
.fine-tune-nudge-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mini-dpad {
  width: 96px;
  height: 96px;
  grid-template-columns: repeat(3, 30px);
  grid-template-rows: repeat(3, 30px);
  gap: 3px;
  margin: 0;
}

.mini-dpad .dpad-btn {
  font-size: 0.72rem;
  border-radius: var(--radius-xs);
}

.mini-dpad .dpad-center {
  font-size: 0.62rem;
  font-family: var(--font-mono);
  color: var(--accent-gold);
}

.fine-tune-steppers {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stepper-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px 10px;
}

.stepper-label {
  font-size: 0.70rem;
  color: var(--text-dim);
}

.stepper-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.76rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s ease;
}

.stepper-btn:active {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(0.92);
}

.stepper-val {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #ffffff;
  min-width: 44px;
  text-align: center;
}

/* Action Bar */
.fine-tune-action-row {
  display: flex;
  gap: 8px;
  width: 100%;
  padding-top: 4px;
  border-top: 1px solid var(--border-subtle);
}

/* Panel 4: Tactile Laser Brush */
.brush-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

.brush-mode-pills {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 2px;
  gap: 2px;
}

.brush-mode-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 5px 8px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.brush-mode-btn.active {
  background: rgba(0, 245, 212, 0.15);
  border-color: #00f5d4;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(0, 245, 212, 0.2);
}

.brush-size-pills {
  display: flex;
  gap: 4px;
}

.brush-tip-hint {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.3;
  padding: 2px 4px;
}

/* =============================================================================
   AI SUBJECT ARCHITECTURAL INTELLIGENCE CARD
   ============================================================================= */
.subject-intel-section {
  margin: 10px 0 6px 0;
  width: 100%;
}

.subject-intel-card {
  background: linear-gradient(135deg, rgba(16, 16, 22, 0.85) 0%, rgba(10, 10, 14, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.subject-intel-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(236, 233, 226, 0.3) 50%, transparent 100%);
}

.intel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.intel-title-group {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.intel-badge-icon {
  font-size: 1.25rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.2));
}

.intel-titles {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.intel-badge-label {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.intel-badge-sub {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.intel-badge-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(236, 233, 226, 0.8);
  padding: 3px 8px;
  white-space: nowrap;
}

.intel-features-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.feature-tag {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 5px;
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 2.5px 7px;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s ease;
}

.feature-tag:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text-main);
}

.intel-motion-preview {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 7px;
  padding: 7px 9px;
  margin-top: 2px;
}

.motion-icon-wrap {
  font-size: 0.8rem;
  line-height: 1.2;
  color: #fbbf24;
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.4));
  flex-shrink: 0;
  margin-top: 1px;
}

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

.motion-header {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(236, 233, 226, 0.65);
}

.motion-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
  word-break: break-word;
}

/* =============================================================================
   LIVING CREATION & PHASED TRANSFORMATION MODAL
   ============================================================================= */
.creation-progress-sheet {
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px 20px 0 0;
  padding: 16px 18px 24px;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.8), 0 0 24px rgba(13, 148, 136, 0.2);
  animation: slideSheetUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* 16:9 Morph Viewport */
.morph-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9), 0 4px 20px rgba(0, 0, 0, 0.5);
  user-select: none;
  touch-action: none;
}

.morph-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
}

.morph-layer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Layer 1: Mask Silhouette */
.morph-layer.mask-layer {
  z-index: 1;
  background: radial-gradient(circle at center, #111827 0%, #030712 100%);
}

.morph-grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(13, 148, 136, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 148, 136, 0.08) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.morph-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan, #00f5d4), transparent);
  box-shadow: 0 0 12px var(--accent-cyan, #00f5d4);
  animation: scanLaser 3.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes scanLaser {
  0%, 100% { top: 0%; opacity: 0; }
  10%, 90% { opacity: 1; }
  50% { top: 98%; }
}

/* Layer 2: Synthesized Artwork */
.morph-layer.art-layer {
  z-index: 2;
  transition: opacity 0.4s ease;
}

/* Default Auto-Breathing Animation */
.morph-container.auto-breathing .art-layer {
  animation: morphBreathe 5.5s ease-in-out infinite alternate;
}

@keyframes morphBreathe {
  0%, 15% {
    opacity: 0.08;
    transform: scale(0.985);
  }
  85%, 100% {
    opacity: 1.0;
    transform: scale(1.0);
  }
}

.morph-shimmer-fx {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 20%,
    rgba(255, 255, 255, 0.08) 45%,
    rgba(0, 245, 212, 0.15) 50%,
    rgba(255, 255, 255, 0.08) 55%,
    transparent 80%
  );
  background-size: 200% 200%;
  animation: shimmerSweep 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shimmerSweep {
  0% { background-position: -120% -120%; }
  100% { background-position: 120% 120%; }
}

/* Floating Corner Badges */
.morph-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-dim, #94a3b8);
  pointer-events: none;
}

.morph-badge.art-badge {
  left: auto;
  right: 8px;
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(15, 23, 42, 0.85);
}

/* Interactive Split Slider Handle */
.morph-slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 32px;
  transform: translateX(-50%);
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: ew-resize;
  touch-action: none;
}

.morph-container.interactive-mode .morph-slider-handle {
  display: flex;
}

.morph-container.interactive-mode .art-layer {
  animation: none;
  clip-path: inset(0 0 0 50%);
}

.handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 8px rgba(0, 245, 212, 0.8);
}

.handle-grip {
  position: relative;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid #00f5d4;
  color: #00f5d4;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(0, 245, 212, 0.5);
}

/* Mode Indicator Pill */
.morph-mode-pill {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.62rem;
  color: var(--text-muted, #cbd5e1);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.morph-mode-pill:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(0, 245, 212, 0.3);
}

.mode-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00f5d4;
  box-shadow: 0 0 6px #00f5d4;
  animation: pulseDot 1.6s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* 4-Stage Humanized Narrative Stepper */
.creation-narrative-stepper {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
}

.stepper-track {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stepper-step {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.4;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.stepper-step.active {
  opacity: 1;
  transform: translateX(2px);
}

.stepper-step.completed {
  opacity: 0.85;
}

.step-indicator {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted, #cbd5e1);
  flex-shrink: 0;
  position: relative;
  transition: all 0.3s ease;
}

.stepper-step.active .step-indicator {
  background: rgba(13, 148, 136, 0.25);
  border-color: #00f5d4;
  color: #00f5d4;
  box-shadow: 0 0 10px rgba(0, 245, 212, 0.4);
  animation: pulseStepRing 1.8s ease-in-out infinite;
}

@keyframes pulseStepRing {
  0%, 100% { box-shadow: 0 0 6px rgba(0, 245, 212, 0.3); }
  50% { box-shadow: 0 0 14px rgba(0, 245, 212, 0.6); }
}

.stepper-step.completed .step-indicator {
  background: #059669;
  border-color: #10b981;
  color: #ffffff;
}

.step-num {
  display: block;
}

.step-check {
  display: none;
}

.stepper-step.completed .step-num {
  display: none;
}

.stepper-step.completed .step-check {
  display: block;
  font-size: 0.72rem;
}

.step-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.step-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main, #ffffff);
  line-height: 1.2;
}

.stepper-step.active .step-title {
  color: #00f5d4;
}

.step-sub {
  font-size: 0.65rem;
  color: var(--text-dim, #94a3b8);
  line-height: 1.2;
}

/* Dynamic Countdown & Telemetry Bar */
.creation-countdown-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
}

.countdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
}

.countdown-status {
  font-weight: 500;
  color: var(--text-main, #ffffff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65%;
}

.countdown-timer {
  font-weight: 600;
  color: #38bdf8;
  font-feature-settings: "tnum";
}

.countdown-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.countdown-fill {
  width: 8%;
  height: 100%;
  background: linear-gradient(90deg, #0d9488, #059669, #38bdf8, #00f5d4);
  background-size: 200% 100%;
  border-radius: 10px;
  transition: width 0.4s ease;
  animation: fillGaze 2.5s linear infinite;
}

@keyframes fillGaze {
  0% { background-position: 100% 0%; }
  100% { background-position: -100% 0%; }
}

/* Usability Reassurance Row */
.creation-reassurance-row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.reassurance-pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 0.62rem;
  color: var(--text-dim, #94a3b8);
  line-height: 1.25;
}

.reassurance-pill .pill-icon {
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* Success Actions */
.creation-success-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.project-now-btn {
  width: 100%;
  padding: 12px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  justify-content: center;
  background: linear-gradient(135deg, #059669, #0d9488);
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.4);
}

/* =============================================================================
   GRANULAR TELEMETRY & UNIT ECONOMICS AUDIT MODAL
   ============================================================================= */
.telemetry-pill-btn {
  background: rgba(13, 148, 136, 0.18);
  border: 1px solid rgba(0, 245, 212, 0.35);
  color: #00f5d4;
  font-size: 0.68rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.telemetry-pill-btn:hover {
  background: rgba(13, 148, 136, 0.35);
  box-shadow: 0 0 10px rgba(0, 245, 212, 0.3);
}

.telemetry-audit-sheet {
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px 20px 0 0;
  padding: 16px 18px 24px;
  max-width: 540px;
  margin: 0 auto;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.9), 0 0 24px rgba(13, 148, 136, 0.2);
}

.telemetry-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.t-kpi-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.t-kpi-card.highlight-green {
  background: rgba(5, 150, 105, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
}

.t-kpi-card.highlight-gold {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
}

.t-kpi-label {
  font-size: 0.60rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-dim, #94a3b8);
}

.t-kpi-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main, #ffffff);
  font-feature-settings: "tnum";
}

.t-kpi-card.highlight-green .t-kpi-val {
  color: #10b981;
}

.t-kpi-card.highlight-gold .t-kpi-val {
  color: #f59e0b;
}

.t-kpi-sub {
  font-size: 0.65rem;
  color: var(--text-muted, #cbd5e1);
}

.telemetry-section-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.t-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-main, #ffffff);
}

.t-badge {
  font-size: 0.60rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim, #94a3b8);
  font-family: monospace;
}

.telemetry-section-box.highlight-box {
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(0, 245, 212, 0.22);
}

.t-badge.green {
  background: rgba(5, 150, 105, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.t-badge.gold {
  background: rgba(217, 119, 6, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.t-table-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.t-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 0.70rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.t-label {
  color: var(--text-muted, #cbd5e1);
}

.t-val {
  font-weight: 500;
  color: var(--text-main, #ffffff);
  font-feature-settings: "tnum";
}

.t-val.highlight {
  color: #00f5d4;
  font-weight: 600;
}

.t-val.positive {
  color: #38bdf8;
  font-weight: 600;
}

.t-val.negative {
  color: #f87171;
}

.t-row.total-row {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 6px;
  margin-top: 2px;
}

.t-row.total-row .t-label,
.t-row.total-row .t-val {
  font-weight: 700;
  color: #f59e0b;
}

.t-row.profit-row {
  border-top: 1px dashed rgba(16, 185, 129, 0.4);
  padding-top: 6px;
  margin-top: 4px;
}

.t-row.profit-row .t-label {
  font-weight: 700;
  color: #10b981;
  text-transform: uppercase;
}

.t-val.profit {
  font-size: 0.82rem;
  font-weight: 700;
  color: #10b981;
}

.telemetry-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.t-action-btn {
  flex: 1;
  padding: 9px 12px;
  font-size: 0.78rem;
  justify-content: center;
  text-decoration: none;
  display: flex;
  align-items: center;
}

