:root {
  --iv-brand: #bf5b24;
  --iv-brand-dark: #934118;
  --iv-brand-soft: #fff3ea;
  --iv-ink: #231f1c;
  --iv-muted: #746d67;
  --iv-line: #e8ded6;
  --iv-surface: #fff;
  --iv-bg: #f7f3ef;
  --iv-success: #21845a;
  --iv-danger: #c43e35;
  --iv-shadow: 0 18px 50px rgba(67, 43, 28, .12);
  --iv-radius-sm: 10px;
  --iv-radius-md: 16px;
  --iv-radius-lg: 24px;
}

html { scroll-behavior: smooth; }
body { background: var(--iv-bg) !important; color: var(--iv-ink); }
body.iv-modal-open { overflow: hidden; }

.topbar-shell { max-width: 1760px !important; }
.topbar-nav .nav-link[data-nav-action="template"] { display: none !important; }
.iv-mobile-menu-button { display: none !important; min-width: 44px; min-height: 44px; }
.brand-logo-openlai { width: 184px !important; height: 68px !important; max-width: 21vw; object-fit: contain !important; border-radius: 8px; }
.topbar-brand:has(.brand-logo-openlai) { min-width: 184px; }

.creation-shell { max-width: 1760px !important; width: min(1760px, 100%) !important; --flow-sidebar-width: clamp(210px, 15vw, 260px) !important; --flow-gap: clamp(18px, 1.7vw, 30px) !important; }
.flow-content { min-width: 0; }
body[data-app-view] .creation-shell { grid-template-columns: var(--flow-sidebar-width) minmax(0, 1fr) !important; }
body[data-app-view] .flow-content { width: 100% !important; max-width: none !important; margin: 0 !important; }
body[data-app-view] .flow-content > .layout,
body[data-app-view] .flow-content > .front-resource-showcase { display: none !important; }
.flow-sidebar { position: sticky; top: 86px; align-self: start; max-height: calc(100vh - 102px); overflow: auto; }
.flow-sidebar .sidebar-system, .flow-sidebar .sidebar-invite { display: none; }
.flow-sidebar-head span { line-height: 1.55; }

.iv-page { display: none; width: 100%; min-height: calc(100vh - 120px); padding: 30px clamp(14px, 2vw, 34px) 80px; }
body[data-app-view="home"] #iv-home-page,
body[data-app-view="workspace"] #iv-workspace-page,
body[data-app-view="portraits"] #iv-portraits-page,
body[data-app-view="scenes"] #iv-scenes-page,
body[data-app-view="records"] #iv-records-page,
body[data-app-view="help"] #iv-help-page { display: block; }

body:not([data-app-view="workspace"]) .flow-step-shell { display: none; }
body[data-app-view="workspace"] .flow-step-shell { display: block !important; }
body[data-app-view="home"] .flow-sidebar { display: none; }
body[data-app-view="home"] .creation-shell { display: block; max-width: none !important; width: 100% !important; }
body[data-app-view="home"] .flow-content { width: 100%; }

.iv-page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin: 0 0 28px; max-width: none; }
.iv-page-head h1 { margin: 0 0 6px; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.04em; }
.iv-page-head p { margin: 0; color: var(--iv-muted); line-height: 1.65; }
.iv-page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.iv-primary, .iv-secondary, .iv-ghost, .iv-danger {
  border: 0; border-radius: 12px; min-height: 44px; padding: 0 18px; font-weight: 750; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: .18s ease;
}
.iv-primary { background: var(--iv-brand); color: #fff; box-shadow: 0 9px 24px rgba(191, 91, 36, .22); }
.iv-primary:hover { background: var(--iv-brand-dark); transform: translateY(-1px); }
.iv-secondary { background: var(--iv-surface); color: var(--iv-ink); border: 1px solid var(--iv-line); }
.iv-ghost { background: transparent; color: var(--iv-muted); }
.iv-danger { background: #fff0ef; color: var(--iv-danger); border: 1px solid #f4cbc7; }
.iv-primary:disabled, .iv-secondary:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.iv-home-hero { position: relative; overflow: hidden; min-height: calc(100vh - 128px); display: grid; place-items: center; padding: 80px 24px; background:
  radial-gradient(circle at 14% 12%, rgba(255,255,255,.72), transparent 28%),
  linear-gradient(135deg, #f0ded0 0%, #fbf6f1 52%, #e9efe9 100%); }
.iv-home-hero::after { content: ''; position: absolute; width: 420px; height: 420px; right: -120px; bottom: -190px; border-radius: 50%; background: rgba(191,91,36,.10); }
.iv-home-copy { position: relative; z-index: 1; max-width: 820px; text-align: center; }
.iv-eyebrow { display: inline-flex; gap: 8px; align-items: center; color: var(--iv-brand-dark); font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.iv-home-copy h1 { margin: 18px 0; font-size: clamp(42px, 7vw, 76px); line-height: 1.04; letter-spacing: -.065em; }
.iv-home-copy p { max-width: 680px; margin: 0 auto; color: #625b55; font-size: clamp(17px, 2vw, 21px); line-height: 1.75; }
.iv-home-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.iv-home-actions button { min-height: 52px; padding-inline: 26px; }
.iv-home-proof { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 1120px; margin: -46px auto 42px; position: relative; z-index: 2; background: #fff; border: 1px solid var(--iv-line); border-radius: var(--iv-radius-lg); box-shadow: var(--iv-shadow); }
.iv-proof-item { padding: 24px; border-right: 1px solid var(--iv-line); }
.iv-proof-item:last-child { border-right: 0; }
.iv-proof-item b { display: block; font-size: 26px; margin-bottom: 6px; }
.iv-proof-item span { color: var(--iv-muted); font-size: 13px; }
.iv-home-section { max-width: 1120px; margin: 0 auto 44px; padding: 0 18px; }
.iv-home-section h2 { font-size: 30px; letter-spacing: -.035em; }
.iv-journey-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.iv-journey-card { padding: 24px; background: #fff; border: 1px solid var(--iv-line); border-radius: var(--iv-radius-md); }
.iv-journey-card i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--iv-brand-soft); color: var(--iv-brand); font-style: normal; font-weight: 900; }
.iv-journey-card h3 { margin: 18px 0 8px; }
.iv-journey-card p { margin: 0; color: var(--iv-muted); line-height: 1.65; font-size: 14px; }

.iv-workspace-shell { width: 100%; max-width: none; margin: 0; }
.iv-workspace-summary { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(120px, .6fr)); gap: 1px; background: var(--iv-line); border: 1px solid var(--iv-line); border-radius: var(--iv-radius-md); overflow: hidden; margin-bottom: 16px; }
.iv-summary-cell { padding: 15px 18px; background: #fff; min-width: 0; }
.iv-summary-cell span { display: block; color: var(--iv-muted); font-size: 12px; margin-bottom: 5px; }
.iv-summary-cell b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iv-step-rail { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.iv-step { min-height: 70px; text-align: left; padding: 12px 14px; border: 1px solid var(--iv-line); border-radius: 14px; background: #fff; cursor: pointer; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; }
.iv-step-index { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #eee8e3; font-weight: 800; }
.iv-step strong, .iv-step small { display: block; }
.iv-step strong { color: var(--iv-ink) !important; }
.iv-step small { color: var(--iv-muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iv-step[data-state="current"] { border-color: var(--iv-brand); background: var(--iv-brand-soft); box-shadow: inset 0 0 0 1px var(--iv-brand); }
.iv-step[data-state="current"] .iv-step-index, .iv-step[data-state="completed"] .iv-step-index { background: var(--iv-brand); color: #fff; }
.iv-step[data-state="locked"] { opacity: .58; }
.iv-workspace-panels > .section { display: none !important; border-radius: 0 !important; box-shadow: none !important; border: 0 !important; background: transparent !important; padding: 18px 0 0 !important; overflow: visible !important; }
body[data-interview-step="input"] #section-script-workbench,
body[data-interview-step="script"] #section-script-workbench,
body[data-interview-step="confirm"] #section-generation-workbench,
body[data-interview-step="result"] #section-preview-workbench { display: block !important; }
body[data-interview-step="input"] #section-script-workbench #oralCopyEditor,
body[data-interview-step="input"] #section-script-workbench .copy-meta,
body[data-interview-step="input"] #section-script-workbench #prepareVideoBlueprintBtn,
body[data-interview-step="input"] #section-script-workbench #generateScriptBtn,
body[data-interview-step="input"] #section-script-workbench #videoBlueprintSummaryShell { display: none !important; }
body[data-interview-step="script"] #section-script-workbench .home-composer-main > .content-mode-toggle,
body[data-interview-step="script"] #section-script-workbench .composer-topic-field,
body[data-interview-step="script"] #section-script-workbench #frontInterviewConfig,
body[data-interview-step="script"] #section-script-workbench #quickSetupGrid,
body[data-interview-step="script"] #section-script-workbench #composerSubmitBtn { display: none !important; }
body[data-interview-step="script"] #section-script-workbench > .panel > .actions {
  justify-content: center;
}
body[data-interview-step="script"] #section-script-workbench .script-review-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  margin-top: 26px;
}
body[data-interview-step="script"] #section-script-workbench .script-review-actions .home-action-note {
  margin: 0;
}
body[data-interview-step="script"] #section-script-workbench #prepareVideoBlueprintBtn {
  min-width: 270px;
  min-height: 54px;
  padding-inline: 28px;
  border-color: var(--iv-brand);
  color: var(--iv-brand-dark);
  font-weight: 800;
}
body[data-interview-step="script"] #section-script-workbench #videoBlueprintSummaryShell {
  display: none !important;
}
.iv-workspace-panels .section[aria-hidden="true"] { visibility: hidden; }
.iv-validation { padding: 12px 14px; margin-bottom: 12px; border-radius: 12px; background: #fff7e7; color: #7a5717; font-size: 14px; }
.iv-validation.is-ready { background: #edf8f2; color: #176b48; }
.iv-position-contract { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 12px 0; padding: 12px; border: 1px dashed #e2b692; border-radius: 12px; background: #fff9f4; color: #7b421f; font-weight: 700; }

.iv-library-shell { width: 100%; max-width: none; margin: 0; }
.iv-library-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 12px; margin-bottom: 18px; }
.iv-library-toolbar input, .iv-library-toolbar select, .iv-modal input, .iv-modal select, .iv-modal textarea { width: 100%; min-height: 46px; border: 1px solid var(--iv-line); border-radius: 12px; background: #fff; padding: 10px 13px; color: var(--iv-ink); }
.iv-asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.iv-asset-card { overflow: hidden; background: #fff; border: 1px solid var(--iv-line); border-radius: var(--iv-radius-md); cursor: pointer; transition: .18s ease; }
.iv-asset-card:hover { transform: translateY(-2px); box-shadow: var(--iv-shadow); }
.iv-asset-media { aspect-ratio: 4/5; background: #ede9e4; overflow: hidden; position: relative; }
.iv-asset-card.is-scene .iv-asset-media { aspect-ratio: 16/10; }
.iv-asset-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.iv-asset-placeholder { height: 100%; display: grid; place-items: center; color: #aaa19a; font-weight: 700; }
.iv-job-placeholder { align-content: center; gap: 10px; text-align: center; padding: 24px; }
.iv-job-placeholder b, .iv-job-placeholder span { display: block; }
.iv-job-placeholder span { color: var(--iv-muted); font-size: 12px; font-weight: 500; }
.iv-job-card .iv-state-chip { left: 10px; top: 10px; }
.iv-job-spinner { width: 30px; height: 30px; display: inline-block; border: 3px solid #ead6c5; border-top-color: var(--iv-primary); border-radius: 50%; animation: iv-job-spin .8s linear infinite; }
.iv-job-wait { min-height: 240px; display: grid; place-items: center; align-content: center; gap: 12px; text-align: center; }
.iv-job-wait h3, .iv-job-wait p { margin: 0; }
.iv-job-wait p { max-width: 460px; color: var(--iv-muted); line-height: 1.7; }
@keyframes iv-job-spin { to { transform: rotate(360deg); } }
.iv-asset-body { padding: 14px; }
.iv-asset-body b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iv-asset-body span { display: block; color: var(--iv-muted); font-size: 12px; margin-top: 6px; }
.iv-use-asset { width: 100%; margin-top: 10px; }
.iv-asset-badge { position: absolute; top: 10px; left: 10px; padding: 5px 8px; border-radius: 99px; background: rgba(255,255,255,.9); font-size: 11px; font-weight: 800; }
.iv-asset-menu { position: absolute; right: 8px; bottom: 8px; z-index: 3; }
.iv-asset-menu-trigger { width: 34px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(70,55,45,.12); border-radius: 9px; background: rgba(255,255,255,.94); color: var(--iv-ink); padding: 0; cursor: pointer; box-shadow: 0 3px 12px rgba(42,31,23,.1); }
.iv-asset-menu-dots { display: block; font-size: 18px; font-weight: 800; line-height: 1; letter-spacing: 0; transform: translateY(-2px); }
.iv-asset-menu-trigger:hover, .iv-asset-menu-trigger:focus-visible { background: #fff; color: var(--iv-primary); }
.iv-asset-menu-popover { display: none; position: absolute; right: 0; bottom: 36px; width: 116px; padding: 5px; border: 1px solid var(--iv-line); border-radius: 10px; background: #fff; box-shadow: var(--iv-shadow); }
.iv-asset-menu.is-open .iv-asset-menu-popover { display: grid; }
.iv-asset-menu-popover button { border: 0; border-radius: 7px; background: transparent; padding: 9px 10px; color: var(--iv-ink); text-align: left; cursor: pointer; }
.iv-asset-menu-popover button:hover { background: #f7f2ee; }
.iv-asset-menu-popover button.is-danger { color: var(--iv-danger); }
.iv-optimization-badge { position: absolute; left: 10px; bottom: 10px; z-index: 3; padding: 6px 9px; border-radius: 999px; background: #fff8e8; color: #8a5a10; font-size: 11px; font-weight: 850; box-shadow: 0 3px 12px rgba(42,31,23,.12); }
.iv-optimization-badge.is-running { background: #fff8e8; color: #8a5a10; }
.iv-optimization-badge.is-ready { background: #eaf7f1; color: #176a4d; }
.iv-optimization-badge.is-failed { background: #fff0ef; color: var(--iv-danger); }
.iv-optimizer-job-wait { min-height: 250px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; text-align: center; }
.iv-optimizer-job-wait span, .iv-job-wait.is-failed span, .iv-job-wait.is-failed small { display: block; color: var(--iv-muted); line-height: 1.6; }
.iv-empty { grid-column: 1/-1; min-height: 340px; display: grid; place-items: center; text-align: center; background: transparent; border: 1px dashed #d8ccc2; border-radius: 18px; padding: 30px; }
.iv-empty h3 { margin: 0 0 8px; }
.iv-empty p { color: var(--iv-muted); margin: 0 0 18px; }

.iv-record-grid { display: grid; gap: 0; width: 100%; max-width: none; margin: 0; border-top: 1px solid var(--iv-line); }
.iv-record { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(130px, .55fr)) auto; gap: 18px; align-items: center; padding: 20px 8px; background: transparent; border: 0; border-bottom: 1px solid var(--iv-line); border-radius: 0; }
.iv-record:has(.iv-record-video) { grid-template-columns: minmax(180px, 240px) minmax(0, 1.6fr) repeat(3, minmax(110px, .55fr)) auto; }
.iv-record-video { width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; background: #171717; object-fit: cover; }
.iv-record span { color: var(--iv-muted); font-size: 12px; }
.iv-record b { display: block; margin-top: 4px; }
.iv-state-chip { display: inline-flex !important; width: fit-content; padding: 5px 9px; border-radius: 99px; background: #eee9e4; color: #5e5751 !important; font-weight: 800; }
.iv-state-chip.is-success { background: #e9f7ef; color: var(--iv-success) !important; }
.iv-state-chip.is-running { background: #fff3dc; color: #9a6310 !important; }
.iv-state-chip.is-failed { background: #ffefee; color: var(--iv-danger) !important; }

.iv-help-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; max-width: 960px; margin: 0 auto; }
.iv-help-card { background: #fff; border: 1px solid var(--iv-line); border-radius: var(--iv-radius-md); padding: 22px; }
.iv-help-card h3 { margin-top: 0; }
.iv-help-card p, .iv-help-card li { color: var(--iv-muted); line-height: 1.7; }
.iv-help-card ol { margin: 0; padding-left: 20px; }
.iv-help-tag { display: inline-flex; margin-bottom: 12px; padding: 5px 9px; border-radius: 999px; background: var(--iv-brand-soft); color: var(--iv-brand-dark); font-size: 11px; font-weight: 850; letter-spacing: .04em; }

.iv-guide-card { min-height: 250px; padding: 26px; border: 1px solid var(--iv-line); border-radius: 18px; background: linear-gradient(145deg, #fff, #f8efe7); }
.iv-guide-progress { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 34px; }
.iv-guide-progress i { height: 5px; border-radius: 999px; background: #e5dcd5; }
.iv-guide-progress i.is-active { background: var(--iv-brand); }
.iv-guide-index { display: block; color: var(--iv-brand); font-size: 12px; font-weight: 900; letter-spacing: .12em; }
.iv-guide-card h3 { margin: 10px 0; font-size: 26px; }
.iv-guide-card p { margin: 0; color: var(--iv-muted); font-size: 15px; line-height: 1.8; }
.iv-guide-actions { justify-content: flex-end; }
.iv-guide-layer { position: fixed; inset: 0; z-index: 12000; pointer-events: none; }
.iv-modal-layer:has(.iv-guide-target) { z-index: 12001; }
.iv-guide-shade { position: absolute; inset: 0; background: rgba(21, 18, 16, .68); backdrop-filter: blur(1px); }
.iv-guide-target { position: relative !important; z-index: 12001 !important; border-radius: 14px !important; outline: 4px solid #fff !important; box-shadow: 0 0 0 8px var(--iv-brand), 0 16px 48px rgba(0,0,0,.32) !important; animation: ivGuidePulse 1.8s ease-in-out infinite; }
.iv-guide-tooltip { position: fixed; left: 0; top: 0; z-index: 12003; padding: 24px; border: 1px solid rgba(255,255,255,.7); border-radius: 18px; background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.35); pointer-events: auto; }
.iv-guide-tooltip::before { content: ''; position: absolute; left: 34px; top: -9px; width: 18px; height: 18px; background: #fff; transform: rotate(45deg); }
.iv-guide-tooltip.is-above::before { top: auto; bottom: -9px; }
.iv-guide-dismiss { position: absolute; right: 12px; top: 10px; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: #f4efeb; color: var(--iv-ink); font: 700 22px/1 Arial, sans-serif; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-align: center; }
.iv-guide-kicker { display: block; padding-right: 34px; color: var(--iv-brand-dark); font-size: 12px; font-weight: 900; letter-spacing: .06em; }
.iv-guide-tooltip h3 { margin: 12px 0 8px; font-size: 24px; }
.iv-guide-tooltip p { margin: 0; color: var(--iv-muted); font-size: 14px; line-height: 1.75; }
.iv-guide-tip { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; color: var(--iv-brand); font-size: 12px; font-weight: 850; }
.iv-guide-tip::before { content: '↑'; font-size: 16px; }
.iv-guide-tooltip.is-above .iv-guide-tip::before { content: '↓'; }
.iv-guide-tooltip footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--iv-line); }
@keyframes ivGuidePulse { 0%, 100% { outline-color: #fff; } 50% { outline-color: #ffe6d6; } }

.iv-modal-layer { display: none; position: fixed; inset: 0; z-index: 10000; background: rgba(28,22,18,.54); padding: 24px; align-items: center; justify-content: center; }
.iv-modal-layer.is-open { display: flex; }
.iv-modal { width: min(760px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: #fff; border-radius: 22px; box-shadow: 0 30px 90px rgba(0,0,0,.25); padding: 24px; }
.iv-modal.is-wide { width: min(1080px, 100%); }
.iv-modal-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 20px; }
.iv-modal-head h2 { margin: 0 0 4px; }
.iv-modal-head p { margin: 0; color: var(--iv-muted); }
.iv-modal-close { box-sizing: border-box; flex: 0 0 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--iv-line); background: #fff; color: var(--iv-ink) !important; border-radius: 50%; width: 42px; height: 42px; line-height: 1; cursor: pointer; font-size: 21px; }
.iv-create-choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.iv-create-choice { min-height: 126px; text-align: left; padding: 20px; border: 0; border-radius: 16px; background: #08677b; color: #fff; cursor: pointer; }
.iv-create-choice b, .iv-create-choice span { display: block; }
.iv-create-choice b { font-size: 18px; margin-bottom: 10px; }
.iv-create-choice span { opacity: .86; line-height: 1.55; }
.iv-modal-form-host > form, .iv-modal-form-host > .builder-card { display: block !important; box-shadow: none !important; border: 0 !important; padding: 0 !important; }
.iv-delivery-form { margin: 0 !important; background: transparent !important; }
.iv-delivery-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr); gap: 38px; align-items: start; }
.iv-delivery-main { min-width: 0; }
.iv-delivery-section { padding: 2px 0 28px; margin-bottom: 28px; border-bottom: 1px solid var(--iv-line); }
.iv-delivery-section-head { display: block; margin-bottom: 20px; }
.iv-delivery-section-head > span { display: none; }
.iv-delivery-section-head h3 { margin: 1px 0 6px; font-size: 19px; }
.iv-delivery-section-head p { margin: 0; color: var(--iv-muted); font-size: 13px; line-height: 1.6; }
.iv-delivery-section-body { display: grid; gap: 20px; }
.iv-create-group-field { display: grid; gap: 10px; }
.iv-create-group-field > label { display: grid; gap: 9px; }
.iv-inline-group-create { grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 12px; border: 1px solid var(--iv-line); border-radius: 12px; background: #faf7f4; }
.iv-inline-group-create:not([hidden]) { display: grid; }
.iv-inline-group-create button { min-height: 46px; white-space: nowrap; }
.iv-delivery-section-body > label, .iv-delivery-section-body > .field { display: grid; gap: 9px; margin: 0 !important; }
.iv-delivery-form label { color: var(--iv-ink); font-size: 14px; font-weight: 750; }
.iv-delivery-form input, .iv-delivery-form select { min-height: 54px !important; padding-inline: 16px !important; }
.iv-delivery-form textarea { min-height: 148px !important; padding: 15px 16px !important; line-height: 1.65; resize: vertical; }
.iv-delivery-form .section-grid.three { display: grid !important; grid-template-columns: repeat(3, minmax(0,1fr)) !important; gap: 14px !important; margin: 0 !important; }
.iv-delivery-form .actions { display: flex !important; gap: 12px; justify-content: flex-start; margin: 0 !important; }
.iv-delivery-form .actions button, .iv-delivery-form--upload button[type="submit"] { min-height: 52px; padding: 0 22px; }
.iv-scene-presets { display: grid; gap: 10px; }
.iv-scene-presets > span { color: var(--iv-ink); font-size: 14px; font-weight: 750; }
.iv-scene-presets .iv-preset { min-height: 38px; padding: 8px 14px; border: 1px solid var(--iv-line); border-radius: 999px; background: #fff; color: var(--iv-muted); cursor: pointer; }
.iv-scene-presets .iv-preset:hover, .iv-scene-presets .iv-preset.is-active { border-color: var(--iv-brand); background: var(--iv-brand-soft); color: var(--iv-brand) !important; }
.iv-delivery-preview, .iv-upload-guide { position: sticky; top: 0; min-height: 500px; padding: 26px; border-radius: 20px; background: #f7f2ed; border: 1px solid #eadfd5; }
.iv-preview-kicker, .iv-upload-guide > span { display: inline-flex; padding: 6px 10px; border-radius: 99px; background: #fff; color: var(--iv-brand-dark); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.iv-delivery-preview h3, .iv-upload-guide h3 { margin: 18px 0 8px; font-size: 21px; }
.iv-delivery-preview > p { margin: 0 0 22px; color: var(--iv-muted); font-size: 13px; line-height: 1.7; }
.iv-delivery-preview .compact-preview { display: grid !important; gap: 16px; margin: 0 !important; }
.iv-delivery-preview .output.compact { min-height: 210px; padding: 18px; border: 1px dashed #d8c7b9; border-radius: 16px; background: rgba(255,255,255,.72); }
.iv-delivery-preview pre { margin: 0; white-space: pre-wrap; color: var(--iv-muted); font-family: inherit; line-height: 1.6; }
.iv-delivery-preview .preview-image { width: 100%; max-height: 430px; object-fit: contain; border-radius: 16px; background: #fff; }
.iv-prompt-presets { display: grid; gap: 12px; margin-bottom: 14px; padding: 14px; border: 1px solid var(--iv-line); border-radius: 14px; background: #faf7f4; }
.iv-prompt-presets-head b, .iv-prompt-presets-head span { display: block; }
.iv-prompt-presets-head b { font-size: 13px; }
.iv-prompt-presets-head span { margin-top: 3px; color: var(--iv-muted); font-size: 12px; font-weight: 400; }
.iv-prompt-preset-list { display: flex; flex-wrap: wrap; gap: 8px; }
.iv-prompt-preset-list button { min-height: 34px; padding: 0 11px; border: 1px solid #decfc3; border-radius: 999px; background: #fff; color: var(--iv-brand-dark); font-size: 12px; font-weight: 750; cursor: pointer; }
.iv-prompt-preset-list button:hover { border-color: var(--iv-brand); background: var(--iv-brand-soft); }
.iv-upload-guide ul { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.iv-upload-guide li { padding: 13px 0 13px 30px; border-bottom: 1px solid #e7d9cd; position: relative; color: #5f5852; }
.iv-upload-guide li::before { content: '✓'; position: absolute; left: 2px; color: var(--iv-brand); font-weight: 900; }
.iv-optimizer-workbench { display: grid; grid-template-columns: minmax(360px,.92fr) minmax(520px,1.08fr); gap: 22px; align-items: start; }
.iv-optimizer-compare { min-width: 0; padding: 18px; border: 1px solid var(--iv-line); border-radius: 16px; background: #fbfaf8; }
.iv-optimizer-compare > h3, .iv-optimizer-section h3 { margin: 0; font-size: 16px; }
.iv-optimizer-images { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 16px; }
.iv-optimizer-images figure { min-width: 0; margin: 0; }
.iv-optimizer-images figure > span { display: inline-flex; margin: 0 0 8px; padding: 5px 9px; border-radius: 99px; background: #eef5f2; color: #22624f; font-size: 11px; font-weight: 850; }
.iv-optimizer-preview { aspect-ratio: 3/4; background: #f4f0ec; border: 1px dashed #dbcfc5; border-radius: 14px; overflow: hidden; display: grid; place-items: center; }
.iv-optimizer-preview img { width: 100%; height: 100%; object-fit: contain; }
.iv-optimizer-preview p { max-width: 190px; margin: 0; padding: 16px; color: var(--iv-muted); font-size: 13px; line-height: 1.65; text-align: center; }
.iv-optimizer-preview.iv-source img { object-fit: cover; }
.iv-optimizer-grid { display: grid; grid-template-columns: minmax(260px, 420px) minmax(320px, 1fr); gap: 24px; align-items: start; }
.iv-generated-review .iv-optimizer-preview { width: min(100%, 420px); max-height: min(62vh, 620px); margin: 0 auto; aspect-ratio: auto; }
.iv-generated-review .iv-optimizer-preview img { width: auto; max-width: 100%; height: auto; max-height: min(62vh, 620px); object-fit: contain; }
.iv-generated-review .iv-optimizer-controls h3 { margin: 18px 0 8px; font-size: 15px; }
.iv-generated-prompt { max-height: 230px; margin: 0; padding: 14px; overflow: auto; border: 1px solid var(--iv-line); border-radius: 12px; background: #faf8f5; color: var(--iv-muted); font-size: 13px; line-height: 1.65; }
.iv-review-hint { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #fff7ec; color: #7a5436; font-size: 12px; line-height: 1.65; }
.iv-optimizer-tip { margin-top: 14px; padding: 12px 14px 12px 34px; border: 1px solid #dbe4df; border-radius: 12px; background: #f3f7f5; color: #53635d; font-size: 12px; line-height: 1.6; position: relative; }
.iv-optimizer-tip::before { content: '●'; position: absolute; left: 14px; color: #286b58; }
.iv-optimizer-controls { min-width: 0; display: grid; gap: 0; align-content: start; }
.iv-optimizer-section { padding: 18px 0; border-bottom: 1px solid var(--iv-line); }
.iv-optimizer-section > p { margin: 7px 0 13px; color: var(--iv-muted); font-size: 12px; line-height: 1.55; }
.iv-optimizer-section .iv-preset-row { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.iv-optimizer-section .iv-preset { min-height: 42px; padding: 8px 10px; }
.iv-optimizer-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 14px; }
.iv-optimizer-fields-three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.iv-optimizer-fields-four { grid-template-columns: repeat(2,minmax(0,1fr)); }
.iv-optimizer-fields label { display: grid; gap: 7px; font-size: 12px; font-weight: 800; }
.iv-optimizer-fields select { min-height: 44px; }
.iv-optimizer-advanced { margin-top: 13px; border: 1px solid var(--iv-line); border-radius: 12px; background: #fff; }
.iv-optimizer-advanced summary { padding: 12px 14px; cursor: pointer; font-size: 13px; font-weight: 800; }
.iv-optimizer-advanced summary span { margin-left: 5px; color: var(--iv-muted); font-size: 11px; font-weight: 500; }
.iv-optimizer-advanced textarea { width: calc(100% - 24px); margin: 0 12px 12px; min-height: 86px; }
.iv-optimizer-actions { display: grid; grid-template-columns: minmax(150px,1fr) auto auto; gap: 10px; align-items: center; margin-top: 16px; padding: 15px; border: 1px solid var(--iv-line); border-radius: 14px; background: #fbfaf8; }
.iv-optimizer-actions > div { display: grid; gap: 4px; }
.iv-optimizer-actions b { font-size: 14px; }
.iv-optimizer-actions small { color: var(--iv-muted); font-size: 11px; }
.iv-person-detail { display: grid; grid-template-columns: minmax(250px, .72fr) minmax(0, 1.28fr); gap: 24px; align-items: start; }
.iv-person-detail-photo { min-height: 390px; aspect-ratio: 3/4; border-radius: 18px; overflow: hidden; background: #eee9e4; display: grid; place-items: center; color: var(--iv-muted); }
.iv-person-detail-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.iv-person-detail-main { min-width: 0; display: grid; gap: 20px; }
.iv-scene-detail { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr); gap: 24px; align-items: start; }
.iv-scene-detail-preview { aspect-ratio: 16/9; max-height: 520px; overflow: hidden; border-radius: 16px; background: #eee9e4; display: grid; place-items: center; color: var(--iv-muted); }
.iv-scene-detail-preview img { width: 100%; height: 100%; display: block; object-fit: contain; }
.iv-scene-detail-main { min-width: 0; display: grid; gap: 16px; align-content: start; }
.iv-scene-detail-main > label { display: grid; gap: 8px; color: var(--iv-ink); font-size: 14px; font-weight: 800; }
.iv-scene-detail-main .iv-validation { margin: 0; }
.iv-scene-detail-main .iv-modal-actions { margin-top: 2px; }
.iv-person-fields { display: grid; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--iv-line); }
.iv-person-fields label { display: grid; gap: 8px; color: var(--iv-ink); font-size: 14px; font-weight: 800; }
.iv-person-voice { padding-bottom: 22px; border-bottom: 1px solid var(--iv-line); }
.iv-person-voice header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.iv-person-voice h3 { margin: 0; font-size: 18px; }
.iv-person-voice p { margin: 10px 0 14px; color: var(--iv-muted); font-size: 13px; line-height: 1.65; }
.iv-person-voice audio { width: 100%; margin: 0 0 14px; }
.iv-voice-badge { display: inline-flex; padding: 6px 11px; border-radius: 99px; border: 1px solid #d8e3df; background: #eef6f3; color: #315c50; font-size: 12px; font-weight: 800; }
.iv-person-voice-actions, .iv-person-detail-actions, .iv-person-detail-actions > div { display: flex; gap: 10px; flex-wrap: wrap; }
.iv-person-detail-actions { justify-content: space-between; align-items: center; }
.iv-person-detail-actions button, .iv-person-voice-actions button { min-height: 44px; padding-inline: 18px; }
.iv-preset-row { display: flex; flex-wrap: wrap; gap: 8px; }
.iv-preset { border: 1px solid var(--iv-line); border-radius: 99px; background: #fff; color: var(--iv-ink) !important; min-height: 38px; padding: 0 12px; cursor: pointer; }
.iv-preset.is-active { border-color: var(--iv-brand); background: var(--iv-brand-soft); color: var(--iv-brand-dark); }
.iv-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.iv-progress { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; margin: 16px 0; }
.iv-progress span { min-height: 7px; border-radius: 99px; background: #e8e1dc; }
.iv-progress span.is-done, .iv-progress span.is-active { background: var(--iv-brand); }
.iv-mobile-actions { display: none; }

@media (max-width: 760px) {
  .iv-person-detail { grid-template-columns: 1fr; }
  .iv-person-detail-photo { min-height: 300px; max-height: 460px; }
  .iv-person-detail-actions { align-items: stretch; }
  .iv-person-detail-actions > div, .iv-person-detail-actions > button { width: 100%; }
}

/* 单人访谈只呈现受访人；双人模式才恢复采访人和角色关系。 */
#frontRoleConfigGrid.is-single .role-card.is-interviewer,
#frontRoleConfigGrid.is-single .role-relation-chip {
  display: none !important;
}

#frontRoleConfigGrid:not(.is-single) .role-card.is-interviewer {
  display: grid !important;
}

#frontRoleConfigGrid:not(.is-single) .role-relation-chip {
  display: inline-flex !important;
}

/* Keep the legacy builder as an implementation host, but present one broad, flat workspace. */
body[data-app-view="workspace"] .iv-page { padding-inline: clamp(14px, 1.8vw, 30px); }
body[data-app-view="workspace"] #section-script-workbench { --home-axis-width: 100% !important; --home-main-max: 100% !important; }
body[data-app-view="workspace"] #section-script-workbench .section-head { width: 100% !important; max-width: none !important; justify-content: flex-start !important; text-align: left !important; }
body[data-app-view="workspace"] #section-script-workbench .title-wrap { justify-content: flex-start !important; }
body[data-app-view="workspace"] #section-script-workbench .title-copy { align-items: flex-start !important; }
body[data-app-view="workspace"] #section-script-workbench .section-grid,
body[data-app-view="workspace"] #section-script-workbench .home-composer,
body[data-app-view="workspace"] #section-script-workbench .home-composer-main { width: 100% !important; max-width: none !important; margin: 0 !important; }
body[data-app-view="workspace"] #section-script-workbench .home-composer { grid-template-columns: minmax(0, 1fr) !important; }
body[data-app-view="workspace"] #section-script-workbench .section-grid { gap: 22px !important; }
body[data-app-view="workspace"] #section-script-workbench .home-composer-main { grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); column-gap: 26px; align-items: start; }
body[data-app-view="workspace"] #section-script-workbench .content-mode-toggle,
body[data-app-view="workspace"] #section-script-workbench .composer-topic-field { grid-column: 1; }
body[data-app-view="workspace"] #section-script-workbench #frontInterviewConfig { grid-column: 2; grid-row: 1 / span 2; }
body[data-app-view="workspace"] #section-script-workbench .interview-config-card { padding: 0 0 0 24px !important; border: 0 !important; border-left: 1px solid var(--iv-line) !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
body[data-app-view="workspace"] #section-script-workbench #frontRoleConfigGrid { grid-template-columns: minmax(0, 1fr) !important; gap: 10px; align-items: stretch; }
body[data-app-view="workspace"] #section-script-workbench #frontRoleConfigGrid .role-card { width: 100%; min-width: 0; grid-template-columns: 58px minmax(0, 1fr); }
body[data-app-view="workspace"] #section-script-workbench #frontRoleConfigGrid .role-copy { min-width: 0; }
body[data-app-view="workspace"] #section-script-workbench #frontRoleConfigGrid .role-copy small { line-height: 1.45; }
body[data-app-view="workspace"] #section-script-workbench #frontRoleRelation { display: flex; width: 100%; min-width: 0; white-space: normal; text-align: center; line-height: 1.5; }
body[data-app-view="workspace"] #section-script-workbench #frontInterviewAutoRow { grid-template-columns: minmax(130px, .72fr) minmax(0, 1fr); }
body[data-app-view="workspace"] #section-script-workbench .role-card,
body[data-app-view="workspace"] #section-script-workbench .interview-auto-row,
body[data-app-view="workspace"] #section-script-workbench .auto-camera-note { border-radius: 0 !important; box-shadow: none !important; background: transparent !important; border: 0 !important; border-top: 1px solid var(--iv-line) !important; padding-inline: 0 !important; }
body[data-app-view="workspace"] #section-script-workbench .composer-topic-field textarea { min-height: 360px !important; border-radius: 18px !important; box-shadow: none !important; background: #fff !important; }
body[data-app-view="workspace"] #section-script-workbench .surface-note { max-width: none !important; margin: 0 !important; text-align: left !important; }
body[data-app-view="workspace"] #section-script-workbench { min-height: 0 !important; }
body[data-app-view="workspace"] #section-script-workbench .home-estimate-card { display: none !important; }

/* Input composer: keep every creation choice inside one top-to-bottom canvas. */
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .home-composer-main {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(190px, .34fr) !important;
  gap: 0 !important;
  padding: 0 !important;
  overflow: visible;
  border: 1px solid var(--iv-line);
  border-radius: 20px;
  background: #fff;
  margin-top: 72px !important;
}
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .content-mode-toggle {
  order: 1;
  grid-column: 1 / -1;
  margin: -64px auto 24px;
}

/* Give the creation header, mode switch, and sidebar steps room to breathe. */
body[data-app-view="workspace"] #iv-workspace-page > .iv-page-head { margin-bottom: 42px; }
body[data-app-view="workspace"] #iv-workspace-page > .iv-page-head h1 { font-size: clamp(32px, 3.4vw, 44px); }
body[data-app-view="workspace"] #iv-workspace-page > .iv-page-head p { max-width: 620px; font-size: 14px; line-height: 1.6; }
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .section-head { margin-bottom: 26px !important; }
body[data-app-view="workspace"][data-interview-step="input"] #scriptWorkbenchTitle { font-size: clamp(36px, 3.3vw, 48px) !important; line-height: 1.1; }
body[data-app-view="workspace"][data-interview-step="input"] #scriptWorkbenchNote { max-width: 620px !important; font-size: 14px !important; line-height: 1.6; }
body[data-app-view="workspace"] .flow-step-list { gap: 16px; margin-top: 14px; }
body[data-app-view="workspace"] .flow-step-tab { min-height: 78px; padding: 16px 14px; }
body[data-app-view="workspace"] .flow-step-copy { gap: 5px; }
body[data-app-view="workspace"] .flow-step-copy span { line-height: 1.5; }
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench #frontInterviewConfig {
  order: 2;
  grid-column: 1;
  grid-row: auto;
  padding: 18px 10px 8px 20px !important;
  border: 0 !important;
  background: transparent !important;
}
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .interview-config-head,
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench #frontInterviewAutoRow,
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench #frontRoleRelation {
  display: none !important;
}
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench #frontRoleConfigGrid {
  display: flex !important;
  gap: 24px;
  align-items: flex-start;
}
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench #frontRoleConfigGrid.is-single {
  display: flex !important;
}
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench #frontRoleConfigGrid .role-card {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  width: auto;
  min-width: 150px;
  min-height: 54px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  cursor: pointer;
}
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench #frontRoleConfigGrid .role-card:hover .role-copy b { color: var(--iv-brand); }
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .role-avatar {
  width: 46px;
  height: 46px;
}
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .role-copy {
  align-content: center;
  gap: 1px;
}
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .role-copy small { display: none; }
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .role-copy b { font-size: 14px; }
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .front-role-select {
  display: none;
}
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench #quickSetupGrid {
  order: 3;
  display: grid !important;
  grid-column: 2;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  margin: 0 !important;
  padding: 18px 20px 8px 10px;
}
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench #quickSetupGrid [data-quick-action="portrait"],
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench #quickSetupGrid [data-quick-action="ratio"],
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench #quickSetupGrid [data-quick-action="duration"] {
  display: none !important;
}
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench #quickSetupGrid .quick-setup-card {
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench #quickSetupGrid .quick-setup-card:hover {
  border: 0;
  box-shadow: none;
  transform: none;
}
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench #quickSetupGrid .quick-setup-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border-color: var(--iv-line);
  background: #faf8f6;
}
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench #quickSetupGrid .quick-setup-copy b { font-size: 14px; }
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .composer-topic-field {
  order: 4;
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  border: 0;
}
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .composer-topic-field textarea {
  min-height: 330px !important;
  padding: 24px 24px 108px !important;
  border: 0 !important;
  border-radius: 0 0 20px 20px !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none;
}
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .composer-input-meta {
  bottom: 82px;
}
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .composer-tool-row {
  left: 18px;
  right: 84px;
  bottom: 18px;
}
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .composer-submit-btn {
  right: 18px;
  bottom: 18px;
  width: auto;
  min-width: 112px;
  padding: 0 22px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
}
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .composer-submit-btn.is-loading {
  position: absolute !important;
  right: 18px !important;
  bottom: 18px !important;
  width: 44px;
  height: 44px;
  padding: 0 !important;
  color: transparent;
  font-size: 0;
}

.iv-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; max-height: min(62vh, 620px); overflow: auto; padding: 2px; }
.iv-picker-card { min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--iv-line); border-radius: 16px; background: #fff; color: var(--iv-ink); text-align: left; cursor: pointer; box-shadow: none; }
.iv-picker-card:hover { transform: translateY(-1px); border-color: rgba(240, 100, 27, .55); box-shadow: 0 12px 28px rgba(75, 44, 24, .1); }
.iv-picker-card.is-selected { border: 2px solid var(--iv-brand); background: var(--iv-brand-soft); }
.iv-picker-media { display: grid; place-items: center; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; background: #f3efeb; }
.iv-picker-card.is-scene .iv-picker-media, .iv-picker-card.is-no-scene .iv-picker-media { aspect-ratio: 16 / 10; }
.iv-picker-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.iv-picker-empty { padding: 18px; color: var(--iv-muted); font-size: 13px; text-align: center; }
.iv-picker-copy { display: grid; gap: 4px; padding: 12px 14px 14px; }
.iv-picker-copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.iv-picker-copy small { color: var(--iv-muted); font-size: 12px; }
#quickSceneThumb:has(img) svg { display: none; }
#quickSceneThumb img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .composer-submit-btn.is-loading::before {
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: 0;
  transform: translate(-50%, -50%);
}
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .prompt-chip-row,
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .home-composer-main > .section-grid,
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .home-composer-main > .collapsible-card,
body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .home-composer-main > .home-estimate-card {
  order: 5;
  grid-column: 1 / -1;
}

@media (max-width: 760px) {
  body[data-interview-step="script"] #section-script-workbench .script-review-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }
  body[data-interview-step="script"] #section-script-workbench #prepareVideoBlueprintBtn {
    width: 100%;
    min-width: 0;
  }
  body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .home-composer-main {
    grid-template-columns: 1fr !important;
    margin-top: 58px !important;
  }
  body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench #frontRoleConfigGrid {
    flex-wrap: wrap;
  }
  body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench #frontInterviewConfig { padding: 16px 18px 6px !important; }
  body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench #quickSetupGrid {
    grid-column: 1;
    grid-template-columns: 1fr;
    padding: 8px 18px;
  }
  body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .composer-tool-row {
    right: 18px;
    overflow-x: auto;
  }
  body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .composer-topic-field textarea { padding-bottom: 156px !important; }
  body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .composer-submit-btn {
    right: 18px;
    bottom: 76px;
  }
  body[data-app-view="workspace"][data-interview-step="input"] #section-script-workbench .composer-submit-btn.is-loading {
    right: 18px !important;
    bottom: 76px !important;
  }
}

/* Chengyuan-style account overview without card-on-card nesting. */
.account-menu[data-iv-enhanced="true"] { width: min(360px, calc(100vw - 28px)); padding: 18px; border-radius: 18px; }
.iv-account-head { display: grid; grid-template-columns: 46px 1fr; gap: 12px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--iv-line); }
.iv-account-avatar { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--iv-brand-dark), #d59a56); font-weight: 850; }
.iv-account-head b, .iv-account-head span { display: block; }
.iv-account-head span { margin-top: 4px; color: var(--iv-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iv-account-balance { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 18px 4px; border-bottom: 1px solid var(--iv-line); }
.iv-account-balance span, .iv-account-balance b { display: block; }
.iv-account-balance span { color: var(--iv-muted); font-size: 12px; }
.iv-account-balance b { margin-top: 5px; font-size: 22px; }
.iv-account-list { display: grid; padding: 8px 0; }
.iv-account-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; width: 100%; min-height: 44px; padding: 0 6px; border: 0; border-bottom: 1px solid #f1ebe6; border-radius: 0; background: transparent; color: var(--iv-ink); text-align: left; cursor: pointer; }
.iv-account-row b { color: var(--iv-brand-dark); font-size: 12px; }
.iv-account-ledger summary { list-style: none; }
.iv-account-ledger summary::-webkit-details-marker { display: none; }
.iv-ledger-list { max-height: 230px; overflow: auto; padding: 4px 6px 10px; }
.iv-ledger-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f1ebe6; }
.iv-ledger-row span b, .iv-ledger-row span small { display: block; }
.iv-ledger-row span b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.iv-ledger-row span small { color: var(--iv-muted); margin-top: 3px; font-size: 11px; }
.iv-ledger-row strong { color: var(--iv-danger); font-size: 13px; }
.iv-ledger-row strong.is-positive { color: var(--iv-success); }
.iv-ledger-empty { padding: 16px 0; color: var(--iv-muted); font-size: 12px; text-align: center; }
.iv-account-logout { width: 100%; min-height: 44px; border: 0; border-radius: 10px; background: var(--iv-brand); color: #fff; font-weight: 800; cursor: pointer; }
.iv-account-center { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--iv-line); }
.iv-account-center section { padding: 18px 6px; border-bottom: 1px solid var(--iv-line); }
.iv-account-center section:nth-child(odd) { margin-right: 22px; }
.iv-account-center span, .iv-account-center b { display: block; }
.iv-account-center span { color: var(--iv-muted); font-size: 12px; }
.iv-account-center b { margin-top: 6px; overflow-wrap: anywhere; }
.iv-account-security { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--iv-line); }
.iv-account-security b, .iv-account-security span { display: block; }
.iv-account-security span { margin-top: 4px; color: var(--iv-muted); font-size: 13px; }

/* The old builder screens remain as implementation hosts, not user-facing pages. */
#section-core-config, #section-portrait-assets, #section-scene-assets, #section-current-context,
#section-voice-assets, .front-summary-strip { display: none !important; }

@media (min-width: 960px) {
  body[data-interview-step="input"] #section-script-workbench .home-composer-main,
  body[data-interview-step="script"] #section-script-workbench .section-grid { max-width: 940px; margin-inline: auto; }
}

@media (max-width: 1040px) {
  .iv-asset-grid { grid-template-columns: repeat(3, 1fr); }
  .iv-home-proof { grid-template-columns: repeat(2, 1fr); margin-inline: 18px; }
  .iv-proof-item:nth-child(2) { border-right: 0; }
  .iv-proof-item:nth-child(-n+2) { border-bottom: 1px solid var(--iv-line); }
  .iv-workspace-summary { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 1180px) {
  body[data-app-view="workspace"] #section-script-workbench .home-composer-main { grid-template-columns: 1fr; }
  body[data-app-view="workspace"] #section-script-workbench #frontInterviewConfig { grid-column: 1; grid-row: auto; }
  body[data-app-view="workspace"] #section-script-workbench .interview-config-card { padding: 20px 0 0 !important; border-left: 0 !important; border-top: 1px solid var(--iv-line) !important; }
  body[data-app-view="workspace"] #section-script-workbench #frontRoleConfigGrid { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important; }
  body[data-app-view="workspace"] #section-script-workbench #frontRoleRelation { width: auto; white-space: nowrap; }
}

@media (max-width: 820px) {
  .topbar-nav { display: none !important; position: fixed; top: 72px; left: 12px; right: 12px; padding: 12px; border-radius: 16px; background: #fff; box-shadow: var(--iv-shadow); z-index: 9999; }
  body.iv-menu-open .topbar-nav { display: grid !important; }
  .topbar-nav .nav-link { min-height: 44px; display: flex; align-items: center; }
  .iv-mobile-menu-button { display: inline-flex !important; }
  .credit-chip, .topbar-icon-btn { display: none !important; }
  body[data-app-view] .creation-shell { display: block !important; }
  .flow-sidebar { display: none !important; }
  .iv-page { padding: 18px 14px 92px; }
  .iv-page-head { display: grid; }
  .iv-page-actions { width: 100%; }
  .iv-page-actions > * { flex: 1; }
  .iv-journey-grid { grid-template-columns: repeat(2, 1fr); }
  .iv-step-rail { display: flex; overflow-x: auto; padding-bottom: 5px; }
  .iv-step { min-width: 210px; }
  .iv-library-toolbar { grid-template-columns: 1fr; }
  .iv-asset-grid { grid-template-columns: repeat(2, 1fr); }
  .iv-record { grid-template-columns: 1fr 1fr; }
  .iv-record > :first-child { grid-column: 1/-1; }
  .iv-help-grid { grid-template-columns: 1fr; }
  .iv-optimizer-grid, .iv-optimizer-workbench, .iv-scene-detail { grid-template-columns: 1fr; }
  .iv-optimizer-section .iv-preset-row, .iv-optimizer-fields-three { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .iv-optimizer-actions { grid-template-columns: 1fr 1fr; }
  .iv-optimizer-actions > div { grid-column: 1 / -1; }
  .iv-create-choices { grid-template-columns: 1fr; }
  .iv-delivery-layout { grid-template-columns: 1fr; gap: 24px; }
  .iv-delivery-preview, .iv-upload-guide { position: static; min-height: 0; }
  .iv-delivery-form .section-grid.three { grid-template-columns: 1fr !important; }
  .iv-mobile-actions { position: fixed; display: flex; left: 0; right: 0; bottom: 0; z-index: 9000; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); gap: 10px; background: rgba(255,255,255,.96); border-top: 1px solid var(--iv-line); backdrop-filter: blur(14px); }
  body:not([data-app-view="workspace"]) .iv-mobile-actions { display: none; }
  .iv-mobile-actions button { flex: 1; min-height: 48px; }
  body[data-app-view="workspace"] #section-script-workbench #frontRoleConfigGrid,
  body[data-app-view="workspace"] #section-script-workbench #frontInterviewAutoRow { grid-template-columns: 1fr !important; }
  body[data-app-view="workspace"] #section-script-workbench #frontRoleRelation { width: 100%; white-space: normal; }
}

@media (max-width: 520px) {
  .topbar-brand-copy span { display: none; }
  .brand-logo-openlai { width: 124px !important; height: 54px !important; max-width: 34vw; }
  .topbar-brand:has(.brand-logo-openlai) { min-width: 124px; }
  .account-trigger { max-width: 112px; overflow: hidden; text-overflow: ellipsis; }
  .iv-home-hero { min-height: 470px; padding: 64px 18px; }
  .iv-home-copy h1 { font-size: 43px; }
  .iv-home-proof { grid-template-columns: 1fr; margin-top: -30px; }
  .iv-proof-item { border-right: 0; border-bottom: 1px solid var(--iv-line); }
  .iv-proof-item:last-child { border-bottom: 0; }
  .iv-journey-grid, .iv-asset-grid { grid-template-columns: 1fr; }
  .iv-workspace-summary { grid-template-columns: 1fr; }
  .iv-modal-layer { padding: 10px; }
  .iv-modal { padding: 18px; border-radius: 18px; }
  .iv-delivery-section { padding-bottom: 22px; margin-bottom: 22px; }
  .iv-delivery-form .actions { display: grid !important; }
  .iv-inline-group-create:not([hidden]) { grid-template-columns: 1fr; }
  .iv-delivery-form .actions button { width: 100%; }
  .iv-delivery-preview, .iv-upload-guide { padding: 20px; }
  .iv-guide-tooltip { padding: 20px; }
  .iv-guide-tooltip h3 { font-size: 21px; }
}

/* A real 9:16 generation stage replaces the empty landscape player. */
body[data-app-view="workspace"] #section-preview-workbench .video-box { justify-items: center; }
.video-generation-frame {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(160deg, #211b18, #090807);
  box-shadow: 0 20px 48px rgba(59, 42, 31, .18);
}
.video-generation-frame video { width: 100%; height: 100%; object-fit: contain; border-radius: 0; background: #080706; }
.video-generation-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 38px;
  color: #fff;
  text-align: center;
  background: radial-gradient(circle at 50% 32%, rgba(255, 132, 65, .2), transparent 34%), linear-gradient(160deg, #30251f, #100d0b);
}
.video-generation-placeholder[hidden] { display: none !important; }
.video-generation-placeholder b { font-size: 22px; }
.video-generation-placeholder span { max-width: 280px; color: rgba(255,255,255,.72); font-size: 14px; line-height: 1.65; }
.video-generation-placeholder small { color: rgba(255,255,255,.58); font-size: 12px; }
.video-generation-continue { min-height: 40px; margin-top: 4px; padding: 0 16px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; background: rgba(255,255,255,.1); color: #fff; font-size: 13px; font-weight: 800; cursor: pointer; }
.video-generation-continue:hover { background: rgba(255,255,255,.18); }
.video-generation-spinner { width: 54px; height: 54px; border: 3px solid rgba(255,255,255,.16); border-top-color: #ff7a32; border-radius: 50%; animation: spin .9s linear infinite; }
.video-generation-progress { width: min(100%, 270px); height: 6px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.14); }
.video-generation-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff6a1f, #ffb068); transition: width .4s ease; }
.video-generation-frame.is-failed .video-generation-spinner { animation: none; border-color: rgba(255,255,255,.2); border-top-color: #ef6a63; }
.video-generation-frame.is-failed .video-generation-progress i { background: #ef6a63; }

.recent-video-panel { padding: 16px !important; }
.recent-video-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.recent-video-head > div { display: grid; gap: 3px; }
.recent-video-head b { font-size: 16px; }
.recent-video-head span { color: var(--iv-muted); font-size: 12px; }
.recent-video-head button { min-height: 36px; padding: 0 12px; }
.recent-video-list { display: grid; gap: 8px; }
.recent-video-item { width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--iv-line); border-radius: 13px; background: #fff; color: var(--iv-ink); text-align: left; cursor: pointer; }
.recent-video-item:hover, .recent-video-item.is-active { border-color: #efb48f; background: #fff8f3; }
.recent-video-index { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--iv-brand-soft); color: var(--iv-brand); font-weight: 800; }
.recent-video-copy { min-width: 0; display: grid; gap: 4px; }
.recent-video-copy b, .recent-video-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-video-copy small, .recent-video-empty { color: var(--iv-muted); font-size: 12px; }
.recent-video-empty { padding: 20px; text-align: center; border: 1px dashed var(--iv-line); border-radius: 13px; }
.iv-cloud-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.iv-cloud-summary > div { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--iv-line); border-radius: 14px; background: #fffaf6; }
.iv-cloud-summary span { color: var(--iv-muted); font-size: 12px; }
.iv-cloud-list { display: grid; gap: 8px; max-height: 58vh; overflow: auto; }
.iv-cloud-filters { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; }
.iv-cloud-filters button { min-width: 76px; min-height: 38px; padding: 0 16px; border: 1px solid var(--iv-line); border-radius: 999px; background: #fff; color: var(--iv-muted); font-weight: 800; cursor: pointer; }
.iv-cloud-filters button.is-active { border-color: var(--iv-brand); background: var(--iv-brand-soft); color: var(--iv-brand); }
.iv-cloud-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; width: 100%; padding: 14px; border: 1px solid var(--iv-line); border-radius: 14px; background: #fff; color: var(--iv-ink); text-align: left; cursor: pointer; }
.iv-cloud-row[hidden] { display: none !important; }
.iv-cloud-row:hover { border-color: #efb48f; background: #fff8f3; }
.iv-cloud-row span { min-width: 0; display: grid; gap: 5px; }
.iv-cloud-row b, .iv-cloud-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iv-cloud-row small { color: var(--iv-muted); }
.iv-cloud-row strong { flex: 0 0 auto; color: var(--iv-success); }
.iv-cloud-kind { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--iv-brand-soft); color: var(--iv-brand); font-style: normal; font-weight: 900; }
.iv-cloud-thumb { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: #f2ece7; }
.iv-cloud-video-thumb { display: block; background: #171310; pointer-events: none; }
.iv-cloud-delete { min-width: 58px; min-height: 34px; padding: 0 12px; border: 1px solid #efc6bd; border-radius: 10px; background: #fff8f6; color: #c33f2f; font-weight: 800; cursor: pointer; }
.iv-cloud-delete:hover { border-color: #d35c49; background: #fff0ec; }
.iv-cloud-delete:disabled { cursor: wait; opacity: .6; }
.iv-cloud-protected { color: var(--iv-muted); font-size: 12px; white-space: nowrap; }
.iv-cloud-audio-row { cursor: default; }
.iv-cloud-audio-row audio { width: min(100%, 320px); height: 32px; margin-top: 5px; }
.iv-cloud-filter-empty { padding: 28px; border: 1px dashed var(--iv-line); border-radius: 14px; color: var(--iv-muted); text-align: center; }

@media (max-width: 760px) {
  .video-generation-frame { width: min(100%, 360px); }
  .recent-video-head { align-items: stretch; flex-direction: column; }
  .iv-cloud-summary { grid-template-columns: 1fr; }
  .iv-cloud-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; }
  .iv-cloud-row > strong { display: none; }
  .iv-cloud-delete { min-width: 48px; padding: 0 8px; }
}
