:root {
  color-scheme: dark;
  --bg: #101113;
  --surface: #181a1f;
  --surface-2: #202329;
  --line: #32353c;
  --text: #f5f3ee;
  --muted: #aaa69e;
  --quick: #ff6844;
  --quick-2: #8c80ff;
  --quick-soft: #38231e;
  --pro: #e1b45c;
  --pro-soft: #352a19;
  --ok: #62d4a7;
  --danger: #ff8585;
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--quick); outline-offset: 3px; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 30; min-height: 72px; padding: 12px clamp(18px,4vw,48px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); background: #101113e8; backdrop-filter: blur(18px); }
.brand { width: fit-content; padding: 0; display: flex; align-items: center; gap: 12px; border: 0; color: var(--text); background: transparent; cursor: pointer; text-decoration: none; font-size: 18px; font-weight: 820; letter-spacing: -.03em; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: white; background: linear-gradient(145deg,var(--quick),var(--quick-2)); box-shadow: 0 9px 24px #0004; }
.product-tabs { display: flex; align-items: center; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: #0d0e10; }
.product-tab { min-height: 42px; padding: 0 24px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 750; }
.product-tab.is-active { color: #191a1c; background: var(--text); }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 14px; }
.top-actions a, .task-button { border: 0; color: var(--muted); background: transparent; text-decoration: none; cursor: pointer; font-size: 13px; }
.task-button { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); }

.product-view { min-height: calc(100vh - 72px); }
#quick-view { display: grid; grid-template-columns: minmax(390px, .86fr) minmax(480px, 1.14fr); }
.quick-compose { padding: clamp(38px,5vw,76px) clamp(24px,5vw,74px) 72px; border-right: 1px solid var(--line); }
.eyebrow { display: block; color: var(--quick); font-size: 11px; line-height: 1.2; font-weight: 850; letter-spacing: .16em; }
h1 { max-width: 640px; margin: 15px 0 12px; font-size: clamp(38px,5vw,72px); line-height: .98; letter-spacing: -.065em; }
.lead { max-width: 650px; margin: 0 0 40px; color: var(--muted); font-size: 15px; line-height: 1.7; }
form { max-width: 720px; }
fieldset { min-width: 0; margin: 24px 0 0; padding: 0; border: 0; }
legend, .field-head > label { font-weight: 780; }
.field-head { min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-head > span, .inline-actions { color: var(--muted); font-size: 11px; }
.inline-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; }
.text-action { padding: 5px 8px; border: 0; border-radius: 8px; color: var(--quick); background: var(--quick-soft); cursor: pointer; font-weight: 760; }
.muted-action { color: var(--muted); background: transparent; }
textarea, input { width: 100%; color: var(--text); border: 1px solid var(--line); background: var(--surface); }
#prompt { min-height: 190px; margin-top: 10px; padding: 20px; resize: vertical; border-radius: var(--radius); font-size: 17px; line-height: 1.62; }
textarea:focus, input:focus { border-color: color-mix(in srgb,var(--quick) 65%,var(--line)); outline: 0; }
.polish-versions { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 9px; color: var(--muted); font-size: 11px; }
.polish-versions button { border: 0; color: var(--text); background: transparent; cursor: pointer; }
.helper, .action-caption { margin: 8px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.field-error { min-height: 16px; margin: 5px 2px 0; color: var(--danger); font-size: 12px; line-height: 1.5; }
.safety-note { margin: 10px 0 0; padding: 12px 14px; border: 1px solid #62d4a74d; border-radius: 12px; color: var(--muted); background: #182622; font-size: 11px; line-height: 1.55; }
.safety-note strong, .safety-note a { color: var(--ok); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); gap: 4px; margin-top: 10px; padding: 4px; border-radius: 13px; background: var(--surface-2); }
.segmented label { position: relative; min-width: 0; }
.segmented input { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
.segmented span { min-height: 40px; padding: 0 8px; display: grid; place-items: center; border-radius: 9px; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 740; text-align: center; }
.segmented input:checked + span { color: var(--text); background: var(--surface); box-shadow: 0 3px 12px #0003; }
.segmented input:focus-visible + span { outline: 2px solid var(--quick); }
.quality-options { max-width: 440px; }
.provider-note { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; gap: 12px; align-items: center; margin-top: 24px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.provider-orb { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: white; background: linear-gradient(145deg,var(--quick-2),var(--quick)); font-weight: 860; }
.provider-note div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.provider-note div span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.available { color: var(--ok); font-size: 11px; font-weight: 760; }
.advanced { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.advanced summary { color: var(--muted); cursor: pointer; font-size: 12px; }
.seed-row { display: flex; gap: 8px; margin-top: 12px; }
.seed-row input { min-width: 0; padding: 11px 12px; border-radius: 10px; }
.seed-row button, .secondary { min-height: 42px; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface); cursor: pointer; }
.primary, .pro-primary { width: 100%; min-height: 56px; margin-top: 24px; border: 0; border-radius: 14px; color: white; background: linear-gradient(135deg,var(--quick),#ff7d42); cursor: pointer; font-weight: 850; box-shadow: 0 14px 34px #ff684426; }
.primary:disabled, .pro-primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.action-caption { text-align: center; }

.result-stage { min-width: 0; padding: clamp(34px,6vw,88px); display: flex; flex-direction: column; justify-content: center; background: radial-gradient(circle at 78% 12%,#ff684419,transparent 38%),#0c0d0f; }
.result-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.result-head h2 { margin: 7px 0 0; font-size: 28px; letter-spacing: -.04em; }
.status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status i.running { background: var(--pro); animation: pulse 1.3s infinite; }
.status i.ok { background: var(--ok); }
.status i.error { background: var(--danger); }
.video-frame { width: 100%; max-height: 72vh; aspect-ratio: 16/9; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(140deg,#1d2028,#402623 55%,#15171c); box-shadow: 0 28px 80px #0008; }
.video-frame video { width: 100%; height: 100%; object-fit: contain; background: #050608; }
.empty-state { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 28px; color: var(--text); text-align: center; }
.empty-state > span:last-child { color: var(--muted); font-size: 12px; }
.empty-mark { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 17px; background: linear-gradient(145deg,var(--quick-2),var(--quick)); font-weight: 860; }
.progress { position: absolute; inset: auto 0 0; height: 5px; background: #ffffff12; }
.progress span, .pro-progress span { display: block; width: 0; height: 100%; background: var(--quick); transition: width .35s ease; }
.progress-percent { position: absolute; right: 15px; bottom: 15px; z-index: 2; padding: 7px 10px; border: 1px solid #ffffff20; border-radius: 999px; background: #090a0dcf; font-size: 11px; font-weight: 780; }
.result-meta { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.result-actions { display: flex; align-items: center; gap: 12px; }
.result-meta a, .result-meta button, .pro-result-card > a { color: var(--text); text-decoration: none; border: 0; border-bottom: 1px solid var(--muted); background: transparent; font: inherit; font-weight: 760; cursor: pointer; padding: 0; }
.result-meta button:disabled { cursor: wait; opacity: .6; }
.queue-detail, .error-state, .quota-state { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--surface); font-size: 12px; line-height: 1.55; }
.error-state, .quota-state { color: #ffb0b0; border-color: #ff858550; background: #321c20; }
.submission-recovery-actions { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.submission-recovery-actions[hidden] { display: none; }
.inline-decision { margin-top: 10px; padding: 16px; display: grid; gap: 13px; border: 1px solid #e1b45c70; border-radius: 14px; color: var(--text); background: #2b2112; }
.inline-decision[hidden] { display: none; }
.inline-decision p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.inline-decision-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.inline-decision-actions button { min-height: 42px; border-radius: 11px; cursor: pointer; font: inherit; font-weight: 760; }
.inline-decision-actions .danger-action { border: 1px solid #ff858550; color: #ffb0b0; background: #321c20; }
.quota-state { display: flex; flex-direction: column; }

.pro-view { background: #0c0e11; }
.pro-view:not([hidden]) { display: block; }
.pro-rail { position: sticky; top: 72px; z-index: 20; min-height: 88px; padding: 14px clamp(22px,4vw,52px); display: grid; grid-template-columns: minmax(190px,.7fr) minmax(520px,1.8fr) minmax(190px,.7fr); align-items: center; gap: 28px; border-bottom: 1px solid var(--line); background: #111318f3; backdrop-filter: blur(18px); }
.pro-rail-brand { display: flex; align-items: center; gap: 12px; }
.pro-rail-brand > span:last-child { min-width: 0; display: grid; gap: 3px; }
.pro-rail-brand strong { font-size: 16px; letter-spacing: -.02em; }
.pro-rail-brand small { overflow: hidden; color: var(--muted); font-size: 8px; letter-spacing: .13em; text-overflow: ellipsis; white-space: nowrap; }
.pro-logo { width: 42px; height: 42px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #111318; background: var(--text); font-weight: 900; }
.workflow-steps { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.workflow-steps li { min-width: 0; min-height: 58px; padding: 9px 11px; display: flex; align-items: center; gap: 10px; border: 1px solid transparent; border-radius: 14px; color: var(--muted); }
.workflow-steps li > div { min-width: 0; display: grid; gap: 2px; }
.workflow-steps li strong { overflow: hidden; font-size: 12px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.workflow-steps li small { overflow: hidden; font-size: 9px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.workflow-marker { width: 10px; height: 10px; flex: 0 0 auto; border: 2px solid #62656c; border-radius: 50%; background: transparent; }
.workflow-steps li.is-current { color: var(--text); border-color: #e1b45c4c; background: var(--pro-soft); }
.workflow-steps li.is-current .workflow-marker { border-color: var(--pro); background: var(--pro); box-shadow: 0 0 0 5px #e1b45c16; }
.workflow-steps li.is-done { color: var(--ok); }
.workflow-steps li.is-done .workflow-marker { border-color: var(--ok); background: var(--ok); }
.pro-rail > p { justify-self: end; margin: 0; display: grid; gap: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; text-align: right; }
.pro-rail > p strong { color: var(--text); font-size: 11px; }
.pro-workspace { width: min(100%,1040px); min-height: calc(100vh - 160px); margin: 0 auto; padding: clamp(38px,5vw,68px) clamp(22px,5vw,64px) 80px; }
.pro-step h1 { margin: 8px 0 10px; font-size: clamp(42px,6vw,68px); }
.pro-step h2 { margin: 5px 0 0; font-size: clamp(26px,3vw,40px); letter-spacing: -.045em; }
.pro-step h2 + p, .step-heading > div > p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.pro-eyebrow { color: var(--pro); }
.pro-page-intro { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 24px; }
.pro-page-intro .lead { max-width: 620px; margin-bottom: 24px; }
.pro-form-card { padding: clamp(22px,3vw,34px); border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(155deg,#191b20,#14161a); box-shadow: 0 24px 70px #0002; }
.stacked-field { display: grid; gap: 10px; margin-top: 22px; font-size: 13px; font-weight: 770; }
.stacked-field:first-child { margin-top: 0; }
.stacked-field > span { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.5; }
.stacked-field textarea { min-height: 150px; padding: 18px; resize: vertical; border-radius: 16px; line-height: 1.62; }
.stacked-field input { min-height: 50px; padding: 0 16px; border-radius: 13px; }
.duration-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 12px; }
.duration-cards button { min-height: 96px; padding: 18px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; border: 1px solid var(--line); border-radius: 16px; color: var(--text); background: var(--surface); cursor: pointer; text-align: left; }
.duration-cards button span { color: var(--muted); font-size: 11px; }
.duration-cards button.is-selected { color: var(--pro); border-color: var(--pro); background: var(--pro-soft); }
.pro-primary { color: #17120a; background: var(--pro); box-shadow: 0 14px 34px #e1b45c20; }
.compact { width: auto; min-height: 44px; margin: 0; padding: 0 20px; border: 0; border-radius: 11px; cursor: pointer; font-weight: 820; }
.step-heading { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; margin-bottom: 30px; }
.back-link { min-height: 40px; padding: 0 12px 0 9px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: var(--surface); cursor: pointer; font-size: 12px; font-weight: 720; }
.back-link span { color: var(--pro); font-size: 22px; line-height: 0; transform: translateY(-1px); }
.back-link:hover { border-color: #e1b45c66; background: var(--pro-soft); }
.save-state, .pro-badge { padding: 7px 10px; border-radius: 999px; color: var(--pro); background: var(--pro-soft); font-size: 11px; }
.script-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(260px,.5fr); gap: 20px; }
.segment-tabs { display: flex; gap: 8px; padding-bottom: 8px; overflow-x: auto; scrollbar-width: thin; }
.segment-tabs button { flex: 0 0 auto; min-width: 72px; min-height: 42px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: var(--surface); cursor: pointer; }
.segment-tabs button.is-selected { color: var(--pro); border-color: var(--pro); background: var(--pro-soft); }
.segment-tabs button.has-error { color: var(--danger); border-color: var(--danger); }
.button-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.script-summary, .pro-result-card { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.script-summary > p { color: var(--muted); line-height: 1.7; white-space: pre-line; }
.continuity-note { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.continuity-note span { color: var(--pro); font-size: 11px; font-weight: 800; }
.continuity-note p { margin-bottom: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.storyboard-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mode-card { min-height: 128px; padding: 20px; display: grid; gap: 8px; align-content: start; border: 1px solid var(--line); border-radius: 17px; color: var(--text); background: var(--surface); text-align: left; }
.mode-card span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.mode-card i { color: var(--pro); font-size: 11px; font-style: normal; }
.mode-card.is-selected { border-color: var(--pro); background: var(--pro-soft); }
.mode-card:disabled { opacity: .58; }
.storyboard-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 18px; }
.story-card { min-height: 250px; overflow: hidden; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.story-visual { min-height: 104px; padding: 16px; display: flex; align-items: flex-end; justify-content: space-between; color: #f0c46d; background: radial-gradient(circle at 72% 28%,#e1b45c 0 4%,transparent 4.7%),linear-gradient(150deg,#24303a,#15181d 62%,#0b0d10); }
.story-visual span { color: #ffffff8c; font-size: 8px; letter-spacing: .14em; }
.story-visual b { font-size: 20px; letter-spacing: -.03em; }
.story-card > span, .story-card > strong, .story-card > p, .story-card > button { margin-left: 16px; margin-right: 16px; }
.story-card span { color: var(--pro); font-size: 12px; font-weight: 790; }
.story-card strong { font-size: 15px; }
.story-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.story-card button { margin-top: auto; margin-bottom: 16px; width: fit-content; border: 0; color: var(--pro); background: transparent; cursor: pointer; }
.cost-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--line); }
.cost-summary div { padding: 16px; display: grid; gap: 6px; background: var(--surface); }
.cost-summary span { color: var(--muted); font-size: 11px; }
.cost-summary strong { font-size: 12px; }
.production-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(340px,.72fr); gap: 20px; }
.production-list { display: grid; gap: 10px; }
.production-item { min-height: 74px; padding: 14px 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.production-item > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--pro); background: var(--pro-soft); font-size: 11px; font-weight: 800; }
.production-item div { min-width: 0; display: grid; gap: 3px; }
.production-item div small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.production-item > i { color: var(--muted); font-size: 11px; font-style: normal; }
.production-item.is-done > i { color: var(--ok); }
.production-item.is-running > i { color: var(--pro); }
.pro-result-frame { aspect-ratio: 16/9; position: relative; overflow: hidden; border-radius: 14px; background: linear-gradient(145deg,#1c2732,#221b19); }
.pro-result-frame video { width: 100%; height: 100%; object-fit: contain; background: #050608; }
#pro-result-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 7px; text-align: center; }
#pro-result-empty > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: #17120a; background: var(--pro); font-weight: 860; }
#pro-result-empty p { max-width: 260px; margin: 0; color: var(--muted); font-size: 11px; }
.pro-progress { position: absolute; inset: auto 0 0; height: 5px; background: #ffffff12; }
.pro-progress span { background: var(--pro); }
.pro-job-state { display: grid; gap: 5px; margin: 15px 0; }
.pro-job-state span { color: var(--muted); font-size: 11px; line-height: 1.5; }

.task-drawer { position: fixed; z-index: 60; top: 72px; right: 0; width: min(420px,100%); height: calc(100vh - 72px); padding: 28px; overflow-y: auto; border-left: 1px solid var(--line); background: #111318; box-shadow: -24px 0 70px #0009; }
.drawer-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.drawer-head h2 { margin: 6px 0 0; }
.drawer-head button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface); cursor: pointer; font-size: 24px; }
.task-drawer > p { color: var(--muted); font-size: 11px; line-height: 1.5; }
.drawer-backdrop { position: fixed; z-index: 50; inset: 72px 0 0; background: #0008; backdrop-filter: blur(3px); }
.task-list { display: grid; gap: 10px; margin-top: 22px; }
.task-entry { padding: 15px; display: grid; gap: 7px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.task-entry > div { display: flex; justify-content: space-between; gap: 12px; }
.task-entry strong { font-size: 12px; }
.task-entry span, .task-entry p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.task-entry button { width: fit-content; border: 0; color: var(--quick); background: transparent; cursor: pointer; padding: 0; }
.task-entry .task-actions { justify-content: flex-start; gap: 16px; }
.task-entry .task-actions button:last-child { color: var(--muted); }
.task-entry .task-remove-decision { padding-top: 10px; display: grid; gap: 9px; border-top: 1px solid var(--line); }
.task-entry .task-remove-decision p { color: var(--text); }
.task-entry .task-remove-decision .task-actions { display: flex; }
.task-entry .task-remove-decision [data-confirm-remove-task] { color: #ff9f9f; }

@keyframes pulse { 50% { opacity: .35; } }
@media (max-width: 980px) {
  #quick-view { grid-template-columns: 1fr; }
  .quick-compose { border-right: 0; border-bottom: 1px solid var(--line); }
  .result-stage { min-height: 620px; }
  .pro-rail { top: 72px; min-height: 72px; padding: 9px 18px; grid-template-columns: 1fr; }
  .pro-rail-brand, .pro-rail > p { display: none; }
  .workflow-steps { gap: 5px; }
  .workflow-steps li { min-height: 52px; justify-content: center; padding: 7px 5px; gap: 7px; }
  .workflow-steps li small { display: none; }
  .workflow-steps li strong { font-size: 11px; }
  .workflow-marker { width: 8px; height: 8px; }
  .script-layout, .production-layout { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .task-drawer { top: 62px; height: calc(100vh - 62px); }
  .drawer-backdrop { inset: 62px 0 0; }
  .inline-decision-actions { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .topbar { grid-template-columns: auto 1fr auto; gap: 8px; padding: 10px 14px; }
  .brand > span:last-child { display: none; }
  .product-tabs { justify-self: end; }
  .product-tab { min-height: 38px; padding: 0 11px; font-size: 12px; }
  .top-actions { width: auto; justify-content: flex-end; }
  .top-actions a { display: none; }
  .task-button { min-height: 38px; padding: 0 11px; }
  #quick-view { min-height: auto; }
  .quick-compose, .result-stage, .pro-workspace { padding: 34px 18px 48px; }
  .pro-rail { top: 72px; padding: 7px 12px; }
  .workflow-steps li { min-height: 48px; flex-direction: column; gap: 5px; }
  .workflow-steps li strong { font-size: 10px; }
  .pro-page-intro { grid-template-columns: 1fr; gap: 2px; }
  .pro-page-intro > .pro-badge { width: fit-content; margin-bottom: 16px; }
  .pro-form-card { padding: 18px; border-radius: 18px; }
  .field-grid, .duration-cards, .storyboard-mode, .storyboard-grid, .cost-summary { grid-template-columns: 1fr; }
  .result-stage { min-height: 520px; }
  .step-heading { grid-template-columns: 1fr auto; }
  .step-heading .back-link { grid-column: 1 / -1; justify-self: start; }
  .storyboard-grid { grid-template-columns: 1fr 1fr; }
  .cost-summary { gap: 0; }
}
@media (max-width: 430px) {
  .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
  .storyboard-grid { grid-template-columns: 1fr; }
  .field-head { align-items: flex-start; }
  .inline-actions { max-width: 70%; }
  #prompt { min-height: 165px; }
  .provider-note { grid-template-columns: auto minmax(0,1fr) auto; }
  .provider-note #retry-service-button { grid-column: 2 / -1; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
