/* ==========================================================================
   AuraBily / Bilitis Studio — Design System & PWA Stylesheet
   Theme: Fine-Art Sovereign Dark & Champagne Gold (#0a0a0a / #c8a96e)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Outfit:wght@300;400;500;600&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg-main: #0a0a0a;
  --bg-surface: #121212;
  --bg-card: #161616;
  --bg-card-hover: #1c1c1c;
  --bg-glass: rgba(18, 18, 18, 0.82);
  --bg-glass-card: rgba(24, 24, 24, 0.7);

  --gold-primary: #c8a96e;
  --gold-light: #e4cf9b;
  --gold-dark: #8f7444;
  --gold-glow: rgba(200, 169, 110, 0.25);
  --gold-gradient: linear-gradient(135deg, #dfc285 0%, #c8a96e 50%, #9e7f45 100%);

  --text-primary: #f5f5f5;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --text-gold: #c8a96e;

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-gold: rgba(200, 169, 110, 0.35);
  --border-gold-focus: rgba(200, 169, 110, 0.75);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 4px 20px rgba(200, 169, 110, 0.18);
  --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.85);

  --font-serif: 'Cinzel', Georgia, serif;
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Microsoft YaHei", "Meiryo", sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Microsoft YaHei", "Meiryo", sans-serif;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  letter-spacing: -0.01em;
}

/* Subtle Film Grain Noise Texture */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  background-image: radial-gradient(rgba(200, 169, 110, 0.03) 1px, transparent 0);
  background-size: 24px 24px;
  opacity: 0.8;
  z-index: 0;
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-gold);
  box-shadow: var(--shadow-gold);
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.brand-logo img, .brand-logo svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Top-Level Creation Mode Selector (Masterpiece vs Comics Storyboard) */
.main-mode-switcher {
  display: inline-flex;
  align-items: center;
  background: rgba(14, 14, 14, 0.75);
  border: 1px solid rgba(200, 169, 110, 0.25);
  border-radius: var(--radius-pill);
  padding: 3px 4px;
  gap: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  user-select: none;
}

.mode-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.95rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.mode-switch-btn .mode-icon {
  font-size: 0.95rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.mode-switch-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.mode-switch-btn.active {
  background: linear-gradient(135deg, rgba(200, 169, 110, 0.24) 0%, rgba(200, 169, 110, 0.08) 100%);
  color: var(--gold-light);
  border-color: rgba(200, 169, 110, 0.45);
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(200, 169, 110, 0.18);
}

.mode-switch-btn.active .mode-icon {
  transform: scale(1.12);
}

@media (max-width: 720px) {
  .main-mode-switcher {
    padding: 2px 3px;
    gap: 2px;
  }
  .mode-switch-btn {
    padding: 0.28rem 0.65rem;
    font-size: 0.74rem;
    gap: 0.35rem;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Accessibility Utility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Sovereign Language Picker */
.lang-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
}

.lang-picker-wrapper:hover,
.lang-picker-wrapper:focus-within {
  border-color: var(--border-gold);
  background: rgba(200, 169, 110, 0.06);
  box-shadow: 0 0 10px rgba(200, 169, 110, 0.15);
}

.lang-picker-icon {
  font-size: 0.85rem;
  line-height: 1;
  opacity: 0.85;
}

.lang-picker-select {
  background: transparent;
  color: var(--gold-light);
  border: none;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  padding: 0.1rem 0.2rem;
  letter-spacing: 0.04em;
}

.lang-picker-select option {
  background: #141414;
  color: var(--text-primary);
  font-size: 0.82rem;
  padding: 0.4rem;
}

/* Status Pill */
.status-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #666;
  transition: background-color 0.3s ease;
}

.status-dot.online {
  background-color: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-dot.busy {
  background-color: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
  animation: pulse 1.5s infinite;
}

.status-dot.offline {
  background-color: #ef4444;
}

.status-dot.warning {
  background-color: #f39c12;
  box-shadow: 0 0 8px rgba(243, 156, 18, 0.6);
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-light);
  background: rgba(200, 169, 110, 0.05);
}

/* Main Container Layout */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem;
  padding-bottom: calc(5.5rem + var(--safe-bottom));
}

@media (min-width: 960px) {
  .app-container {
    display: grid;
    grid-template-columns: 460px 1fr;
    gap: 1.75rem;
    padding-bottom: 2rem;
  }
}

/* Tab Sections */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Viewer Column (Desktop Right Column) */
.desktop-viewer-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

/* Viewer Tabs Bar (Desktop Segmented Control) */
.viewer-tabs-bar {
  display: flex;
  background: #0d0d0d;
  border: 1px solid rgba(200, 169, 110, 0.22);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 6px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
}

.viewer-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.65rem 1.2rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.viewer-tab-btn svg {
  color: inherit;
  opacity: 0.75;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.viewer-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.viewer-tab-btn:hover svg {
  opacity: 1;
}

.viewer-tab-btn.active {
  background: rgba(200, 169, 110, 0.12);
  color: var(--gold-primary);
  border-color: rgba(200, 169, 110, 0.35);
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.viewer-tab-btn.active svg {
  opacity: 1;
  transform: scale(1.08);
}

.viewer-gallery-count {
  font-size: 0.7rem;
  padding: 0.12rem 0.48rem;
  border-radius: var(--radius-pill);
  background: rgba(200, 169, 110, 0.2);
  color: var(--gold-light);
  border: 1px solid rgba(200, 169, 110, 0.35);
  font-weight: 600;
  line-height: 1.2;
}

@media (max-width: 959px) {
  /* On mobile (<960px), creation and viewer columns are transparent and use bottom navigation */
  .creation-column,
  .desktop-viewer-column {
    display: contents;
  }
  .viewer-tabs-bar {
    display: none;
  }
}

@media (min-width: 960px) {
  /* On desktop, creation column manages the active mode tab */
  .creation-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .creation-column #tab-studio,
  .creation-column #tab-storydirector {
    display: none;
  }

  .creation-column #tab-studio.active,
  .creation-column #tab-storydirector.active {
    display: block;
    animation: fadeInViewer 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  /* In the right viewer column, visibility is controlled by .viewer-active */
  .desktop-viewer-column #tab-preview,
  .desktop-viewer-column #tab-gallery {
    display: none;
  }

  .desktop-viewer-column #tab-preview.viewer-active,
  .desktop-viewer-column #tab-gallery.viewer-active {
    display: block;
    animation: fadeInViewer 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
}

@keyframes fadeInViewer {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Studio Panel / Card */
.studio-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-gold);
  margin-bottom: 0.6rem;
}

/* Form Groups & Controls */
.form-group {
  margin-bottom: 1.25rem;
}

.select-control, .input-control, .textarea-control {
  width: 100%;
  background: #0d0d0d;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  transition: all 0.2s ease;
  outline: none;
}

.select-control:focus, .input-control:focus, .textarea-control:focus {
  border-color: var(--border-gold-focus);
  box-shadow: 0 0 0 2px rgba(200, 169, 110, 0.15);
}

.textarea-control {
  resize: vertical;
  min-height: 95px;
  line-height: 1.45;
}

/* Prompt Lead & Creative Centerpiece */
.prompt-lead-group {
  margin-bottom: 1.15rem;
}

.studio-prompt-textarea {
  min-height: 105px;
  background: rgba(13, 13, 13, 0.95);
  border: 1px solid rgba(200, 169, 110, 0.28);
  border-radius: var(--radius-sm);
  line-height: 1.5;
  font-size: 0.92rem;
}

.studio-prompt-textarea:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 2px rgba(200, 169, 110, 0.2), 0 0 16px rgba(200, 169, 110, 0.1);
}

/* Live Directive & Aesthetic Aura Bar */
.prompt-aura-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(200, 169, 110, 0.05);
  border: 1px solid rgba(200, 169, 110, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.65rem;
  margin-top: 0.45rem;
  margin-bottom: 0.55rem;
  font-size: 0.74rem;
  color: var(--text-muted);
  transition: all 0.25s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompt-aura-bar:hover {
  border-color: rgba(200, 169, 110, 0.4);
  background: rgba(200, 169, 110, 0.08);
}

.prompt-aura-bar .aura-sparkle {
  font-size: 0.82rem;
  flex-shrink: 0;
}

.prompt-aura-bar .aura-title {
  color: var(--gold-primary);
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.prompt-aura-bar .aura-content {
  color: var(--text-gold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Prompt Header, Meta Chips & Sovereign Safety Status */
.prompt-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.prompt-meta-chips {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.prompt-safety-status {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.25s ease;
  user-select: none;
}

.prompt-safety-status.status-active {
  color: #38ef7d;
  background: rgba(56, 239, 125, 0.1);
  border: 1px solid rgba(56, 239, 125, 0.35);
  box-shadow: 0 0 10px rgba(56, 239, 125, 0.15);
}

.prompt-safety-status.status-inactive {
  color: #e6a23c;
  background: rgba(230, 162, 60, 0.1);
  border: 1px solid rgba(230, 162, 60, 0.35);
  box-shadow: 0 0 10px rgba(230, 162, 60, 0.12);
}

/* Switch Toggle & Safety Settings Card */
.safety-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(200, 169, 110, 0.22);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  gap: 0.8rem;
  transition: all 0.2s ease;
}

.safety-toggle-card:hover {
  border-color: rgba(200, 169, 110, 0.4);
  background: rgba(200, 169, 110, 0.04);
}

.safety-toggle-info {
  flex: 1;
}

.safety-toggle-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  color: var(--gold-light);
  font-family: var(--font-display);
}

.safety-toggle-title .safety-icon {
  font-size: 1rem;
}

.safety-toggle-desc {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.35;
}

.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-toggle {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #242424;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider-toggle:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #999;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.switch-toggle input:checked + .slider-toggle {
  background-color: rgba(56, 239, 125, 0.25);
  border-color: #38ef7d;
  box-shadow: 0 0 10px rgba(56, 239, 125, 0.25);
}

.switch-toggle input:checked + .slider-toggle:before {
  transform: translateX(20px);
  background-color: #38ef7d;
  box-shadow: 0 0 8px rgba(56, 239, 125, 0.7);
}

/* Studio Director Desk (Sliding Tabbed Panels) */
.director-panel {
  background: linear-gradient(180deg, rgba(22, 22, 22, 0.92) 0%, rgba(14, 14, 14, 0.98) 100%);
  border: 1px solid rgba(200, 169, 110, 0.25);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.director-tabs-nav {
  display: flex;
  background: #0a0a0a;
  border-bottom: 1px solid rgba(200, 169, 110, 0.18);
  padding: 4px;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.director-tabs-nav::-webkit-scrollbar {
  display: none;
}

.director-tab-btn {
  flex: 1;
  min-width: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.62rem 0.4rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
}

.director-tab-btn .tab-icon {
  font-size: 0.95rem;
  filter: grayscale(0.4);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.director-tab-btn:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}

.director-tab-btn:hover .tab-icon {
  filter: grayscale(0);
}

.director-tab-btn.active {
  background: rgba(200, 169, 110, 0.12);
  color: var(--gold-primary);
  border-color: rgba(200, 169, 110, 0.32);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(200, 169, 110, 0.2), 0 2px 8px rgba(0, 0, 0, 0.25);
}

.director-tab-btn.active .tab-icon {
  filter: grayscale(0);
  transform: scale(1.1);
}

.director-panels-viewport {
  padding: 1rem 1.15rem;
  min-height: 155px;
  position: relative;
}

.director-panel-slide {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.director-panel-slide.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: slidePanelIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slidePanelIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.director-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

@media (max-width: 540px) {
  .director-grid-2col {
    grid-template-columns: 1fr;
  }
}

.medium-description-card {
  background: rgba(200, 169, 110, 0.05);
  border: 1px solid rgba(200, 169, 110, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 0.4rem;
  transition: all 0.2s ease;
}

.medium-description-card strong {
  color: var(--gold-light);
}

.sub-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Accordion / Collapsible Technical Settings */
.accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-family: var(--font-display);
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  margin-top: 0.65rem;
  transition: all 0.2s ease;
}

.accordion-toggle:hover {
  background: rgba(200, 169, 110, 0.06);
  border-color: rgba(200, 169, 110, 0.3);
  color: var(--gold-light);
}

.accordion-toggle #accordion-arrow {
  font-size: 0.85rem;
  color: var(--gold-primary);
  transition: transform 0.2s ease;
}

.accordion-content {
  display: none;
  padding: 0.75rem 0.25rem 0.25rem;
  animation: fadeInAccordion 0.2s ease;
}

.accordion-content.open {
  display: block;
}

@keyframes fadeInAccordion {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.director-actions-bar {
  display: flex;
  gap: 0.6rem;
  padding: 0.8rem 1.15rem 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(10, 10, 10, 0.55);
}

.btn-full-gold {
  flex: 3;
  min-width: 170px;
  justify-content: center;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #0b0b0b;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(200, 169, 110, 0.25);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.btn-full-gold:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 14px rgba(200, 169, 110, 0.4);
  transform: translateY(-1px);
}

@media (max-width: 500px) {
  .director-actions-bar {
    flex-direction: column;
  }
}

/* Prompt Quick Tags */
.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.tag-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-chip:hover {
  border-color: var(--border-gold);
  color: var(--gold-light);
  background: rgba(200, 169, 110, 0.06);
}

/* Prompt Toolbar */
.prompt-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
}

.magic-btn {
  background: rgba(200, 169, 110, 0.08);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.8rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.magic-btn:hover {
  background: var(--gold-gradient);
  color: #0a0a0a;
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.magic-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Specific Toolbar Semantic Buttons */
.magic-btn.btn-compose {
  background: linear-gradient(135deg, rgba(200, 169, 110, 0.18), rgba(200, 169, 110, 0.08));
  border: 1px solid rgba(200, 169, 110, 0.45);
  font-weight: 600;
}

.magic-btn.btn-compose:hover {
  background: linear-gradient(135deg, #e4cf9b, #c8a96e);
  color: #0d0d0d;
}

.magic-btn.btn-enhance {
  background: rgba(147, 112, 219, 0.1);
  border-color: rgba(186, 150, 255, 0.35);
  color: #d8b4fe;
}

.magic-btn.btn-enhance:hover {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #fff;
  border-color: #c084fc;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.4);
}

.btn-autotune {
  background: rgba(45, 212, 191, 0.09);
  border-color: rgba(45, 212, 191, 0.35);
  color: #5eead4;
}

.btn-autotune:hover {
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  border-color: #2dd4bf;
  color: #fff;
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.35);
}

.btn-autotune.tuning {
  animation: pulseGold 1s infinite alternate;
  pointer-events: none;
}

.magic-btn.btn-random {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-secondary);
}

.magic-btn.btn-random:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

@keyframes pulseGold {
  from { box-shadow: 0 0 4px rgba(200, 169, 110, 0.2); }
  to { box-shadow: 0 0 16px rgba(200, 169, 110, 0.5); }
}

/* Ratio Selector Chips */
.ratio-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.ratio-btn {
  background: #0d0d0d;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.2rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  text-align: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ratio-btn.active, .ratio-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-light);
  background: rgba(200, 169, 110, 0.08);
}

/* Accordion / Collapsible Settings */
.accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-family: var(--font-display);
  padding: 0.5rem 0;
  cursor: pointer;
  border-top: 1px solid var(--border-subtle);
  margin-top: 0.75rem;
}

.accordion-toggle:hover {
  color: var(--text-gold);
}

.accordion-content {
  display: none;
  padding-top: 0.75rem;
}

.accordion-content.open {
  display: block;
}

.inline-flex {
  display: flex;
  gap: 0.75rem;
}

/* Big Action Button */
.action-btn-primary {
  width: 100%;
  background: var(--gold-gradient);
  color: #0a0a0a;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.95rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(200, 169, 110, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 1rem;
}

.action-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 26px rgba(200, 169, 110, 0.5);
}

.action-btn-primary:active {
  transform: translateY(0);
}

.action-btn-primary:disabled {
  opacity: 0.5;
  transform: none;
  cursor: not-allowed;
  box-shadow: none;
}

/* Progress Tracker */
.progress-card {
  display: none;
  background: #111;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-top: 1.25rem;
  box-shadow: var(--shadow-gold);
}

.progress-card.visible {
  display: block;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-gold);
  font-family: var(--font-display);
  font-weight: 500;
  margin-bottom: 0.6rem;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: #222;
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gold-gradient);
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
  position: relative;
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 1.5s infinite;
}

.progress-caption {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
}

/* Live Preview / Active Artwork Card */
.preview-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  position: relative;
  overflow: hidden;
}

.preview-placeholder {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem 1rem;
}

.preview-placeholder svg {
  width: 56px;
  height: 56px;
  margin-bottom: 1rem;
  stroke: var(--text-muted);
  opacity: 0.6;
}

.preview-img-wrapper {
  display: none;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  background: #000;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
  cursor: pointer;
}

.preview-img-wrapper.visible {
  display: block;
}

.preview-img-wrapper img {
  width: 100%;
  height: auto;
  max-height: 650px;
  object-fit: contain;
  display: block;
  transition: transform 0.3s ease;
}

.preview-img-wrapper:hover img {
  transform: scale(1.015);
}

/* Ensure the wrapper for the active artwork is relative */
.preview-img-wrapper, .active-artwork-container {
    position: relative;
    display: inline-block; /* Or block, depending on layout */
    max-width: 100%;
}

/* The image itself should be block to avoid gap issues */
.active-artwork-img {
    display: block;
    width: 100%;
    height: auto;
}

/* The overlay container */
.svg-bubble-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none; /* Allows right-clicking/saving the underlying image if needed */
    transition: opacity 0.25s ease-in-out;
}

/* Ensure underlying masterpiece artwork remains completely visible through overlay */
.svg-bubble-overlay svg {
    background: transparent !important;
}
.svg-bubble-overlay svg > rect:first-of-type,
.svg-bubble-overlay .storyboard-backdrop {
    fill: transparent !important;
    display: none !important;
}
.svg-bubble-overlay .storyboard-panel-frame {
    fill: transparent !important;
    fill-opacity: 0 !important;
}
.svg-bubble-overlay .storyboard-panel-placeholder,
.svg-bubble-overlay .storyboard-placeholder-rect,
.svg-bubble-overlay .storyboard-placeholder-text,
.svg-bubble-overlay .storyboard-placeholder-camera,
.svg-bubble-overlay .storyboard-header-meta {
    display: none !important;
}

.btn-overlay-toggle {
    background: rgba(200, 169, 110, 0.12);
    border: 1px solid rgba(200, 169, 110, 0.4);
    color: var(--gold-light, #f0e6d2);
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-overlay-toggle:hover {
    background: rgba(200, 169, 110, 0.24);
    border-color: var(--gold-primary, #c8a96e);
}
.btn-overlay-toggle.overlay-hidden {
    opacity: 0.6;
    border-style: dashed;
    color: var(--text-muted);
}

.preview-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.85rem;
  width: 100%;
}

.btn-secondary {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--gold-primary);
  color: var(--gold-light);
  background: rgba(200, 169, 110, 0.08);
}

.btn-danger {
  color: #ff6b6b !important;
  border-color: rgba(235, 87, 87, 0.35) !important;
  background: rgba(235, 87, 87, 0.08) !important;
}

.btn-danger:hover {
  background: #c0392b !important;
  border-color: #e74c3c !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(192, 57, 43, 0.4);
}

.btn-outline-danger {
  font-size: 0.74rem !important;
  padding: 0.4rem 0.75rem !important;
  color: #f18b82 !important;
  border-color: rgba(241, 139, 130, 0.3) !important;
  background: rgba(241, 139, 130, 0.06) !important;
}

.btn-outline-danger:hover {
  background: rgba(235, 87, 87, 0.22) !important;
  border-color: #eb5757 !important;
  color: #fff !important;
}

/* Gallery Grid */
.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.95rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.gallery-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.gallery-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.gallery-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--text-gold);
  letter-spacing: 0.04em;
}

.gallery-count-badge {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  background: rgba(200, 169, 110, 0.12);
  color: var(--gold-light);
  border: 1px solid rgba(200, 169, 110, 0.25);
  border-radius: var(--radius-pill);
}

/* Gallery Filter & Search Toolbar */
.gallery-filter-bar {
  background: rgba(18, 18, 18, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.gallery-filter-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-search-group {
  grid-column: span 1;
}

@media (min-width: 900px) {
  .filter-search-group {
    grid-column: span 1;
  }
}

.filter-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-select,
.filter-input {
  width: 100%;
  background: #141414;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 0.48rem 0.65rem;
  outline: none;
  transition: all 0.2s ease;
}

.filter-select:hover,
.filter-input:hover {
  border-color: rgba(200, 169, 110, 0.35);
}

.filter-select:focus,
.filter-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.filter-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.filter-search-box .filter-input {
  padding-right: 1.8rem;
}

.filter-clear-btn {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  display: none;
}

.filter-clear-btn:hover {
  color: var(--gold-light);
  background: rgba(255, 255, 255, 0.05);
}

/* Active Filter Chips & Status */
.gallery-filter-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
  font-size: 0.75rem;
}

.filter-status-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.active-filter-chips {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(200, 169, 110, 0.15);
  color: var(--gold-light);
  border: 1px solid rgba(200, 169, 110, 0.3);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
}

.filter-chip-remove {
  cursor: pointer;
  color: var(--gold-primary);
  font-weight: bold;
  font-size: 0.8rem;
  padding: 0 2px;
}

.filter-chip-remove:hover {
  color: #ff6b6b;
}

.filter-chip-none {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.72rem;
}

.btn-reset-filters {
  margin-left: auto;
  background: rgba(235, 87, 87, 0.1);
  color: #ff8b8b;
  border: 1px solid rgba(235, 87, 87, 0.25);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reset-filters:hover {
  background: rgba(235, 87, 87, 0.2);
  color: #fff;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1.25rem;
  }
}

.gallery-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.gallery-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-gold);
  box-shadow: var(--shadow-gold);
}

.gallery-thumb-box {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #0d0d0d;
  position: relative;
  overflow: hidden;
}

.gallery-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-card:hover .gallery-thumb-box img {
  transform: scale(1.05);
}

.gallery-card-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.5rem;
  font-size: 0.68rem;
  color: var(--gold-light);
  font-family: var(--font-display);
}

.gallery-card-info {
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gallery-card-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.stars-view {
  color: var(--gold-primary);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

/* Lightbox Modal */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(16px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.open {
  display: flex;
}

.lightbox-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  position: relative;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .lightbox-content {
    flex-direction: row;
    max-height: 85vh;
  }
  .lightbox-img-box {
    flex: 1.2;
  }
  .lightbox-details {
    flex: 1;
    overflow-y: auto;
  }
}

.lightbox-img-box {
  background: #050505;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  min-height: 320px;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.lightbox-img-box.magnifier-active {
  cursor: crosshair;
}

.lightbox-img-box img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  transition: filter 0.2s ease;
}

/* Floating Inspection Toolbar */
.lightbox-img-toolbar {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(12, 12, 12, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-gold);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.75);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-img-toolbar:hover {
  background: rgba(18, 18, 18, 0.95);
  border-color: var(--gold-light);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85), 0 0 12px var(--gold-glow);
}

.btn-magnifier-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-magnifier-toggle:hover {
  color: var(--gold-light);
  background: rgba(200, 169, 110, 0.16);
}

.btn-magnifier-toggle.active {
  color: #0a0a0a;
  background: var(--gold-gradient);
  box-shadow: 0 0 14px var(--gold-glow);
  font-weight: 600;
}

.loupe-btn-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.loupe-btn-text {
  letter-spacing: 0.02em;
}

.loupe-zoom-badge {
  font-size: 0.68rem;
  font-family: var(--font-serif);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.45);
  color: var(--gold-light);
  border: 1px solid var(--border-subtle);
  letter-spacing: 0.04em;
  font-weight: 600;
}

.btn-magnifier-toggle.active .loupe-zoom-badge {
  background: rgba(10, 10, 10, 0.88);
  color: #fcebc7;
  border-color: rgba(255, 255, 255, 0.22);
}

.magnifier-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  padding-left: 0.35rem;
}

.btn-loupe-zoom {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-loupe-zoom:hover {
  background: var(--gold-primary);
  color: #0a0a0a;
  border-color: var(--gold-light);
  box-shadow: 0 0 8px var(--gold-glow);
}

#btn-details-magnifier.active {
  border-color: var(--gold-primary);
  color: var(--gold-light);
  background: rgba(200, 169, 110, 0.16);
  box-shadow: 0 0 10px rgba(200, 169, 110, 0.25);
}

/* ==========================================================================
   Vintage Inspection Loupe (Master Darkroom Magnifier)
   ========================================================================== */
.vintage-magnifier {
  position: absolute;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 50;
  opacity: 0;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.05s ease-out;
  /* Authentic Multi-Tier Antique Brass Bezel */
  border: 6px solid transparent;
  background:
    linear-gradient(#080808, #080808) padding-box,
    linear-gradient(135deg, #f7e7c4 0%, #c8a96e 24%, #6e5022 48%, #e4cf9b 72%, #38240a 100%) border-box;
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.92),
    0 8px 18px rgba(0, 0, 0, 0.7),
    inset 0 0 0 2px rgba(45, 30, 12, 0.95),
    inset 0 0 0 4px rgba(228, 207, 155, 0.45),
    inset 0 0 24px rgba(0, 0, 0, 0.88);
}

.vintage-magnifier.visible {
  opacity: 1;
}

/* Inner Optical Magnification Glass */
.magnifier-glass {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background-repeat: no-repeat;
  z-index: 1;
  box-shadow:
    inset 0 0 28px rgba(0, 0, 0, 0.72),
    inset 0 0 8px rgba(200, 169, 110, 0.4);
}

/* Optical Glass Convex Reflection & Glare */
.magnifier-glare {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(circle at 33% 26%, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.12) 28%, transparent 56%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, transparent 42%, rgba(0, 0, 0, 0.35) 100%);
  border-top: 1.5px solid rgba(255, 255, 255, 0.65);
  border-left: 1.2px solid rgba(255, 255, 255, 0.35);
}

/* Vintage Darkroom Graticule / Film Reticle */
.magnifier-reticle {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.65;
}

.magnifier-reticle::before {
  content: '';
  position: absolute;
  width: 50px;
  height: 1px;
  background: rgba(200, 169, 110, 0.55);
}

.magnifier-reticle::after {
  content: '';
  position: absolute;
  width: 1px;
  height: 50px;
  background: rgba(200, 169, 110, 0.55);
}

.reticle-ring {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(200, 169, 110, 0.65);
  border-radius: 50%;
}

.reticle-dot {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #f7e7c4;
  border-radius: 50%;
  box-shadow: 0 0 3px rgba(200, 169, 110, 0.8);
}

/* Engraved Inner Bezel Inscription */
.magnifier-rim-text {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 7.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #e4cf9b;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  pointer-events: none;
  z-index: 4;
  opacity: 0.9;
}

/* Ornate Fluted Rosewood & Brass Loupe Handle */
.magnifier-handle {
  position: absolute;
  bottom: -24px;
  right: -24px;
  width: 18px;
  height: 98px;
  transform: rotate(-45deg);
  transform-origin: top center;
  pointer-events: none;
  z-index: -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(6px 14px 16px rgba(0, 0, 0, 0.9));
}

.handle-ferrule {
  width: 14px;
  height: 16px;
  background: linear-gradient(90deg, #6e5223 0%, #e4cf9b 35%, #fff1d6 50%, #c8a96e 70%, #5a421b 100%);
  border-radius: 2px 2px 0 0;
  border-bottom: 1.5px solid #3d2a0d;
}

.handle-stem {
  width: 12px;
  height: 70px;
  background: linear-gradient(90deg, #180c05 0%, #4a210d 25%, #7a3a19 45%, #542710 70%, #1a0c04 100%);
  border-radius: 5px;
  box-shadow: inset 1px 0 2px rgba(255, 255, 255, 0.15), inset -1px 0 2px rgba(0, 0, 0, 0.85);
}

.handle-pommel {
  width: 16px;
  height: 12px;
  background: linear-gradient(90deg, #6e5223 0%, #e4cf9b 40%, #c8a96e 70%, #423013 100%);
  border-radius: 0 0 8px 8px;
}

@media (max-width: 600px) {
  .vintage-magnifier {
    width: 170px;
    height: 170px;
    border-width: 5px;
  }
  .magnifier-handle {
    bottom: -20px;
    right: -20px;
    height: 80px;
  }
  .handle-stem {
    height: 56px;
  }
}

.lightbox-details {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}

.lightbox-close:hover {
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.lightbox-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--text-gold);
  margin-bottom: 0.5rem;
}

.lightbox-prompt-container {
  background: rgba(13, 13, 13, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.85rem;
}

.lightbox-prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.prompt-header-label {
  font-size: 0.7rem;
  font-family: var(--font-display);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.lightbox-prompt {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-word;
  transition: max-height 0.25s ease;
}

.lightbox-prompt.truncated {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-height: calc(1.4em * 2) !important;
  word-break: break-word;
}

.prompt-expand-btn {
  background: none;
  border: none;
  color: var(--gold-primary);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.3rem 0 0 0;
  display: inline-block;
  transition: color 0.15s ease;
}

.prompt-expand-btn:hover {
  color: var(--gold-light);
  text-decoration: underline;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.meta-row span:last-child {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Masterpiece Generative Specifications Card */
.masterpiece-specs-card {
  background: rgba(18, 18, 18, 0.7);
  border: 1px solid rgba(200, 169, 110, 0.22);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-bottom: 0.85rem;
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.specs-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.specs-card-title {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.specs-badge {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  background: rgba(200, 169, 110, 0.15);
  border: 1px solid rgba(200, 169, 110, 0.35);
  color: var(--gold-primary);
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  font-weight: 600;
}

.specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

@media (max-width: 600px) {
  .specs-grid {
    grid-template-columns: 1fr;
  }
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.spec-item.spec-fullwidth {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.45rem;
  margin-top: 0.2rem;
}

.spec-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  font-weight: 500;
}

.spec-val {
  font-size: 0.78rem;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.35;
  word-break: break-word;
}

.spec-val-code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold-light);
  background: rgba(0, 0, 0, 0.4);
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: block;
  word-break: break-all;
}

/* Star Rating Control */
.rating-picker {
  display: flex;
  gap: 0.35rem;
  font-size: 1.3rem;
  color: #444;
  cursor: pointer;
  margin: 0.75rem 0;
}

.rating-picker span.active {
  color: var(--gold-primary);
  text-shadow: 0 0 10px rgba(200, 169, 110, 0.5);
}

/* Bottom Navigation Bar (Mobile) */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  padding: 0.6rem 0;
  padding-bottom: calc(0.6rem + var(--safe-bottom));
}

@media (min-width: 960px) {
  .mobile-nav {
    display: none;
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  transition: all 0.2s ease;
}

.nav-item.active {
  color: var(--gold-light);
}

.nav-item.active svg {
  stroke: var(--gold-light);
  transform: translateY(-2px);
  filter: drop-shadow(0 2px 8px rgba(200, 169, 110, 0.5));
}

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: calc(5rem + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: #181818;
  border: 1px solid var(--border-gold);
  color: var(--text-primary);
  border-radius: var(--radius-pill);
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  box-shadow: var(--shadow-gold);
  pointer-events: auto;
  animation: fadeIn 0.3s ease;
  max-width: 90vw;
}

.toast.toast-error {
  border-radius: var(--radius-md);
  border-color: #f48771;
  background: rgba(26, 12, 12, 0.98);
  box-shadow: 0 10px 30px rgba(244, 135, 113, 0.25), 0 0 15px rgba(244, 135, 113, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 460px;
  padding: 0.9rem 1.1rem;
}

.toast-error-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: #f48771;
  font-size: 0.88rem;
}

.toast-error-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.2rem;
  line-height: 1;
}

.toast-error-close:hover {
  color: #fff;
}

.toast-error-body {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
  word-break: break-word;
  max-height: 120px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
}

.toast-error-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.toast-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  font-size: 0.72rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.toast-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: #f48771;
  color: #fff;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Floating Console Log Viewer */
.console-logviewer {
  display: none;
  position: fixed;
  bottom: calc(4.5rem + var(--safe-bottom));
  right: 1.25rem;
  left: 1.25rem;
  max-width: 780px;
  height: 280px;
  background: rgba(13, 13, 13, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(200, 169, 110, 0.2);
  z-index: 250;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Consolas', 'Courier New', monospace;
  animation: slideUpLog 0.25s ease forwards;
}

@media (min-width: 820px) {
  .console-logviewer {
    left: auto;
    width: 680px;
  }
}

.console-logviewer.open {
  display: flex;
}

@keyframes slideUpLog {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.logviewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.85rem;
  background: rgba(25, 25, 25, 0.9);
  border-bottom: 1px solid var(--border-subtle);
  user-select: none;
}

.logviewer-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--gold-light);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.log-badge {
  background: var(--gold-dark);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 0.1rem 0.45rem;
  font-size: 0.65rem;
}

.logviewer-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-micro {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-micro:hover {
  background: var(--gold-dark);
  border-color: var(--gold-primary);
  color: #fff;
}

.logviewer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem 0.85rem;
  font-size: 0.74rem;
  line-height: 1.45;
  background: #080808;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-entry {
  display: flex;
  gap: 0.5rem;
}

.log-time {
  color: var(--text-muted);
  flex-shrink: 0;
  user-select: none;
}

.log-msg {
  flex: 1;
}

.log-entry.info .log-msg {
  color: #9cdcfe;
}

.log-entry.warn .log-msg {
  color: #dcdcaa;
}

.log-entry.error .log-msg {
  color: #f48771;
  font-weight: 500;
}

.log-entry.success .log-msg {
  color: #4ec9b0;
}

/* Queue Panel Specifics */
.queue-panel {
  bottom: calc(4.5rem + var(--safe-bottom));
  left: 1.25rem;
  right: auto;
}

@media (min-width: 820px) {
  .queue-panel {
    left: 1.25rem;
    right: auto;
    width: 480px;
  }
}

.header-queue-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--gold-primary);
  color: #000;
  font-size: 0.62rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 0.05rem 0.35rem;
  line-height: 1.2;
}

.btn-danger:hover {
  background: #a93226 !important;
  border-color: #e74c3c !important;
  color: #fff !important;
}

.queue-body {
  gap: 0.75rem;
}

.queue-status-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  max-height: 160px;
}

.queue-item {
  background: #121212;
  border: 1px solid rgba(200, 169, 110, 0.25);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.queue-item.running {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(200, 169, 110, 0.2);
}

.queue-item-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.queue-item-title {
  font-size: 0.76rem;
  color: var(--text-primary);
  font-weight: 600;
}

.queue-item-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.queue-item-tag {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  font-weight: 700;
}

.queue-item-tag.running {
  background: rgba(200, 169, 110, 0.2);
  color: var(--gold-light);
  border: 1px solid var(--gold-primary);
  animation: pulse-glow 2s infinite ease-in-out;
}

.queue-item-tag.pending {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.queue-time-info {
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--gold-light);
  margin-top: 0.15rem;
}

.queue-time-info.pending-time {
  color: var(--text-muted);
}

.countdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--gold-light);
}

.countdown-badge.overtime {
  background: rgba(255, 140, 0, 0.15);
  border-color: rgba(255, 140, 0, 0.4);
  color: #ffaa33;
}

.countdown-badge.pulse {
  animation: pulse-countdown 1.5s infinite ease-in-out;
}

@keyframes pulse-countdown {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1); }
}

/* =========================================================================
   MICE PAINTER CREW OVERLAY (Artistic Whitewash & Scaffolding Animation)
   ========================================================================= */

/* Easel mode when no previous artwork is loaded */
.preview-img-wrapper.priming-canvas {
  display: block !important;
  min-height: 520px;
  background: #181715 radial-gradient(circle at center, #24211c 0%, #121110 100%) !important;
  border: 1px solid rgba(200, 169, 110, 0.35);
}

/* Overlay root container */
.mice-painter-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  overflow: hidden;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mice-painter-overlay.active {
  display: block !important;
  opacity: 1;
}

/* Dynamic HTML5 Paint Canvas */
.mice-paint-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s ease;
}

.mice-painter-overlay.mice-finishing .mice-paint-canvas {
  opacity: 0;
  transform: scale(1.03);
}

/* Mice Stage for Vector Actors & Scaffolding */
.mice-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

/* --- Scaffolding & Construction Props --- */
.mice-scaffold-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 16px;
  background: linear-gradient(180deg, #b07d4b 0%, #7d4e22 55%, #4a2d12 100%);
  border-bottom: 2px solid #2f1b0a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
  z-index: 10;
  transition: transform 0.5s ease-in;
}

.mice-scaffold-top::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(0, 0, 0, 0.15) 40px, rgba(0, 0, 0, 0.15) 42px);
}

/* Suspension ropes */
.mice-rope {
  position: absolute;
  top: -20px;
  width: 3px;
  height: 28px;
  background: repeating-linear-gradient(45deg, #d4b285, #d4b285 3px, #93714b 3px, #93714b 6px);
  box-shadow: 1px 0 3px rgba(0, 0, 0, 0.4);
}
.mice-rope-left { left: 45px; }
.mice-rope-right { right: 45px; }

/* Left Wooden Ladder */
.mice-scaffold-ladder {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 18px;
  width: 38px;
  z-index: 11;
  transition: transform 0.6s ease-in;
}

.ladder-pole {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(90deg, #9c6835, #5f3a18);
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.5);
}
.ladder-pole-left { left: 0; }
.ladder-pole-right { right: 0; }

.ladder-rung {
  position: absolute;
  left: 3px;
  right: 3px;
  height: 5px;
  background: linear-gradient(180deg, #b07d4b, #6b4119);
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* Caution Signboard */
.mice-caution-sign {
  position: absolute;
  top: 26px;
  left: 8px;
  background: linear-gradient(135deg, #f39c12, #d35400);
  color: #fff;
  padding: 4px 8px;
  font-family: var(--font-mono, monospace);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  border-radius: 4px;
  border: 1.5px dashed #fce38a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.65);
  transform-origin: top center;
  animation: sign-sway 4s ease-in-out infinite alternate;
  z-index: 12;
  white-space: nowrap;
}

@keyframes sign-sway {
  0% { transform: rotate(-5deg); }
  100% { transform: rotate(3deg); }
}

/* --- Actor Mice Containers --- */
.mouse-actor {
  position: absolute;
  will-change: transform;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

/* 1. Maestro (Top Director) */
.mouse-maestro-wrap {
  top: -12px;
  left: 35%;
  z-index: 16;
  animation: maestro-patrol 9s ease-in-out infinite;
}

@keyframes maestro-patrol {
  0%, 100% { transform: translateX(0) scaleX(1); }
  45% { transform: translateX(70px) scaleX(1); }
  50% { transform: translateX(70px) scaleX(-1); }
  95% { transform: translateX(0) scaleX(-1); }
}

.mouse-maestro .maestro-arm {
  transform-origin: 38px 40px;
  animation: arm-wave 1.8s ease-in-out infinite alternate;
}

@keyframes arm-wave {
  0% { transform: rotate(-8deg); }
  100% { transform: rotate(18deg); }
}

/* 2. Barnabé (The Roller Mouse) */
.mouse-barnabe-wrap {
  top: 40%;
  left: -90px;
  z-index: 15;
  transition: transform 0.25s linear;
}

.mouse-barnabe .tail-wiggle {
  transform-origin: 20px 44px;
  animation: tail-wag 0.8s ease-in-out infinite alternate;
}

.mouse-barnabe .roller-assembly {
  transform-origin: 48px 34px;
  animation: roller-bob 0.5s ease-in-out infinite alternate;
}

@keyframes roller-bob {
  0% { transform: translateY(-2px) rotate(-3deg); }
  100% { transform: translateY(2px) rotate(4deg); }
}

.mouse-barnabe .foot-left {
  animation: foot-step 0.3s ease-in-out infinite alternate;
}
.mouse-barnabe .foot-right {
  animation: foot-step 0.3s ease-in-out infinite alternate-reverse;
}

@keyframes foot-step {
  0% { transform: translateX(-3px); }
  100% { transform: translateX(3px); }
}

/* 3. Gaston (The Ladder Climber Mouse) */
.mouse-gaston-wrap {
  top: 140px;
  left: 10px;
  z-index: 14;
  animation: gaston-climb 7s ease-in-out infinite alternate;
}

@keyframes gaston-climb {
  0% { transform: translateY(0); }
  50% { transform: translateY(80px); }
  100% { transform: translateY(-40px); }
}

.mouse-gaston .bucket-swing-group {
  transform-origin: 52px 44px;
  animation: bucket-wobble 1.6s ease-in-out infinite alternate;
}

@keyframes bucket-wobble {
  0% { transform: translate(52px, 44px) rotate(-14deg); }
  100% { transform: translate(52px, 44px) rotate(16deg); }
}

/* 4. Pipou (The Splatter Brush Mouse) */
.mouse-pipou-wrap {
  bottom: 12px;
  right: 18px;
  z-index: 15;
}

.mouse-pipou .brush-frenzy-group {
  transform-origin: 30px 32px;
  animation: brush-slosh 0.45s ease-in-out infinite alternate;
}

@keyframes brush-slosh {
  0% { transform: rotate(-24deg); }
  100% { transform: rotate(26deg); }
}

/* Generic tail animation */
@keyframes tail-wag {
  0% { transform: rotate(-10deg); }
  100% { transform: rotate(15deg); }
}

/* --- Comic Speech Bubble --- */
.mouse-speech-bubble {
  position: absolute;
  top: -55px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  color: #1a1a24;
  border: 2px solid #2c3e50;
  border-radius: 12px;
  padding: 5px 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  white-space: nowrap;
  animation: bubble-bounce 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mouse-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px 6px 0 6px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
  display: block;
  width: 0;
}

.mouse-speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 9px 8px 0 8px;
  border-style: solid;
  border-color: #2c3e50 transparent transparent transparent;
  display: block;
  width: 0;
}

@keyframes bubble-bounce {
  0% { transform: translateX(-50%) scale(0.6) translateY(10px); opacity: 0; }
  100% { transform: translateX(-50%) scale(1) translateY(0); opacity: 1; }
}

/* --- Comic Onomatopoeias (Pop effects) --- */
.comic-onomatopoeia {
  position: absolute;
  font-family: "Impact", "Arial Black", -apple-system, sans-serif;
  font-size: 1.1rem;
  font-style: italic;
  font-weight: 900;
  color: #ffdf40;
  text-shadow:
    -1.5px -1.5px 0 #000,
    1.5px -1.5px 0 #000,
    -1.5px 1.5px 0 #000,
    1.5px 1.5px 0 #000,
    0 4px 8px rgba(0,0,0,0.6);
  pointer-events: none;
  z-index: 28;
  animation: splat-burst 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes splat-burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(-15deg); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.2) rotate(6deg); }
  75% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50%, -75%) scale(1.15) rotate(12deg); }
}

/* --- Completion & Scamper Away Animations --- */
.mice-painter-overlay.mice-finishing .mouse-maestro-wrap {
  animation: maestro-exit 0.65s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards !important;
}

.mice-painter-overlay.mice-finishing .mouse-barnabe-wrap {
  animation: barnabe-exit 0.65s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards !important;
}

.mice-painter-overlay.mice-finishing .mouse-gaston-wrap {
  animation: gaston-exit 0.65s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards !important;
}

.mice-painter-overlay.mice-finishing .mouse-pipou-wrap {
  animation: pipou-exit 0.65s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards !important;
}

.mice-painter-overlay.mice-finishing .mice-scaffold-ladder {
  transform: translateY(120%);
}

.mice-painter-overlay.mice-finishing .mice-scaffold-top {
  transform: translateY(-120%);
}

@keyframes maestro-exit {
  0% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-12px) scale(1.1); }
  100% { transform: translateY(-90px) scale(0.6); opacity: 0; }
}

@keyframes barnabe-exit {
  0% { transform: scaleX(1); }
  100% { transform: translateX(450px) scaleX(1.2); opacity: 0; }
}

@keyframes gaston-exit {
  0% { transform: translateY(0); }
  100% { transform: translateY(350px); opacity: 0; }
}

@keyframes pipou-exit {
  0% { transform: scale(1); }
  100% { transform: translateX(250px) scale(0.6); opacity: 0; }
}

/* ==========================================================================
   Model Comparison Preview Deck
   ========================================================================== */
.model-preview-deck {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  margin: 1rem 0 1.25rem 0;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.model-preview-deck:hover {
  border-color: rgba(200, 169, 110, 0.25);
}

.model-preview-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.model-preview-actions-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-preview-mode {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid transparent;
}

.btn-preview-mode.mode-eco {
  background: rgba(133, 227, 179, 0.12);
  border-color: rgba(133, 227, 179, 0.4);
  color: #85e3b3;
}

.btn-preview-mode.mode-eco:hover {
  background: rgba(133, 227, 179, 0.22);
  border-color: rgba(133, 227, 179, 0.7);
}

.btn-preview-mode.mode-live {
  background: rgba(230, 126, 34, 0.15);
  border-color: rgba(230, 126, 34, 0.5);
  color: #e67e22;
  animation: pulse-glow 2s infinite ease-in-out;
}

.btn-preview-mode.mode-live:hover {
  background: rgba(230, 126, 34, 0.25);
  border-color: rgba(230, 126, 34, 0.8);
}

.model-preview-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.model-preview-icon {
  font-size: 1.1rem;
}

.model-preview-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.02em;
}

.model-preview-status {
  font-size: 0.72rem;
  font-family: var(--font-body);
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  transition: all 0.25s ease;
}

.model-preview-status.active-generating {
  color: var(--gold-primary);
  background: rgba(200, 169, 110, 0.1);
  border-color: var(--border-gold);
  animation: pulse-glow 2s infinite ease-in-out;
}

.model-preview-status.all-ready {
  color: #85e3b3;
  background: rgba(133, 227, 179, 0.1);
  border-color: rgba(133, 227, 179, 0.3);
}

.model-preview-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.model-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  min-height: 140px;
}

.preview-model-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #111111;
  border: 1.5px solid var(--border-subtle);
  aspect-ratio: 1 / 1.15;
  cursor: pointer;
  user-select: none;
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1), 
              border-color 0.22s ease, 
              box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
}

.preview-model-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75), 0 0 12px var(--gold-glow);
}

.preview-model-card.active-model {
  border-color: var(--gold-primary);
  box-shadow: 0 0 18px var(--gold-glow);
  outline: 1px solid var(--gold-primary);
}

.preview-model-card.active-model::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--gold-primary);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  z-index: 3;
}

.card-cache-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(10, 10, 10, 0.78);
  backdrop-filter: blur(4px);
  color: var(--gold-light);
  font-size: 0.62rem;
  font-weight: 500;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(200, 169, 110, 0.3);
  z-index: 3;
}

.card-cache-tag.card-masterpiece-tag {
  background: rgba(28, 18, 8, 0.88);
  border-color: rgba(230, 180, 80, 0.6);
  color: #ffda79;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 6px rgba(230, 180, 80, 0.25);
  letter-spacing: 0.02em;
}

.preview-card-img-wrap {
  position: relative;
  width: 100%;
  flex: 1;
  overflow: hidden;
  background: #141414;
}

.preview-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.preview-card-img.loaded {
  opacity: 1;
}

.preview-model-card:hover .preview-card-img.loaded {
  transform: scale(1.05);
}

.card-engine-category-tag {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 2;
}

.preview-card-skeleton.no-spinner {
  background: linear-gradient(135deg, rgba(200, 169, 110, 0.06), rgba(15, 15, 15, 0.85));
  display: flex;
  align-items: center;
  justify-content: center;
}

.engine-badge-placeholder {
  font-size: 0.72rem;
  font-family: var(--font-serif);
  color: var(--text-gold, #c8a96e);
  letter-spacing: 0.05em;
  opacity: 0.85;
}

/* Skeleton Loading Shimmer */
.preview-card-skeleton {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    #141414 0%,
    rgba(200, 169, 110, 0.08) 50%,
    #141414 100%
  );
  background-size: 200% 100%;
  animation: preview-shimmer 1.8s infinite linear;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-skeleton-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(200, 169, 110, 0.2);
  border-top-color: var(--gold-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes preview-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.preview-card-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.45rem 0.5rem;
  background: linear-gradient(to top, rgba(10, 10, 10, 0.95) 0%, rgba(10, 10, 10, 0.6) 70%, transparent 100%);
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.preview-card-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.preview-card-sub {
  font-size: 0.62rem;
  color: var(--gold-light);
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Empty State / Notice */
.preview-grid-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.8rem;
  gap: 0.5rem;
}

.preview-grid-empty-icon {
  font-size: 1.8rem;
  opacity: 0.5;
}

@media (max-width: 600px) {
  .model-preview-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
}

/* ==========================================================================
   Story Director — Sequential Multi-Panel Comic / Manga Studio Styles
   ========================================================================== */

.btn-storydirector {
  background: linear-gradient(135deg, rgba(200, 169, 110, 0.22) 0%, rgba(143, 116, 68, 0.35) 100%);
  border: 1px solid rgba(200, 169, 110, 0.45);
  color: var(--gold-light);
  box-shadow: 0 2px 10px rgba(200, 169, 110, 0.15);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-storydirector:hover {
  background: linear-gradient(135deg, rgba(200, 169, 110, 0.35) 0%, rgba(143, 116, 68, 0.55) 100%);
  border-color: var(--gold-primary);
  box-shadow: 0 4px 16px rgba(200, 169, 110, 0.3);
  transform: translateY(-1px);
}

.sd-header-box {
  background: rgba(200, 169, 110, 0.05);
  border: 1px solid rgba(200, 169, 110, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  backdrop-filter: blur(8px);
}

.sd-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.sd-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.02em;
}

.sd-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  background: rgba(200, 169, 110, 0.15);
  color: var(--gold-primary);
  border: 1px solid rgba(200, 169, 110, 0.3);
}

.sd-subtitle {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* Interactive DAG Progression Stepper */
.sd-dag-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(200, 169, 110, 0.18);
  gap: 0.2rem;
}

.dag-step {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  user-select: none;
}

.dag-step-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
}

.dag-step-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.dag-step:hover .dag-step-dot {
  background: rgba(200, 169, 110, 0.15);
  color: var(--gold-light);
  border-color: rgba(200, 169, 110, 0.35);
}

.dag-step:hover .dag-step-label {
  color: var(--text-primary);
}

.dag-step.active .dag-step-dot {
  background: var(--gold-primary);
  color: #0d0d0d;
  border-color: var(--gold-light);
  box-shadow: 0 0 10px rgba(200, 169, 110, 0.5);
}

.dag-step.active .dag-step-label {
  color: var(--gold-light);
  font-weight: 600;
}

.dag-step-line {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  min-width: 6px;
  border-radius: 1px;
}

.btn-mode-return {
  background: rgba(200, 169, 110, 0.1);
  border: 1px solid rgba(200, 169, 110, 0.28);
  color: var(--gold-light);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-family: var(--font-display);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-mode-return:hover {
  background: rgba(200, 169, 110, 0.22);
  border-color: var(--gold-primary);
  transform: translateY(-1px);
}

.sd-concept-textarea {
  min-height: 54px;
  font-size: 0.82rem;
  line-height: 1.4;
  resize: vertical;
}

.sd-chips-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.sd-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.sd-chip:hover {
  background: rgba(200, 169, 110, 0.12);
  border-color: rgba(200, 169, 110, 0.35);
  color: var(--gold-light);
  transform: translateY(-1px);
}

/* Explicit Level Toggle */
.sd-explicit-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
  height: 38px;
}

.sd-level-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.3rem;
  white-space: nowrap;
}

.sd-level-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.sd-level-btn.active {
  background: rgba(200, 169, 110, 0.18);
  color: var(--gold-light);
  font-weight: 600;
  border: 1px solid rgba(200, 169, 110, 0.35);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Character Anchor Section */
.sd-character-anchor-card {
  background: rgba(18, 18, 18, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 0.65rem;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.sd-anchor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-light);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  user-select: none;
}

.sd-anchor-header:hover {
  background: rgba(200, 169, 110, 0.05);
}

.sd-anchors-body {
  padding: 0.65rem 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Storyboard Toolbar */
.sd-storyboard-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  gap: 0.5rem;
}

.btn-sd-ai {
  background: linear-gradient(135deg, rgba(200, 169, 110, 0.25) 0%, rgba(180, 140, 70, 0.4) 100%);
  border: 1px solid var(--gold-primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(200, 169, 110, 0.2);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-sd-ai:hover {
  background: linear-gradient(135deg, rgba(200, 169, 110, 0.4) 0%, rgba(180, 140, 70, 0.6) 100%);
  box-shadow: 0 4px 16px rgba(200, 169, 110, 0.35);
  transform: translateY(-1px);
}

/* Storyboard Panels Container & Cards */
.sd-panels-container {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.sd-panel-card {
  background: rgba(22, 22, 22, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  position: relative;
  transition: all 0.2s ease;
  border-left: 3px solid var(--gold-dark);
}

.sd-panel-card:hover, .sd-panel-card:focus-within {
  border-color: rgba(200, 169, 110, 0.3);
  border-left-color: var(--gold-primary);
  background: rgba(26, 26, 26, 0.85);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.sd-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  gap: 0.5rem;
}

.sd-panel-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(200, 169, 110, 0.15);
  color: var(--gold-light);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.sd-panel-angle-select {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.74rem;
  padding: 0.25rem 0.4rem;
  outline: none;
}

.sd-panel-angle-select:focus {
  border-color: var(--gold-primary);
}

.sd-panel-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  line-height: 1;
}

.sd-panel-delete-btn:hover {
  color: #ff5555;
  background: rgba(255, 85, 85, 0.1);
}

.sd-panel-desc {
  width: 100%;
  min-height: 48px;
  background: rgba(12, 12, 12, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.76rem;
  padding: 0.35rem 0.5rem;
  line-height: 1.35;
  resize: vertical;
  outline: none;
  margin-bottom: 0.35rem;
}

.sd-panel-desc:focus {
  border-color: var(--gold-primary);
}

/* Panel Dialogue & SFX drawer */
.sd-panel-extras {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.7rem;
}

.sd-extra-field {
  flex: 1;
  min-width: 130px;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  gap: 0.3rem;
}

.sd-extra-field label {
  color: var(--gold-light);
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

.sd-extra-field input, .sd-extra-field select {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.7rem;
  outline: none;
}

/* Assembly Section */
.sd-assembly-section {
  background: rgba(14, 14, 14, 0.85);
  border: 1px solid rgba(200, 169, 110, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.sd-prompt-preview-wrap {
  margin-bottom: 0.65rem;
}

.sd-prompt-preview-text {
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
  font-size: 0.72rem;
  color: #ccc;
  background: rgba(8, 8, 8, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 0.45rem 0.6rem;
  max-height: 85px;
  overflow-y: auto;
  line-height: 1.4;
  word-break: break-word;
  white-space: pre-wrap;
}

.sd-buttons-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* HIL Checkpoint Banner & Buttons */
.sd-hil-banner {
  background: linear-gradient(135deg, rgba(200, 169, 110, 0.12) 0%, rgba(30, 25, 15, 0.9) 100%);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  animation: fadeIn 0.3s ease;
}

.sd-hil-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sd-hil-icon {
  font-size: 1.35rem;
}

.sd-hil-text strong {
  display: block;
  font-size: 0.76rem;
  color: var(--gold-light);
}

.sd-hil-text p {
  margin: 0.15rem 0 0;
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.btn-hil-approve {
  white-space: nowrap;
  font-size: 0.75rem;
  padding: 0.42rem 0.8rem;
  background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
  border: 1px solid rgba(46, 204, 113, 0.6);
  color: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(39, 174, 96, 0.3);
}

.btn-hil-approve:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(39, 174, 96, 0.45);
}

.sd-panel-reroll-btn {
  background: rgba(200, 169, 110, 0.12);
  border: 1px solid rgba(200, 169, 110, 0.3);
  color: var(--gold-light);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sd-panel-reroll-btn:hover {
  background: rgba(200, 169, 110, 0.25);
  border-color: var(--gold-primary);
  transform: translateY(-1px);
}

/* 6-Stage DAG Enhancements & Roster Styling */
.sd-stage-box {
  margin-bottom: 0.75rem;
  animation: fadeIn 0.25s ease;
}

.sd-roster-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.sd-character-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(200, 169, 110, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color 0.2s ease;
}

.sd-character-card:hover {
  border-color: rgba(200, 169, 110, 0.45);
}

.sd-char-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sd-char-badge {
  background: rgba(200, 169, 110, 0.15);
  color: var(--gold-light);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid rgba(200, 169, 110, 0.3);
}

/* Stage 6 Vector Compositor Styles */
.sd-vector-compositor-box {
  background: #080808;
  border: 1px solid rgba(200, 169, 110, 0.35);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6);
}

.sd-vector-svg-container {
  width: 100%;
  max-height: 480px;
  overflow: auto;
  border-radius: 4px;
  background: #111;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sd-vector-svg-container svg {
  max-width: 100%;
  height: auto;
  display: block;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   CHARACTER FASHION STUDIO — THUMB-FIRST PWA UI
   ========================================================================== */
.fs-studio-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 5.5rem; /* Espace pour le dock sticky en bas */
  color: #f4f1ea;
}

.fs-vault-bar, .fs-card, .fs-pro-accordion, .fs-anchor-preview {
  background: rgba(18, 18, 22, 0.92);
  border: 1px solid rgba(200, 169, 110, 0.28);
  border-radius: 14px;
  padding: 1rem;
}

.fs-vault-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.fs-badge-gold {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #c8a96e;
}

.fs-wardrobe-switcher {
  display: flex;
  gap: 0.35rem;
  background: #0d0d10;
  padding: 0.25rem;
  border-radius: 999px;
}

.fs-wstate-btn {
  background: transparent;
  border: none;
  color: #a09d96;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  cursor: pointer;
  min-height: 36px;
}

.fs-wstate-btn.active {
  background: #c8a96e;
  color: #0a0a0c;
  font-weight: 700;
}

/* Carrousel Horizontal du Vault */
.fs-vault-carousel {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: none;
}

.fs-vault-avatar {
  flex: 0 0 auto;
  width: 110px;
  min-height: 96px;
  background: #16161b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.fs-vault-avatar.active {
  border: 2px solid #c8a96e;
  background: rgba(200, 169, 110, 0.14);
  transform: translateY(-2px);
}

.fs-avatar-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c8a96e, #7a5c2e);
  color: #0a0a0c;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Grille d'Archétypes (Touch Targets >= 48px) */
.fs-archetype-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 0.65rem;
  margin: 0.75rem 0;
}

.fs-arch-tile {
  background: #15151a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.85rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: #f4f1ea;
  cursor: pointer;
  min-height: 84px;
}

.fs-arch-tile.active {
  border: 2px solid #c8a96e;
  background: rgba(200, 169, 110, 0.15);
  box-shadow: 0 0 15px rgba(200, 169, 110, 0.25);
}

.fs-arch-icon { font-size: 1.4rem; }
.fs-arch-title { font-weight: 700; font-size: 0.9rem; }
.fs-arch-sub { font-size: 0.75rem; color: #aaa; }

/* Rangées de Chips Tactiles */
.fs-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.45rem;
}

.fs-chip {
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: #1a1a20;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ddd;
  font-size: 0.84rem;
  cursor: pointer;
}

.fs-chip.active {
  background: #c8a96e;
  color: #0a0a0c;
  border-color: #c8a96e;
  font-weight: 700;
}

/* Accordéon Pro (<details>) */
.fs-pro-summary {
  cursor: pointer;
  font-weight: 700;
  color: #c8a96e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  list-style: none;
}

.fs-pro-body {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
}

.fs-input-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.fs-text-input, .fs-select-input {
  flex: 1;
  min-height: 48px;
  background: #0e0e12;
  border: 1px solid rgba(200, 169, 110, 0.35);
  border-radius: 10px;
  color: #fff;
  padding: 0 0.85rem;
  font-size: 0.9rem;
}

/* Dock Sticky en bas (Zone de confort du pouce) */
.fs-sticky-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 10, 14, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(200, 169, 110, 0.35);
  padding: 0.75rem 1rem;
  display: flex;
  gap: 0.75rem;
  z-index: 900;
}

.fs-btn-primary, .fs-btn-secondary, .fs-btn-gold-full {
  min-height: 52px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
}

.fs-btn-primary, .fs-btn-gold-full {
  flex: 2;
  background: linear-gradient(135deg, #d8b87a, #b38f4d);
  color: #0a0a0c;
}

.fs-btn-secondary {
  flex: 1;
  background: #1f1f27;
  color: #f4f1ea;
  border: 1px solid rgba(200, 169, 110, 0.4);
}