@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Pretendard:wght@300;400;500;600;700&display=swap');

/* ─── 2026 Premium Dark Theme Tokens ──────────────────────────────────── */
:root {
  /* Core Surfaces - Deep Dark / Obsidian */
  --bg-base: #121212;
  --bg-app: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100vw" height="100vh"><defs><radialGradient id="glow" cx="50%" cy="0%" r="70%"><stop offset="0%" stop-color="%231a231f" /><stop offset="100%" stop-color="%23121212" /></radialGradient></defs><rect width="100%" height="100%" fill="url(%23glow)" /></svg>');
  --sidebar-bg: #000000;
  --header-bg: rgba(0, 0, 0, 0.75);
  --card-bg: #181818;
  --modal-bg: #282828;

  /* Glassmorphism Borders & Separators */
  --sep: rgba(255, 255, 255, 0.08);
  --sep-strong: rgba(255, 255, 255, 0.15);
  --glass-border: 1px solid rgba(255, 255, 255, 0.05);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.1);

  /* Premium Typography (Bright contrast) */
  --text-main: #FFFFFF;
  --text-muted: #B3B3B3;
  --text-faint: #535353;

  /* Accents - Vibrant Cyber/Neon Elements */
  --accent-primary: #1ED760;
  /* Spotify Neon Green */
  --accent-secondary: #1DB954;
  /* Spotify Green */
  --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  --accent-glow: 0 0 15px rgba(30, 215, 96, 0.3);
  --accent-pale: rgba(30, 215, 96, 0.1);

  /* Status Colors */
  --success: #00FF9D;
  --warning: #FFB800;
  --danger: #FF3B30;

  /* Layout */
  --header-h: 64px;
  --sidebar-w: 460px;

  /* Radii - Modern squircle approximations */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-xl: 20px;
  --r-pill: 9999px;

  /* Fonts */
  --font-sans: 'Pretendard', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  /* Shadows - Ambient & deep */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 24px rgba(30, 215, 96, 0.15);

  /* Animations */
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Custom Global Scrollbar (High Visibility) ─────────────────────── */
::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
  border-left: 1px solid var(--sep);
  border-top: 1px solid var(--sep);
}

::-webkit-scrollbar-thumb {
  background: #333333;
  /* Dark gray */
  border: 3px solid var(--bg-base);
  /* padding effect */
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
  /* Neon green highlight on hover */
}

::-webkit-scrollbar-corner {
  background: var(--bg-base);
}

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

html,
body {
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-base);
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-main);
  background-image: var(--bg-app);
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] {
  display: none !important;
}

/* Scrollbar styling for Webkit */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ─── Modern App Header ──────────────────────────────────────────────────────── */
.app-header {
  height: var(--header-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--header-bg);
  border-bottom: var(--glass-border);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bg-base);
  background: var(--accent-primary);
  padding: 3px 8px;
  border-radius: var(--r-pill);
  box-shadow: var(--accent-glow);
}

.header-brand h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(0, 229, 255, 0.2);
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

/* Status Badge */
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--sep);
  backdrop-filter: blur(8px);
  transition: all 0.3s var(--ease-smooth);
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

.status.idle {
  color: var(--text-muted);
}

.status.idle::before {
  background: var(--text-faint);
  box-shadow: none;
}

.status.working {
  color: var(--accent-primary);
  border-color: var(--accent-pale);
  animation: pulse-border 2s infinite;
}

.status.working::before {
  background: var(--accent-primary);
}

.status.error {
  color: var(--danger);
  border-color: rgba(255, 59, 48, 0.2);
}

.status.error::before {
  background: var(--danger);
}

@keyframes pulse-border {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(30, 215, 96, 0);
  }

  50% {
    box-shadow: 0 0 0 4px rgba(30, 215, 96, 0.2);
  }
}

.api-key-wrap .field-label-xs {
  color: var(--text-muted);
  margin-bottom: 4px;
  display: block;
}

.api-key-row {
  display: flex;
  gap: 8px;
}

.api-key-hint {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-summary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--sep);
}

.user-summary-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-summary-text strong {
  font-size: 0.84rem;
  font-weight: 600;
}

.auth-gate {
  flex: 1;
  min-height: calc(100vh - var(--header-h));
  display: grid;
  grid-template-columns: minmax(280px, 520px) minmax(320px, 620px);
  gap: 32px;
  align-items: center;
  padding: 40px;
  background:
    radial-gradient(circle at top left, rgba(30, 215, 96, 0.18), transparent 35%),
    radial-gradient(circle at bottom right, rgba(29, 185, 84, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.18));
}

.auth-hero {
  max-width: 520px;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: rgba(30, 215, 96, 0.12);
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
}

.auth-hero h2 {
  margin-top: 18px;
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.auth-copy {
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 44ch;
}

.auth-card-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.auth-card {
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid var(--sep);
  border-radius: var(--r-xl);
  padding: 22px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
}

.auth-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

/* ─── Premium Inputs ───────────────────────────────────────────────────────────── */
input,
select,
textarea {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--sep-strong);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--r-sm);
  transition: all 0.25s var(--ease-smooth);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.5);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-pale), inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

input[type="password"] {
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
}

/* ─── Dynamic Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--r-sm);
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent-gradient);
  color: #fff;
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--ease-spring);
  box-shadow: var(--shadow-glow);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 215, 96, 0.25);
}

.btn:hover::before {
  opacity: 1;
}

.btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(30, 215, 96, 0.15);
}

.btn:disabled {
  opacity: 0.5;
  filter: grayscale(0.8);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--sep);
  box-shadow: none;
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--sep-strong);
}

.btn.full {
  width: 100%;
}

.btn.sm {
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: var(--r-xs);
}

/* ─── Sidebar & Steps Layout ─────────────────────────────────────────────────────── */
.app-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--sidebar-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-right: var(--glass-border);
  display: flex;
  flex-direction: column;
  z-index: 10;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

.workflow-steps {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
}

.workflow-step {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--sep);
  border-radius: var(--r-md);
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.4s var(--ease-smooth);
}

.workflow-step.open {
  background: var(--card-bg);
  border-color: var(--sep-strong);
  box-shadow: var(--shadow-md);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text-main);
}

.step-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.step-badge {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--ease-smooth);
}

.workflow-step.open .step-badge {
  background: var(--accent-primary);
  color: #000;
  border-color: transparent;
  box-shadow: 0 0 12px rgba(30, 215, 96, 0.3);
}

.step-title {
  font-size: 0.95rem;
  font-weight: 600;
  flex: 1;
}

.step-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.step-chevron {
  color: var(--text-muted);
  transition: transform 0.3s var(--ease-spring);
}

.workflow-step.open .step-chevron {
  transform: rotate(180deg);
  color: var(--accent-primary);
}

.step-content {
  display: flex;
  flex-direction: column;
  padding: 0 16px 16px;
  animation: slideDown 0.3s var(--ease-smooth);
}

.step-content[hidden] {
  display: none;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sections & Fields */
.step-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-divider {
  border: none;
  border-top: 1px solid var(--sep);
  margin: 8px 0;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.field-inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: -2px;
  margin-bottom: 8px;
}

.field-helper {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.field-label-xs {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.required-dot {
  color: var(--accent-primary);
}

.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* ─── Project List ──────────────────────────────────────────────────────── */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}

.project-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.project-list-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.project-list-item.active {
  background: rgba(30, 215, 96, 0.1);
  border-color: rgba(30, 215, 96, 0.3);
  color: var(--accent-primary);
  font-weight: 500;
}

.pli-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
}

.pli-id {
  font-size: 0.7rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

.pli-delete {
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  opacity: 0;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.project-list-item:hover .pli-delete {
  opacity: 1;
}

.pli-delete:hover {
  background: rgba(255, 59, 48, 0.2);
  color: var(--danger);
}

/* New Project Toggle */
.new-project-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px dashed var(--sep-strong);
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.new-project-toggle:hover,
.new-project-toggle[aria-expanded="true"] {
  background: rgba(30, 215, 96, 0.05);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.new-project-toggle svg {
  flex: 0 0 auto;
  transition: transform 0.3s;
}

.new-project-toggle[aria-expanded="true"] .toggle-chevron {
  transform: rotate(180deg);
}

.new-project-form {
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--r-sm);
  border: 1px solid var(--sep);
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slideDown 0.3s;
}

/* ─── Progress Card ──────────────────────────────────────────────────────── */
.progress-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--sep-strong);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

.progress-card.hidden {
  display: none;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.progress-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.progress-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.progress-ring {
  position: relative;
  width: 48px;
  height: 48px;
}

.progress-ring svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 4;
}

.ring-fill {
  fill: none;
  stroke: var(--accent-gradient);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  transition: stroke-dashoffset 0.4s var(--ease-smooth);
}

.progress-ring>span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-main);
}

.progress-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  width: 0%;
  transition: width 0.4s var(--ease-smooth);
  box-shadow: var(--accent-glow);
}

.progress-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-faint);
}

.progress-steps li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
}

.progress-steps li.active {
  color: var(--accent-primary);
}

.progress-steps li.active::before {
  background: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-primary);
}

.progress-steps li.done {
  color: var(--text-muted);
}

.progress-steps li.done::before {
  background: var(--success);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid var(--sep);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.meta-key {
  color: var(--text-muted);
}

.meta-val {
  color: var(--text-main);
  font-weight: 500;
  font-family: var(--font-mono);
}

/* ─── Main Storyboard Panel ──────────────────────────────────────────────────────── */
.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
}

.main-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--sep);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
}

.main-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-main);
}

.table-wrap {
  flex: 1;
  overflow: auto;
  padding: 0;
  position: relative;
}

table {
  width: 100%;
  min-width: 1300px;
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(10, 10, 14, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--sep-strong);
}

tbody tr {
  background: transparent;
  transition: background 0.2s;
  border-bottom: 1px solid var(--sep);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

tbody td {
  padding: 16px;
  vertical-align: top;
  border-bottom: 1px solid var(--sep);
}

.scene-no,
.chapter,
.est {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.scene-no {
  font-weight: 700;
  color: var(--accent-primary);
}

.narration-cell {
  min-width: 290px;
}

.narration-input {
  width: 100%;
  min-height: 96px;
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--sep);
  border-radius: var(--r-sm);
  color: var(--text-main);
  font-family: var(--font-sans);
  resize: vertical;
}

.duration-hint {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.duration-hint.invalid,
.est.invalid {
  color: var(--danger);
}

.duration-hint.valid,
.est.valid {
  color: var(--accent-primary);
}

.narration {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-main);
  max-width: 280px;
}

.prompt-en,
.prompt-ko,
.video-prompt-en {
  width: 100%;
  min-height: 80px;
  font-size: 0.8rem;
  padding: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--sep);
  border-radius: var(--r-sm);
  color: var(--text-main);
  font-family: var(--font-sans);
}

.preview img {
  width: 160px;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  transition: transform 0.3s;
}

.preview img:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-primary);
}

.scene-status {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Table Actions grid */
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.tiny,
.upload-label {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--sep);
  color: var(--text-main);
  padding: 6px 8px;
  border-radius: var(--r-xs);
  font-size: 0.75rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.tiny:hover,
.upload-label:hover {
  background: var(--accent-pale);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.upload-input {
  display: none;
}

.refine-select {
  grid-column: 1/-1;
  padding: 6px;
  font-size: 0.75rem;
}

/* ─── Empty State (Cinematic & Breathtaking) ────────────────────────────────── */
.table-empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(30, 215, 96, 0.05) 0%, rgba(18, 18, 18, 0.8) 100%);
}

.table-empty-state[hidden] {
  display: none !important;
}

.empty-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
  color: var(--accent-primary);
  filter: drop-shadow(0 0 20px rgba(30, 215, 96, 0.3));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.empty-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  color: #fff;
}

.empty-desc {
  font-size: 1rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  max-width: 400px;
  margin-bottom: 32px;
}

.empty-steps {
  list-style: none;
  display: flex;
  gap: 40px;
}

.empty-steps li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  width: 120px;
}

.es-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--sep-strong);
  color: var(--text-main);
  font-size: 1.2rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s;
}

.empty-steps li:hover .es-badge {
  border-color: var(--accent-primary);
  background: var(--accent-pale);
  color: var(--accent-primary);
  box-shadow: var(--accent-glow);
}

/* ─── Modals ──────────────────────────────────────────────────────── */
.modal-backdrop,
.image-viewer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.image-viewer-backdrop:not([hidden]) {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--modal-bg);
  border: 1px solid var(--sep-strong);
  border-radius: var(--r-xl);
  padding: 32px;
  width: 400px;
  box-shadow: var(--shadow-md), 0 0 1px rgba(255, 255, 255, 0.2) inset;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s var(--ease-spring);
}

.modal-backdrop.open .modal {
  transform: scale(1) translateY(0);
}

.modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 184, 0, 0.1);
  color: var(--warning);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.image-viewer {
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  max-width: 90vw;
  max-height: 90vh;
}

.image-viewer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.image-viewer-title {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.image-viewer-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-viewer-body img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--r-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

/* ─── Responsive Adjustments ────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  :root {
    --sidebar-w: 380px;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 320px;
  }

  .field-row,
  .empty-steps {
    flex-direction: column;
    gap: 12px;
  }

  .empty-steps li {
    flex-direction: row;
    text-align: left;
    width: auto;
    align-items: center;
  }
}
