/* Caption fonts - the real .ttf files the render bakes in, so the preview is honest */
@font-face { font-family: 'Poppins ExtraBold'; src: url('/fonts/Poppins-ExtraBold.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Poppins Black'; src: url('/fonts/Poppins-Black.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Bebas Neue'; src: url('/fonts/BebasNeue-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Anton'; src: url('/fonts/Anton-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('/fonts/Montserrat-Variable.ttf') format('truetype-variations'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Chilanka'; src: url('/fonts/Chilanka-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Archivo Black'; src: url('/fonts/ArchivoBlack-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Oswald'; src: url('/fonts/Oswald-Variable.ttf') format('truetype-variations'); font-weight: 200 700; font-display: swap; }
@font-face { font-family: 'Luckiest Guy'; src: url('/fonts/LuckiestGuy-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('/fonts/Caveat-Variable.ttf') format('truetype-variations'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-Variable.ttf') format('truetype-variations'); font-weight: 100 900; font-display: swap; }
/* Reel Forge Studio - dark editor theme.
   Looks like a pro mobile video editor (charcoal panels, phone-style
   monitors, bright active pills) while keeping Consciousverse colors:
   Scholar Orange #F77331 is the accent, Cream #FFF9EB the text. */

:root {
  --bg: #0F0D0C;
  --bg-2: #161312;
  --panel: #1C1918;
  --panel-2: #26211F;
  --panel-3: #312A27;
  --line: rgba(255, 249, 235, 0.08);
  --line-strong: rgba(255, 249, 235, 0.16);
  --text: #FFF9EB;
  --text-soft: rgba(255, 249, 235, 0.66);
  --text-faint: rgba(255, 249, 235, 0.42);
  --orange: #F77331;
  --orange-deep: #E25F1E;
  --orange-glow: rgba(247, 115, 49, 0.35);
  --orange-tint: rgba(247, 115, 49, 0.14);
  --on-orange: #200F07;
  --ok: #5BD38C;
  --ok-tint: rgba(91, 211, 140, 0.14);
  --bad: #FF7A63;
  --bad-tint: rgba(255, 122, 99, 0.14);
  --radius: 24px;
  --radius-sm: 14px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Poppins', system-ui, sans-serif;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 88% -8%, rgba(247, 115, 49, 0.22), transparent 62%),
    radial-gradient(700px 480px at -8% 30%, rgba(247, 115, 49, 0.10), transparent 60%),
    radial-gradient(800px 600px at 50% 120%, rgba(120, 60, 30, 0.25), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
.hidden { display: none !important; }
.muted { color: var(--text-soft); }
.error { color: var(--bad); font-size: 13px; }
code { background: var(--panel-3); color: var(--text); padding: 1px 7px; border-radius: 6px; font-size: 12px; }
h1, h2 { margin: 0; letter-spacing: -0.01em; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Buttons & inputs ---------- */
button, .btn-primary, a.primary {
  font: inherit; cursor: pointer; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--panel-2); color: var(--text); padding: 8px 16px; font-weight: 600; font-size: 13px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button:hover { border-color: rgba(255, 249, 235, 0.32); background: var(--panel-3); }
button:active { transform: scale(0.98); }
button:disabled { opacity: .5; cursor: wait; }
.btn-primary, button.primary, a.primary, #submit-btn {
  background: var(--orange); border-color: var(--orange); color: var(--on-orange);
  box-shadow: 0 8px 24px var(--orange-glow);
}
.btn-primary:hover, button.primary:hover, a.primary:hover, #submit-btn:hover { background: #FF8A4F; border-color: #FF8A4F; }
.btn-lg { padding: 14px 30px; font-size: 15px; font-weight: 700; }
.btn-ghost { background: transparent; }
button.danger { color: var(--bad); border-color: rgba(255, 122, 99, 0.3); background: transparent; }
button.danger:hover { background: var(--bad-tint); border-color: var(--bad); }

input[type="text"], input[type="password"], select, textarea {
  font: inherit; width: 100%; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 14px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-soft) 50%), linear-gradient(135deg, var(--text-soft) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
select option { background: var(--panel); color: var(--text); }
input:hover, select:hover, textarea:hover { background: var(--panel-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-tint); }
textarea { resize: vertical; min-height: 80px; }
input[type="color"] { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); padding: 4px; cursor: pointer; }
input[type="file"] { color: var(--text-soft); font-size: 12px; }
button:focus-visible, .choice:focus-within, .seg:focus-within, .pill-toggle:focus-within, .preset:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

/* ---------- Logo ---------- */
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.logo-glyph { width: 30px; height: 30px; border-radius: 10px; background: linear-gradient(145deg, #FF8A4F, var(--orange-deep)); position: relative; box-shadow: 0 6px 18px var(--orange-glow); }
.logo-glyph::after { content: ''; position: absolute; left: 12px; top: 9px; border-left: 9px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.logo-sub { font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--orange); background: var(--orange-tint); padding: 3px 10px; border-radius: 999px; }

/* ---------- Login ---------- */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 410px; background: var(--panel); border: 1px solid var(--line); border-radius: 32px; padding: 38px; box-shadow: var(--shadow); }
.login-title { font-size: 32px; font-weight: 800; margin: 26px 0 4px; }
.login-card form { display: grid; gap: 12px; margin-top: 24px; }
.login-card .btn-primary { padding: 13px; font-size: 15px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 14px 28px; background: rgba(15, 13, 12, 0.78); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.status-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-left: 8px; flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; padding: 5px 11px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--text-soft); }
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); }
.chip.on::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-tint), 0 0 10px var(--ok); }
.chip.off::before { background: var(--bad); }
.usage-pill { margin-left: auto; background: var(--panel); }
.usage-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 8px var(--orange); }

/* ---------- Usage drawer ---------- */
.dashboard { max-width: 1440px; margin: 16px auto 0; padding: 0 28px; }
.dashboard-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.dashboard-head h2 { font-size: 16px; }
.dashboard-note { font-size: 12px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr) 2fr; gap: 12px; }
.stat-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 12px; color: var(--text-soft); font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--text-faint); }
.gauge-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.gauge-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-soft); margin-bottom: 6px; }
.gauge-track { height: 6px; background: var(--panel-3); border-radius: 999px; overflow: hidden; }
.gauge-fill { height: 100%; width: 0; background: var(--ok); border-radius: 999px; transition: width .4s ease; }
.gauge-fill.low { background: var(--bad); }

/* ---------- Layout ---------- */
.layout { max-width: 1440px; margin: 0 auto; padding: 26px 28px 60px; display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 28px; align-items: start; }
.col-head { margin: 4px 0 18px; }
.col-head h1 { font-size: 28px; font-weight: 800; }
.col-head p { margin: 4px 0 0; }
.jobs-col { position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: var(--panel-3) transparent; }

/* ---------- Steps (editor panels) ---------- */
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; scroll-margin-top: 90px; }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.step-head h2 { font-size: 17px; font-weight: 700; }
.step-num { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--panel-3); color: var(--orange); }
.step-num svg { width: 19px; height: 19px; }
.step-note { font-size: 12px; color: var(--text-faint); }
.step-intro { margin: -6px 0 18px; max-width: 720px; }
.step-feature { background: linear-gradient(180deg, rgba(247, 115, 49, 0.10), rgba(247, 115, 49, 0.02) 40%), var(--panel); border-color: rgba(247, 115, 49, 0.30); }
.step-feature .step-num { background: var(--orange); color: var(--on-orange); box-shadow: 0 6px 18px var(--orange-glow); }
.new-badge { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--on-orange); background: var(--orange); padding: 3px 9px; border-radius: 999px; }
.field-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-soft); margin: 0 0 7px; }
.field-hint { font-size: 12px; margin: 12px 0 0; color: var(--text-faint); }
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.field-col { min-width: 0; }

/* ---------- Upload ---------- */
.upload-grid { display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: stretch; }
.speech-lang-field { margin-top: 16px; max-width: 360px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  min-height: 250px; border: 1.5px dashed var(--line-strong); border-radius: 20px; cursor: pointer;
  background:
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(255,249,235,.025) 22px 23px),
    var(--panel-2);
  color: var(--text); font-weight: 600; padding: 20px; transition: all .2s ease;
}
.dropzone:hover, .dropzone.drag-over { border-color: var(--orange); background-color: var(--panel-3); box-shadow: inset 0 0 60px rgba(247,115,49,.08); }
.dropzone.has-file { border-style: solid; border-color: var(--ok); box-shadow: inset 0 0 50px rgba(91,211,140,.07); }
.dz-icon { width: 54px; height: 54px; border-radius: 18px; background: var(--orange); position: relative; box-shadow: 0 10px 26px var(--orange-glow); }
.dz-icon::before { content: ''; position: absolute; left: 50%; top: 16px; width: 3px; height: 20px; background: var(--on-orange); transform: translateX(-50%); border-radius: 2px; }
.dz-icon::after { content: ''; position: absolute; left: 50%; top: 15px; width: 13px; height: 13px; border-left: 3px solid var(--on-orange); border-top: 3px solid var(--on-orange); transform: translateX(-50%) rotate(45deg); }
.dz-hint { font-weight: 400; font-size: 12px; color: var(--text-faint); }

/* ---------- Phone monitors ---------- */
.phone { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.phone-label { font-size: 11px; color: var(--text-faint); text-align: center; max-width: 240px; }
.preview-frame, .card-stage {
  position: relative; width: 150px; aspect-ratio: 9 / 16; border-radius: 22px; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, #3A2A22, #120E0C);
  box-shadow: 0 0 0 6px #050404, 0 0 0 7px rgba(255,249,235,.10), 0 24px 50px rgba(0,0,0,.55);
}
.preview-frame canvas { width: 100%; height: 100%; display: block; }
.preview-placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 14px; color: var(--text-faint); font-size: 11px; }
.monitor-meta {
  position: absolute; left: 0; right: 0; top: 0; z-index: 2; padding: 10px 10px 18px; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(0,0,0,.6), transparent); pointer-events: none;
}
#monitor-title { font-size: 10px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#monitor-sub { font-size: 9px; color: var(--text-soft); }
.phone-lg .card-stage { width: 240px; }
.card-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-stage iframe { position: absolute; left: 0; top: 0; width: 1080px; height: 1920px; border: 0; transform-origin: 0 0; pointer-events: none; background: transparent; }

/* ---------- Presets ---------- */
.default-bar { display: flex; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.default-note { font-size: 12px; color: var(--text-faint); }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.preset {
  text-align: left; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 10px 14px; border-radius: 18px;
  border: 1.5px solid var(--line); background: var(--panel-2); font-weight: 600;
}
.preset:hover { border-color: rgba(247,115,49,.6); background: var(--panel-3); }
.preset.active { border-color: var(--orange); background: var(--panel-3); box-shadow: 0 0 0 4px var(--orange-tint), 0 10px 30px rgba(0,0,0,.35); }
.preset-swatch { height: 72px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; font-size: 15px; letter-spacing: .03em; text-transform: uppercase; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.preset-name { font-size: 13px; padding: 0 4px; }
.preset-desc { font-size: 11px; font-weight: 400; color: var(--text-soft); line-height: 1.35; padding: 0 4px; }

/* ---------- Motion graphics ---------- */
.motion-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: start; }
.motion-grid.disabled { opacity: .4; pointer-events: none; filter: grayscale(.5); }
.choice-list { display: grid; gap: 8px; margin-bottom: 20px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 16px; cursor: pointer; background: var(--panel-2); transition: all .15s ease; }
.choice:hover { border-color: rgba(247,115,49,.5); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice.active { border-color: var(--orange); background: linear-gradient(90deg, var(--orange-tint), transparent), var(--panel-2); }
.choice-dot { flex: 0 0 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); margin-top: 2px; }
.choice.active .choice-dot { border-color: var(--orange); background: radial-gradient(circle, var(--orange) 45%, transparent 50%); }
.choice-title { font-weight: 600; font-size: 13px; }
.choice-sub { font-size: 12px; color: var(--text-soft); }
.choice-cost { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--orange); background: var(--orange-tint); padding: 1px 8px; border-radius: 999px; }

/* Segmented pills - "Default Settings / Custom Settings" style */
.segmented { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 20px; }
.seg { flex: 1 1 auto; text-align: center; padding: 9px 12px; border-radius: 12px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--text-soft); transition: all .15s ease; }
.seg:hover { color: var(--text); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg.active { background: var(--orange); color: var(--on-orange); box-shadow: 0 6px 18px var(--orange-glow); }
.time-note { font-size: 12px; color: var(--text-soft); background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; margin: 0; }
.motion-preview { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.card-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 270px; padding: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; }
.card-tabs button { padding: 6px 11px; font-size: 12px; border: 0; background: transparent; color: var(--text-soft); border-radius: 11px; }
.card-tabs button:hover { color: var(--text); background: var(--panel-3); }
.card-tabs button.active { background: var(--orange); color: var(--on-orange); }

/* Switch */
.switch { margin-left: auto; position: relative; width: 50px; height: 28px; flex: 0 0 50px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--panel-3); border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; transition: background .2s ease; }
.slider::before { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); box-shadow: 0 2px 6px rgba(0,0,0,.4); transition: transform .2s ease; }
.switch input:checked + .slider { background: var(--orange); border-color: var(--orange); box-shadow: 0 0 16px var(--orange-glow); }
.switch input:checked + .slider::before { transform: translateX(22px); background: #fff; }

/* Pill toggles */
.pill-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-toggle { position: relative; cursor: pointer; }
.pill-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.pill-toggle span { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12px; font-weight: 600; color: var(--text-soft); background: var(--panel-2); transition: all .15s ease; }
.pill-toggle span::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.pill-toggle input:checked + span { border-color: rgba(247,115,49,.6); color: var(--text); background: var(--orange-tint); }
.pill-toggle input:checked + span::before { background: var(--orange); box-shadow: 0 0 8px var(--orange); }
.pill-toggle.muted-toggle { opacity: .45; }

/* ---------- B-roll library ---------- */
.broll-library { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.broll-library summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.broll-library-list { display: grid; gap: 6px; margin: 10px 0; }
.broll-clip-row { display: grid; grid-template-columns: 1fr 1.2fr auto auto; gap: 8px; align-items: center; padding: 8px 10px; background: var(--panel-2); border-radius: 12px; }
.broll-clip-name { font-weight: 600; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.broll-clip-size { font-size: 11px; }
.broll-clip-tags-input { padding: 6px 10px; font-size: 12px; }
.broll-upload-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }

/* ---------- Tool dock + submit (bottom bar, editor toolbar style) ---------- */
.tool-dock {
  position: sticky; bottom: 98px; z-index: 11; display: flex; justify-content: center; gap: 4px; margin: 0 auto 10px; width: fit-content;
  padding: 6px; background: rgba(28, 25, 24, 0.88); backdrop-filter: blur(14px); border: 1px solid var(--line-strong); border-radius: 20px;
  box-shadow: 0 14px 34px rgba(0,0,0,.45);
}
.tool-dock button { flex-direction: column; gap: 2px; padding: 8px 12px; min-width: 62px; border: 0; background: transparent; color: var(--text-soft); border-radius: 14px; font-size: 10px; font-weight: 600; }
.tool-dock button:hover { background: var(--panel-3); color: var(--text); }
.tool-dock button.active { background: var(--orange); color: var(--on-orange); box-shadow: 0 6px 16px var(--orange-glow); }
.tool-dock svg { width: 20px; height: 20px; }
.submit-bar {
  position: sticky; bottom: 16px; z-index: 10; display: flex; align-items: center; gap: 16px; justify-content: space-between;
  background: linear-gradient(90deg, #2A211C, #1C1918); border: 1px solid var(--line-strong); color: var(--text); border-radius: 22px; padding: 14px 14px 14px 22px; box-shadow: 0 20px 44px rgba(0,0,0,.5);
}
.submit-summary { font-size: 12px; line-height: 1.45; color: var(--text-soft); }
.submit-summary strong { color: var(--text); }

/* ---------- Jobs ---------- */
.jobs-list { display: grid; gap: 14px; }
.empty-state { background: var(--panel); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 30px; text-align: center; }
.job-card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 16px 18px; display: grid; gap: 10px; }
.job-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.job-filename { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.job-meta-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.elapsed-chip { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.badge { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.badge-done { background: var(--ok-tint); color: var(--ok); }
.badge-failed { background: var(--bad-tint); color: var(--bad); }
.badge-progress { background: var(--orange-tint); color: var(--orange); }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-row .progress-track { flex: 1; }
.progress-pct { font-size: 12px; font-weight: 700; color: var(--orange); font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; }
.upload-progress { margin-top: 12px; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 8px; }
.upload-progress-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; }
.upload-progress-meta { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.upload-progress .progress-track { height: 8px; }
.progress-track { height: 5px; background: var(--panel-3); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--orange); border-radius: 999px; transition: width .5s ease; }
.progress-fill.active { background: linear-gradient(90deg, var(--orange) 0%, #FFB085 50%, var(--orange) 100%); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; box-shadow: 0 0 12px var(--orange-glow); }
@keyframes shimmer { to { background-position: -200% 0; } }
.stage-strip { display: flex; gap: 3px; }
.stage-strip span { flex: 1; height: 14px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--line); }
.stage-strip span.done { background: linear-gradient(180deg, #FF9560, var(--orange-deep)); border-color: transparent; }
.stage-strip span.now { background: var(--orange); border-color: transparent; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.job-step { font-size: 12px; color: var(--text-soft); }
.job-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.job-actions .error { flex-basis: 100%; }
.job-player { display: flex; justify-content: center; background: #050404; border-radius: 18px; padding: 12px; }
.job-player video { width: 100%; max-width: 250px; aspect-ratio: 9 / 16; border-radius: 16px; background: #000; }
.job-token-badge, .review-list { font-size: 11px; color: var(--text-soft); background: var(--panel-2); border-radius: 12px; padding: 7px 10px; }
.job-log { display: none; white-space: pre-wrap; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; background: #080706; color: var(--text-soft); border: 1px solid var(--line); border-radius: 14px; padding: 12px; max-height: 260px; overflow: auto; }
.job-log.open { display: block; }

/* Transcript review */
.review-panel { border: 1px solid rgba(247, 115, 49, 0.35); border-radius: 16px; padding: 12px; background: var(--panel-2); display: grid; gap: 10px; }
.review-mode { display: flex; gap: 6px; }
.review-mode-btn { flex: 1 1 auto; padding: 8px 10px; font-size: 12px; font-weight: 600; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text-soft); cursor: pointer; }
.review-mode-btn.active { background: var(--orange); border-color: var(--orange); color: var(--on-orange); }
.review-banner { font-size: 12px; color: var(--text-soft); }
.transcript { font-size: 13px; line-height: 1.9; max-height: 260px; overflow: auto; }
.t-word { cursor: pointer; padding: 1px 3px; border-radius: 5px; }
.t-word:hover { background: var(--panel-3); }
.t-word.marked { background: var(--bad-tint); color: var(--bad); text-decoration: line-through; }
.t-word.pending { background: var(--orange); color: var(--on-orange); }
.t-word.edited { background: var(--orange-tint); color: var(--orange); text-decoration: underline; text-decoration-style: dotted; }
.t-word-edit { font: inherit; font-size: 13px; width: auto; min-width: 48px; max-width: 220px; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--orange); background: var(--panel); color: var(--text); }
.review-actions { display: flex; justify-content: flex-end; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .jobs-col { position: static; max-height: none; order: -1; }
  .stat-row { grid-template-columns: repeat(3, 1fr); }
  .stat-tile-gauge { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .topbar { padding: 12px 16px; flex-wrap: wrap; position: static; }
  .status-chips { order: 3; flex-basis: 100%; margin-left: 0; }
  .layout, .dashboard { padding-left: 16px; padding-right: 16px; }
  .step { padding: 18px 16px; }
  .upload-grid, .motion-grid { grid-template-columns: 1fr; }
  .phone { margin: 0 auto; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .tool-dock { bottom: 78px; width: 100%; overflow-x: auto; justify-content: space-between; padding: 4px; border-radius: 18px; }
  .tool-dock button { min-width: 50px; padding: 6px 6px; font-size: 9.5px; }
  .tool-dock svg { width: 18px; height: 18px; }
  .submit-bar { padding: 8px; border-radius: 18px; bottom: 12px; }
  .submit-summary { display: none; }
  #submit-btn { width: 100%; padding: 12px; }
  .broll-upload-row, .broll-clip-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .progress-fill.active, .stage-strip span.now { animation: none; }
}

/* ---------- Exact preview + caption styles ---------- */
#exact-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.preview-busy { position: absolute; right: 8px; bottom: 8px; z-index: 3; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.55); display: grid; place-items: center; }
.preview-busy span { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--orange); border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.upload-grid .preview-frame { width: 190px; }
.phone-label strong { color: var(--orange); font-weight: 600; }
.caption-style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.cap-tile { flex-direction: column; align-items: stretch; gap: 6px; padding: 10px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--panel-2); text-align: left; }
.cap-tile:hover { border-color: rgba(247,115,49,.6); background: var(--panel-3); }
.cap-tile.active { border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-tint); }
.cap-demo { height: 58px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(160deg, #4a3a30, #1d1512); overflow: hidden; }
.cap-demo b { font-family: 'Poppins ExtraBold', 'Poppins', sans-serif; font-weight: 800; color: var(--cream, #FFF9EB); }
.cap-demo i { font-style: normal; color: var(--orange); }
.cap-name { font-size: 12px; font-weight: 600; }
.cap-sub { font-size: 11px; color: var(--text-soft); font-weight: 400; line-height: 1.3; }
.burned-note { font-size: 12px; margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--ok-tint); color: var(--ok); }
.burned-note.none { background: var(--panel-2); color: var(--text-soft); }

/* ---------- Step timeline + preview clips ---------- */
.stage-list-wrap { margin-top: 2px; }
.stage-list { list-style: none; margin: 0; padding: 10px 12px; display: grid; gap: 5px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; }
.stage-list li { display: grid; grid-template-columns: 16px 1fr auto; gap: 8px; align-items: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.st-icon { text-align: center; font-weight: 700; }
.st-done { color: var(--text-soft); }
.st-done .st-icon { color: var(--ok); }
.st-now { color: var(--text); font-weight: 600; }
.st-now .st-icon, .st-now .st-time { color: var(--orange); }
.st-next { color: var(--text-faint); }
.st-time { white-space: nowrap; }
.st-footer { font-size: 12px; margin: 8px 2px 0; color: var(--text-soft); }
.st-footer strong { color: var(--orange); }
.peek-block { margin-top: 4px; }
.peek-title { font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--text-soft); }
.peek-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.peek-tile { margin: 0; display: grid; gap: 4px; }
.peek-tile video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; background: #000; border: 1px solid var(--line); }
.peek-tile figcaption { font-size: 11px; line-height: 1.3; color: var(--text-soft); }
.peek-details summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text-soft); padding: 4px 0; }
.peek-details[open] summary { margin-bottom: 6px; }

/* Thumbnail options */
.thumb-block { margin-top: 4px; padding: 14px; background: var(--panel-2); border: 1.5px solid rgba(247,115,49,.45); border-radius: 18px; }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.thumb-tile { margin: 0; display: grid; gap: 4px; }
.thumb-tile img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; background: #000; border: 1px solid var(--line); }
.thumb-tile figcaption { font-size: 11px; line-height: 1.3; color: var(--text-soft); }
.thumb-tile a { font-size: 11px; color: var(--orange); text-decoration: none; }
.thumb-tile a:hover { text-decoration: underline; }
.thumb-regen { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.thumb-regen input { flex: 1 1 240px; font: inherit; font-size: 13px; color: var(--text); background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; }
.thumb-regen input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-tint); }
.thumb-regen button:disabled { opacity: .45; cursor: not-allowed; }

/* End card profile photo */
.endphoto { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; }
.endphoto img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--orange); }
.endphoto-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; font-size: 13px; }
.endphoto-txt span { font-size: 12px; }
.endphoto .btn-small { cursor: pointer; padding: 7px 12px; font-size: 12px; border-radius: 10px; background: var(--panel-3); color: var(--text); white-space: nowrap; }

/* =====================================================================
   Visual tiles (6 Oct 2026) - CapCut-style pickers for fonts, caption
   animation, cut effects, colour grade, caption language, and the
   feature switches. The real <select>/<input> controls stay in the DOM
   (app.js/studio.js read them); tiles.js mirrors them.
   ===================================================================== */
@font-face { font-family: 'Lilita One'; src: url('/fonts/LilitaOne-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Bangers'; src: url('/fonts/Bangers-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Righteous'; src: url('/fonts/Righteous-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Permanent Marker'; src: url('/fonts/PermanentMarker-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Kalam'; src: url('/fonts/Kalam-Bold.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'DM Serif Display'; src: url('/fonts/DMSerifDisplay-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Abril Fatface'; src: url('/fonts/AbrilFatface-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Mukta ExtraBold'; src: url('/fonts/Mukta-ExtraBold.ttf') format('truetype'); font-display: swap; }

::selection { background: var(--orange); color: var(--on-orange); }
* { scrollbar-width: thin; scrollbar-color: var(--panel-3) transparent; }
input, textarea { caret-color: var(--orange); }

.sr-select { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.step > span.field-label { margin-top: 22px; }
.sub-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 22px; }
.sub-head .field-label { margin: 0 0 7px; }
.sub-note { font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact-grid { margin-top: 18px; }

/* ---- generic tile ---- */
.tile {
  appearance: none; font: inherit; color: var(--text); cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: stretch; gap: 7px; padding: 8px;
  background: var(--panel-2); border: 1.5px solid var(--line); border-radius: 16px;
  transition: border-color .18s ease, background-color .18s ease, transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s ease;
}
.tile:hover { border-color: rgba(247,115,49,.55); background: var(--panel-3); transform: translateY(-2px); }
.tile:active { transform: translateY(0) scale(.98); }
.tile.active { border-color: var(--orange); background: linear-gradient(180deg, rgba(247,115,49,.16), rgba(247,115,49,.04)); box-shadow: 0 0 0 4px var(--orange-tint), 0 10px 24px rgba(0,0,0,.35); }
.tile:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.tile-name { font-size: 11.5px; font-weight: 600; color: var(--text-soft); line-height: 1.25; }
.tile.active .tile-name { color: var(--text); }

/* ---- font strip: each font in its own lettering ---- */
.tile-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 118px; gap: 10px; overflow-x: auto; padding: 4px 4px 12px; margin: 0 -4px; scroll-snap-type: x proximity; }
.tile-strip .tile { scroll-snap-align: start; }
.font-sample { font-size: 38px; line-height: 1.05; height: 52px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(160deg, #3a2c24, #17110e); color: var(--text); }
.tile-font.active .font-sample { color: var(--orange); }
.font-line { font-size: 12px; letter-spacing: .02em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- caption animation tiles: the word really animates ---- */
.anim-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.anim-stage { height: 58px; display: flex; align-items: center; justify-content: center; gap: 5px; border-radius: 11px; overflow: hidden;
  background: linear-gradient(160deg, #4a3a30, #1d1512); font-family: 'Poppins Black', 'Poppins', sans-serif; font-size: 14px; letter-spacing: .01em; }
.anim-stage b { display: inline-block; font-weight: 900; color: var(--text); text-shadow: 0 2px 6px rgba(0,0,0,.6); }
.anim-stage em { font-style: normal; color: #FFA06B; }
.anim-bounce b { animation: a-bounce 1.8s cubic-bezier(.2,.9,.3,1.4) infinite; animation-delay: calc(var(--i) * .45s); }
.anim-pop { animation: a-pop 2.2s cubic-bezier(.2,.9,.3,1.3) infinite; }
.anim-fade { animation: a-fade 2.2s ease-in-out infinite; }
.anim-slide { animation: a-slide 2.2s cubic-bezier(.16,1,.3,1) infinite; }
.anim-typewriter b { animation: a-type 2.4s steps(1) infinite; animation-delay: calc(var(--i) * .35s); }
@keyframes a-bounce { 0%, 30%, 100% { transform: scale(1); } 12% { transform: scale(1.32); } }
@keyframes a-pop { 0% { transform: scale(.55); opacity: 0; } 12% { transform: scale(1.08); opacity: 1; } 20%, 85% { transform: scale(1); opacity: 1; } 100% { opacity: 0; } }
@keyframes a-fade { 0% { opacity: 0; } 18%, 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes a-slide { 0% { transform: translateY(18px); opacity: 0; } 16%, 82% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(0); opacity: 0; } }
@keyframes a-type { 0% { opacity: 0; } 8%, 90% { opacity: 1; } 100% { opacity: 0; } }

/* ---- caption language: 3-way switch ---- */
.lang-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 18px; }
.lang-switch .tile { background: transparent; border-color: transparent; gap: 2px; padding: 9px 8px; border-radius: 13px; }
.lang-switch .tile:hover { transform: none; background: var(--panel-3); }
.lang-switch .tile.active { background: var(--orange); border-color: var(--orange); box-shadow: 0 6px 14px rgba(0,0,0,.35); }
.lang-name { font-size: 13px; font-weight: 700; }
.lang-sample { font-size: 11px; color: var(--text-soft); font-family: 'Mukta ExtraBold', 'Poppins', sans-serif; }
.lang-switch .tile.active .lang-name, .lang-switch .tile.active .lang-sample { color: var(--on-orange); }

/* ---- shared mini "frame" used by the cut + look tiles ---- */
[data-frame] { background-color: #2a201b; background-size: cover; background-position: center 35%;
  /* Abstract warm studio frame until a clip is loaded (then tiles.js swaps in YOUR frame). */
  background-image:
    radial-gradient(70% 55% at 62% 30%, rgba(255,214,170,.55), transparent 70%),
    linear-gradient(180deg, transparent 58%, rgba(32,15,7,.55)),
    repeating-linear-gradient(90deg, #5a3f30 0 7px, #3a281f 7px 12px, #7a5640 12px 17px, #2c1e18 17px 22px),
    linear-gradient(160deg, #8a6a52, #2a1c16); background-blend-mode: screen, normal, overlay, normal; }
[data-frame].has-frame { background-color: #000; }

/* ---- cut effect tiles ---- */
.cut-row + .sr-select + .fx-grid { margin-top: 14px; }
.cut-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.cut-stage { position: relative; height: 92px; border-radius: 11px; overflow: hidden; }
.cut-stage .cut-a, .cut-stage .cut-b { position: absolute; inset: 0; background: inherit; opacity: 0; }
.cut-flash .cut-a { background: #fff; animation: c-flash 1.6s ease-out infinite; }
.cut-glitch .cut-a { animation: c-glitch-r 1.6s steps(1) infinite; mix-blend-mode: screen; filter: sepia(1) saturate(6) hue-rotate(-50deg); }
.cut-glitch .cut-b { animation: c-glitch-b 1.6s steps(1) infinite; mix-blend-mode: screen; filter: sepia(1) saturate(6) hue-rotate(170deg); }
.cut-blur { animation: c-blur 1.6s cubic-bezier(.16,1,.3,1) infinite; }
.cut-mix .cut-a { background: #fff; animation: c-flash 4.8s ease-out infinite; }
.cut-mix { animation: c-mix 4.8s cubic-bezier(.16,1,.3,1) infinite; }
@keyframes c-flash { 0%, 55% { opacity: 0; } 58% { opacity: .95; } 80%, 100% { opacity: 0; } }
@keyframes c-glitch-r { 0%, 55% { opacity: 0; transform: none; } 57% { opacity: .55; transform: translateX(-6px); clip-path: inset(10% 0 55% 0); } 61% { opacity: .55; transform: translateX(5px); clip-path: inset(45% 0 20% 0); } 66%, 100% { opacity: 0; transform: none; clip-path: none; } }
@keyframes c-glitch-b { 0%, 55% { opacity: 0; } 58% { opacity: .5; transform: translateX(6px); clip-path: inset(60% 0 10% 0); } 63% { opacity: .5; transform: translateX(-4px); clip-path: inset(5% 0 70% 0); } 67%, 100% { opacity: 0; transform: none; clip-path: none; } }
@keyframes c-blur { 0%, 55% { filter: none; } 57% { filter: blur(7px) brightness(1.1); } 75%, 100% { filter: none; } }
@keyframes c-mix { 0%, 85% { filter: none; } 88% { filter: blur(6px); } 95%, 100% { filter: none; } }

/* ---- colour grade tiles: same frame, each look ---- */
.look-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.look-stage { height: 64px; border-radius: 11px; transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.tile-color-look:hover .look-stage { transform: scale(1.03); }

/* ---- feature tiles (checkbox) ---- */
.fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.fx-tile { position: relative; display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; cursor: pointer;
  background: var(--panel-2); border: 1.5px solid var(--line); border-radius: 18px; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.fx-tile:hover { border-color: rgba(247,115,49,.5); background: var(--panel-3); }
.fx-tile input { position: absolute; opacity: 0; pointer-events: none; }
.fx-tile:focus-within { outline: 2px solid var(--orange); outline-offset: 3px; }
.fx-tile:has(input:checked) { border-color: var(--orange); background: linear-gradient(110deg, rgba(247,115,49,.17), rgba(247,115,49,.03) 70%); box-shadow: 0 10px 26px rgba(0,0,0,.3); }
.fx-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fx-txt strong { font-size: 13.5px; font-weight: 700; }
.fx-txt span { font-size: 11.5px; line-height: 1.35; color: var(--text-soft); }
.fx-switch { width: 40px; height: 24px; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--line-strong); position: relative; transition: background .2s ease, border-color .2s ease; }
.fx-switch::before { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-faint); transition: transform .22s cubic-bezier(.2,.8,.2,1.2), background .2s ease; }
.fx-tile:has(input:checked) .fx-switch { background: var(--orange); border-color: var(--orange); }
.fx-tile:has(input:checked) .fx-switch::before { transform: translateX(16px); background: #fff; }
.fx-unavailable { opacity: .55; }

.fx-demo { width: 76px; height: 58px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; position: relative;
  background: linear-gradient(160deg, #4a3a30, #1d1512); }
.demo-kw { font-family: 'Poppins Black', 'Poppins', sans-serif; font-size: 9px; color: var(--text); text-align: center; line-height: 1.15; }
.demo-kw em { display: block; font-style: normal; font-size: 13px; color: #FFA06B; animation: d-emph 2s cubic-bezier(.2,.9,.3,1.4) infinite; }
@keyframes d-emph { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.18); } 40% { transform: scale(1); } }
.demo-emoji { display: grid; justify-items: center; gap: 1px; font-family: 'Poppins Black', 'Poppins', sans-serif; font-size: 10px; }
.demo-emoji img { width: 26px; height: 26px; animation: d-pop 2s cubic-bezier(.2,.9,.3,1.5) infinite; }
@keyframes d-pop { 0%, 25% { transform: translateY(6px) scale(.4); opacity: 0; } 40%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; } }
.demo-frame { width: 30px; height: 50px; border-radius: 6px; border: 1.5px solid rgba(255,249,235,.55); position: relative; overflow: hidden; background: #2a201b; }
.demo-shake i { position: absolute; inset: 4px; border-radius: 3px; background: linear-gradient(180deg, transparent 62%, var(--orange) 62% 70%, transparent 70%), linear-gradient(160deg, #8a6a52, #2a1c16); animation: d-shake 2s linear infinite; }
@keyframes d-shake { 0%, 50%, 70%, 100% { transform: none; } 52% { transform: translate(2px,-1px); } 55% { transform: translate(-2px,1px); } 58% { transform: translate(1px,2px); } 61% { transform: translate(-1px,-2px); } 64% { transform: translate(1px,0); } }
.demo-progress b { position: absolute; left: 0; top: 0; height: 4px; background: var(--orange); animation: d-fill 3s linear infinite; }
@keyframes d-fill { from { width: 0; } to { width: 100%; } }
.demo-wide { width: 66px; height: 38px; border-radius: 6px; position: relative; overflow: hidden;
  background: radial-gradient(14% 30% at 78% 42%, #c48a66 0 60%, transparent 62%), radial-gradient(26% 30% at 78% 100%, #d9c3a1 0 70%, transparent 72%), #3a4a5a; }
.demo-wide b { position: absolute; top: 0; bottom: 0; width: 22px; border: 1.5px solid var(--orange); border-radius: 4px; box-shadow: 0 0 0 999px rgba(0,0,0,.45); animation: d-reframe 2.6s cubic-bezier(.65,0,.35,1) infinite; }
@keyframes d-reframe { 0%, 20% { left: 22px; } 55%, 100% { left: 40px; } }
.demo-wave { display: flex; align-items: center; gap: 2px; height: 34px; }
.demo-wave i { width: 3px; border-radius: 2px; background: var(--text-soft); height: 30%; animation: d-wave 1.1s ease-in-out infinite; }
.demo-wave i:nth-child(3n) { height: 70%; animation-delay: .2s; }
.demo-wave i:nth-child(4n) { height: 50%; animation-delay: .35s; }
.demo-wave i:nth-child(5n) { height: 90%; animation-delay: .1s; }
.fx-tile:has(input:checked) .demo-wave i { background: var(--orange); }
@keyframes d-wave { 0%, 100% { transform: scaleY(.55); } 50% { transform: scaleY(1); } }
.demo-sfx { position: relative; width: 40px; height: 40px; }
.demo-sfx i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--orange); opacity: 0; animation: d-ring 2.1s cubic-bezier(.16,1,.3,1) infinite; }
.demo-sfx i:nth-child(2) { animation-delay: .7s; }
.demo-sfx i:nth-child(3) { animation-delay: 1.4s; }
@keyframes d-ring { 0% { transform: scale(.2); opacity: .9; } 100% { transform: scale(1.15); opacity: 0; } }
.demo-music { display: flex; align-items: flex-end; gap: 4px; height: 30px; }
.demo-music i { width: 6px; border-radius: 3px 3px 1px 1px; background: var(--orange); animation: d-eq 1s ease-in-out infinite; height: 100%; transform-origin: bottom; }
.demo-music i:nth-child(2) { animation-delay: .25s; }
.demo-music i:nth-child(3) { animation-delay: .5s; }
.demo-music i:nth-child(4) { animation-delay: .1s; }
@keyframes d-eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.fx-tile:not(:has(input:checked)) .fx-demo * { animation-play-state: paused; }
.fx-tile:not(:has(input:checked)):hover .fx-demo * { animation-play-state: running; }

@media (max-width: 720px) {
  .fx-grid { grid-template-columns: 1fr; }
  .tile-strip { grid-auto-columns: 104px; }
  .anim-row, .cut-row, .look-row { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .anim-stage, .anim-stage b, .cut-stage, .cut-stage *, .fx-demo, .fx-demo * { animation: none !important; }
  .tile, .fx-tile { transition: none; }
}

/* Keep wide tile strips inside the page on phones (the font strip used to stretch it). */
.layout > *, .create-col, .step { min-width: 0; }
.tile-strip { max-width: 100%; }
@media (max-width: 720px) { .tool-dock button { min-width: 0; flex: 1 1 0; padding: 6px 2px; } }

/* ---------- Quality check results (job card) ---------- */
.quality { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; font-size: 12px; }
.quality-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.quality-head .q-all { color: var(--ok); font-weight: 700; }
.quality-head .q-some { color: #FFB35C; font-weight: 700; }
.quality ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.quality li { display: grid; grid-template-columns: 10px 1fr; gap: 8px; align-items: baseline; color: var(--text-soft); line-height: 1.4; }
.quality li strong { color: var(--text); font-weight: 600; margin-right: 4px; }
.q-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); transform: translateY(1px); }
.q-warn .q-dot { background: #FFB35C; }
.q-warn { color: var(--text) !important; }

/* ---------- Quick fix panel (job card) ---------- */
.qf-panel { margin-top: 4px; padding: 14px; background: var(--panel-2); border: 1.5px solid rgba(247,115,49,.45); border-radius: 18px; display: grid; gap: 14px; }
.qf-sec h4 { margin: 0 0 8px; font-size: 13px; font-weight: 700; }
.qf-sec > summary { display: flex; align-items: baseline; gap: 10px; cursor: pointer; list-style: none; }
.qf-sec > summary::-webkit-details-marker { display: none; }
.qf-sec > summary h4 { margin: 0; }
.qf-sec > summary::after { content: '+'; margin-left: auto; color: var(--text-soft); font-weight: 700; }
.qf-sec[open] > summary::after { content: '–'; }
.qf-hint { margin: -4px 0 8px; font-size: 11.5px; }
.qf-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; gap: 8px; margin-bottom: 8px; transition: opacity .2s ease; }
.qf-card.is-removed { opacity: .5; }
.qf-card-head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.qf-card-head .muted { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.qf-remove { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-soft); cursor: pointer; }
.qf-remove input { accent-color: var(--bad); }
.qf-field { display: grid; gap: 4px; font-size: 11.5px; color: var(--text-soft); }
.qf-field input, .qf-field textarea, .qf-line input { width: 100%; font: inherit; font-size: 13px; color: var(--text); background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; }
.qf-field input:focus, .qf-field textarea:focus, .qf-line input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-tint); }
.qf-lines { display: grid; gap: 6px; margin-top: 10px; max-height: 340px; overflow-y: auto; padding-right: 4px; }
.qf-line { display: grid; grid-template-columns: 38px 1fr; gap: 8px; align-items: center; }
.qf-time { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.qf-stickers { display: flex; flex-wrap: wrap; gap: 8px; }
.qf-sticker { display: grid; justify-items: center; gap: 2px; padding: 6px 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel); color: var(--text-soft); font: inherit; font-size: 10.5px; cursor: pointer; }
.qf-sticker img { width: 34px; height: 34px; }
.qf-sticker:hover { border-color: var(--bad); }
.qf-sticker.is-removed { opacity: .4; border-color: var(--bad); text-decoration: line-through; }
.qf-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 11.5px; border-top: 1px solid var(--line); padding-top: 12px; }
.qf-foot .btn-primary { padding: 10px 18px; }
.qf-foot .btn-primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ======================================================================
   Sidebar shell + Carousel Creator + Content & Captions (10 Oct 2026)
   ====================================================================== */

.shell { display: flex; align-items: stretch; min-height: 100vh; }
.sidenav {
  flex: 0 0 92px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 10px; position: sticky; top: 0; height: 100vh; z-index: 30;
  background: rgba(15, 13, 12, 0.85); backdrop-filter: blur(16px); border-right: 1px solid var(--line);
}
.sidenav-logo { margin-bottom: 10px; }
.sidenav-item {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 11px 4px; border-radius: 16px; border: 1px solid transparent; background: transparent;
  color: var(--text-soft); font-size: 10.5px; font-weight: 600; text-align: center; line-height: 1.2;
}
.sidenav-item svg { width: 20px; height: 20px; }
.sidenav-item:hover { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.sidenav-item.active { background: var(--orange); color: var(--on-orange); box-shadow: 0 6px 18px var(--orange-glow); }
.shell-main { flex: 1; min-width: 0; }
.view { width: 100%; }

/* ---------- Post-type picker (shared: Carousel Creator + Content studio) --- */
.posttype-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.posttype-card {
  display: grid; gap: 6px; justify-items: start; text-align: left; padding: 16px; border-radius: 18px;
  border: 1.5px solid var(--line); background: var(--panel-2); color: var(--text);
}
.posttype-card:hover { border-color: var(--line-strong); background: var(--panel-3); }
.posttype-card.active { border-color: var(--orange); background: linear-gradient(135deg, var(--orange-tint), transparent), var(--panel-2); box-shadow: 0 0 0 3px var(--orange-tint); }
.posttype-card strong { font-size: 14px; }
.posttype-card .muted { font-size: 12px; line-height: 1.35; }
.posttype-funnel { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--orange); background: var(--orange-tint); padding: 2px 9px; border-radius: 999px; }
.postype-reference { display: grid; gap: 10px; }
.postype-ref-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 5px; }
.postype-ref-card strong { font-size: 13px; }
.postype-ref-card p { font-size: 11.5px; line-height: 1.4; margin: 0; }

/* ---------- Carousel Creator: slide editor + job grid ---------- */
.slide-editor-list { display: grid; gap: 12px; margin-top: 4px; }
.slide-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: grid; gap: 8px; }
.slide-card-head { display: flex; align-items: center; justify-content: space-between; }
.slide-role { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--orange); }
.slide-card textarea { min-height: unset; font-size: 13px; padding: 9px 11px; }
.btn-small { font-size: 12px; padding: 6px 13px; }
.btn-small.danger { color: var(--bad); border-color: rgba(255, 122, 99, 0.3); background: transparent; }
.btn-small.danger:hover { background: var(--bad-tint); border-color: var(--bad); }

.slide-thumb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.slide-thumb-grid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); }
.job-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin-bottom: 14px; }
.job-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.job-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* ---------- Content & Captions studio ---------- */
.platform-row { display: flex; flex-wrap: wrap; gap: 8px; }
.platform-row .seg { border-radius: 999px; padding: 9px 20px; border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text); }
.platform-row .seg.active { background: var(--orange); border-color: var(--orange); color: var(--on-orange); box-shadow: 0 6px 18px var(--orange-glow); }
.hook-options { display: grid; gap: 10px; margin-top: 10px; }
.hook-option { background: var(--panel-2); border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 16px; cursor: pointer; }
.hook-option p { margin: 0 0 8px; font-size: 14px; line-height: 1.4; }
.hook-option.active { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-tint); }
.hook-option-actions { display: flex; gap: 8px; }
#ct-body { min-height: 360px; font-size: 14px; line-height: 1.6; }
#ct-subject { margin-top: 6px; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidenav { position: sticky; top: 0; height: auto; width: 100%; flex-direction: row; justify-content: center; padding: 10px; }
  .sidenav-item { flex-direction: row; width: auto; padding: 8px 14px; }
  .sidenav-logo { display: none; }
}
