/* MotionSites Web Builder Studio — Cinema-Grade Dark UI + AI Co-Pilot & Section Architect */
:root {
  --bg-0: #070709;
  --bg-1: #0e0e12;
  --bg-2: #15151c;
  --bg-3: #1d1d27;
  --fg-0: #f6f5f0;
  --fg-1: #c8c6be;
  --fg-2: #8a8880;
  --accent: #e5a93c;
  --accent-soft: rgba(229, 169, 60, 0.14);
  --emerald: #34d399;
  --emerald-soft: rgba(52, 211, 153, 0.14);
  --danger: #f87171;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "JetBrains Mono", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: var(--bg-0);
  color: var(--fg-0);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  overflow: hidden;
}

.grain-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Topbar */
.topbar {
  height: 58px;
  background: rgba(14, 14, 18, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 16px;
  z-index: 30;
}
.topbar-left, .topbar-center, .topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-badge {
  display: flex;
  align-items: center;
  gap: 9px;
}
.logo-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.logo-title {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.03em;
}
.logo-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 17px;
  color: var(--accent);
}
.skill-pills {
  display: flex;
  gap: 6px;
  margin-left: 8px;
}
.meta-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--fg-1);
}
.preset-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ai-sparkle {
  color: var(--accent);
}

/* Shell Layout */
.studio-shell {
  display: grid;
  grid-template-columns: 270px 1fr;
  height: calc(100vh - 58px);
}

/* Sidebar */
.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}
.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--fg-2);
  padding: 0 8px 8px;
}
.step-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.step-tab {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 11px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg-1);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.step-tab:hover {
  background: var(--bg-2);
  color: var(--fg-0);
}
.step-tab.active {
  background: var(--bg-2);
  border-color: var(--border-strong);
  color: var(--fg-0);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.step-num {
  font-family: var(--font-mono);
  font-size: 10.5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-tab.active .step-num {
  background: var(--accent);
  color: var(--bg-0);
  border-color: var(--accent);
  font-weight: 600;
}
.step-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.step-title {
  font-weight: 500;
  font-size: 12.8px;
  letter-spacing: -0.01em;
}
.step-desc {
  font-size: 11px;
  color: var(--fg-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Active Stack Blueprint Summary Card */
.active-stack-card {
  margin-top: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.stack-card-header {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.stack-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.8px;
}
.stack-k {
  color: var(--fg-2);
}
.stack-v {
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 145px;
}
.accent-text {
  color: var(--accent);
}
.stack-swatches {
  display: flex;
  gap: 5px;
}
.swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
}
.badge-score {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--emerald-soft);
  color: var(--emerald);
}

/* Main Stage */
.main-stage {
  height: 100%;
  overflow-y: auto;
  padding: 22px 30px 60px;
  background: radial-gradient(circle at 50% 0%, rgba(229, 169, 60, 0.06), transparent 55%);
}
.step-panel {
  display: none;
  max-width: 1440px;
  margin: 0 auto;
}
.step-panel.active {
  display: block;
  animation: fadeIn 0.25s var(--ease);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* AI Co-Pilot Hero Box in Step 1 */
.ai-copilot-hero-box {
  background: linear-gradient(135deg, rgba(229, 169, 60, 0.11) 0%, rgba(21, 21, 28, 0.92) 60%);
  border: 1px solid rgba(229, 169, 60, 0.38);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.32);
}
.ai-copilot-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.ai-copilot-top h2 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.ai-prompt-input-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.ai-main-textarea {
  flex: 1;
  background: rgba(7, 7, 9, 0.78) !important;
  border-color: var(--border-strong) !important;
  font-size: 13.5px !important;
}
.ai-generate-btn {
  padding: 0 24px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  white-space: nowrap;
}
.ai-quick-prompts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.ai-prompt-chip {
  font-size: 11.5px !important;
  padding: 4px 11px !important;
}
.ai-live-response-box {
  margin-top: 4px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(7, 7, 9, 0.86);
  border: 1px solid rgba(52, 211, 153, 0.45);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-live-response-box.is-loading {
  border-color: var(--accent);
}
.ai-live-response-box.is-error {
  border-color: var(--danger);
}
.ai-res-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.ai-res-summary {
  font-size: 13px;
  color: var(--fg-0);
  line-height: 1.5;
}
.ai-res-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Step 2: Interactive Sections Architect */
.ai-section-adder-bar {
  background: var(--bg-1);
  border: 1px solid rgba(229, 169, 60, 0.35);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.ai-sec-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sections-architect-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 22px;
  align-items: start;
}
.section-catalog-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.catalog-sec-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s var(--ease);
}
.catalog-sec-card:hover {
  border-color: var(--accent);
  transform: translateX(2px);
}
.catalog-sec-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 3px;
}
.catalog-sec-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}
.catalog-sec-desc {
  font-size: 11.5px;
  color: var(--fg-2);
  line-height: 1.4;
}

.active-sections-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.active-sec-card {
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.active-sec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.active-sec-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sec-order-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.sec-type-label {
  font-weight: 600;
  font-size: 14px;
}
.active-sec-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.icon-btn-sm {
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--fg-1);
  font-size: 11.5px;
  cursor: pointer;
}
.icon-btn-sm:hover {
  color: var(--fg-0);
  border-color: var(--accent);
}
.icon-btn-sm.danger:hover {
  color: var(--danger);
  border-color: var(--danger);
}
.sec-items-mini-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.sec-subitem-row {
  display: grid;
  grid-template-columns: 1fr 1.6fr auto;
  gap: 8px;
  align-items: center;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.eyebrow-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--accent);
  display: block;
  margin-bottom: 5px;
}
.panel-header h1 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}
.panel-lead {
  color: var(--fg-1);
  max-width: 72ch;
  font-size: 13.5px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Recommendation Banner */
.recommendation-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(229, 169, 60, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 18px;
  color: var(--fg-0);
}
.hidden {
  display: none !important;
}
.rec-icon {
  color: var(--accent);
  font-size: 18px;
}
.rec-text {
  flex: 1;
  font-size: 13px;
}
.rec-close {
  background: transparent;
  border: none;
  color: var(--fg-1);
  font-size: 18px;
  cursor: pointer;
}

/* Cards & Grids */
.grid-2col {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 22px;
}
.studio-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title-row h2 {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.mono-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--bg-3);
  color: var(--fg-1);
  border: 1px solid var(--border);
}
.card-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

/* Forms & Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-group label {
  font-size: 11.8px;
  color: var(--fg-1);
  font-weight: 500;
}
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.stat-pair-inputs {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 6px;
}
.studio-input, .studio-textarea, .studio-select, .studio-search {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg-0);
  padding: 8px 11px;
  font-family: inherit;
  font-size: 13px;
  transition: border-color 0.2s ease;
}
.studio-input:focus, .studio-textarea:focus, .studio-select:focus, .studio-search:focus {
  outline: none;
  border-color: var(--accent);
}
.headline-input {
  font-family: var(--font-serif);
  font-size: 19px;
  letter-spacing: -0.01em;
}
.studio-search {
  min-width: 260px;
}

/* Buttons */
.btn-accent, .btn-primary-sm, .btn-secondary-sm, .btn-ghost, .btn-ghost-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  border: 1px solid transparent;
  text-decoration: none;
}
.btn-accent {
  background: var(--accent);
  color: #070709;
  padding: 8px 18px;
  font-size: 13px;
}
.btn-accent:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}
.btn-primary-sm {
  background: var(--fg-0);
  color: var(--bg-0);
  padding: 7px 16px;
  font-size: 12.5px;
}
.btn-primary-sm:hover {
  transform: translateY(-1px);
}
.btn-secondary-sm {
  background: var(--bg-3);
  color: var(--fg-0);
  border-color: var(--border-strong);
  padding: 7px 14px;
  font-size: 12.5px;
}
.btn-secondary-sm:hover {
  background: var(--bg-2);
  border-color: var(--accent);
}
.btn-ghost {
  background: var(--bg-2);
  color: var(--fg-0);
  border-color: var(--border);
  padding: 7px 14px;
  font-size: 12.5px;
}
.btn-ghost:hover {
  border-color: var(--border-strong);
}
.btn-ghost-sm {
  background: transparent;
  color: var(--fg-1);
  border-color: var(--border);
  padding: 5px 11px;
  font-size: 12px;
}
.btn-ghost-sm:hover {
  color: var(--fg-0);
  border-color: var(--border-strong);
}

/* Font Pairings & Colour Tokens */
.font-pairings-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.font-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-radius: var(--radius-md);
  background: var(--bg-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.font-card:hover {
  border-color: var(--border-strong);
}
.font-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.font-card-title {
  font-weight: 500;
  font-size: 13px;
}
.font-card-desc {
  font-size: 11px;
  color: var(--fg-2);
}
.font-sample {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
  color: var(--accent);
}

.palette-presets-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.palette-card {
  padding: 9px;
  border-radius: var(--radius-md);
  background: var(--bg-2);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: all 0.2s ease;
}
.palette-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.palette-dots {
  display: flex;
  gap: 4px;
}
.palette-dots span {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
}
.palette-name {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
}

.token-pickers-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.color-token-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.color-token-box label {
  font-size: 11px;
  color: var(--fg-2);
}
.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.color-input-wrap input[type="color"] {
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  cursor: pointer;
}
.studio-input-sm {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--fg-0);
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 4px 6px;
}

/* Live Mini Token Preview */
.token-live-preview {
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.3s ease;
}
.tlp-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  opacity: 0.7;
}
.tlp-h1 {
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 0.96;
  letter-spacing: -0.03em;
}
.tlp-sub {
  font-size: 12.5px;
  opacity: 0.75;
  max-width: 46ch;
}
.tlp-pills {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.tlp-btn-primary {
  padding: 6px 15px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 500;
}
.tlp-btn-glass {
  padding: 6px 15px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  border: 1px solid rgba(255,255,255,0.2);
}

/* Filter Bars & Chips */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--fg-1);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.chip:hover {
  color: var(--fg-0);
  border-color: var(--border-strong);
}
.chip.active {
  background: var(--fg-0);
  color: var(--bg-0);
  border-color: var(--fg-0);
  font-weight: 500;
}

/* Examples Grid */
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.example-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s var(--ease);
}
.example-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}
.example-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 12px 32px rgba(0, 0, 0, 0.4);
}
.ex-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-2);
  overflow: hidden;
}
.ex-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.example-card:hover .ex-thumb-wrap img {
  transform: scale(1.04);
}
.ex-cat-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(7, 7, 9, 0.78);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-0);
  border: 1px solid var(--border);
}
.ex-len-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(7, 7, 9, 0.78);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
}
.ex-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.ex-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.ex-desc {
  font-size: 12.5px;
  color: var(--fg-1);
  flex: 1;
}
.ex-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.trait-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--fg-2);
}
.ex-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* Media Shelf & Contact Sheets */
.subtab-group {
  display: inline-flex;
  background: var(--bg-2);
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}
.subtab {
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--fg-1);
  font-size: 12px;
  cursor: pointer;
}
.subtab.active {
  background: var(--fg-0);
  color: var(--bg-0);
  font-weight: 500;
}
.media-subview, .build-subview {
  display: none;
}
.media-subview.active, .build-subview.active {
  display: block;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}
.media-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s var(--ease);
}
.media-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.media-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #040406;
  overflow: hidden;
  cursor: pointer;
}
.media-stage video, .media-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-num-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.78);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent);
}
.media-space-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.75);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-1);
}
.media-info {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.media-title {
  font-weight: 600;
  font-size: 13.5px;
}
.media-desc {
  font-size: 11.5px;
  color: var(--fg-1);
  flex: 1;
}
.media-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* Contact Sheets View */
.sheet-selector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.sheet-tabs {
  display: flex;
  gap: 6px;
}
.contact-sheet-stage {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}
.sheet-img-container {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 12px;
}
.sheet-img-container img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  display: block;
}
.sheet-items-sidebar {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  max-height: 75vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sheet-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sheet-item-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--fg-0);
  text-align: left;
  cursor: pointer;
  font-size: 12px;
}
.sheet-item-btn:hover, .sheet-item-btn.active {
  border-color: var(--accent);
}

/* Techniques Grid */
.budget-meter {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-2);
  border: 1px solid var(--border);
  font-size: 12px;
}
.budget-heavy {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--emerald);
}
.budget-heavy.warn {
  color: var(--danger);
}
.techniques-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}
.tech-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
}
.tech-card.selected {
  border-color: var(--accent);
  background: rgba(229, 169, 60, 0.07);
}
.tech-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cost-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}
.cost-light { background: rgba(52, 211, 153, 0.14); color: #34d399; }
.cost-medium { background: rgba(229, 169, 60, 0.16); color: #e5a93c; }
.cost-heavy { background: rgba(248, 113, 113, 0.16); color: #f87171; }
.tech-name {
  font-weight: 600;
  font-size: 14px;
  margin-top: 6px;
}
.tech-when {
  font-size: 12px;
  color: var(--fg-1);
}

/* Live Preview & Code Editor */
.preview-toolbar, .code-toolbar, .builder-target-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 14px;
}
.viewport-toggles, .preview-quick-add {
  display: flex;
  align-items: center;
  gap: 6px;
}
.vp-btn {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--fg-1);
  font-size: 12px;
  cursor: pointer;
}
.vp-btn.active {
  background: var(--fg-0);
  color: var(--bg-0);
  font-weight: 500;
}
.preview-meta, .code-actions, .builder-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.iframe-stage-wrap {
  background: #040406;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  justify-content: center;
  min-height: 72vh;
}
.iframe-container {
  width: 100%;
  height: 72vh;
  transition: width 0.3s var(--ease);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}
.iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.code-editor-textarea {
  width: 100%;
  height: 68vh;
  background: #08080b;
  color: #e6e4dc;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  resize: vertical;
}
.builder-notes-banner {
  background: var(--bg-2);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--fg-1);
}

/* Look-and-Fix QA */
.qa-status-banner {
  background: var(--emerald-soft);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: var(--fg-0);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  font-size: 13px;
}
.shots-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 290px;
  gap: 16px;
}
.shot-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.shot-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
}
.shot-frame {
  background: #040406;
  max-height: 440px;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.shot-frame img {
  width: 100%;
  height: auto;
  display: block;
}
.shot-placeholder {
  padding: 36px 24px;
  text-align: center;
  color: var(--fg-2);
  font-size: 12px;
}
.score-pill-lg {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--emerald-soft);
  color: var(--emerald);
}
.rubric-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rubric-item {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rubric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rubric-name {
  font-weight: 600;
  font-size: 13px;
}
.rubric-score {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-3);
  color: var(--accent);
}
.rubric-note {
  font-size: 12px;
  color: var(--fg-1);
}
.rubric-fix-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}
.rubric-fix-lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-2);
}

.blocking-checks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--border);
  font-size: 12.5px;
}
.check-pass {
  color: var(--emerald);
  font-family: var(--font-mono);
  font-size: 11px;
}
.delivery-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  font-family: var(--font-mono);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.modal-dialog {
  width: 100%;
  max-width: 960px;
  max-height: 85vh;
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-close {
  background: none;
  border: none;
  color: var(--fg-1);
  font-size: 24px;
  cursor: pointer;
}
.modal-pre {
  padding: 22px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--fg-0);
}
.muted-note {
  color: var(--fg-2);
  font-size: 12px;
}
.mono-code {
  font-family: var(--font-mono);
  font-size: 12px;
}
