/* ============ Pixel Portal — Shot List ============ */

:root {
  /* Brand */
  --accent: #5BD68C;
  --accent-hi: #7DE3A4;
  --accent-lo: #3CB46E;
  --accent-glow: rgba(91, 214, 140, 0.32);
  --accent-soft: rgba(91, 214, 140, 0.12);
  --accent-text: #0a1f14;

  /* Surfaces (dark) */
  --bg: #0a0d0c;
  --bg-grad-1: #0f1411;
  --bg-grad-2: #0a0d0c;
  --surface-0: #121815;
  --surface-1: #161d1a;
  --surface-2: #1c2521;
  --surface-3: #232d28;
  --surface-hi: #2a3530;
  --rail: #08110d;

  /* Text */
  --text: #ecf2ee;
  --text-2: #b8c4be;
  --text-3: #7a8682;
  --text-4: #525c58;

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-2: rgba(255, 255, 255, 0.10);
  --border-hi: rgba(91, 214, 140, 0.35);

  /* Shadows — layered for depth */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.35), 0 1px 1px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.40), 0 2px 4px rgba(0,0,0,0.30), inset 0 1px 0 rgba(255,255,255,0.04);
  --shadow-lg: 0 16px 32px rgba(0,0,0,0.50), 0 6px 12px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.05);
  --shadow-xl: 0 28px 56px rgba(0,0,0,0.55), 0 12px 24px rgba(0,0,0,0.40), inset 0 1px 0 rgba(255,255,255,0.06);
  --shadow-inset: inset 0 1px 2px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 0 1px var(--border-hi), 0 8px 24px var(--accent-glow);

  /* Status colors */
  --status-approved: #5BD68C;
  --status-approved-bg: rgba(91, 214, 140, 0.14);
  --status-review: #F5C26B;
  --status-review-bg: rgba(245, 194, 107, 0.14);
  --status-draft: #8A98A4;
  --status-draft-bg: rgba(138, 152, 164, 0.14);

  /* Type */
  --font-sans: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Bricolage Grotesque', 'Inter Tight', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
  --font-brand: 'Syne Mono', 'JetBrains Mono', ui-monospace, monospace;

  /* Layout */
  --rail-w: 72px;
  --rail-w-expanded: 232px;
  --header-h: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  --accent: #1a9b58;
  --accent-hi: #22b769;
  --accent-lo: #14784a;
  --accent-glow: rgba(26, 155, 88, 0.20);
  --accent-soft: rgba(26, 155, 88, 0.08);
  --accent-text: #ffffff;

  --bg: #f4f1ea;
  --bg-grad-1: #f7f4ed;
  --bg-grad-2: #ebe7dd;
  --surface-0: #ffffff;
  --surface-1: #fbf9f4;
  --surface-2: #f1ede4;
  --surface-3: #e7e2d6;
  --surface-hi: #ddd8c9;
  --rail: #1c2521;

  --text: #1a1f1c;
  --text-2: #4a544f;
  --text-3: #6f7a75;
  --text-4: #8a9590;

  --border: rgba(20, 30, 25, 0.08);
  --border-2: rgba(20, 30, 25, 0.14);
  --border-hi: rgba(26, 155, 88, 0.40);

  --shadow-sm: 0 1px 2px rgba(40,30,15,0.06);
  --shadow-md: 0 4px 8px rgba(40,30,15,0.08), 0 2px 4px rgba(40,30,15,0.05);
  --shadow-lg: 0 16px 32px rgba(40,30,15,0.10), 0 6px 12px rgba(40,30,15,0.06);
  --shadow-xl: 0 28px 56px rgba(40,30,15,0.14), 0 12px 24px rgba(40,30,15,0.08);
  --shadow-inset: inset 0 1px 2px rgba(40,30,15,0.06);
  --shadow-glow: 0 0 0 1px var(--border-hi), 0 8px 24px var(--accent-glow);

  --status-approved: #14784a;
  --status-approved-bg: rgba(26, 155, 88, 0.14);
  --status-review: #B8841C;
  --status-review-bg: rgba(245, 194, 107, 0.22);
  --status-draft: #5e6a64;
  --status-draft-bg: rgba(94, 106, 100, 0.10);
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  letter-spacing: -0.005em;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }
::selection { background: var(--accent); color: var(--accent-text); }

/* ===== App shell ===== */
.app {
  height: 100vh;
  width: 100vw;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(91,214,140,0.06), transparent 60%),
    radial-gradient(800px 500px at -10% 80%, rgba(91,214,140,0.04), transparent 60%),
    linear-gradient(180deg, var(--bg-grad-1), var(--bg-grad-2));
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .app {
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(26,155,88,0.05), transparent 60%),
    linear-gradient(180deg, var(--bg-grad-1), var(--bg-grad-2));
}

/* ===== Sidebar rail ===== */
.rail {
  background: var(--rail);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  gap: 4px;
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: var(--rail-w);
  z-index: 50;
  overflow: hidden;
  transition: width 0.32s var(--ease), box-shadow 0.32s var(--ease);
}
.app:not(.rail-expanded) .rail:hover,
.app.rail-expanded .rail {
  width: var(--rail-w-expanded);
  box-shadow: 14px 0 40px rgba(0,0,0,0.45);
}
[data-theme="light"] .rail {
  background: linear-gradient(180deg, #1c2521, #161d1a);
}
.rail-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 8px;
  margin-bottom: 14px;
  color: #fff;
}
.rail-logo-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-hi), var(--accent-lo));
  display: grid; place-items: center;
  box-shadow:
    0 2px 8px var(--accent-glow),
    inset 0 1px 0 rgba(255,255,255,0.3),
    inset 0 -2px 4px rgba(0,0,0,0.2);
  flex-shrink: 0;
}
.rail-logo-mark svg { width: 20px; height: 20px; color: var(--accent-text); }
.rail-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: #fff;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  pointer-events: none;
}
.app.rail-expanded .rail-logo-text,
.app:not(.rail-expanded) .rail:hover .rail-logo-text {
  opacity: 1;
  transform: translateX(0);
}
.rail-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  padding: 16px 10px 6px;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  white-space: nowrap;
  height: 0;
  overflow: hidden;
}
.app.rail-expanded .rail-section-label,
.app:not(.rail-expanded) .rail:hover .rail-section-label {
  opacity: 1;
  height: auto;
}
.rail-item {
  display: flex; align-items: center; gap: 14px;
  padding: 10px;
  border-radius: 8px;
  color: rgba(255,255,255,0.62);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.18s var(--ease);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}
.rail-item:link, .rail-item:visited, .rail-item:hover, .rail-item:active { text-decoration: none; }
.rail-item:hover { color: #fff; background: rgba(255,255,255,0.05); }
.rail-item.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(91,214,140,0.16), rgba(91,214,140,0.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), inset 0 0 0 1px rgba(91,214,140,0.18);
}
.rail-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 12px var(--accent-glow);
}
.rail-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.rail-item-label {
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  pointer-events: none;
}
.app.rail-expanded .rail-item-label,
.app:not(.rail-expanded) .rail:hover .rail-item-label {
  opacity: 1;
  transform: translateX(0);
}
.rail-spacer { flex: 1; }
.rail-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.5);
  margin: 8px auto 0;
  transition: all 0.2s var(--ease);
}
.rail-toggle:hover { background: rgba(255,255,255,0.10); color: #fff; }
.rail-toggle svg { width: 14px; height: 14px; transition: transform 0.3s var(--ease); }
.app.rail-expanded .rail-toggle svg { transform: rotate(180deg); }

/* ===== Main column ===== */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  margin-left: var(--rail-w);
  height: 100vh;
  transition: margin-left 0.32s var(--ease);
}
.app.rail-expanded .main { margin-left: var(--rail-w-expanded); }

/* ===== Mobile: hide the rail entirely, give content the full viewport ===== */
@media (max-width: 720px) {
  .rail { display: none; }
  .main, .app.rail-expanded .main { margin-left: 0; }
  .header { padding: 0 14px; gap: 8px; }
  .subheader { padding: 16px 14px 12px; gap: 14px; }
  .subheader h1 { font-size: 24px; }
  .subheader-meta { font-size: 12px; }
}
@media (max-width: 540px) {
  .subheader { flex-direction: column; align-items: flex-start; }
  .subheader-right { flex-direction: row; align-items: center; align-self: stretch; justify-content: flex-start; flex-wrap: wrap; }
}

/* ===== Top header ===== */
.header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  background: linear-gradient(180deg, rgba(0,0,0,0.25), transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 4;
}
[data-theme="light"] .header {
  background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0.4));
}
.site-title {
  font-family: var(--font-brand);
  font-weight: 400;          /* Syne Mono only ships at 400 */
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  padding: 4px 0;
  flex-shrink: 0;
  transition: color 0.15s var(--ease);
}
.site-title:hover { color: var(--accent); }
.site-title-divider {
  width: 1px;
  height: 22px;
  background: var(--border-2);
  flex-shrink: 0;
}

.crumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--text-3);
}
.crumb-active { color: var(--text); font-weight: 500; }
.crumb-sep { color: var(--text-4); }

/* On narrow screens, drop the breadcrumb so the brand and actions
   have room to breathe. */
@media (max-width: 540px) {
  .site-title { font-size: 19px; }
  .site-title-divider, .crumbs { display: none; }
}

.header-search {
  flex: 1;
  max-width: 380px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-3);
  font-size: 13px;
  transition: all 0.2s var(--ease);
  margin-left: 16px;
}
.header-search:focus-within {
  border-color: var(--border-hi);
  box-shadow: 0 0 0 4px var(--accent-soft);
  color: var(--text);
}
.header-search svg { width: 14px; height: 14px; flex-shrink: 0; }
.header-search input {
  flex: 1;
  background: none; border: none; outline: none;
  color: var(--text);
  font-size: 13px;
  min-width: 0;
}
.header-search input::placeholder { color: var(--text-3); }

.header-spacer { flex: 1; }

.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--text-2);
  background: var(--surface-1);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.18s var(--ease);
}
.icon-btn:hover {
  color: var(--text);
  background: var(--surface-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.icon-btn svg { width: 16px; height: 16px; }

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F5C26B, #D97757);
  display: grid; place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.25);
  border: 1px solid var(--border-2);
}

/* ===== Project sub-header ===== */
.subheader {
  padding: 22px 32px 18px;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  flex-shrink: 0;
}
.subheader-left { flex: 1; min-width: 0; }
.subheader-eyebrow {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.subheader-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.subheader h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
  line-height: 1.05;
  color: var(--text);
}
.subheader-meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-size: 12.5px;
  color: var(--text-3);
}
.subheader-meta strong {
  color: var(--text-2);
  font-weight: 500;
}
.subheader-meta .sep { color: var(--text-4); }

.subheader-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* progress chip */
.progress-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 8px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
}
.progress-track {
  width: 100px; height: 4px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-lo), var(--accent-hi));
  box-shadow: 0 0 8px var(--accent-glow);
  transition: width 0.4s var(--ease);
}

/* ===== Toolbar ===== */
.toolbar {
  padding: 12px 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.seg {
  display: inline-flex;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  gap: 2px;
}
.seg button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-3);
  transition: all 0.16s var(--ease);
}
.seg button svg { width: 14px; height: 14px; }
.seg button:hover { color: var(--text-2); }
.seg button.active {
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  color: var(--text);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 0 0 1px rgba(91,214,140,0.18);
}
[data-theme="light"] .seg button.active {
  background: var(--surface-0);
  box-shadow:
    var(--shadow-sm),
    inset 0 0 0 1px rgba(26,155,88,0.25);
}

.toolbar-spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
  transition: all 0.16s var(--ease);
}
.btn:hover {
  background: var(--surface-2);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn svg { width: 14px; height: 14px; }

.btn-primary {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  color: var(--accent-text);
  border: 1px solid var(--accent-lo);
  font-weight: 600;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.25) inset,
    0 -1px 0 rgba(0,0,0,0.15) inset,
    0 4px 12px var(--accent-glow),
    0 2px 4px rgba(0,0,0,0.2);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #8DEEB2, var(--accent-hi));
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.3) inset,
    0 -1px 0 rgba(0,0,0,0.15) inset,
    0 8px 20px var(--accent-glow),
    0 3px 6px rgba(0,0,0,0.25);
}
.btn-primary svg { width: 14px; height: 14px; }

/* ===== Scroll area ===== */
.scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 32px 80px;
  scroll-behavior: smooth;
}
.scroll::-webkit-scrollbar { width: 12px; }
.scroll::-webkit-scrollbar-track { background: transparent; }
.scroll::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
.scroll::-webkit-scrollbar-thumb:hover { background: var(--surface-hi); background-clip: padding-box; border: 3px solid transparent; }

/* ===== Scene group ===== */
.scene {
  margin-top: 24px;
}
.scene-header {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s var(--ease);
}
.scene-header:hover { opacity: 0.85; }
.scene-chev {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  color: var(--text-3);
  transition: transform 0.25s var(--ease);
}
.scene-chev svg { width: 14px; height: 14px; }
.scene.collapsed .scene-chev { transform: rotate(-90deg); }
.scene-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}
.scene-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
}
.scene-count {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  margin-left: 4px;
}
.scene-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-2), transparent);
  margin: 0 8px;
}
.scene-actions { display: flex; gap: 4px; }
.scene-actions .icon-btn {
  width: 28px; height: 28px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.scene-actions .icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--border);
}
.scene-body {
  display: grid;
  gap: 16px;
  padding-top: 6px;
  overflow: hidden;
  transition: max-height 0.4s var(--ease), opacity 0.3s var(--ease), padding 0.3s var(--ease);
}
.scene.collapsed .scene-body {
  max-height: 0 !important;
  opacity: 0;
  padding-top: 0;
}

/* Thin add-shot bar (used when last grid row is full) */
.scene-body.has-card-add { /* default — add card lives inside grid */ }
.add-shot-bar {
  margin-top: 14px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-1);
  border: 1px dashed var(--border-2);
  border-radius: 10px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: all 0.16s var(--ease);
}
.add-shot-bar:hover {
  background: var(--surface-2);
  color: var(--accent);
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.add-shot-bar svg { width: 14px; height: 14px; }

/* Scene title inline-editable */
.scene-title-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  flex: 0 1 auto;
  min-width: 0;
}
.scene-title-input {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 7px;
  margin: -3px -7px;
  width: auto;
  min-width: 120px;
  flex: 0 0 auto;
  field-sizing: content;
  transition: all 0.15s var(--ease);
}
.scene-title-input:hover {
  background: var(--surface-1);
  border-color: var(--border);
}
.scene-title-input:focus {
  background: var(--surface-1);
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}

/* Add-a-scene button — green accent, matches add-shot bar dimensions */
.add-scene-bar {
  margin-top: 32px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: color-mix(in oklab, var(--accent) 10%, var(--surface-1));
  border: 1px dashed color-mix(in oklab, var(--accent) 50%, var(--border-2));
  border-radius: 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: all 0.16s var(--ease);
}
.add-scene-bar:hover {
  background: color-mix(in oklab, var(--accent) 16%, var(--surface-1));
  border-color: color-mix(in oklab, var(--accent) 75%, var(--border-2));
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.add-scene-bar svg { width: 14px; height: 14px; }

/* Grey dot for custom-field markers */
.di-dot-grey { background: var(--text-4) !important; }

/* Data Input — single ordered list with drag-reorder */
.di-list {
  display: flex; flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.di-row {
  position: relative;
  display: grid;
  grid-template-columns: 22px 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.15s var(--ease);
}
.di-row:hover { border-color: var(--border-2); background: var(--surface-2); }
.di-row.off { opacity: 0.55; }
.di-row.dragging { opacity: 0.35; }
.di-row.drop-before::before,
.di-row.drop-after::after {
  content: '';
  position: absolute;
  left: 0; right: 0; height: 2px;
  background: var(--accent);
  border-radius: 999px;
  box-shadow: 0 0 8px var(--accent-glow);
}
.di-row.drop-before::before { top: -3px; }
.di-row.drop-after::after { bottom: -3px; }
.di-handle {
  cursor: grab;
  color: var(--text-4);
  display: grid; place-items: center;
}
.di-handle:active { cursor: grabbing; }
.di-handle svg { width: 14px; height: 14px; }
.di-row-icon {
  display: grid; place-items: center;
  color: var(--text-3);
}
.di-row-icon svg { width: 16px; height: 16px; }
.di-row-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}
.di-row-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13.5px;
  color: var(--text);
  width: 100%;
}
.di-row-input:hover { background: var(--surface-0); border-color: var(--border); }
.di-row-input:focus { background: var(--surface-0); border-color: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-glow); outline: none; }
.di-add-custom { width: 100%; justify-content: center; margin-bottom: 4px; }

/* Crew grid — 2x2 of locked crew fields */
.crew-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.crew-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.crew-cell-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
}
.crew-cell input { width: 100%; }

/* Toast — bottom center, fades in/out */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--surface-3);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: toast-in 0.18s var(--ease);
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Empty/dash field appearance — placeholder shows as muted dash */
.row-control.is-empty,
.row-control.is-empty::placeholder {
  color: var(--text-4);
}
.row-control.is-empty {
  font-style: normal;
}

/* ===== Cards grid ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.shot-card {
  background: linear-gradient(180deg, var(--surface-1), var(--surface-0));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s var(--ease), opacity 0.18s var(--ease);
  position: relative;
  display: flex;
  flex-direction: column;
}
.shot-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-2);
}
.shot-card.dragging {
  opacity: 0.35;
  transform: scale(0.98);
}
.shot-card.drop-before::before,
.shot-card.drop-after::after {
  content: '';
  position: absolute;
  left: -8px; right: -8px;
  height: 3px;
  background: var(--accent);
  border-radius: 999px;
  box-shadow: 0 0 12px var(--accent-glow);
  pointer-events: none;
  z-index: 5;
}
.shot-card.drop-before::before { top: -10px; }
.shot-card.drop-after::after { bottom: -10px; }

.shot-thumb {
  position: relative;
  width: 100%;
  background: var(--surface-2);
  overflow: hidden;
}
.shot-thumb.ar-16-9 { aspect-ratio: 16 / 9; }
.shot-thumb.ar-4-3  { aspect-ratio: 4 / 3; }
.shot-thumb.ar-1-1  { aspect-ratio: 1 / 1; }
.shot-thumb img,
.shot-thumb .thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease);
}
.shot-card:hover .thumb-img { transform: scale(1.04); }
.thumb-img {
  background-size: cover;
  background-position: center;
}
.thumb-empty {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,0.015),
      rgba(255,255,255,0.015) 8px,
      rgba(255,255,255,0.04) 8px,
      rgba(255,255,255,0.04) 16px
    );
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-size: 12px;
  font-weight: 500;
}
.thumb-empty:hover {
  color: var(--accent);
  background:
    repeating-linear-gradient(
      45deg,
      rgba(91,214,140,0.04),
      rgba(91,214,140,0.04) 8px,
      rgba(91,214,140,0.08) 8px,
      rgba(91,214,140,0.08) 16px
    );
}
.thumb-empty svg { width: 24px; height: 24px; opacity: 0.6; }
.thumb-empty:hover svg { opacity: 1; }
.thumb-empty .upload-hint {
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* file-drop drag-over */
.shot-thumb.file-over .thumb-empty,
.shot-thumb.file-over::after {
  color: var(--accent);
}
.shot-thumb.file-over {
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
}

.shot-num-badge {
  position: absolute;
  top: 10px; left: 10px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.12);
  letter-spacing: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.08);
}

/* Drag handle on the card */
.card-drag-handle {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  width: 32px; height: 18px;
  display: grid; place-items: center;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  opacity: 0;
  cursor: grab;
  transition: opacity 0.18s var(--ease);
  z-index: 3;
}
.shot-card:hover .card-drag-handle { opacity: 0.9; }
.card-drag-handle:active { cursor: grabbing; }
.card-drag-handle svg { width: 14px; height: 14px; }

.shot-status-badge {
  position: absolute;
  top: 10px; right: 10px;
}

.shot-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.55));
  opacity: 0;
  transition: opacity 0.22s var(--ease);
  display: flex;
  align-items: flex-end;
  padding: 10px;
  gap: 6px;
}
.shot-card:hover .shot-thumb-overlay { opacity: 1; }
.thumb-action {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.18);
  display: grid; place-items: center;
  color: #fff;
  transition: all 0.18s var(--ease);
}
.thumb-action:hover { background: var(--accent); color: var(--accent-text); border-color: var(--accent); transform: scale(1.06); }
.thumb-action svg { width: 14px; height: 14px; }
.thumb-action.primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* ===== Inline-form card body ===== */
.shot-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.inline-input,
.inline-textarea,
.inline-select {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 8px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  width: 100%;
  outline: none;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  margin: 0 -8px;
  width: calc(100% + 16px);
}
.inline-input:hover,
.inline-textarea:hover,
.inline-select:hover {
  background: var(--surface-2);
  border-color: var(--border);
}
.inline-input:focus,
.inline-textarea:focus,
.inline-select:focus {
  background: var(--surface-2);
  border-color: var(--border-hi);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.inline-input.title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.inline-textarea {
  resize: none;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.45;
  min-height: 38px;
}
.inline-textarea::placeholder,
.inline-input::placeholder { color: var(--text-4); }

.shot-form-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  margin: 0 -8px;
  border-radius: 6px;
  transition: background 0.15s var(--ease);
}
.shot-form-row:hover { background: var(--surface-2); }
.shot-form-row .row-icon {
  width: 14px; height: 14px;
  color: var(--text-4);
  flex-shrink: 0;
}
.shot-form-row .row-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-4);
  white-space: nowrap;
  width: 50px;
}
.shot-form-row .row-control {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 0;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.shot-form-row .row-control:focus {
  outline: none;
}
.shot-form-row select.row-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%237a8682' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 18px;
}
.shot-form-row select.row-control option {
  background: var(--surface-1);
  color: var(--text);
}

.shot-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  padding-top: 4px;
  margin-top: 2px;
  border-top: 1px dashed var(--border);
}
.shot-form-grid.full {
  grid-template-columns: 1fr;
  gap: 2px;
}
.shot-form-grid.full .shot-form-row {
  grid-template-columns: 16px auto 1fr;
  padding: 6px 8px;
}
.row-label-full {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
  min-width: 78px;
}

.shot-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}
.shot-status-row .quick-actions { display: flex; gap: 2px; }
.shot-status-row .quick-actions .icon-btn {
  width: 28px; height: 28px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.shot-status-row .quick-actions .icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

.shot-tags {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  letter-spacing: 0.01em;
}
.tag.tag-mono { font-family: var(--font-mono); font-size: 10px; }
.tag svg { width: 10px; height: 10px; opacity: 0.7; }

/* Status pill */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  letter-spacing: 0.01em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid transparent;
  white-space: nowrap;
}
.status-pill .pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.status-pill.approved {
  color: var(--status-approved);
  background: var(--status-approved-bg);
  border-color: rgba(91,214,140,0.25);
}
.status-pill.review {
  color: var(--status-review);
  background: var(--status-review-bg);
  border-color: rgba(245,194,107,0.25);
}
.status-pill.draft {
  color: var(--status-draft);
  background: var(--status-draft-bg);
  border-color: rgba(138,152,164,0.20);
}

/* ===== Add card ===== */
.add-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  background: transparent;
  border: 1.5px dashed var(--border-2);
  border-radius: var(--radius-lg);
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
  min-height: 240px;
  padding: 32px 16px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  box-shadow: none;
}
.shot-card.add-card:hover {
  background: var(--surface-1);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.add-card-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface-1);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  transition: all 0.2s var(--ease);
}
.shot-card.add-card:hover .add-card-icon {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.add-card-icon svg { width: 18px; height: 18px; }

/* ===== Table view ===== */
.table-wrap {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-top: 16px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: auto;
}
.table thead { background: var(--surface-2); }
.table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}

/* Hover state — apply to the whole row, not per-cell, so no artifacts */
.table .tbl-row { cursor: pointer; transition: background 0.12s var(--ease); }
.table .tbl-row:hover { background: var(--surface-2); }
.table .tbl-row.is-open { background: var(--surface-2); }
.table .tbl-row.dragging { opacity: 0.4; }
.table .tbl-row.drop-before > td:first-child { box-shadow: inset 0 3px 0 0 var(--accent); }
.table .tbl-row.drop-after  > td:first-child { box-shadow: inset 0 -3px 0 0 var(--accent); }
.table tbody tr:last-child td { border-bottom: none; }

/* Column sizing */
.table .col-drag,
.table .col-drag-h {
  width: 28px;
  padding-left: 12px;
  padding-right: 0;
  color: var(--text-4);
}
.table .col-drag { cursor: grab; }
.table .col-drag:active { cursor: grabbing; }
.table .col-drag svg { width: 14px; height: 14px; }
.table .col-drag:hover { color: var(--text-2); }

.table .col-num,
.table .col-num-h {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  width: 44px;
  text-align: center;
  padding-left: 0;
  padding-right: 0;
}

.table .col-thumb-h,
.table .col-thumb {
  width: 1px;
  padding: 10px 12px;
}
.tbl-thumb {
  position: relative;
  width: var(--tbl-thumb-w, 200px);
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.tbl-ar-16-9 .tbl-thumb { aspect-ratio: 16 / 9; --tbl-thumb-w: 200px; }
.tbl-ar-4-3  .tbl-thumb { aspect-ratio: 4 / 3;  --tbl-thumb-w: 168px; }
.tbl-ar-1-1  .tbl-thumb { aspect-ratio: 1 / 1;  --tbl-thumb-w: 130px; }
.tbl-thumb:hover { border-color: var(--text-4); box-shadow: var(--shadow-sm); }
.tbl-thumb.file-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 30%, transparent);
}
.tbl-thumb-img {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
}
.tbl-thumb-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-4);
}
.tbl-thumb-empty svg { width: 24px; height: 24px; }
.tbl-thumb:hover .tbl-thumb-empty { color: var(--text-2); }
.tbl-thumb-clear {
  position: absolute;
  top: 6px; right: 6px;
  width: 24px; height: 24px;
  display: none;
  align-items: center; justify-content: center;
  background: color-mix(in oklch, black 60%, transparent);
  color: white;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  padding: 0;
  backdrop-filter: blur(6px);
}
.tbl-thumb-clear svg { width: 12px; height: 12px; }
.tbl-thumb:hover .tbl-thumb-clear { display: flex; }
.tbl-thumb-clear:hover { background: var(--status-draft); }

/* Inline editable text cells */
.tbl-input {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 9px;
  font: inherit;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  transition: background 0.12s var(--ease), border-color 0.12s var(--ease);
  resize: none;
  font-family: inherit;
  box-sizing: border-box;
}
.tbl-input.mono { font-family: var(--font-mono); font-size: 12px; }
.tbl-input.title { font-weight: 500; color: var(--text); }
.tbl-input.is-empty { color: var(--text-4); }
.tbl-input.multi {
  min-height: 52px;
  field-sizing: content;
  max-height: 200px;
}
.tbl-input::placeholder { color: var(--text-4); }
.tbl-input:hover { border-color: var(--border); }
.tbl-input:focus {
  outline: none;
  background: var(--surface-1);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 18%, transparent);
}

.tbl-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%237a8682' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px;
  padding-right: 24px;
  cursor: pointer;
}
.tbl-select option { background: var(--surface-1); color: var(--text); }

.table .col-title-h,
.table .col-title { min-width: 180px; max-width: 280px; }

/* Summary column — flex-grow, single line, muted */
.table .col-summary-h,
.table .col-summary { width: auto; }
.tbl-summary {
  display: block;
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  letter-spacing: 0.005em;
}
.tbl-summary.is-empty { color: var(--text-4); font-style: italic; }

.table .col-status-h,
.table .col-status { width: 1px; white-space: nowrap; }

.table .col-actions-h,
.table .col-actions {
  width: 1px;
  white-space: nowrap;
  padding-right: 8px;
  padding-left: 8px;
}
.col-actions-inner { display: inline-flex; gap: 2px; align-items: center; }

/* Expand chevron column */
.table .col-expand-h,
.table .col-expand {
  width: 32px;
  padding-left: 4px;
  padding-right: 14px;
  color: var(--text-4);
}
.tbl-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 5px;
  transition: transform 0.18s var(--ease), color 0.12s var(--ease);
}
.tbl-row:hover .tbl-chevron { color: var(--text-2); }
.tbl-chevron.open { transform: rotate(180deg); color: var(--text); }

/* Detail row — expanded panel */
.tbl-detail-row > td {
  padding: 0;
  background: var(--surface-0);
  border-bottom: 1px solid var(--border);
}
.tbl-detail {
  padding: 18px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: tbl-detail-in 0.18s var(--ease);
}
@keyframes tbl-detail-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.tbl-detail-section { display: flex; flex-direction: column; gap: 6px; }
.tbl-detail-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.tbl-detail-icon { width: 12px; height: 12px; color: var(--text-3); }
.tbl-detail-dot  { width: 8px; height: 8px; }
.tbl-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px 18px;
}
.tbl-detail-field { display: flex; flex-direction: column; gap: 6px; }

/* Scene divider rows */
.table-scene-row td {
  background: var(--surface-2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--text);
  padding: 10px 14px;
}
.table-scene-row:hover td { background: var(--surface-2); }
.table-scene-row .scene-num { display: inline-block; margin-right: 8px; }
.table-scene-row .scene-row-meta {
  color: var(--text-3);
  font-weight: 400;
  margin-left: 8px;
  font-family: var(--font-sans);
  font-size: 12px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-3);
}

/* ===== Aspect ratio picker (matches .seg styling) ===== */
.ar-picker {
  display: inline-flex;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  gap: 2px;
}
.ar-picker button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: -0.005em;
  transition: all 0.16s var(--ease);
}
.ar-picker button:hover { color: var(--text-2); }
.ar-picker button.active {
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  color: var(--text);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 0 0 1px rgba(91,214,140,0.18);
}
[data-theme="light"] .ar-picker button.active {
  background: var(--surface-0);
  box-shadow:
    var(--shadow-sm),
    inset 0 0 0 1px rgba(26,155,88,0.25);
}
.ar-shape {
  background: currentColor;
  border-radius: 1.5px;
  opacity: 0.85;
  flex-shrink: 0;
}
.ar-shape.ar-16-9 { width: 14px; height: 8px; }
.ar-shape.ar-4-3  { width: 12px; height: 9px; }
.ar-shape.ar-1-1  { width: 10px; height: 10px; }

.modal-wide { width: min(640px, 92vw); }

.repeater {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.repeater-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.repeater-row input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: all 0.18s var(--ease);
}
.repeater-row input:focus {
  border-color: var(--border-hi);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.btn-ghost {
  background: transparent;
  border: 1px dashed var(--border-2);
  color: var(--text-3);
  box-shadow: none;
  align-self: flex-start;
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--accent);
  border-color: var(--accent);
}

/* Data Input modal */
.di-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.di-section-hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-4);
  text-transform: none;
  letter-spacing: 0;
}
.di-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}
.di-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: left;
  transition: all 0.18s var(--ease);
  box-shadow: var(--shadow-sm);
}
.di-card:hover {
  border-color: var(--border-2);
  background: var(--surface-3);
}
.di-card.on {
  border-color: rgba(91,214,140,0.35);
  background: linear-gradient(180deg, rgba(91,214,140,0.10), var(--surface-2));
  box-shadow: 0 0 0 1px rgba(91,214,140,0.20), var(--shadow-sm);
}
.di-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text-2);
  flex-shrink: 0;
}
.di-card.on .di-icon {
  background: var(--accent-soft);
  border-color: rgba(91,214,140,0.30);
  color: var(--accent);
}
.di-icon svg { width: 16px; height: 16px; }
.di-label {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.di-toggle {
  width: 28px; height: 16px;
  border-radius: 999px;
  background: var(--surface-3);
  position: relative;
  transition: background 0.2s var(--ease);
  flex-shrink: 0;
  box-shadow: var(--shadow-inset);
}
.di-toggle.on { background: var(--accent); }
.di-toggle-dot {
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s var(--ease);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.di-toggle.on .di-toggle-dot { transform: translateX(12px); }

.di-custom-row .di-custom-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.di-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}
.di-dot-icon {
  display: grid; place-items: center;
  width: 14px;
}

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  display: grid; place-items: center;
  z-index: 100;
  animation: fadeIn 0.18s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(560px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--surface-1), var(--surface-0));
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 24px;
  animation: pop 0.22s var(--ease);
}
@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}
.modal-sub {
  font-size: 13px;
  color: var(--text-3);
  margin: 0 0 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.field input,
.field select,
.field textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: all 0.18s var(--ease);
  box-shadow: var(--shadow-inset);
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--border-hi);
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-inset);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ===== Theme toggle ===== */
.theme-toggle {
  position: relative;
  width: 56px; height: 28px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  display: flex; align-items: center;
  padding: 0 4px;
  box-shadow: var(--shadow-inset);
  transition: background 0.2s var(--ease);
}
.theme-toggle::before {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent-lo));
  box-shadow: 0 2px 6px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: transform 0.28s var(--ease);
}
[data-theme="light"] .theme-toggle::before { transform: translateX(28px); }
.theme-toggle svg {
  width: 12px; height: 12px;
  z-index: 1;
  color: var(--text-3);
  transition: opacity 0.2s var(--ease);
}
.theme-toggle .icon-sun { margin-left: auto; }
[data-theme="light"] .theme-toggle .icon-sun { opacity: 0; }
.theme-toggle .icon-moon { opacity: 0; }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 1; }

/* ===== Dropdown menu (status edit) ===== */
.menu {
  position: absolute;
  z-index: 200;
  background: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 5px;
  min-width: 160px;
  animation: pop 0.16s var(--ease);
}
.menu-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-2);
  transition: all 0.14s var(--ease);
  text-align: left;
}
.menu-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.menu-item:hover { background: var(--surface-2); color: var(--text); }
.menu-item .swatch {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

/* ===== Auth controls (header) ===== */
.auth-skeleton {
  width: 80px; height: 34px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-1), var(--surface-2), var(--surface-1));
  background-size: 200% 100%;
  animation: auth-shimmer 1.4s linear infinite;
  border: 1px solid var(--border);
}
@keyframes auth-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.user-menu-wrap { position: relative; }
.user-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 3px 10px 3px 3px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.16s var(--ease);
  box-shadow: var(--shadow-sm);
}
.user-trigger:hover {
  background: var(--surface-2);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.avatar.avatar-sm {
  width: 28px; height: 28px;
  font-size: 11px;
  border-radius: 50%;
}
.email-pill {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 720px) {
  .email-pill { display: none; }
  .user-trigger { padding: 3px; }
}

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 5px;
  z-index: 200;
  animation: pop 0.14s var(--ease);
}
.user-menu-header {
  padding: 10px 12px 8px;
}
.user-menu-email {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
}
.user-menu-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}
.user-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ===== Signup prompt — accent at top of the modal ===== */
.signup-prompt-art {
  width: 56px;
  height: 56px;
  margin: 4px auto 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
    color-mix(in oklch, var(--accent-hi) 55%, transparent),
    color-mix(in oklch, var(--accent-lo) 18%, transparent) 60%,
    transparent 75%);
  display: grid; place-items: center;
}
.signup-prompt-art .dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent-lo));
  box-shadow: 0 0 16px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.4);
}

/* ===== Auth modal extras ===== */
.btn-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: 9px;
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}
.btn-google:hover:not(:disabled) {
  background: #f8f9fa;
  border-color: #c8d2dc;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.22);
}
.btn-google:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }

.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.auth-or::before, .auth-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-tabs {
  margin-bottom: 16px;
}
.auth-tabs .seg { width: 100%; }
.auth-tabs .seg button { flex: 1; justify-content: center; }

.auth-pw-switch {
  font-size: 12.5px;
  color: var(--text-3);
  margin: -8px 0 14px;
}
.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover { color: var(--accent-hi); }

.error-text {
  font-size: 12.5px;
  color: var(--error, #ff8e8e);
  background: color-mix(in oklch, #d13b3b 14%, transparent);
  border: 1px solid color-mix(in oklch, #d13b3b 28%, transparent);
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 12px;
}

/* ===== Quick keyboard hints (subtle) ===== */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--border-2);
}
