:root {
  color-scheme: light dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f4f6fb; --surface: #ffffff; --surface-raised: #ffffff; --surface-soft: #f7f8fc;
  --text: #151a2d; --text-soft: #606a80; --border: #dde2ec; --border-strong: #cbd2df;
  --primary: #6657e8; --primary-strong: #5143cb; --primary-soft: #efedff;
  --success: #0b7a55; --success-soft: #e4f6ee; --danger: #b3261e; --danger-soft: #ffebe9;
  --shadow-sm: 0 1px 2px rgba(24, 32, 56, .05), 0 8px 24px rgba(24, 32, 56, .06);
  --shadow-lg: 0 18px 50px rgba(24, 32, 56, .16);
  --radius-sm: 10px; --radius-md: 14px; --radius-lg: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1020; --surface: #15192b; --surface-raised: #1b2035; --surface-soft: #1c2135;
    --text: #f2f3fb; --text-soft: #aeb5c8; --border: #2d344a; --border-strong: #414a65;
    --primary: #9c91ff; --primary-strong: #b5adff; --primary-soft: #29264d;
    --success: #5bd2a2; --success-soft: #163c31; --danger: #ff938d; --danger-soft: #472420;
    --shadow-sm: 0 10px 30px rgba(0, 0, 0, .18); --shadow-lg: 0 20px 60px rgba(0, 0, 0, .38);
  }
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
button, textarea, select, input { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, textarea:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible, article:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 62%, transparent); outline-offset: 3px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin: 0; }

.skip-link { position: fixed; top: 8px; left: 8px; z-index: 1000; padding: 10px 14px; border-radius: 8px; background: var(--text); color: var(--surface); text-decoration: none; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.app-shell { min-height: 100dvh; background: radial-gradient(circle at 78% 8%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 32rem); }
.topbar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 10px max(20px, calc((100vw - 1400px) / 2)); border-bottom: 1px solid color-mix(in srgb, var(--border) 78%, transparent); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(16px); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--primary); color: white; box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 24%, transparent); }
.brand-mark svg { width: 22px; height: 22px; stroke-width: 1.65; }
.brand > span:last-child { display: grid; line-height: 1.16; }
.brand strong { font-size: 15px; letter-spacing: -.01em; }
.brand small { margin-top: 3px; color: var(--text-soft); font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.runtime-status { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 7px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-soft); font-size: 12px; font-weight: 700; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 14%, transparent); }

.shell { width: min(calc(100% - 40px), 1400px); margin: 0 auto; padding: 30px 0 64px; }
.intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 24px; }
.eyebrow { margin-bottom: 6px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .13em; }
h1 { font-size: clamp(28px, 3.2vw, 42px); line-height: 1.08; letter-spacing: -.035em; }
.intro-copy { max-width: 720px; margin-top: 10px; color: var(--text-soft); font-size: 15px; }
.policy-badge { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; min-width: 190px; padding: 10px 13px; border: 1px solid color-mix(in srgb, var(--success) 36%, var(--border)); border-radius: var(--radius-md); background: color-mix(in srgb, var(--success-soft) 80%, var(--surface)); color: var(--success); }
.policy-badge svg { width: 23px; height: 23px; }
.policy-badge span { display: grid; line-height: 1.25; }
.policy-badge strong { font-size: 12px; }
.policy-badge small { font-size: 11px; color: color-mix(in srgb, var(--success) 75%, var(--text)); }
.beta-auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 1.4fr) auto; align-items: end; gap: 16px; margin-bottom: 20px; padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border)); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--primary-soft) 48%, var(--surface)); box-shadow: var(--shadow-sm); }
.beta-auth h2 { margin-bottom: 2px; }
.beta-auth-form { min-width: 0; }
.beta-auth-form > label { display: block; margin-bottom: 6px; color: var(--text); font-size: 12px; font-weight: 750; }
.beta-auth-controls { display: flex; align-items: center; gap: 8px; }
.beta-auth-controls input { width: 100%; min-width: 0; min-height: 44px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--text); }
.beta-auth-controls input:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); outline: none; }
.secondary-button { min-height: 44px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 12px; font-weight: 750; white-space: nowrap; transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease; }
.secondary-button:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.beta-auth .feedback { min-height: 0; margin-top: 6px; }
.beta-wallet { min-width: 150px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); text-align: right; }
.beta-wallet strong { display: block; color: var(--primary); font-size: 17px; font-variant-numeric: tabular-nums; }
.beta-wallet span { display: block; color: var(--text-soft); font-size: 10px; }

.workspace { display: grid; grid-template-columns: minmax(390px, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
.composer-panel, .jobs-panel { min-width: 0; }
.composer-panel { position: sticky; top: 20px; }
.composer-card { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.source-mode { display: flex; gap: 8px; margin: 0 0 14px; padding: 0; border: 0; }
.source-mode legend { margin-bottom: 7px; color: var(--text-soft); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.source-mode label { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.source-mode label:has(input:checked) { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: var(--primary-soft); color: var(--primary); }
.source-mode input { width: 18px; height: 18px; accent-color: var(--primary); }
.custom-prompt-fields[hidden] { display: none; }
.template-field { margin-bottom: 14px; padding: 12px; border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border)); border-radius: var(--radius-md); background: color-mix(in srgb, var(--primary-soft) 38%, var(--surface)); }
.template-field-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; color: var(--primary); }
.template-field-heading svg { flex: 0 0 auto; width: 18px; height: 18px; }
.template-field-heading label { margin: 0; color: var(--text); }
.template-field select { background: var(--surface); }
.section-header { min-height: 62px; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: color-mix(in srgb, var(--surface) 82%, transparent); box-shadow: var(--shadow-sm); }
.section-heading-icon { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--primary-soft); color: var(--primary); }
.section-heading-icon svg { width: 19px; height: 19px; }
.section-heading-copy { min-width: 0; display: grid; gap: 2px; }
.section-heading-copy > div { display: flex; align-items: center; gap: 8px; }
.section-heading-copy p { color: var(--text-soft); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-header-actions { margin-left: auto; }
h2 { font-size: 18px; line-height: 1.25; letter-spacing: -.015em; }
.privacy-note { flex: 0 0 auto; margin-left: auto; padding: 4px 7px; border-radius: 999px; background: var(--surface-soft); color: var(--text-soft); font-size: 9px; font-weight: 700; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: 6px; color: var(--text); font-size: 12px; font-weight: 750; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.label-row span { color: var(--text-soft); font-size: 10px; font-variant-numeric: tabular-nums; }
textarea, select { width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--text); transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease; }
textarea:hover, select:hover { border-color: var(--border-strong); }
textarea:focus, select:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }
textarea { min-height: 126px; padding: 11px 12px; resize: vertical; line-height: 1.55; }
select { min-width: 0; padding: 8px 36px 8px 11px; text-overflow: ellipsis; }
.field-hint { margin-top: 6px; color: var(--text-soft); font-size: 10px; line-height: 1.45; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.reference-field { margin-top: 13px; }
.reference-picker { min-height: 44px; display: flex !important; align-items: center; justify-content: center; gap: 8px; margin: 0 !important; padding: 8px 10px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--text-soft) !important; cursor: pointer; transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease; }
.reference-picker:hover, .reference-field:focus-within .reference-picker { border-color: var(--primary); background: var(--primary-soft); color: var(--primary) !important; }
.reference-picker svg { width: 17px; height: 17px; }
.reference-preview { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.reference-preview:empty { display: none; }
.reference-card { position: relative; min-width: 0; aspect-ratio: 1; overflow: hidden; margin: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); }
.reference-card > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.reference-alias { position: absolute; z-index: 1; left: 4px; bottom: 4px; max-width: calc(100% - 8px); overflow: hidden; padding: 2px 4px; border-radius: 4px; background: rgba(8, 12, 24, .48); color: rgba(255, 255, 255, .76); font-size: 8px; font-weight: 650; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; backdrop-filter: blur(4px); }
.reference-remove { position: absolute; z-index: 2; top: -4px; right: -4px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: white; cursor: pointer; opacity: 0; transform: scale(.92); transition: opacity 150ms ease, transform 150ms ease; }
.reference-remove::before { content: ""; position: absolute; z-index: -1; inset: 11px; border-radius: 6px; background: rgba(8, 12, 24, .68); transition: background-color 150ms ease; }
.reference-remove svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; }
.reference-card:hover .reference-remove, .reference-card:focus-within .reference-remove { opacity: 1; transform: scale(1); }
.reference-remove:hover::before { background: color-mix(in srgb, var(--danger) 78%, black); }
.reference-remove:focus-visible { opacity: 1; transform: scale(1); outline: 3px solid color-mix(in srgb, var(--primary) 70%, white); outline-offset: -2px; }
.reference-picker.is-disabled { cursor: not-allowed; opacity: .55; }
.field-error { margin-top: 6px; color: var(--danger); font-size: 11px; line-height: 1.4; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
.settings-grid .field label { white-space: nowrap; }
.settings-grid select { padding-inline: 9px; font-size: 12px; }
.settings-grid.template-settings-locked select:disabled { opacity: 1; border-color: color-mix(in srgb, var(--primary) 26%, var(--border)); background: color-mix(in srgb, var(--primary-soft) 56%, var(--surface-soft)); color: var(--text); cursor: default; }
.primary-button { width: 100%; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; margin-top: 16px; border: 0; border-radius: 11px; background: var(--primary); color: white; font-weight: 750; box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 22%, transparent); transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease; }
.primary-button:hover { background: var(--primary-strong); box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 28%, transparent); }
.primary-button:active { transform: translateY(1px); }
.primary-button svg { width: 18px; height: 18px; }
.feedback { min-height: 20px; margin-top: 9px; color: var(--text-soft); font-size: 11px; }
.feedback[data-tone="good"] { color: var(--success); }
.feedback[data-tone="bad"] { color: var(--danger); }

.count-badge { min-width: 24px; height: 22px; display: inline-grid; place-items: center; padding: 0 7px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-soft); font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text-soft); transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease; }
.icon-button:hover { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 38%, var(--border)); background: var(--primary-soft); }
.jobs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; align-items: stretch; gap: 10px; }
.job-card { position: relative; min-width: 0; height: 100%; display: flex; flex-direction: column; overflow: visible; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease; content-visibility: auto; contain-intrinsic-size: 430px; }
.job-card:hover { border-color: color-mix(in srgb, var(--primary) 34%, var(--border)); box-shadow: 0 12px 32px rgba(24, 32, 56, .1); transform: translateY(-1px); }
.job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.job-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.job-identity { min-width: 0; display: grid; gap: 2px; }
.job-id { color: var(--text); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .035em; }
.job-identity time { color: var(--text-soft); font-size: 10px; }
.state-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 25px; padding: 4px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 10px; font-weight: 750; }
.state-chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.job-card[data-tone="good"] .state-chip { background: var(--success-soft); color: var(--success); }
.job-card[data-tone="bad"] .state-chip { background: var(--danger-soft); color: var(--danger); }
.job-card[data-tone="neutral"] .state-chip { background: var(--surface-soft); color: var(--text-soft); }
.download-icon { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; margin: -9px -8px -9px 0; border-radius: 10px; color: var(--primary); text-decoration: none; transition: color 160ms ease, background-color 160ms ease; }
.download-icon:hover { color: var(--primary-strong); background: var(--primary-soft); }
.download-icon svg { width: 18px; height: 18px; }
.spec-list { display: grid; grid-template-columns: 1.4fr .65fr .75fr; gap: 4px; margin-top: 9px; }
.spec-list > div { min-width: 0; display: flex; align-items: baseline; gap: 4px; padding: 5px 6px; border-radius: 7px; background: var(--surface-soft); }
.spec-list span, .spec-list strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spec-list span { flex: 0 0 auto; color: var(--text-soft); font-size: 8px; }
.spec-list strong { color: var(--text); font-size: 9px; }
.job-visual { flex: 0 0 168px; height: 168px; margin-top: 9px; overflow: hidden; border-radius: 9px; }
.video-frame { position: relative; display: grid; place-items: center; background: #070a12; }
.video-frame video { display: block; width: 100%; height: 100%; object-fit: contain; outline: none; }
.video-frame video:focus-visible { box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--primary) 75%, white); }
.video-play-button { position: absolute; z-index: 1; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, .65); border-radius: 999px; background: rgba(15, 20, 32, .88); color: white; font-size: 13px; font-weight: 700; cursor: pointer; }
.video-play-button:hover { background: rgba(36, 46, 68, .95); }
.video-play-button:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.video-play-button:disabled { cursor: wait; }
.video-play-button[hidden], .video-play-error[hidden] { display: none; }
.video-play-button svg { width: 18px; height: 18px; }
.video-play-error { position: absolute; z-index: 1; right: 12px; bottom: 12px; left: 12px; padding: 6px 8px; border-radius: 6px; background: rgba(15, 20, 32, .88); color: white; font-size: 11px; text-align: center; }
.status-visual { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; border: 1px dashed var(--border-strong); background: var(--surface-soft); color: var(--text-soft); text-align: left; }
.status-visual.bad { border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); background: color-mix(in srgb, var(--danger-soft) 45%, var(--surface)); color: var(--danger); }
.status-visual-icon { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, currentColor 10%, transparent); }
.status-visual-icon svg { width: 20px; height: 20px; }
.status-visual > div { min-width: 0; }
.status-visual strong { display: block; color: currentColor; font-size: 11px; }
.status-visual p { margin-top: 3px; color: var(--text-soft); font-size: 9px; overflow-wrap: anywhere; }
.cancel-button { flex: 0 0 auto; min-width: 52px; min-height: 44px; padding: 0 9px; border: 1px solid var(--border); border-radius: 9px; background: transparent; color: var(--danger); font-size: 11px; font-weight: 750; }
.cancel-button:hover { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); background: var(--danger-soft); }
.prompt-toggle { flex: 0 0 auto; min-width: 64px; min-height: 44px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 0; border-radius: 9px; background: transparent; color: var(--text-soft); font-size: 10px; font-weight: 750; }
.prompt-toggle:hover, .prompt-toggle[aria-expanded="true"] { background: var(--primary-soft); color: var(--primary); }
.prompt-toggle svg { width: 15px; height: 15px; }
.prompt-control { display: flex; }
.prompt-popover { position: absolute; z-index: 20; left: 11px; right: 11px; top: 59px; max-height: min(220px, calc(100% - 70px)); overflow: auto; padding: 12px; border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border)); border-radius: 11px; background: var(--surface-raised); color: var(--text); box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-5px); transition: opacity 160ms ease, transform 160ms ease, visibility 160ms; }
.prompt-popover-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.prompt-popover strong { color: var(--primary); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.prompt-copy { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; margin: -9px -8px -9px 0; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--primary); font-size: 10px; font-weight: 750; }
.prompt-copy:hover { background: var(--primary-soft); color: var(--primary-strong); }
.prompt-copy svg { width: 15px; height: 15px; }
.prompt-popover p { margin-top: 6px; font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.prompt-control:hover .prompt-popover, .prompt-control:focus-within .prompt-popover, .job-card[data-prompt-open="true"] .prompt-popover { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.empty-state { grid-column: 1 / -1; min-height: 260px; display: grid; place-items: center; align-content: center; gap: 7px; padding: 32px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--text-soft); text-align: center; }
.empty-state svg { width: 36px; height: 36px; margin-bottom: 6px; color: var(--primary); }
.empty-state strong { color: var(--text); font-size: 14px; }
.empty-state p { font-size: 12px; }

@media (max-width: 1180px) { .workspace { grid-template-columns: minmax(370px, 400px) minmax(0, 1fr); } .jobs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .shell { width: min(calc(100% - 24px), 680px); padding-top: 22px; }
  .topbar { padding-inline: 12px; }
  .intro { align-items: flex-start; }
  .policy-badge { min-width: 0; }
  .policy-badge span { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .beta-auth { grid-template-columns: 1fr; align-items: stretch; gap: 10px; }
  .beta-wallet { text-align: left; }
  .composer-panel { position: static; }
  .jobs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .intro { display: block; }
  .policy-badge { display: inline-flex; margin-top: 15px; }
  .policy-badge span { display: grid; }
  .settings-grid { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); }
  .jobs-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .runtime-status span:last-child { display: none; }
  .runtime-status { width: 36px; justify-content: center; padding: 0; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .settings-grid select { font-size: 16px; }
  .composer-card { padding: 15px; }
  .section-header { padding-inline: 8px; }
  .privacy-note { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (hover: none) {
  .reference-remove { opacity: 1; transform: scale(1); }
  .job-card:hover { transform: none; }
  .prompt-control:hover .prompt-popover, .prompt-control:focus-within .prompt-popover { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-5px); }
  .job-card[data-prompt-open="true"] .prompt-popover { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.quote-info { min-height: 20px; margin: 8px 0 0; color: var(--text-soft); font-size: 12px; font-variant-numeric: tabular-nums; }

/* Wide, portrait-first task gallery. */
.topbar { padding-inline: max(20px, calc((100vw - 1800px) / 2)); }
.shell { width: min(calc(100% - 40px), 1800px); }
.section-header-actions { display: flex; align-items: flex-end; justify-content: flex-end; gap: 8px; }
.page-size-control { display: flex; align-items: center; gap: 7px; color: var(--text-soft); font-size: 10px; font-weight: 700; white-space: nowrap; }
.page-size-control select { width: 72px; min-height: 44px; padding: 7px 9px; }
.date-filter-group { display: grid; gap: 4px; padding: 6px 8px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); }
.filter-group-label { color: var(--text-soft); font-size: 9px; font-weight: 800; line-height: 1; letter-spacing: .05em; text-transform: uppercase; }
.date-filter-range { display: flex; align-items: center; gap: 6px; }
.date-filter-range label { display: flex; align-items: center; gap: 5px; color: var(--text-soft); font-size: 10px; font-weight: 700; white-space: nowrap; }
.date-filter-range input[type="date"] { width: 124px; min-height: 44px; padding: 6px 7px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); color-scheme: light dark; font-size: 11px; transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease; }
.date-filter-range input[type="date"]:hover { border-color: var(--border-strong); }
.date-filter-range input[type="date"]:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); outline: none; }
.date-filter-separator { color: var(--border-strong); }
.batch-progress-list { display: grid; gap: 10px; margin-bottom: 12px; }
.batch-progress-card { padding: 13px 15px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.batch-progress-heading { display: flex; justify-content: space-between; gap: 12px; }
.batch-progress-card progress { width: 100%; height: 8px; margin: 10px 0 5px; accent-color: var(--primary); }
.batch-progress-card p { margin: 4px 0 0; font-size: 12px; }
.jobs-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.job-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px; }
.job-head-actions { justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 6px; margin: -4px -4px 0 0; }
.job-id { font-size: 13px; line-height: 1.35; letter-spacing: .025em; overflow-wrap: anywhere; }
.job-prompt-file { overflow: hidden; color: var(--primary); font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.job-visual { flex: 0 0 auto; width: 100%; height: auto; aspect-ratio: 9 / 16; }
.job-icon-button { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text-soft); transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease; }
.job-icon-button svg { width: 18px; height: 18px; }
.retry-button { border-color: transparent; background: transparent; color: var(--primary); }
.retry-button:hover { border-color: transparent; background: var(--primary-soft); color: var(--primary-strong); }
.retry-button[aria-busy="true"] svg { animation: retry-spin 800ms linear infinite; }
@keyframes retry-spin { to { transform: rotate(360deg); } }
.download-icon { margin: 0; }
.cancel-button { margin: 0; }
.status-filter select { width: 128px; }
.prompt-file-row { display: flex; align-items: center; gap: 9px; margin-top: 8px; }
.prompt-file-button { flex: 0 0 auto; min-height: 44px; display: inline-flex !important; align-items: center; gap: 7px; margin: 0 !important; padding: 8px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); color: var(--text) !important; cursor: pointer; }
.prompt-file-button:hover, .prompt-file-button:focus-within { border-color: var(--primary); color: var(--primary) !important; }
.prompt-file-button svg { width: 17px; height: 17px; }
.prompt-file-name { min-width: 0; overflow: hidden; color: var(--text-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.pagination span { min-width: 150px; color: var(--text-soft); font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }

@media (max-width: 1180px) and (min-width: 761px) { .jobs-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .jobs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .section-header-actions { flex-wrap: wrap; } }
@media (max-width: 620px) { .jobs-grid { grid-template-columns: 1fr; } .section-header { flex-wrap: wrap; } .section-header-actions { width: 100%; justify-content: flex-start; } .date-filter-group { width: 100%; } .date-filter-range { display: grid; grid-template-columns: 1fr 1fr; } .date-filter-range label { min-width: 0; display: grid; gap: 3px; } .date-filter-range input[type="date"] { width: 100%; min-height: 44px; font-size: 16px; } .date-filter-separator { display: none; } .pagination { justify-content: space-between; } .pagination span { min-width: 0; } }
