@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&family=Space+Mono:wght@400;700&display=swap');

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  --bg:         #06060a;
  --bg-2:       #0d0d12;
  --bg-3:       #13131a;
  --bg-4:       #1a1a24;
  --border:     #22222e;
  --border-2:   #2e2e3e;
  --accent:     #c8ff00;
  --accent-dim: #8aaf00;
  --accent-glow:rgba(200,255,0,0.15);
  --text:       #f0f0f5;
  --text-2:     #9898b4;
  --text-3:     #6a6a88;
  --danger:     #ff4040;
  --success:    #00e57a;
  --radius:     6px;
  --radius-lg:  12px;
  --transition: 180ms ease;
}

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 55% 45% at 12% 35%, rgba(200,255,0,.07) 0%, transparent 60%),
    radial-gradient(ellipse 40% 50% at 88% 65%, rgba(200,255,0,.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ─── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

/* ─── NAV ────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 60px;
  background: rgba(6,6,10,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.nav-logo span { color: var(--text-2); font-weight: 300; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-2);
  transition: color var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links .nav-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(200,255,0,0.1);
  border: 1px solid rgba(200,255,0,0.2);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ─── HERO ───────────────────────────────────────────────── */
.hero {
  padding: 108px 40px 48px;
  max-width: 1100px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 56px;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}
.hero-lead { /* left: tag + heading */ }
.hero-trail {
  padding-left: 56px;
  border-left: 1px solid var(--border);
  text-align: center;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 14px;
}
.hero-tag::before {
  content: '';
  display: block;
  width: 16px;
  height: 1px;
  background: var(--accent);
}
.hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(22px, 2.8vw, 34px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero p {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.75;
}

/* ─── TOOL SECTION ───────────────────────────────────────── */
.tool-section {
  padding: 0 40px 80px;
  position: relative;
  z-index: 1;
}

/* ─── TABS ───────────────────────────────────────────────── */
.tool-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.tab-btn {
  padding: 12px 24px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-3);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
}
.tab-btn:hover { color: var(--text-2); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── BRIEF BUILDER ──────────────────────────────────────── */
.brief-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}
.brief-col { min-width: 0; }

.form-section {
  margin-bottom: 36px;
}
.form-section-title {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-2);
  margin-bottom: 8px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 11px 14px;
  outline: none;
  transition: border-color var(--transition);
  appearance: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(200,255,0,.4);
  background: var(--bg-4);
}
.field textarea { resize: vertical; min-height: 90px; }
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2344445a' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.field select option { background: var(--bg-3); }

/* Duration Slider */
.duration-display {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 12px;
}
.duration-display span { font-size: 14px; font-weight: 400; color: var(--text-2); margin-left: 4px; }
.slider-wrap { position: relative; }
input[type="range"] {
  width: 100%;
  height: 2px;
  background: var(--border-2);
  border: none;
  border-radius: 2px;
  outline: none;
  appearance: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px var(--accent-glow);
}
.duration-presets {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.duration-preset {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-3);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition);
}
.duration-preset:hover, .duration-preset.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* Mood Grid */
.mood-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.mood-card {
  position: relative;
  padding: 16px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  user-select: none;
}
.mood-card:hover {
  border-color: var(--border-2);
  background: var(--bg-4);
}
.mood-card.selected {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.mood-card.selected::after {
  content: '✓';
  position: absolute;
  top: 6px; right: 8px;
  font-size: 10px;
  color: var(--accent);
  font-weight: 700;
}
.mood-icon { font-size: 22px; margin-bottom: 8px; }
.mood-name {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-2);
}
.mood-card.selected .mood-name { color: var(--accent); }

/* Style Presets */
.style-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.style-tag {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-2);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.style-tag:hover { border-color: var(--border-2); color: var(--text); }
.style-tag.selected {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* ─── GENERATE BUTTON ────────────────────────────────────── */
.generate-wrap {
  margin-top: 8px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 20px;
}
.btn-generate {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  transition: all var(--transition);
}
.btn-generate:hover {
  background: #d4ff1a;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(200,255,0,0.25);
}
.btn-generate:active { transform: translateY(0); }
.btn-generate.loading {
  opacity: 0.7;
  pointer-events: none;
}
.btn-generate .spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(6,6,10,0.3);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-secondary {
  padding: 13px 24px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  transition: all var(--transition);
}
.btn-secondary:hover {
  color: var(--text);
  border-color: var(--text-3);
}

/* ─── OUTPUT SECTION ─────────────────────────────────────── */
.output-section {
  padding: 0 40px 80px;
  display: none;
}
.output-section.visible { display: block; }
.output-divider {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 48px;
}
.output-divider-line { flex: 1; height: 1px; background: var(--border); }
.output-divider-label {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-3);
  text-transform: uppercase;
  white-space: nowrap;
}

/* Brief Summary Card */
.brief-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  padding: 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
}
.summary-item { }
.summary-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.summary-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Direction Bar */
.direction-bar {
  padding: 20px 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.dir-item { }
.dir-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent-dim);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.dir-value { font-size: 13px; color: var(--text-2); }

/* Shot List */
.shots-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.shots-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
}
.shots-count {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--text-3);
}

.shot-list { display: flex; flex-direction: column; gap: 3px; }

.shot-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}
.shot-card:hover { border-color: var(--border-2); }

.shot-header {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-2);
  cursor: pointer;
}
.shot-num {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(200,255,0,0.2);
  border-radius: 3px;
  padding: 4px 0;
  text-align: center;
}
.shot-info { }
.shot-type {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.shot-subject { font-size: 12px; color: var(--text-2); }
.shot-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}
.shot-meta .dur { color: var(--text-2); }

.shot-body {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.shot-body.open {
  max-height: 600px;
  padding: 20px;
  border-top: 1px solid var(--border);
}
.shot-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.shot-detail-item { }
.shot-detail-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.shot-detail-value { font-size: 13px; color: var(--text-2); }

.shot-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
.keyword-tag {
  padding: 3px 10px;
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--transition);
}
.keyword-tag:hover {
  color: var(--text-2);
  border-color: var(--border-2);
}

/* Footage Grid */
.footage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.footage-thumb {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
  aspect-ratio: 16/9;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.footage-thumb:hover { border-color: var(--border-2); transform: scale(1.02); }
.footage-thumb.selected { border-color: var(--accent); }
.footage-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity var(--transition);
}
.footage-thumb:hover img { opacity: 0.8; }
.footage-source {
  position: absolute;
  bottom: 6px; left: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: white;
  background: rgba(0,0,0,0.7);
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
}
.footage-dur {
  position: absolute;
  bottom: 6px; right: 6px;
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  color: white;
  background: rgba(0,0,0,0.7);
  padding: 2px 6px;
  border-radius: 2px;
}
.footage-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--text-3);
  font-size: 12px;
  gap: 8px;
}
.footage-loading .spinner {
  width: 14px; height: 14px;
  border: 1.5px solid var(--border-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.footage-search-btn {
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-2);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  transition: all var(--transition);
  margin-bottom: 12px;
}
.footage-search-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ─── REFERENCE ANALYZER ─────────────────────────────────── */
.ref-analyzer { max-width: 800px; }
.ref-input-mode {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.mode-btn {
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-3);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  transition: all var(--transition);
}
.mode-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}
.ref-url-input {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.ref-url-input input {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 12px 16px;
  outline: none;
  transition: border-color var(--transition);
}
.ref-url-input input:focus { border-color: var(--border-2); }
.ref-upload-zone {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  border: 2px dashed var(--border-2);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 24px;
}
.ref-upload-zone.visible { display: flex; }
.ref-upload-zone:hover { border-color: var(--accent); background: var(--accent-glow); }
.ref-upload-zone.dragover { border-color: var(--accent); background: var(--accent-glow); }
.upload-icon { font-size: 32px; margin-bottom: 12px; }
.upload-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}
.upload-sub { font-size: 12px; color: var(--text-3); }
#fileInput { display: none; }

.ref-note {
  padding: 14px 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-3);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 24px;
}

/* ─── ANALYSIS RESULTS ───────────────────────────────────── */
.analysis-results { display: none; }
.analysis-results.visible { display: block; }
.analysis-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
}
.use-analysis-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  margin-top: 24px;
  transition: all var(--transition);
}
.use-analysis-btn:hover { background: #d4ff1a; transform: translateY(-1px); }

/* ─── STATUS / TOAST ─────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  background: var(--bg-4);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 999;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--danger); color: var(--danger); }

/* ─── EMPTY / SKELETON ───────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-4) 50%, var(--bg-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ─── REFERENCE VIDEO (brief builder) ───────────────────── */
.brief-ref-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 32px;
}
.brief-ref-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.ref-source-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.ref-source-btn {
  padding: 5px 14px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-3);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition);
}
.ref-source-btn:hover { color: var(--text-2); border-color: var(--border-2); }
.ref-source-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}
.ref-brief-input { display: none; }
.ref-brief-input.active { display: block; }

.ref-brief-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  border: 2px dashed var(--border-2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.ref-brief-dropzone:hover,
.ref-brief-dropzone.dragover { border-color: var(--accent); background: var(--accent-glow); }
.ref-dropzone-icon {
  font-size: 20px;
  color: var(--text-3);
  margin-bottom: 8px;
  font-style: normal;
}
.ref-dropzone-label { font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.ref-dropzone-link { color: var(--accent); cursor: pointer; }
.ref-dropzone-sub { font-size: 11px; color: var(--text-3); }
#refBriefFile { display: none; }

.ref-url-row {
  display: flex;
  gap: 10px;
}
.ref-url-row input {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--transition);
}
.ref-url-row input:focus { border-color: var(--border-2); }
.ref-url-hint {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 8px;
}
.btn-ref-analyze {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.btn-ref-analyze:hover { background: #d4ff1a; }
.btn-ref-analyze.loading { opacity: 0.7; pointer-events: none; }
.btn-ref-analyze .spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(6,6,10,0.3);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.ref-brief-status {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
  min-height: 16px;
}
.ref-brief-status.success { color: var(--success); }
.ref-brief-status.error   { color: var(--danger); }

/* Auto-fill indicator */
.autofill-tag {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(200,255,0,0.2);
  padding: 1px 6px;
  border-radius: 2px;
  vertical-align: middle;
  margin-left: 6px;
  text-transform: uppercase;
}

/* ─── VIDEO TYPE — two-level ─────────────────────────────── */
.video-type-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.video-type-group select { width: 100%; }
.video-type-group select:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── DURATION — short presets ───────────────────────────── */
.duration-presets-short {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.duration-presets-short .duration-preset {
  padding: 3px 7px;
  font-size: 10px;
}
.duration-presets-standard {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ─── SUBJECT & PRODUCT ──────────────────────────────────── */
.label-opt {
  color: var(--text-3);
  font-weight: 400;
}
.field textarea.textarea-sm {
  min-height: 60px;
}

/* ─── EDIT PACE ──────────────────────────────────────────── */
.pace-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pace-btn {
  padding: 7px 16px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-3);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition);
}
.pace-btn:hover {
  color: var(--text-2);
  border-color: var(--border-2);
}
.pace-btn.selected {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* ─── FIELD PILLS (color grade, audio presets) ───────────── */
.field-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.field-pill {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-3);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.field-pill:hover {
  color: var(--text-2);
  border-color: var(--border-2);
}
.field-pill.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* ─── NUMBER OF SHOTS ────────────────────────────────────── */
.shots-mode-group {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.shots-mode-btn {
  flex: 1;
  padding: 7px 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-3);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.shots-mode-btn:hover { color: var(--text-2); border-color: var(--border-2); }
.shots-mode-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}
.shots-mode-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}
.shots-count-wrap {
  position: relative;
}
.shots-count-wrap input[type="number"] {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  padding: 12px 14px;
  outline: none;
  transition: border-color var(--transition);
  -moz-appearance: textfield;
}
.shots-count-wrap input[type="number"]::-webkit-inner-spin-button,
.shots-count-wrap input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
.shots-count-wrap input[type="number"]:not([readonly]):focus { border-color: var(--border-2); background: var(--bg-4); }
.shots-count-wrap input[type="number"][readonly] { color: var(--text-2); cursor: default; }
.shots-count-hint {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 6px;
}

/* ─── VERSIONING ─────────────────────────────────────────── */
.versioning-section {
  margin-bottom: 40px;
  padding: 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.versioning-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}
.versioning-summary {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text-3);
  text-align: right;
}
.versioning-summary.has-versions { color: var(--accent); }

.version-cards {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.version-card {
  flex: 0 0 auto;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  min-width: 130px;
  transition: border-color var(--transition);
}
.version-card.has-selection { border-color: var(--border-2); }

.ratio-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  margin-bottom: 10px;
}
.ratio-rect {
  background: var(--bg-4);
  border: 1.5px solid var(--border-2);
  border-radius: 2px;
  transition: border-color var(--transition);
}
.version-card.has-selection .ratio-rect { border-color: var(--accent); background: var(--accent-glow); }

/* Proportional rectangles — all fit within 52px height */
.ratio-16-9 { width: 64px; height: 36px; }
.ratio-1-1  { width: 46px; height: 46px; }
.ratio-9-16 { width: 24px; height: 44px; }
.ratio-5-4  { width: 50px; height: 40px; }
.ratio-4-3  { width: 52px; height: 39px; }
.ratio-custom { width: 40px; height: 40px; border-style: dashed; }

.version-ratio-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  text-align: center;
}
.version-ratio-sub {
  font-size: 10px;
  color: var(--text-3);
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: 0.04em;
}
.version-durations {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.version-dur-chip {
  padding: 4px 10px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-4);
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  user-select: none;
}
.version-dur-chip:hover { color: var(--text-2); border-color: var(--border-2); }
.version-dur-chip.selected {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}
.version-empty {
  font-size: 12px;
  color: var(--text-3);
  padding: 8px 0;
}

/* Custom format row */
.version-custom-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.version-custom-label {
  font-size: 12px;
  color: var(--text-3);
  cursor: pointer;
  white-space: nowrap;
}
.version-custom-row input[type="number"] {
  width: 52px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  padding: 5px 8px;
  outline: none;
  text-align: center;
  -moz-appearance: textfield;
}
.version-custom-row input[type="number"]::-webkit-inner-spin-button,
.version-custom-row input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
.version-custom-row input:focus { border-color: var(--border-2); }
.version-custom-sep { color: var(--text-3); font-size: 14px; }
.version-custom-add {
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-2);
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition);
}
.version-custom-add:hover { color: var(--accent); border-color: var(--accent); }

/* ─── OUTPUT — DIRECTION BAR (expanded) ──────────────────── */
.direction-bar {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* ─── BRIEF FORM v4 — Editorial Glass ───────────────────── */
.brief-form {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 48px;
}

/* Glass section cards */
.brief-card {
  background: rgba(200,255,0,.018);
  border: 1px solid rgba(200,255,0,.13);
  border-radius: 0;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color var(--transition);
}
.brief-card:hover { border-color: rgba(200,255,0,.32); }

/* Card header: large number + rule */
.card-hdr {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: end;
  gap: 16px;
  padding: 16px 32px 12px;
}
.sec-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  color: rgba(200,255,0,.18);
  letter-spacing: -.02em;
  user-select: none;
  transition: color .25s;
}
.brief-card:hover .sec-num,
.brief-card:focus-within .sec-num { color: rgba(200,255,0,.72); }
.sec-right {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.sec-title {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 2px;
}
.sec-sub { font-size: 11px; color: var(--text-3); }

/* Card body */
.cbody { padding: 24px 32px 28px; }

/* 3-column grid for inside cards */
.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.form-row-2.notes-sub {
  margin-bottom: 12px;
}

/* Compact duration */
.duration-compact {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.duration-compact .duration-display {
  font-size: 22px;
  margin-bottom: 0;
}
.duration-compact .duration-display span {
  font-size: 12px;
  margin-left: 2px;
}
.duration-compact input[type="range"] { flex: 1; }

/* Compact reference bar */
.ref-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 5px 5px 12px;
  transition: border-color var(--transition);
}
.ref-bar:focus-within { border-color: var(--border-2); }
.ref-bar-upload {
  flex-shrink: 0;
  padding: 5px 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-2);
  background: var(--bg-4);
  border: 1px solid var(--border-2);
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  white-space: nowrap;
}
.ref-bar-upload:hover { color: var(--text); border-color: var(--text-3); }
.ref-bar-sep { font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.ref-bar-url {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  outline: none;
  min-width: 0;
  padding: 4px 0;
}
.ref-bar-url::placeholder { color: var(--text-3); font-size: 12px; }
.ref-bar-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 6px 14px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition);
}
.ref-bar-btn:hover { background: #d4ff1a; }
.ref-bar-btn.loading { opacity: 0.7; pointer-events: none; }
.ref-bar-btn .spinner {
  width: 12px; height: 12px;
  border: 1.5px solid rgba(6,6,10,0.3);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
#refBarFile { display: none; }
.ref-bar-status {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 6px;
  min-height: 14px;
  line-height: 1.4;
}
.ref-bar-status.success { color: var(--success); }
.ref-bar-status.error   { color: var(--danger); }

/* Compact shots row */
.shots-compact-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.shots-compact-row .shots-mode-btn {
  flex: 0 0 auto;
  padding: 7px 14px;
  font-size: 11px;
}
.shots-compact-row input[type="number"] {
  flex: 0 0 64px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  padding: 6px 8px;
  text-align: center;
  outline: none;
  margin-left: 8px;
  -moz-appearance: textfield;
}
.shots-compact-row input[type="number"]::-webkit-inner-spin-button,
.shots-compact-row input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
.shots-compact-row input[type="number"]:not([readonly]):focus {
  border-color: var(--border-2);
  background: var(--bg-4);
}
.shots-compact-row input[type="number"][readonly] { color: var(--text-2); cursor: default; }

/* Version rows */
.version-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.version-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.version-row select {
  flex: 1;
  background: var(--bg-4);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  padding: 5px 26px 5px 10px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236a6a88' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.version-row select:focus { border-color: var(--border-2); }
.version-row select option { background: var(--bg-3); }
.version-row-remove {
  flex-shrink: 0;
  width: 24px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-3);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition);
}
.version-row-remove:hover { color: var(--danger); border-color: var(--danger); }
.add-version-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-3);
  background: transparent;
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}
.add-version-btn:hover {
  color: var(--text-2);
  border-color: var(--text-3);
  background: var(--bg-3);
}

/* Creative Notes sub-fields */
.notes-sub .field { margin-bottom: 0; }
.label-sub {
  font-size: 11px !important;
  color: var(--text-3) !important;
  font-weight: 500 !important;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .brief-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .nav { padding: 0 20px; }
  .hero { padding: 90px 20px 32px; grid-template-columns: 1fr; gap: 24px; }
  .hero-trail { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 20px; }
  .tool-section, .output-section { padding: 0 20px 60px; }
  .brief-grid { grid-template-columns: 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .mood-grid { grid-template-columns: repeat(4, 1fr); }
  .shot-details { grid-template-columns: 1fr; }
  .brief-ref-header { flex-direction: column; align-items: flex-start; }
  .versioning-section { padding: 16px; }
  .version-cards { gap: 8px; }
  .brief-form { padding: 0 24px; }
  .card-hdr { padding: 18px 20px 14px; }
  .cbody { padding: 18px 20px 22px; }
}
@media (max-width: 600px) {
  .nav-links { display: none; }
  .mood-grid { grid-template-columns: repeat(3, 1fr); }
  .card-hdr { grid-template-columns: 60px 1fr; }
  .sec-num { font-size: 38px; }
  .hero h1 { font-size: 32px; }
  .shot-header { grid-template-columns: 40px 1fr; }
  .shot-meta { display: none; }
  .pace-group { gap: 4px; }
  .pace-btn { padding: 6px 10px; font-size: 11px; }
  .shots-mode-btn { font-size: 10px; padding: 6px 4px; }
  .shots-compact-row { flex-wrap: wrap; }
  .ref-bar { flex-wrap: wrap; }
  .ref-bar-url { min-width: 0; width: 100%; order: 3; }
  .version-card { min-width: 110px; }
}
