/* VideoAIz — light by default, dark via footer switch */
:root, [data-theme="light"] {
  --bg: #F7F6F2; --panel: #FFFFFF; --inset: #F2F1EC; --line: #E3E1DA; --line2: #C9C6BE;
  --text: #17181B; --sub: #3F434A; --muted: #5E626B;
  --accent: #4338CA; --on-accent: #FFFFFF; --acc-text: #3730A3; --acc-soft: #EEF0FF; --acc-line: #C7CBFA; --chip: #E0E3FF;
  --ok: #166534; --bad: #B91C1C; --tone1: #F1E4DA; --tone2: #DDEAE6; --tone3: #E5E2EF; --tone4: #F0E9D2;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0D0E11; --panel: #16181D; --inset: #0D0E11; --line: #262A31; --line2: #3A3F48;
  --text: #F2EFE9; --sub: #D6D3CD; --muted: #A3A7B0;
  --accent: #818CF8; --on-accent: #0D0E11; --acc-text: #A5B4FC; --acc-soft: #17172A; --acc-line: #2E2F5A; --chip: #22234A;
  --ok: #9BE3B4; --bad: #FCA5A5; --tone1: #2B2220; --tone2: #1F2A2A; --tone3: #24222E; --tone4: #2A2618;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: 'Inter Tight', system-ui, -apple-system, sans-serif; font-size: 15px; line-height: 1.5; }
a { color: var(--acc-text); }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.muted { color: var(--muted); }
.label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
.hidden { display: none !important; }

/* buttons & controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--line2); color: var(--text); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }
.btn-primary:hover { color: var(--on-accent); filter: brightness(1.06); }
.btn-primary[disabled] { opacity: .55; cursor: not-allowed; }
.btn-soft { background: var(--acc-soft); border-color: var(--acc-line); color: var(--acc-text); font-weight: 600; }
.btn-ghost { background: transparent; }
.btn-lg { min-height: 48px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg a, .seg button { min-height: 32px; min-width: 40px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.seg .on { background: var(--text); color: var(--bg); }
.pill { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--sub); font: inherit; font-size: 13px; cursor: pointer; }
.pill.on { border-color: var(--accent); background: var(--acc-soft); color: var(--acc-text); font-weight: 600; }
.pill[disabled] { opacity: .45; cursor: not-allowed; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%; background: var(--inset); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 15px; }
textarea { resize: vertical; line-height: 1.5; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.switch { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.alert { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--acc-line); background: var(--acc-soft); color: var(--acc-text); font-size: 14px; }
.alert.ok { border-color: var(--line); background: var(--panel); color: var(--ok); }

/* logo */
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.logo:hover { color: var(--text); }
.logo-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text strong { font-size: 17px; letter-spacing: -.01em; }
.logo-text strong span { color: #4F46E5; }
[data-theme="dark"] .logo-text strong span { color: #A5B4FC; }
.logo-text small { font-size: 12px; color: var(--muted); }

/* app shell */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--panel); }
.topbar-r { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip-credits { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--text); text-decoration: none; }
.chip-credits svg { color: var(--acc-text); }
.avatar { width: 36px; height: 36px; border-radius: 999px; background: var(--inset); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; }
.shell { display: flex; flex-wrap: wrap; min-height: calc(100vh - 120px); }
.sidenav { flex: 1 1 200px; max-width: 220px; padding: 20px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.sidenav > a { display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 10px; text-decoration: none; color: var(--muted); border: 1px solid transparent; font-size: 14px; }
.sidenav > a.on { background: var(--panel); border-color: var(--line); color: var(--text); font-weight: 600; }
.tipbox { margin-top: 24px; padding: 14px; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.main { flex: 999 1 560px; min-width: 0; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.side { flex: 1 1 280px; max-width: 340px; padding: 24px 20px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 22px; }
.appfoot { border-top: 1px solid var(--line); background: var(--panel); padding: 12px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.theme-row { display: flex; align-items: center; gap: 10px; }
@media (max-width: 1023px) {
  .sidenav { flex-basis: 100%; max-width: none; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; }
  .tipbox { display: none; }
  .side { max-width: none; border-left: 0; border-top: 1px solid var(--line); }
  .main { padding: 16px; }
}

/* studio */
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.between { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.group { display: flex; flex-direction: column; gap: 10px; }
.preview { padding: 16px; }
.stage { margin: 0 auto; max-width: 100%; height: 380px; background: var(--inset); border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--muted); text-align: center; }
.stage video, .stage img { width: 100%; height: 100%; object-fit: contain; background: #000; }
.stage .ph { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px; }
.stage .ph svg { color: var(--acc-text); }
.composer { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.assist { border: 1px solid var(--acc-line); background: var(--acc-soft); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.assist .label { color: var(--acc-text); font-weight: 600; }
.assist textarea { background: var(--panel); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-size: 12px; padding: 5px 10px; border-radius: 999px; background: var(--chip); color: var(--acc-text); }
.modelbtn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; cursor: pointer; width: 100%; }
.modelbtn.on { border-color: var(--accent); background: var(--acc-soft); }
.modelbtn .top { display: flex; justify-content: space-between; width: 100%; font-weight: 600; font-size: 14px; }
.modelbtn .rate { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--acc-text); font-weight: 500; }
.modelbtn small { font-size: 12px; color: var(--muted); }
.costbox { margin-top: auto; padding: 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.costbox .big { font-size: 26px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.tpl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.tpl-list button { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--inset); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.tpl-list button:hover { border-color: var(--accent); }
.filebox { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px dashed var(--line2); border-radius: 10px; font-size: 13px; color: var(--muted); }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.gthumb { position: relative; aspect-ratio: 16 / 10; background: var(--tone1); display: flex; align-items: center; justify-content: center; cursor: pointer; border: 0; padding: 0; width: 100%; }
.gthumb video, .gthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge { position: absolute; left: 8px; bottom: 8px; font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 999px; background: var(--panel); color: var(--ok); }
.badge.busy { background: var(--accent); color: var(--on-accent); }
.badge.bad { color: var(--bad); }
.gbody { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.gbody .p { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gbody .meta { font-size: 11px; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.gbody .err { font-size: 12px; color: var(--bad); }
.gactions { display: flex; flex-wrap: wrap; gap: 6px; }
.spin { width: 22px; height: 22px; border: 3px solid var(--line2); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; right: 20px; bottom: 70px; max-width: 360px; padding: 12px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 14px; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.2); }

/* tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

/* auth */
.auth { min-height: 100vh; display: flex; flex-direction: column; }
.auth-box { width: 100%; max-width: 420px; margin: 40px auto; padding: 28px; display: flex; flex-direction: column; gap: 16px; }

/* landing */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.lnav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; }
.lnav nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; font-size: 14px; }
.lnav nav > a:not(.btn) { color: var(--sub); text-decoration: none; }
.hero { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; padding: 64px 0 48px; }
.hero > div { flex: 1 1 440px; display: flex; flex-direction: column; gap: 22px; }
.hero h1 { font-size: clamp(38px, 6vw, 60px); line-height: 1.02; letter-spacing: -0.03em; font-weight: 800; }
.hero p.sub { font-size: 19px; color: var(--sub); max-width: 540px; margin: 0; }
.badge-top { align-self: flex-start; font-size: 12px; font-family: 'JetBrains Mono', monospace; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--acc-line); background: var(--acc-soft); color: var(--acc-text); }
.demo { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.demo .screen { height: 260px; border-radius: 12px; background: var(--tone1); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); overflow: hidden; }
.demo .screen video { width: 100%; height: 100%; object-fit: cover; }
.demo .io { background: var(--inset); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.section { padding: 56px 0; display: flex; flex-direction: column; gap: 28px; }
.section h2 { font-size: clamp(28px, 4vw, 38px); letter-spacing: -0.02em; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.feat { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.feat .n { font-size: 12px; font-family: 'JetBrains Mono', monospace; color: var(--acc-text); }
.feat p, .step p { margin: 0; color: var(--sub); }
.step { border-top: 2px solid var(--accent); padding-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.step .n { font-size: 40px; font-weight: 800; color: var(--acc-text); line-height: 1; }
.plan { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.plan.hot { background: var(--acc-soft); border-color: var(--accent); }
.plan .price { font-size: 34px; font-weight: 800; }
.usage { padding: 18px; display: flex; flex-wrap: wrap; gap: 24px; font-size: 14px; color: var(--sub); }
details.faq { border-bottom: 1px solid var(--line); padding: 4px 0; }
details.faq summary { min-height: 52px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-size: 17px; font-weight: 600; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: '+'; color: var(--acc-text); font-size: 22px; }
details.faq[open] summary::after { content: '−'; }
details.faq p { margin: 0 0 16px; color: var(--sub); }
.lfoot { border-top: 1px solid var(--line); background: var(--panel); }
.lfoot .wrap { padding: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); }

/* account menu */
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; z-index: 40; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.usermenu .menu a { display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.usermenu .menu a:hover { background: var(--inset); }
.usermenu .menu-email { padding: 8px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; }
/* storyboard (2 views) */
.sb-col { display: flex; flex-direction: column; gap: 14px; }
.sb-pad { padding: 18px 20px; }
.sb-a-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
.sb-preview { padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.sb-stage { position: relative; width: 100%; max-width: 300px; aspect-ratio: 9 / 16; max-height: 520px; border-radius: 12px; overflow: hidden; background: #000; }
.sb-stage video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.sb-tag { position: absolute; top: 10px; left: 10px; font-size: 11px; color: #fff; background: rgba(0,0,0,.6); padding: 3px 8px; border-radius: 6px; }
.sb-ctrl { width: 100%; max-width: 560px; display: flex; align-items: center; gap: 12px; }
.sb-round { width: 44px; height: 44px; flex: none; border-radius: 999px; border: 0; background: var(--text); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.sb-round.on { background: var(--accent); color: var(--on-accent); }
.sb-prog { flex: 1; height: 8px; border-radius: 999px; background: var(--line); cursor: pointer; overflow: hidden; }
.sb-prog div { height: 100%; width: 0; background: var(--accent); }
.sb-side { padding: 18px; }
.sb-go { margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); gap: 10px; }
.sb-bar { height: 10px; border-radius: 999px; background: var(--inset); border: 1px solid var(--line); overflow: hidden; }
.sb-bar div { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.sb-dark { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.sb-dark:hover { color: var(--bg); filter: brightness(1.2); }
.sb-tl { position: relative; padding-top: 18px; cursor: pointer; }
.sb-ruler { position: absolute; top: 0; left: 0; right: 0; height: 16px; font-size: 11px; color: var(--muted); }
.sb-ruler span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.sb-ruler span:first-child { transform: none; }
.sb-ruler span:last-child { transform: translateX(-100%); }
.sb-track { display: flex; gap: 6px; height: 76px; }
.sb-blk { display: flex; min-width: 24px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line2); }
.sb-blk.off { opacity: .35; }
.sb-part { min-width: 6px; border: 0; border-right: 2px solid var(--panel); background: var(--tone1); color: var(--text); font: inherit; padding: 6px 8px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; overflow: hidden; cursor: pointer; text-align: left; }
.sb-part:last-child { border-right: 0; }
.sb-part b { font-size: 12px; white-space: nowrap; }
.sb-part span { font-size: 11px; white-space: nowrap; }
.sb-part.off { background: repeating-linear-gradient(45deg, var(--line), var(--line) 5px, var(--inset) 5px, var(--inset) 10px); color: var(--muted); }
.sb-part.sel { box-shadow: inset 0 0 0 3px var(--accent); }
.sb-head { position: absolute; top: 12px; bottom: -4px; width: 2px; margin-left: -1px; background: #DC2626; pointer-events: none; }
.sb-head::before { content: ''; position: absolute; top: -2px; left: -6px; width: 14px; height: 10px; border-radius: 3px; background: #DC2626; }
.sb-key { display: inline-flex; align-items: center; gap: 8px; }
.sb-sw { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }
.sb-sw.on { background: var(--tone1); border: 1px solid var(--line2); }
.sb-sw.off { background: repeating-linear-gradient(45deg, var(--line2), var(--line2) 3px, var(--inset) 3px, var(--inset) 6px); }
.sb-sw.line { width: 3px; background: #DC2626; }
.sb-manage summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.sb-mrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.sb-mlab { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; min-width: 0; font-size: 14px; min-height: 40px; cursor: pointer; }
.sb-mlab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-mlab input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.sb-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sb-steps button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font: inherit; text-align: left; cursor: pointer; min-height: 60px; }
.sb-steps button span:last-child { display: flex; flex-direction: column; font-size: 14px; line-height: 1.3; }
.sb-steps small { color: var(--muted); font-size: 12px; }
.sb-n { width: 28px; height: 28px; flex: none; border-radius: 999px; background: var(--line); color: var(--sub); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.sb-steps button.on { border: 2px solid var(--accent); background: var(--acc-soft); }
.sb-steps button.on .sb-n { background: var(--accent); color: var(--on-accent); }
.sb-steps button.done .sb-n { background: var(--ok); color: var(--panel); }
.sb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.sb-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; gap: 6px; padding-bottom: 10px; background: var(--panel); }
.sb-card.off { opacity: .55; }
.sb-card .sb-mlab, .sb-card .row { padding: 0 10px; }
.sb-card .sb-mlab { flex: none; }
.sb-card .row { margin-top: auto; }
.sb-thumb { position: relative; height: 170px; background: #000; }
.sb-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb-num { position: absolute; top: 8px; left: 8px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.sb-len { position: absolute; bottom: 8px; right: 8px; font-size: 11px; color: #fff; background: rgba(0,0,0,.6); padding: 2px 6px; border-radius: 4px; }
.sb-add { border: 1px dashed var(--line2); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 14px; min-height: 240px; text-align: center; padding: 12px; }
.sb-plus { font-size: 28px; line-height: 1; }
.sb-b2 { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; }
.sb-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sb-table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 8px 6px; }
.sb-table td { padding: 8px 6px; border-top: 1px solid var(--line); }
.sb-table td:first-child { cursor: pointer; font-weight: 600; }
.sb-table tr.off td { color: var(--muted); }
.sb-table tr.off td:first-child { text-decoration: line-through; }
.sb-table tr.sel td { background: var(--acc-soft); }
.sb-pill { min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line2); background: var(--inset); color: var(--sub); font: inherit; font-size: 13px; cursor: pointer; }
.sb-pill.on { background: var(--ok); border-color: var(--ok); color: var(--panel); }
.sb-b3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.sb-result { background: var(--acc-soft); border: 1px solid var(--acc-line); border-radius: 16px; padding: 18px; display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(200px, auto); gap: 18px; align-items: center; }
.sb-result video { width: 150px; max-height: 270px; border-radius: 10px; background: #000; }
.sb-ok { color: var(--ok); font-weight: 600; font-size: 13px; }
.sb-actions { gap: 10px; }
.sb-actions .btn { width: 100%; }
#slotB2 .sb-result { grid-template-columns: 120px minmax(0, 1fr); }
#slotB2 .sb-result video { width: 120px; }
#slotB2 .sb-actions { grid-column: 1 / -1; }
@media (max-width: 900px) {
  .sb-a-grid, .sb-b2, .sb-b3 { grid-template-columns: 1fr; }
  .sb-result, #slotB2 .sb-result { grid-template-columns: 110px minmax(0, 1fr); }
  .sb-result video, #slotB2 .sb-result video { width: 110px; }
  .sb-actions { grid-column: 1 / -1; }
  .sb-steps { grid-template-columns: 1fr; }
  .sb-stage { max-width: 260px; }
}
/* brand info + idea -> storyboard planner */
.brandbox { border: 1px dashed var(--line2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.brandbox[open] { border-style: solid; background: var(--inset); }
.brandbox summary { cursor: pointer; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; font-size: 14px; }
.brandbox textarea { width: 100%; }
.planbox { border: 2px solid var(--acc-line); background: var(--acc-soft); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.planshot { display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.planshot textarea { width: 100%; font-size: 13px; }
/* studio — guided (option D), responsive: desktop 2 columns · tablet 1 column + bottom bar · phone compact */
.st-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.st-steps { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.st-step { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.st-h { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.st-n { width: 26px; height: 26px; flex: none; border-radius: 999px; background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.st-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; text-align: left; cursor: pointer; min-height: 64px; min-width: 0; }
.st-card:hover { border-color: var(--line2); }
.st-card.on { border: 2px solid var(--accent); background: var(--acc-soft); padding: 11px; }
.st-card > span { font-size: 12px; color: var(--muted); }
.st-purposes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.st-brand { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--inset); border: 1px solid var(--line); font-size: 14px; }
.st-brand.empty { border-style: dashed; border-color: var(--acc-line); background: var(--acc-soft); }
.st-brand-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.st-brand-edit { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--inset); }
.st-brand-edit textarea { width: 100%; }
#prompt { width: 100%; font-size: 15px; }
.st-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-chip { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.st-chip:hover { border-color: var(--line2); }
.st-chip-ai { border-color: var(--acc-line); background: var(--acc-soft); color: var(--acc-text); font-weight: 600; }
.st-photo { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.st-photo img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.st-aspects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.st-ar { flex-direction: row; align-items: center; gap: 12px; }
.st-ar > span { display: flex; flex-direction: column; color: var(--text); font-size: 14px; }
.st-ar > span span { font-size: 12px; color: var(--muted); }
.st-shape { flex: none; border: 2px solid var(--text); border-radius: 4px; display: inline-block; }
.st-shape[data-ar="9:16"] { width: 18px; height: 30px; }
.st-shape[data-ar="16:9"] { width: 32px; height: 18px; }
.st-shape[data-ar="1:1"] { width: 22px; height: 22px; }
.st-seg { display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.st-segb { flex: 1 1 0; min-width: 52px; min-height: 42px; border: 0; border-right: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.st-segb:last-child { border-right: 0; }
.st-segb.on { background: var(--text); color: var(--bg); font-weight: 700; }
.st-models { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.st-rate { font-size: 12px; color: var(--acc-text) !important; }
.st-adv summary { cursor: pointer; font-size: 14px; color: var(--sub); }
.st-aside { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; }
.st-prevcard { padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.st-phone { background: #17181B; padding: 8px; border-radius: 28px; width: 210px; aspect-ratio: 9 / 16; box-sizing: border-box; transition: width .2s; }
.st-phone[data-ar="16:9"] { width: 100%; max-width: 320px; aspect-ratio: 16 / 9; border-radius: 16px; }
.st-phone[data-ar="1:1"], .st-phone[data-ar="4:3"], .st-phone[data-ar="3:4"] { width: 240px; aspect-ratio: 1 / 1; border-radius: 18px; }
.st-screen { width: 100%; height: 100%; border-radius: 20px; overflow: hidden; background: var(--tone1); display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.st-phone[data-ar="16:9"] .st-screen, .st-phone[data-ar="1:1"] .st-screen { border-radius: 10px; }
.st-screen video, .st-screen img { width: 100%; height: 100%; object-fit: cover; background: #000; display: block; }
.st-screen .ph { display: flex; flex-direction: column; gap: 6px; padding: 12px; font-size: 13px; }
.st-sum { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.st-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.st-row > span:last-child { text-align: right; }
.st-total { align-items: baseline; padding-top: 10px; border-top: 1px solid var(--line); }
.st-total strong { font-size: 26px; }
.st-cta { width: 100%; min-height: 54px; }
.st-mbar { display: none; }
/* tablet */
@media (max-width: 1023px) {
  .st-grid { grid-template-columns: minmax(0, 1fr); }
  .st-aside { position: static; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .st-cta, #ctaNote { display: none; }
  .st-main { padding-bottom: 110px; }
  .st-mbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; align-items: center; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0,0,0,.08); }
  .st-mbar-l { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .st-mbar-l #mbarInfo { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .st-mbar .btn { min-height: 48px; padding: 0 22px; }
  .toast { bottom: 90px; }
}
/* phone */
@media (max-width: 640px) {
  .st-purposes, .st-models { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-aspects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-step { padding: 14px; }
  .st-card { padding: 10px; }
  .st-card.on { padding: 9px; }
  .st-segb { flex: 1 0 25%; border-bottom: 1px solid var(--line); }
  .st-aside { grid-template-columns: minmax(0, 1fr); }
  .st-prevcard { flex-direction: row; justify-content: center; }
  .st-phone { width: 150px; border-radius: 22px; }
  .st-phone[data-ar="16:9"] { max-width: 100%; }
  .st-phone[data-ar="1:1"] { width: 180px; }
  .st-prevcard > span { display: none; }
  .st-mbar .btn { padding: 0 16px; font-size: 15px; }
}
/* responsive fixes: gallery thumbs, compact top bar on phones */
.gthumb { overflow: hidden; aspect-ratio: 1 / 1; }
.gthumb video, .gthumb img { position: absolute; inset: 0; }
@media (max-width: 640px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gbody { padding: 8px; }
  .gactions .btn { min-height: 32px; padding: 0 8px; font-size: 12px; }
  .topbar { padding: 10px 14px; gap: 8px; }
  .topbar-r { gap: 6px; flex-wrap: nowrap; }
  .topbar-r > .btn-ghost { display: none; }
  .chip-credits { padding: 6px 10px; }
  .chip-credits .muted { display: none; }
  .sidenav { gap: 2px; padding: 8px 10px; }
  .sidenav > a { min-height: 36px; padding: 0 10px; font-size: 13px; }
}
/* character bible (optional) */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.st-bible { display: flex; flex-direction: column; gap: 10px; }
.st-bible-sw { min-height: 56px; }
.st-bible-sw > span { display: flex; flex-direction: column; gap: 2px; }
.st-bible-sw small { font-size: 12px; }
.st-bible-panel { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--acc-line); background: var(--acc-soft); border-radius: 12px; }
.bb-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.bb-style { grid-template-columns: auto minmax(0, 1fr); }
.bb-use { display: flex; align-items: center; min-height: 40px; }
.bb-use input { width: 20px; height: 20px; accent-color: var(--accent); }
.bb-mid { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bb-mid input { font-weight: 600; }
.bb-mid textarea, .bb-style textarea { width: 100%; font-size: 13px; }
.bb-side { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.bb-photo { width: 72px; height: 72px; border-radius: 10px; border: 1px dashed var(--line2); background: var(--inset); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; overflow: hidden; padding: 0; }
.bb-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-castsave { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border: 1px dashed var(--acc-line); border-radius: 10px; background: var(--acc-soft); }
@media (max-width: 640px) {
  .bb-row { grid-template-columns: auto minmax(0, 1fr); }
  .bb-side { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .bb-photo { width: 56px; height: 56px; }
}
/* estimated render progress */
.gprog { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; background: var(--tone1); color: var(--acc-text); text-align: center; }
.st-screen .gprog { position: static; width: 100%; height: 100%; }
.gprog-n { font-size: 28px; font-weight: 700; color: var(--text); }
.gprog-bar { width: 80%; max-width: 220px; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.gprog-fill { height: 100%; width: 0; background: var(--accent); transition: width 1s linear; }
.gprog-t { font-size: 12px; color: var(--sub); }
/* account menu + page */
.usermenu .menu-sep { height: 1px; background: var(--line); margin: 4px 6px; }
.usermenu .menu a.menu-danger { color: var(--bad); }
.ac-main { max-width: 640px; }
.ac-tabs { align-self: flex-start; flex-wrap: wrap; }
.ac-tabs a { font-size: 13px; padding: 0 14px; min-height: 36px; }
.ac-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.ac-card h2 { font-size: 18px; }
.ac-card input[disabled] { opacity: .7; }
.ac-ok { border-color: var(--ok); color: var(--ok); background: var(--panel); }
.ac-err { border-color: var(--bad); color: var(--bad); background: var(--panel); }
.ac-danger { border-color: var(--bad); }
.ac-delbtn { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 700; }
.ac-delbtn:hover { color: #fff; filter: brightness(1.08); }
/* password show/hide */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap input { width: 100%; padding-right: 46px; box-sizing: border-box; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.pw-eye:hover, .pw-eye[aria-pressed="true"] { color: var(--text); background: var(--inset); }
.logo-mark { background: none; border-radius: 0; }
/* guided tour */
.tour-shield { position: fixed; inset: 0; z-index: 900; }
.tour-hole { position: fixed; z-index: 901; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(13, 14, 17, .62); outline: 3px solid var(--accent); pointer-events: none; transition: all .25s ease; }
.tour-card { position: fixed; z-index: 902; width: 360px; max-width: calc(100vw - 20px); background: var(--panel); color: var(--text); border-radius: 16px; padding: 18px; box-shadow: 0 16px 50px rgba(0,0,0,.3); display: flex; flex-direction: column; gap: 10px; }
.tour-card.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: 420px; }
.tour-card.dock { left: 10px !important; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); top: auto !important; width: auto; max-width: none; }
.tour-step { font-size: 12px; font-weight: 700; color: var(--acc-text); letter-spacing: .04em; }
.tour-title { font-size: 19px; }
.tour-text { margin: 0; font-size: 14px; line-height: 1.55; color: var(--sub); }
.tour-dots { display: flex; gap: 5px; flex-wrap: wrap; }
.tour-dots i { width: 7px; height: 7px; border-radius: 999px; background: var(--line2); }
.tour-dots i.on { background: var(--accent); width: 18px; }
.tour-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.tour-btns { display: flex; gap: 8px; }
.tour-btns .btn { min-height: 40px; padding: 0 16px; }
/* landing refresh */
.tag-new { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-family: 'Inter Tight', system-ui, sans-serif; font-size: 11px; font-weight: 700; letter-spacing: .02em; vertical-align: 1px; }
.steps4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.feats3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }