:root {
    color-scheme: dark;
    --bg: #05080e;
    --bg-deep: #020407;
    --panel: #141e2b;
    --panel-high: #1b2a3c;
    --panel-low: #0e1723;
    --line: #304d6b;
    --line-dark: #0a111b;
    --text: #f2f3f5;
    --muted: #f2f3f5;
    --accent: #39aaff;
    --accent-soft: #2376c8;
    --cyan: #86d4ff;
    --button-surface: radial-gradient(ellipse at 12% 0%, rgba(57,170,255,.16), transparent 62%), linear-gradient(150deg, #182c42, #101b2a 58%, #0a121e);
    --button-edge: #3578ad;
    --button-glow: inset 0 1px 0 rgba(164,218,255,.16), inset 0 0 14px rgba(30,126,228,.08), 0 0 8px rgba(15,125,255,.1), 0 4px 8px rgba(0,0,0,.32);
    --success: #63a1ec;
    --yellow: #f2c86b;
    --red: #ff7888;
    --shadow: 0 14px 32px rgba(12, 13, 15, .28), 0 2px 5px rgba(0, 0, 0, .38);
    --raised: inset 0 1px 0 rgba(255,255,255,.16), inset 0 -1px 0 rgba(0,0,0,.32), 0 4px 8px rgba(0,0,0,.32);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(ellipse at 45% -20%, #0b1726 0, var(--bg) 48%, var(--bg-deep) 100%);
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }

.studio-shell { min-height: 100vh; }

.topbar {
    height: 82px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: linear-gradient(#182637, #0c1522);
    border-bottom: 1px solid #202225;
    box-shadow: inset 0 1px rgba(255,255,255,.12), 0 7px 22px rgba(0,0,0,.32);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand-block { display: flex; align-items: center; gap: 13px; }
.brand-mark {
    width: 48px; height: 48px; display: grid; place-items: center;
    font-weight: 900; letter-spacing: -.08em; color: #fff;
    background: var(--button-surface);
    border: 1px solid var(--accent); border-radius: 12px;
    box-shadow: var(--button-glow), 0 0 16px rgba(57,170,255,.2);
}
.brand-block h1 { margin: 0; font-size: 20px; letter-spacing: .02em; }
.studio-version { display: inline-block; vertical-align: middle; padding: 3px 7px; border: 1px solid var(--button-edge); border-radius: 6px; color: #bce4ff; font-size: 11px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.brand-block p { margin: 2px 0 0; color: var(--muted); font-size: 11px; letter-spacing: .13em; text-transform: uppercase; }

.top-actions, .project-tools { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.setup-entry { color: inherit; text-decoration: none; display: inline-block; }
.tool-button, .raised-button, .wide-button, .back-button, .filter-button, .icon-button, .text-button {
    border: 1px solid var(--button-edge);
    background: var(--button-surface);
    border-radius: 8px;
    cursor: pointer;
    transition: transform .16s ease, filter .16s ease, border-color .16s ease;
    box-shadow: var(--button-glow);
}
.tool-button { padding: 10px 14px; font-size: 12px; font-weight: 700; }
.tool-button[aria-current="page"] { border-color: var(--accent); color: #e6f5ff; box-shadow: var(--button-glow), 0 0 12px rgba(57,170,255,.2); }
button:not(:disabled):hover { filter: brightness(1.11); transform: translateY(-1px); }
button:not(:disabled):active { transform: translateY(1px); box-shadow: inset 0 2px 5px rgba(0,0,0,.35); }
button:focus-visible, textarea:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
button:disabled { opacity: .42; cursor: not-allowed; }

main { max-width: 1500px; margin: 0 auto; padding: 22px 30px; }
.view { display: none; }
.view.active { display: block; animation: appear .22s ease; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } }

.dashboard-heading, .workspace-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.dashboard-heading h2, .workspace-header h2 { margin: 3px 0 4px; font-size: clamp(25px, 3vw, 36px); }
.dashboard-heading p { margin: 0; color: var(--muted); }
.eyebrow { color: #86cfff; font-size: 10px; font-weight: 900; letter-spacing: .18em; }
.raised-button { padding: 10px 14px; font-size: 12px; font-weight: 800; }
.raised-button.subtle { color: #d3d5d9; }
.raised-button.small { padding: 7px 11px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 410px); grid-template-rows: auto auto; gap: 14px; align-items: stretch; }
.dashboard-main, .dashboard-side { display: grid; grid-template-rows: subgrid; grid-row: 1 / span 2; gap: 14px; }
.surface {
    background: linear-gradient(145deg, var(--panel-high), var(--panel) 45%, var(--panel-low));
    border: 1px solid var(--line);
    border-bottom-color: var(--line-dark);
    border-radius: 15px;
    box-shadow: inset 0 1px rgba(255,255,255,.12), inset 0 -1px rgba(0,0,0,.18), var(--shadow);
    padding: 15px;
}
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-heading.compact { margin-bottom: 8px; }
.section-heading h3 { margin: 3px 0 0; font-size: 18px; }
.count-badge { padding: 5px 8px; border: 1px solid #777b82; border-radius: 6px; color: #d5d7db; font-size: 9px; font-weight: 900; letter-spacing: .12em; background: #424449; }

.workflow-grid { display: grid; grid-template-columns: repeat(4, minmax(125px, 1fr)); gap: 10px; }
.workflow-card {
    min-height: 112px;
    padding: 13px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    text-align: left;
    border: 1px solid var(--button-edge);
    border-bottom-color: #25272a;
    border-radius: 12px;
    background: var(--button-surface);
    box-shadow: var(--button-glow);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.workflow-card::after { content: ""; position: absolute; inset: 0; border-top: 1px solid rgba(255,255,255,.09); pointer-events: none; }
.workflow-card.featured { border-color: #469de0; background: var(--button-surface); }
.workflow-card.is-active,
.workflow-card.featured.is-active {
    border-color: #70baff;
    background: radial-gradient(ellipse at 15% 0%, rgba(57,170,255,.24), transparent 70%), linear-gradient(145deg, #17334f, #0d1c30);
    box-shadow: inset 0 1px 1px rgba(255,255,255,.2), inset 0 -3px 5px rgba(0,0,0,.2), 0 0 0 1px rgba(100,177,255,.24), 0 7px 16px rgba(10,28,55,.42);
}
.workflow-card.is-active::before {
    content: "●  AKTIV";
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    padding: 6px 11px;
    border: 2px solid #89caff;
    border-radius: 7px;
    color: #f1f8ff;
    background: #28578b;
    box-shadow: 0 0 13px rgba(100,177,255,.48), inset 0 1px rgba(255,255,255,.18), 0 3px 7px rgba(0,0,0,.3);
    font-size: 10px;
    font-weight: 950;
    line-height: 1;
    letter-spacing: .1em;
    text-shadow: 0 1px 2px rgba(0,0,0,.7);
}
.workflow-card.is-active .workflow-icon { color: #d3eaff; border-color: #70baff; background: linear-gradient(145deg, #4879aa, #304d70); }
.workflow-icon {
    width: 32px; height: 32px; display: grid; place-items: center; margin-bottom: 10px;
    border: 1px solid #39aaff; border-radius: 9px; color: #c7ebff; background: radial-gradient(ellipse at 50% 0%, #214f7c, #0c1c31 80%);
    box-shadow: inset 0 1px rgba(255,255,255,.2), 0 4px 8px rgba(0,0,0,.25); font-size: 18px;
}
.workflow-card strong { font-size: 14px; }
.workflow-card small { margin-top: 3px; color: #f2f3f5; font-size: 11px; }
.workflow-card.stop-render-card { border-color: #9d5d65; background: linear-gradient(145deg, #5c454a, #41363a); }
.workflow-card.stop-render-card .workflow-icon { color: #ffd7dc; border-color: #bd6772; background: linear-gradient(145deg, #8a4c55, #60373d); }
.workflow-card.stop-render-card:hover { border-color: #f0808e; background: linear-gradient(145deg, #704c53, #4d393e); }
.workflow-card.stop-render-card.is-stopping { border-color: #ffbf69; background: linear-gradient(145deg, #705942, #4b4035); }
.workflow-card.stop-render-card:disabled { opacity: .8; cursor: wait; }

.job-list { min-height: 74px; max-height: 380px; overflow-y: auto; scrollbar-gutter: stable; scrollbar-width: auto; scrollbar-color: #839cb5 #303237; }
.job-list::-webkit-scrollbar { width: 12px; }
.job-list::-webkit-scrollbar-track { background: #303237; border-radius: 8px; }
.job-list::-webkit-scrollbar-thumb { background: #839cb5; border: 3px solid #303237; border-radius: 8px; }
.empty-state { min-height: 74px; display: flex; align-items: center; gap: 13px; color: var(--muted); }
.empty-state > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #3d4755; color: var(--success); border: 1px solid #667183; }
.empty-state strong, .empty-state small { display: block; }
.empty-state small { margin-top: 3px; }
.text-button { padding: 6px 9px; border: 0; box-shadow: none; color: #c6efff; background: transparent; }

.job-card { display: grid; grid-template-columns: 64px minmax(130px, .8fr) minmax(190px, 1.5fr) auto minmax(220px, auto); gap: 13px; align-items: center; padding: 10px 14px; border: 1px solid #666970; border-radius: 10px; background: rgba(42,44,48,.68); }
.live-job-thumb { width: 64px; height: 54px; overflow: hidden; display: grid; place-items: center; padding: 0; border: 1px solid #74777e; border-radius: 8px; background: #202225; box-shadow: inset 0 2px 8px rgba(0,0,0,.4), var(--raised); cursor: pointer; }
.live-job-thumb:disabled { opacity: 1; cursor: default; }
.live-job-thumb.placeholder { color: #7ad3f3; font-size: 22px; }
.live-job-thumb img, .live-job-thumb video { width: 100%; height: 100%; display: block; object-fit: contain; background: #202225; }
.job-actions { display: grid; grid-template-columns: repeat(2, minmax(92px, 1fr)); gap: 7px; }
.job-actions.compact { display: flex; flex-wrap: wrap; justify-content: flex-end; }
.job-actions .raised-button { margin: 0; white-space: nowrap; }
.job-name strong, .job-name small { display: block; }
.job-name small { margin-top: 4px; color: var(--muted); }
.job-stage { display: grid; gap: 7px; }
.job-stage-head { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; color: #d6d8dc; }
.progress-track { height: 9px; overflow: hidden; border-radius: 20px; background: #27292c; border: 1px solid #222326; box-shadow: inset 0 2px 4px rgba(0,0,0,.5); }
.progress-bar { width: 0%; height: 100%; background: linear-gradient(90deg, #4d9bca, #79d5ff, #69dbe8); border-radius: inherit; box-shadow: 0 0 12px rgba(108,207,255,.6); transition: width .5s ease; }
.job-state { color: var(--yellow); font-size: 10px; font-weight: 900; letter-spacing: .1em; }

@keyframes etaCalculatingBlink {
    0%, 45% { opacity: 1; text-shadow: 0 0 9px rgba(105, 219, 232, .8); }
    50%, 95% { opacity: .35; text-shadow: none; }
}
.eta-calculating {
    color: #73eaff !important;
    animation: etaCalculatingBlink 1.15s steps(1, end) infinite;
}

@keyframes activeRenderBlink {
    0%, 45% { color: #ff646f; opacity: 1; text-shadow: 0 0 10px rgba(255, 54, 70, .9); }
    50%, 95% { color: #ff303f; opacity: .32; text-shadow: none; }
}
.active-render-title {
    animation: activeRenderBlink 1.05s steps(1, end) infinite;
}

.preview-frame { aspect-ratio: 16/10; display: grid; place-items: center; overflow: hidden; position: relative; border-radius: 11px; border: 1px solid #25272a; background: #292b2e; box-shadow: inset 0 0 18px rgba(0,0,0,.55), 0 2px 0 rgba(255,255,255,.08); }
.preview-frame.rendering { aspect-ratio: auto; min-height: 238px; align-items: start; }
.preview-frame.queued { aspect-ratio: auto; min-height: 238px; align-items: start; }
.preview-frame.rendering .preview-empty { width: 100%; min-width: 0; padding: 10px 20px 12px; }
.preview-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #202225; z-index: 2; animation: previewReveal .45s ease both; }
.preview-video { object-fit: contain; background: #202225; }
.preview-frame.rendering::after { content: ""; position: absolute; inset: -55%; z-index: 2; background: conic-gradient(from 90deg, transparent, rgba(111,207,255,.18), transparent 28%); animation: previewScan 2.5s linear infinite; }
.preview-frame.rendering .preview-empty { color: #caf0ff; }
.preview-frame.rendering .preview-art { opacity: .9; }
.preview-art { position: absolute; inset: 0; display: grid; place-items: center; opacity: .65; background: radial-gradient(circle at 68% 25%, rgba(108,198,255,.32), transparent 28%), linear-gradient(145deg, #34373c, #202225); }
.preview-art::before, .preview-art::after { content: ""; position: absolute; border: 1px solid rgba(112,223,233,.28); transform: rotate(27deg); }
.preview-art::before { width: 44%; height: 44%; }
.preview-art::after { width: 62%; height: 62%; transform: rotate(-20deg); border-color: rgba(116,209,255,.24); }
.preview-art span { font-size: 48px; font-weight: 950; color: rgba(255,255,255,.08); letter-spacing: -.08em; }
.preview-empty { position: relative; z-index: 1; text-align: center; padding: 20px; }
.preview-empty strong, .preview-empty small { display: block; }
.preview-empty small { max-width: 220px; margin-top: 5px; color: var(--muted); }
.preview-live-status { width: min(310px, 100%); margin: 10px auto 0; text-align: left; }
.preview-live-status > div:first-child { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; color: #d8dbe0; font-size: 10px; }
#previewStage { min-width: 0; overflow: hidden; white-space: normal; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.preview-live-status b { flex: 0 0 auto; color: #b8ddff; }
.preview-live-status .progress-track { height: 7px; border-color: #1c2737; background: #202b3b; }
.preview-live-status .progress-bar { background: linear-gradient(90deg, #438de0, #72b7ff, #99d6ff); box-shadow: 0 0 10px rgba(100,177,255,.48); }
.preview-status-details { margin-top: 10px; padding: 9px 10px; border: 1px solid rgba(114,183,255,.3); border-radius: 8px; background: rgba(13,18,27,.55); }
.preview-status-details p { margin: 0 0 8px; color: #f0f3f3; font-size: 11px; line-height: 1.35; }
.preview-status-details dl { display: grid; gap: 5px; margin: 0; }
.preview-status-details dl > div { display: grid; grid-template-columns: 62px 1fr; gap: 7px; align-items: baseline; }
.preview-status-details dt { color: #8dc8ff; font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.preview-status-details dd { margin: 0; color: #d9dde0; font-size: 9px; line-height: 1.3; }
@keyframes previewScan { to { transform: rotate(360deg); } }
@keyframes previewReveal { from { opacity: 0; transform: scale(1.035); } to { opacity: 1; transform: scale(1); } }
.preview-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 13px; }
.preview-meta span, .preview-meta strong { display: block; }
.preview-meta span { color: var(--muted); font-size: 9px; letter-spacing: .12em; }
.preview-meta strong { margin-top: 3px; font-size: 12px; }
.icon-button { width: 34px; height: 32px; padding: 0; font-size: 18px; }

.system-ready { color: var(--success); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.system-ready i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 9px var(--success); }
.status-list { display: grid; }
.status-row { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.09); font-size: 12px; }
.status-row span { color: var(--muted); }
.model-path-status { min-width: 0; max-width: 75%; overflow-wrap: anywhere; text-align: right; font-size: 11px; line-height: 1.4; }
.status-row .ok { color: var(--success); }
.status-row .warn { color: var(--yellow); }
.status-row .muted { color: #c0c2c6; }
.wide-button { width: 100%; padding: 10px; margin-top: 14px; font-size: 11px; font-weight: 800; }
.system-actions { display: grid; gap: 8px; }
.system-actions .wide-button + .wide-button { margin-top: 0; }
.danger-button { color: #ffd7d7; border-color: rgba(214, 92, 92, .65); background: linear-gradient(#65676b, #46484c); }
.danger-button:hover { border-color: #ff8b8b; color: #fff; }

.workspace-header { align-items: center; justify-content: flex-start; }
.back-button { padding: 10px 15px; }
.workflow-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.workflow-editor-stack { display: grid; gap: 12px; }
.configuration-panel { min-height: 0; }
.workflow-description { margin: -3px 0 10px; color: var(--muted); font-size: 12px; }
.field-label, .option-grid label { display: grid; gap: 7px; color: #d7d9dd; font-size: 12px; font-weight: 700; }
textarea, select, input {
    width: 100%; color: var(--text); border: 1px solid #26282b; border-radius: 9px; background: #34363a;
    box-shadow: inset 0 3px 7px rgba(0,0,0,.32), 0 1px rgba(255,255,255,.08); padding: 12px;
}
.surface .field-hint { display: block; margin: 5px 0 8px; color: #f2f3f5; font-size: 10px; line-height: 1.35; }
textarea::placeholder, input::placeholder { color: #f2f3f5; opacity: .72; }
#h3SeedInput:disabled { opacity: 1; color: #f2f3f5; -webkit-text-fill-color: #f2f3f5; }
textarea { resize: vertical; margin-top: 8px; }
.drop-zone { min-height: 130px; margin-top: 18px; display: grid; place-items: center; align-content: center; gap: 4px; border: 1px dashed #898c93; border-radius: 11px; background: rgba(44,46,50,.55); cursor: pointer; }
.drop-zone > span { font-size: 28px; color: #bdefff; }
.drop-zone small { color: var(--muted); }
.option-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.inline-option-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.option-label { color: #dedfe3; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.segmented-control { display: inline-flex; gap: 7px; }
.segmented-control button {
    min-width: 43px; padding: 8px 10px; color: #f0f1f3; font-size: 11px; font-weight: 800;
    border: 1px solid #777a81; border-bottom-color: #282a2d; border-radius: 7px;
    background: linear-gradient(#60636a, #424449); box-shadow: var(--raised); cursor: pointer;
}
.segmented-control button.active { color: #f8ddff; border-color: #81d6ff; background: linear-gradient(#537684, #3b5560); box-shadow: inset 0 1px rgba(255,255,255,.16), 0 0 0 1px rgba(119,208,255,.16), 0 4px 9px rgba(0,0,0,.3); }
.seed-input { width: 150px; padding: 8px 10px; }
.seed-input:disabled { opacity: .48; }
.format-note { margin: 12px 0 0; color: #c6c8cd; font-size: 11px; }
.flux-style-options { padding-bottom: 17px; }
.flux-style-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.flux-style-group { min-width: 0; padding: 13px; border: 1px solid #6b6e74; border-radius: 10px; background: rgba(43,45,49,.48); box-shadow: inset 0 2px 6px rgba(0,0,0,.2); }
.flux-style-group > strong { display: block; margin-bottom: 10px; color: #c2efff; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.flux-style-group .chip-row button { padding: 7px 9px; font-size: 10px; }
.flux-style-group .chip-row button.active { color: #cadcff; border-color: #6498dc; background: linear-gradient(#475b74, #344254); box-shadow: inset 0 1px rgba(255,255,255,.14), 0 0 0 1px rgba(99,161,236,.12), 0 3px 7px rgba(0,0,0,.28); }
.flux-style-summary { margin-top: 13px; padding: 10px 12px; overflow: hidden; color: #b8cef4; border: 1px solid #586575; border-radius: 8px; background: rgba(42,51,63,.5); font-size: 10px; line-height: 1.45; text-overflow: ellipsis; }
.flux-quality output { color: #abefff; font-weight: 900; }
.quality-range { padding: 0; accent-color: var(--accent); box-shadow: none; }
.range-labels { display: flex; justify-content: space-between; margin-top: 4px; color: var(--muted); font-size: 10px; }
.picto-source-grid { display: grid; grid-template-columns: minmax(260px, .82fr) minmax(300px, 1.3fr); gap: 18px; align-items: stretch; }
.picto-source-controls > p { margin: 0 0 16px; color: #e1e2e5; font-size: 13px; line-height: 1.45; }
.effect-control { padding: 14px; margin-bottom: 17px; border: 1px solid #777a81; border-radius: 11px; background: rgba(48,50,54,.65); box-shadow: inset 0 2px 5px rgba(0,0,0,.24); }
.effect-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; font-size: 12px; }
.effect-head output { color: #abefff; font-weight: 900; }
.media-source-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.media-source-buttons button { padding: 8px 11px; border: 1px solid #85888f; border-bottom-color: #292b2e; border-radius: 7px; background: linear-gradient(#60636a, #424449); box-shadow: var(--raised); font-size: 11px; font-weight: 750; cursor: pointer; }
.media-source-buttons button.selected { color: #cadfff; border-color: #639ad5; background: linear-gradient(#455a6f, #364453); }
#h3MultiMedia .multi-toolbar .media-source-buttons { gap: 10px; }
#h3MultiMedia .multi-toolbar .media-source-buttons button { min-height: 39px; padding: 10px 15px; color: #fff; border-color: #aeb4bf; border-bottom-color: #30333a; border-radius: 9px; background: linear-gradient(#747982, #4c5058); box-shadow: inset 0 1px rgba(255,255,255,.18), 0 3px 8px rgba(0,0,0,.38); font-size: 13px; font-weight: 850; letter-spacing: .01em; }
#h3MultiMedia .multi-toolbar .media-source-buttons button:hover { color: #fff; border-color: #b7e5ff; background: linear-gradient(#65808c, #475560); transform: translateY(-1px); }
#h3MultiMedia .multi-toolbar .media-source-buttons button:active { transform: translateY(1px); box-shadow: inset 0 2px 5px rgba(0,0,0,.35); }
.source-file-name { margin-top: 14px; color: #d3d5da; font-size: 11px; }
.picto-preview { min-height: 310px; display: grid; place-items: center; overflow: hidden; border: 1px dashed #85888f; border-radius: 12px; background: #303237; color: var(--muted); box-shadow: inset 0 4px 12px rgba(0,0,0,.3); }
.picto-preview img { width: 100%; height: 100%; max-height: 460px; object-fit: contain; background: #242629; }
.workflow-footer { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding-block: 14px; }
.remember-setting { display: flex; align-items: center; gap: 8px; color: #e1e2e5; font-size: 12px; }
.remember-setting input { width: 16px; height: 16px; accent-color: var(--accent); box-shadow: none; }
.workflow-footer-actions { display: flex; gap: 9px; }
.render-button.compact { width: auto; min-width: 105px; margin: 0; padding: 10px 16px; }
.render-validation { grid-column: 1 / -1; min-height: 0; margin: 0; color: var(--red); font-size: 11px; }
.render-summary { text-align: center; position: sticky; top: 108px; }
.workflow-icon.large { width: 60px; height: 60px; margin: 3px auto 15px; font-size: 28px; }
.render-summary h3 { margin: 0; font-size: 24px; }
.render-summary p { color: var(--muted); line-height: 1.5; font-size: 12px; }
.summary-line { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 12px; }
.summary-line span { color: var(--muted); }
.render-button { width: 100%; padding: 15px; margin-top: 15px; border: 1px solid #b4edff; border-bottom-color: #37739a; border-radius: 10px; color: #fff; font-weight: 900; background: linear-gradient(#7ad2ff, #49a7d9 55%, #3082b1); box-shadow: inset 0 2px rgba(255,255,255,.22), inset 0 -3px 4px rgba(14,75,105,.34), 0 8px 18px rgba(8,35,46,.38); cursor: pointer; }

.workflow-workspace.detail-mode { grid-template-columns: minmax(0, 1fr); }
.dual-media-grid, .h3-director-grid, .director-categories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
.director-categories { align-items: stretch; }
.director-categories > .surface { min-width: 0; }
.director-categories > [data-h3-section="Audio"], .director-categories > [data-h3-section="Ausschlüsse"] { grid-column: 1 / -1; }
.director-categories > [data-h3-section="Audio"] { container: audio-panel / inline-size; }
.avatar-columns { display: grid; grid-template-columns: minmax(310px, .75fr) minmax(520px, 1.35fr); gap: 16px; align-items: start; }
.avatar-column { min-width: 0; display: grid; gap: 16px; align-content: start; }
.avatar-state-grid { display: grid; grid-template-columns: repeat(3, minmax(145px, 1fr)); gap: 8px; }
.avatar-state { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid #556980; border-radius: 9px; background: rgba(45,61,80,.45); color: #c8daf5; font-size: 11px; }
.avatar-state input { width: 15px; height: 15px; box-shadow: none; accent-color: #5791dc; }
.avatar-constant { max-width: 430px; }
.avatar-column .avatar-constant { width: 100%; max-width: none; }
.avatar-batch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 9px; margin-top: 14px; }
.avatar-batch-item { min-width: 0; overflow: hidden; border: 1px solid #696c73; border-radius: 9px; background: #34363a; box-shadow: inset 0 1px rgba(255,255,255,.08), 0 3px 8px rgba(0,0,0,.2); }
.avatar-batch-media { aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; color: #777b82; background: #292b2f; font-size: 26px; }
.avatar-batch-media img { width: 100%; height: 100%; display: block; object-fit: contain; background: #202225; }
.avatar-batch-item > div:last-child { padding: 8px 7px; text-align: center; }
.avatar-batch-item strong, .avatar-batch-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-batch-item strong { color: #e7e8eb; font-size: 10px; }
.avatar-batch-item small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.avatar-batch-item.is-running { border-color: #e0ad58; box-shadow: 0 0 0 1px rgba(242,200,107,.15), 0 0 13px rgba(242,200,107,.2); }
.avatar-batch-item.is-running .avatar-batch-media span { color: #ffd982; animation: previewScan 1.2s linear infinite; }
.avatar-batch-item.is-running small { color: #ffd982; }
.avatar-batch-item.is-done { border-color: #578bcc; }
.avatar-batch-item.is-done small { color: #82b1ef; }
.avatar-batch-item.is-error { border-color: #d86070; }
.avatar-batch-item.is-error .avatar-batch-media span, .avatar-batch-item.is-error small { color: #ff8d9b; }
.square-preview { aspect-ratio: 1; }
.avatar-result-grid { display: grid; grid-template-columns: repeat(6, minmax(125px, 1fr)); gap: 11px; }
.avatar-result-card { overflow: hidden; border: 1px solid #6e7178; border-radius: 9px; background: #303236; }
.avatar-result-card img { width: 100%; aspect-ratio: 1; display: block; object-fit: contain; background: #222427; }
.avatar-result-card strong { display: block; padding: 9px; font-size: 10px; text-align: center; }
.inset-card { padding: 16px; border: 1px solid #666970; border-radius: 12px; background: rgba(43,45,49,.72); box-shadow: inset 0 2px 7px rgba(0,0,0,.25); }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; color: #f1f2f4; font-size: 13px; font-weight: 900; }
.card-title span { color: var(--muted); font-weight: 500; }
.card-title button { padding: 7px 10px; }
.media-preview { min-height: 285px; display: grid; place-items: center; overflow: hidden; margin-top: 10px; border: 1px dashed #777a81; border-radius: 10px; background: #292b2f; color: var(--muted); box-shadow: inset 0 4px 11px rgba(0,0,0,.32); }
.media-preview img, .media-preview video { width: 100%; height: 100%; max-height: 430px; object-fit: contain; background: #202225; }
.film-preview { min-height: 360px; }
.film-input-status.ready { color: #8db7f2; border-color: #5882bd; }
.film-input-status.error, #filmRuntimeInfo.error { color: #ff98a5; border-color: #a95d67; }
#filmRuntimeInfo { white-space: pre-line; line-height: 1.55; }
.film-result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 11px; }
.film-result-grid a { min-width: 0; overflow: hidden; color: var(--text); text-decoration: none; border: 1px solid #6f7279; border-radius: 10px; background: #303236; box-shadow: var(--raised); }
.film-result-grid img { width: 100%; aspect-ratio: 1; display: block; object-fit: contain; background: #202225; }
.h3-result-video { width: 100%; max-height: 72vh; display: block; margin-top: 12px; border: 1px solid #25272a; border-radius: 11px; background: #161719; box-shadow: inset 0 3px 12px rgba(0,0,0,.45); }
.film-result-grid small { display: block; overflow: hidden; padding: 8px 9px; color: #d4d6da; text-overflow: ellipsis; white-space: nowrap; }
.multi-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.multi-toolbar p { max-width: 760px; margin: 4px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.multi-picture-grid { display: grid; grid-template-columns: repeat(3, minmax(210px, 1fr)); gap: 12px; margin-top: 14px; }
.multi-picture-card { min-width: 0; padding: 11px; border: 1px solid #676a70; border-radius: 10px; background: #34363a; }
.multi-picture-card .media-preview { min-height: 190px; margin: 8px 0; }
.multi-picture-card select, .multi-picture-card input { padding: 8px; margin-top: 6px; }
.multi-card-actions { display: flex; justify-content: space-between; gap: 7px; }
.reference-media-list { display: grid; gap: 10px; }
.reference-media-card { display: grid; grid-template-columns: minmax(150px, .7fr) 1fr 1fr auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid #676a70; border-radius: 10px; background: #34363a; }
.reference-media-card label { color: var(--muted); font-size: 10px; }
.reference-media-card audio, .reference-media-card video { width: 100%; max-height: 90px; }
.reference-media-card.audio-reference-card { grid-template-columns: minmax(260px, .72fr) minmax(180px, .5fr) minmax(440px, 1.5fr) auto; align-items: center; }
.audio-reference-source { min-width: 0; }
.reference-media-card.video-reference-card { grid-template-columns: minmax(240px, .8fr) minmax(180px, .5fr) minmax(320px, 1.2fr) auto; align-items: center; }
.video-reference-source { min-width: 0; }
.video-reference-source strong, .video-reference-source small { display: block; overflow-wrap: anywhere; }
.reference-media-card .video-reference-source video { margin-top: 10px; max-height: 200px; background: #202225; border-radius: 7px; }
.video-reference-selection { display: grid; gap: 10px; min-width: 0; }
.video-reference-selection > strong { color: #a5cfff; font-size: 11px; }
.video-reference-selection [data-video-error] { color: var(--red); }
.video-loop-lightbox .preview-lightbox-media { display: grid; grid-template-rows: minmax(120px, 1fr) auto; gap: 12px; padding: 10px; overflow: auto; }
.video-loop-lightbox .preview-lightbox-content { width: 100% !important; height: 100% !important; min-height: 0; }
.video-loop-controls { display: grid; gap: 9px; width: 100%; padding: 12px; border: 1px solid #639ad5; border-radius: 9px; background: #303a48; }
.video-loop-controls > strong { color: #a5cfff; }
.video-loop-controls p { margin: 0; font-size: 11px; overflow-wrap: anywhere; }
.video-loop-controls > label { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 8px; font-size: 11px; }
.video-loop-controls input[type="range"] { padding: 0; accent-color: #70baff; }
.video-loop-timeline { min-width: 0; }
.video-loop-ruler, .video-loop-timeline-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #b8ddff; font-size: 10px; }
.video-loop-ruler { margin-bottom: 5px; }
.video-loop-track { height: 64px; position: relative; overflow: hidden; touch-action: none; user-select: none; border: 1px solid #6383a6; border-radius: 8px; cursor: grab; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(10% - 1px), rgba(167,203,242,.25) calc(10% - 1px), rgba(167,203,242,.25) 10%), linear-gradient(#34465d, #202c3c); }
.video-loop-track:active { cursor: grabbing; }
.video-loop-selection { position: absolute; top: 0; bottom: 0; min-width: 16px; display: grid; place-items: center; border: 2px solid #89caff; border-radius: 6px; background: rgba(87,155,231,.42); box-shadow: inset 0 0 12px rgba(112,186,255,.25); cursor: grab; }
.video-loop-selection b { padding: 0 18px; max-width: 100%; overflow: hidden; white-space: nowrap; pointer-events: none; color: #f1f8ff; font-size: 11px; }
.video-loop-selection:focus-visible, .video-loop-handle:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.video-loop-handle { position: absolute; z-index: 3; top: 0; bottom: 0; width: 16px; background: rgba(137,202,255,.24); cursor: ew-resize; }
.video-loop-handle::after { content: ""; position: absolute; top: 15px; bottom: 15px; left: 6px; width: 3px; border-radius: 2px; background: #e6f3ff; }
.video-loop-handle.start { left: 0; }
.video-loop-handle.end { right: 0; }
.video-loop-playhead { position: absolute; pointer-events: none; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 6px rgba(255,255,255,.7); }
.video-loop-timeline-tools { margin-top: 5px; }
.video-loop-timeline-tools > span { display: flex; gap: 5px; }
.video-loop-timeline-tools button { min-width: 32px; padding: 4px 8px; }
@media (max-width: 900px) { .reference-media-card.video-reference-card { grid-template-columns: 1fr; } }
.audio-reference-source strong, .audio-reference-source small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-reference-source audio { margin-top: 10px; }
.audio-clip-editor { min-width: 0; }
.audio-clip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: #c8cbd0; font-size: 10px; }
.audio-clip-head strong { color: #aeeffc; text-align: right; }
.waveform-zoom { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.waveform-zoom button { min-width: 29px; padding: 4px 7px; font-size: 14px; }
.waveform-zoom b { min-width: 30px; color: #c5e8ff; text-align: center; }
.audio-waveform { position: relative; height: 86px; overflow: hidden; touch-action: none; cursor: grab; border: 1px solid #70747b; border-radius: 8px; background: linear-gradient(#282a2e, #202226); box-shadow: inset 0 3px 9px rgba(0,0,0,.4); }
.audio-waveform:active { cursor: grabbing; }
.audio-waveform canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .82; }
.audio-waveform canvas.waveform-error { background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(255,255,255,.035) 10px 20px); }
.audio-playhead { position: absolute; z-index: 6; top: 0; bottom: 0; width: 2px; pointer-events: none; background: #ff394f; box-shadow: 0 0 7px rgba(255,57,79,.95); transform: translateX(-1px); }
.audio-playhead::before { content: ""; position: absolute; top: 0; left: 50%; border-top: 7px solid #ff394f; border-right: 5px solid transparent; border-left: 5px solid transparent; transform: translateX(-50%); }
.audio-selection-window { position: absolute; top: 0; bottom: 0; min-width: 10px; border: 2px solid #6ad3ff; border-radius: 6px; background: linear-gradient(90deg, rgba(77,187,231,.24), rgba(105,224,244,.2)); box-shadow: 0 0 12px rgba(90,201,245,.38), inset 0 0 0 1px rgba(255,255,255,.16); cursor: grab; }
.audio-selection-window::before, .audio-selection-window::after { content: ""; position: absolute; top: 50%; width: 3px; height: 24px; border-radius: 3px; background: rgba(255,255,255,.75); transform: translateY(-50%); }
.audio-selection-window::before { left: 5px; }
.audio-selection-window::after { right: 5px; }
.audio-selection-window:active { cursor: grabbing; }
.audio-selection-window:focus-visible { outline: 2px solid #8be8fa; outline-offset: -4px; }
.audio-selection-handle { position: absolute; z-index: 3; top: 0; bottom: 0; width: 14px; cursor: ew-resize; }
.audio-selection-handle.start { left: -7px; }
.audio-selection-handle.end { right: -7px; }
.audio-precision-fields { display: grid; grid-template-columns: 130px 130px minmax(180px, 1fr); gap: 8px; align-items: end; margin-top: 8px; }
.audio-precision-fields input { margin-top: 4px; }
.audio-precision-fields output { padding: 9px 10px; border: 1px solid #686b72; border-radius: 7px; color: #9deeff; background: rgba(28,30,34,.7); }
.audio-loop-duration { margin-top: 8px; }
.audio-loop-duration label { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; }
.audio-loop-duration output { color: #c5e8ff; font-weight: 800; }
.audio-loop-duration input { grid-column: 1 / -1; width: 100%; margin: 0; padding: 0; accent-color: #62caef; }
.audio-clip-editor > small { display: block; margin: 6px 0 8px; color: #aeb1b7; }
.mode-status { margin-top: 12px; padding: 11px 13px; border: 1px solid #63777e; border-radius: 9px; background: #333b3f; color: #aeeffc; font-size: 11px; }
.h3-run-mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; padding: 7px; border: 1px solid #70737a; border-radius: 12px; background: #35373b; box-shadow: inset 0 3px 8px rgba(0,0,0,.28); }
.h3-run-mode-switch button { display: grid; gap: 4px; padding: 14px 18px; text-align: left; color: #e8e9eb; border: 1px solid #74777e; border-radius: 9px; background: linear-gradient(#5f6268, #44464b); box-shadow: var(--raised); cursor: pointer; }
.h3-run-mode-switch button strong { font-size: 14px; }
.h3-run-mode-switch button span { color: #c5c8cd; font-size: 10px; }
.h3-run-mode-switch button.active { color: #d4e6ff; border-color: #639ce4; background: linear-gradient(#475c76, #344253); box-shadow: inset 0 1px rgba(255,255,255,.18), 0 0 0 1px rgba(99,156,228,.18), 0 5px 12px rgba(0,0,0,.3); }
.h3-run-mode-switch button.active span { color: #bdd4f5; }
.preview-lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(15,16,18,.9); backdrop-filter: blur(9px); }
.preview-lightbox[hidden] { display: none; }
.preview-lightbox-panel { position: relative; width: min(1480px, 96vw); height: min(900px, 92vh); display: grid; place-items: center; padding: 58px 18px 18px; border: 1px solid #85888f; border-radius: 15px; background: #292b2f; box-shadow: 0 30px 90px rgba(0,0,0,.7), inset 0 1px rgba(255,255,255,.12); }
.preview-lightbox-close { position: absolute; top: 12px; right: 14px; padding: 9px 14px; color: #fff; border: 1px solid #8d9097; border-radius: 8px; background: linear-gradient(#62656b, #424449); box-shadow: var(--raised); cursor: pointer; }
.preview-lightbox-media { width: 100%; height: 100%; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 10px; background: #1e2023; }
.preview-lightbox-media .preview-lightbox-content { display: block; width: auto !important; height: auto !important; max-width: 100% !important; max-height: 100% !important; object-fit: contain !important; object-position: center center; flex: 0 1 auto; }
.cyan-badge { padding: 5px 9px; border: 1px solid #5bb7c8; border-radius: 99px; color: #9deffd; font-size: 9px; letter-spacing: .13em; }
.wide-card { grid-column: 1 / -1; }
.block-list { display: grid; gap: 9px; }
.empty-inline { padding: 4px 0 1px; color: var(--muted); font-size: 11px; }
.builder-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 8px; align-items: start; padding: 10px; border: 1px solid #62656b; border-radius: 9px; background: rgba(44,46,50,.65); }
.builder-row.take-row { grid-template-columns: 250px minmax(240px, 1fr) auto; }
.take-timing { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.take-action { display: grid; gap: 5px; }
.take-action select { padding-block: 7px; }
.take-timing small { display: block; margin-top: 3px; color: #9deeff; font-size: 10px; letter-spacing: .03em; }
.builder-actions { display: flex; gap: 6px; align-items: center; }
.builder-actions button { min-width: 34px; padding: 8px; }
.take-row.timing-error { border-color: #d08072; }
.builder-row > label { min-width: 0; display: grid; gap: 5px; }
.builder-row input, .builder-row textarea, .builder-row select { min-width: 0; max-width: 100%; margin: 0; padding: 9px; }
.builder-row textarea { min-height: 70px; }
.builder-row.dialogue-row { grid-template-columns: 100px 72px 72px 145px 120px minmax(200px, 1fr) 90px 140px auto; }
.camera-controls { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-bottom: 10px; }
.camera-controls label { min-width: 0; }
.camera-controls select { width: 100%; min-width: 0; }
.builder-row.sound-row { min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.builder-row.sound-row > label:nth-of-type(5), .builder-row.sound-row > label:nth-of-type(6) { grid-column: 1 / -1; }
.builder-row.sound-row > [data-delete] { grid-column: 1 / -1; justify-self: end; padding: 8px 12px; }
@container audio-panel (min-width: 900px) {
    .builder-row.sound-row { grid-template-columns: 90px 120px 80px 80px minmax(180px, 1fr) minmax(200px, 2fr) auto; }
    .builder-row.sound-row > label:nth-of-type(5), .builder-row.sound-row > label:nth-of-type(6), .builder-row.sound-row > [data-delete] { grid-column: auto; }
}
.prompt-health { display: flex; align-items: center; min-height: 58px; color: #f1c86d; border-color: #9d7940; }
.prompt-health.good { color: #7db2f2; border-color: #4079b8; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row button, .segment-row button, .surface > button, .inset-card > button { padding: 8px 11px; border: 1px solid #7c7f86; border-bottom-color: #282a2d; border-radius: 7px; background: linear-gradient(#5e6167, #414348); color: #f1f2f4; box-shadow: var(--raised); cursor: pointer; }
.chip-row button.active, .chip-row button.selected { border-color: #639ad5; background: linear-gradient(#455a6f, #364453); color: #cadfff; }
#h3MacroChips, #h3DirectorCategories .chip-row { gap: 5px; }
#h3MacroChips button, #h3DirectorCategories .chip-row button { min-height: 0; padding: 7px 10px; border-radius: 6px; color: #a5cfff; font-size: 12px; line-height: 1.2; box-shadow: 0 2px 4px rgba(0,0,0,.3), inset 0 1px rgba(255,255,255,.12); }
#h3MacroChips button:hover, #h3DirectorCategories .chip-row button:hover { color: #d1e8ff; border-color: #70baff; }
#h3MacroChips button.selected, #h3DirectorCategories .chip-row button.selected { color: #d1e8ff; border-color: #70baff; border-top-color: #355779; background: linear-gradient(#30465f, #243448); box-shadow: inset 0 2px 5px rgba(0,0,0,.65), 0 0 0 1px rgba(112,186,255,.18); transform: translateY(1px); }
.director-event-list { display: grid; gap: 4px; margin-top: 9px; padding-top: 8px; border-top: 1px solid rgba(112,186,255,.22); }
.director-event-list[hidden] { display: none; }
.director-event { display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; gap: 9px; align-items: center; width: 100%; padding: 8px 9px; border: 1px solid rgba(112,186,255,.45); border-radius: 5px; background: rgba(23,33,46,.52); color: #d7d9dc; text-align: left; cursor: pointer; }
.director-event:hover { border-color: #70baff; background: rgba(30,47,67,.66); }
.director-event strong { color: #a5cfff; font-size: 12px; }
.director-event span { overflow: hidden; color: #f2f3f5; font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.director-event b { color: #a5cfff; font-size: 13px; }
.sub-builder { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; padding-top: 13px; border-top: 1px solid rgba(255,255,255,.09); }
.h3-parameter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.range-field { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-top: 15px; color: #e5e6e8; font-size: 12px; font-weight: 700; }
.range-field input { grid-column: 1 / -1; padding: 0; accent-color: var(--accent); box-shadow: none; }
.range-field output { color: #bbf1ff; }
.h3-resolution-readout { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 9px; padding: 8px 10px; border: 1px solid #59727a; border-radius: 8px; background: #30383c; }
.h3-resolution-readout span { color: #8ceafa; font-size: 9px; font-weight: 900; letter-spacing: .1em; }
.h3-resolution-readout strong { color: #eefcff; font-size: 13px; }
.toggle-line { display: flex; align-items: center; gap: 9px; margin-top: 14px; color: #e6e7ea; font-size: 12px; }
.toggle-line input { width: 17px; height: 17px; accent-color: #5591df; box-shadow: none; }
#h3SequenceControls { margin-top: 10px; padding: 12px; border: 1px solid #676a70; border-radius: 9px; background: rgba(38,40,43,.55); color: var(--muted); font-size: 11px; }
.sequence-duration-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#h3SequencePlan { display: block; color: #8be8fa; font-weight: 700; line-height: 1.35; }
.motion-beacon { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid #5284c9; border-radius: 10px; background: rgba(48,65,87,.34); color: #a8c8f6; }
.motion-beacon span { color: #d9dde0; font-size: 11px; }
.motion-beacon .progress-track { grid-column: 1 / -1; width: 100%; }
.motion-controls { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 14px; }
.motion-mode-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.motion-mode-switch button { padding: 13px 14px; text-align: left; }
.motion-mode-switch button small { display: block; margin-top: 4px; color: #d4d6da; font-size: 10px; font-weight: 400; }
.motion-mode-switch button.active { border-color: #62a1ed; background: linear-gradient(#465b74, #344455); color: #fff; box-shadow: 0 0 0 1px rgba(98,161,237,.18), var(--raised); }
.motion-result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 10px; margin-top: 12px; }
.motion-result-item { overflow: hidden; padding: 0 0 9px; border: 1px solid #74777e; border-radius: 9px; background: #303236; color: var(--text); text-align: left; box-shadow: var(--raised); }
.motion-result-item video { width: 100%; aspect-ratio: 1; display: block; object-fit: contain; background: #202225; }
.motion-result-item strong, .motion-result-item small { display: block; padding: 6px 9px 0; }
.motion-result-item small { color: var(--muted); }
.segment-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-top: 12px; }
.segment-row div { display: flex; justify-content: space-between; gap: 10px; padding: 10px; border: 1px solid #676a70; border-radius: 8px; background: #33363a; font-size: 11px; }
.segment-row span { color: #77adef; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(18,19,21,.72); backdrop-filter: blur(8px); }
.modal-backdrop[hidden] { display: none; }
.confirm-backdrop { z-index: 100; background: rgba(10,11,13,.82); }
.confirm-modal {
    width: min(460px, calc(100vw - 32px));
    padding: 24px;
    text-align: center;
    color: #ff6977;
    border: 1px solid #a84e57;
    border-radius: 15px;
    background: linear-gradient(145deg, #5b5d62, #44464b 52%, #36383c);
    box-shadow: inset 0 1px rgba(255,255,255,.13), 0 24px 70px rgba(0,0,0,.62), 0 0 28px rgba(205,62,76,.18);
}
.confirm-symbol { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 12px; border: 2px solid #ff6977; border-radius: 50%; color: #ff6977; font-size: 27px; font-weight: 950; }
.confirm-modal h2 { margin: 0 0 12px; color: #ff6977; font-size: 23px; }
.confirm-modal p { margin: 7px 0; color: #ff6977; line-height: 1.45; }
.confirm-modal .confirm-detail { color: #ff9aa3; font-size: 12px; }
.confirm-actions { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }
.confirm-actions button { min-width: 120px; }
.jobs-modal { width: min(1320px, 96vw); max-height: 86vh; overflow: auto; background: linear-gradient(145deg, #575a60, #3d3f44); border: 1px solid #7b7e85; border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.55), inset 0 1px rgba(255,255,255,.15); }
.modal-header, .jobs-toolbar, .modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; }
.modal-header { border-bottom: 1px solid #2b2d30; }
.modal-header h2 { margin: 3px 0 0; font-size: 23px; }
.jobs-toolbar { padding-block: 13px; background: rgba(36,38,41,.28); }
.filter-group { display: flex; gap: 7px; }
.filter-button { padding: 7px 12px; font-size: 11px; }
.filter-button.active { color: #cbf0ff; border-color: var(--accent); }
.database-table { margin: 0 20px; border: 1px solid #2b2d30; border-radius: 10px; overflow: hidden; background: rgba(39,41,44,.55); }
.database-head, .database-row { display: grid; grid-template-columns: 58px 1.2fr .7fr .65fr 1.15fr 1.8fr; gap: 12px; align-items: center; padding: 11px 13px; }
.database-head { color: var(--muted); font-size: 9px; letter-spacing: .13em; background: #36383c; border-bottom: 1px solid #25272a; }
.database-row { font-size: 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.database-row:last-child { border-bottom: 0; }
.job-thumb { width: 52px; height: 52px; overflow: hidden; display: grid; place-items: center; border: 1px solid #74777e; border-radius: 8px; color: #9ad6ef; background: #292b2f; }
.job-thumb img, .job-thumb video { width: 100%; height: 100%; display: block; object-fit: contain; background: #202225; }
.job-name-cell { min-width: 0; display: grid; gap: 4px; }
.job-name-cell input { width: 100%; min-width: 0; padding: 7px 8px; color: var(--text); border: 1px solid #71747a; border-radius: 6px; background: #303237; }
.job-name-cell small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.result-size-note { color: #c8f1ff; font-weight: 800; }
.database-empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.modal-footer { color: var(--muted); font-size: 11px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 18px; }
.asset-modal { width: min(1180px, 96vw); }
.asset-modal .modal-header p, .avatar-editor-modal .modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.asset-browser-grid { display: grid; grid-template-columns: repeat(5, minmax(135px, 1fr)); gap: 12px; min-height: 230px; max-height: 62vh; overflow: auto; padding: 18px 20px 2px; }
.asset-card { overflow: hidden; padding: 0; text-align: left; border: 1px solid #74777e; border-radius: 10px; background: #34363a; box-shadow: var(--raised); cursor: pointer; }
.asset-card:hover { border-color: #7ad2ff; transform: translateY(-1px); }
.asset-card img, .asset-card video { width: 100%; aspect-ratio: 1; display: block; object-fit: contain; background: #202225; }
.asset-card .asset-audio { aspect-ratio: 1; display: grid; place-items: center; color: #bdefff; font-size: 34px; background: #292b30; }
.asset-card strong, .asset-card small { display: block; overflow: hidden; padding-inline: 9px; text-overflow: ellipsis; white-space: nowrap; }
.asset-card strong { padding-top: 9px; font-size: 11px; }
.asset-card small { padding-block: 4px 10px; color: var(--muted); font-size: 9px; }
.avatar-editor-modal { width: min(760px, 94vw); }
.h3-editor-modal { width: min(1040px, 96vw); }
.h3-editor-modal textarea { min-height: 52vh; font-family: Consolas, "Courier New", monospace; line-height: 1.5; }
.avatar-editor-body { padding: 18px 20px 0; }
.avatar-editor-body textarea { min-height: 230px; }
.avatar-editor-body p { color: var(--muted); font-size: 11px; }
.avatar-state > label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.avatar-state-edit { margin-left: auto; padding: 5px 7px; border: 1px solid #8c9097; border-radius: 5px; color: #f1f2f4; background: linear-gradient(#61646a,#424449); cursor: pointer; box-shadow: var(--raised); }
.avatar-state-edit.custom { color: #b9d6ff; border-color: #598ecf; }
.h3-section-edit.custom { color: #b9d6ff; border-color: #598ecf; box-shadow: 0 0 0 1px rgba(89,142,207,.18), var(--raised); }

.settings-modal { width: min(980px, 96vw); }
.settings-modal .modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.system-details-modal { width: min(1080px, 96vw); }
.system-details-modal .modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.system-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px 20px; overflow-y: auto; overflow-x: hidden; min-width: 0; }
.system-detail-card { min-width: 0; padding: 15px; border: 1px solid #74777e; border-radius: 10px; background: #3a3c41; box-shadow: var(--raised); }
.system-detail-card.wide { grid-column: 1 / -1; }
.system-detail-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.system-detail-card h3 { margin: 0; font-size: 15px; }
.system-detail-state { color: var(--success); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.system-detail-state.warn { color: var(--yellow); }
.system-detail-list { display: grid; gap: 0; }
.system-detail-row { display: grid; grid-template-columns: minmax(110px, .45fr) minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.system-detail-row:first-child { border-top: 0; }
.system-detail-row span { color: var(--muted); }
.system-detail-row strong { min-width: 0; overflow-wrap: anywhere; text-align: right; }
.system-detail-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 7px; min-width: 0; }
.system-detail-check { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 9px; padding: 8px 10px; border: 1px solid #666970; border-radius: 7px; background: #303236; }
.system-detail-check > span { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.system-detail-check b { flex: 0 0 auto; color: var(--success); }
.system-detail-check b.missing { color: #ff9ca6; }
.system-detail-check b.pending { color: var(--yellow); font-size: 10px; }
.system-model-group { min-width: 0; margin-top: 10px; border-top: 1px solid rgba(255,255,255,.12); }
.system-model-group summary { padding: 10px 0; cursor: pointer; overflow-wrap: anywhere; }
.system-detail-card > p { color: var(--muted); font-size: 11px; line-height: 1.5; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px 20px 2px; }
.settings-card { min-width: 0; padding: 17px; border: 1px solid #74777e; border-radius: 12px; background: linear-gradient(145deg, rgba(91,94,100,.84), rgba(61,63,68,.92)); box-shadow: inset 0 1px rgba(255,255,255,.12), 0 6px 14px rgba(0,0,0,.22); }
.settings-card-wide { grid-column: 1 / -1; }
.settings-card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.settings-card-title h3 { margin: 4px 0 0; font-size: 16px; }
.settings-card > p { margin: 12px 0 0; color: #c9cbd0; font-size: 11px; line-height: 1.5; }
.settings-state { flex: 0 0 auto; padding: 5px 8px; border: 1px solid #7e8188; border-radius: 99px; color: #d9dbe0; font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.settings-state.ok { color: #88b8f6; border-color: #5587c8; }
.settings-state.pending { color: #f1cf83; border-color: #9b8047; }
.settings-field { display: grid; gap: 6px; margin-top: 10px; color: #e6e7ea; font-size: 11px; font-weight: 750; }
.settings-field input { padding: 10px 11px; color: #cfd1d5; background: #34363a; cursor: default; }
.settings-field input:not([readonly]):not(:disabled) { cursor: text; }
.settings-toggle, .settings-select { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.09); }
.settings-toggle:first-of-type { border-top: 0; }
.settings-toggle input { width: 18px; height: 18px; accent-color: #6bc6f1; box-shadow: none; }
.settings-toggle span, .settings-select > span { display: grid; gap: 3px; }
.settings-toggle strong, .settings-select strong { color: #f0f1f3; font-size: 12px; }
.settings-toggle small, .settings-select small { color: var(--muted); font-size: 10px; }
.settings-select { grid-template-columns: 1fr minmax(170px, auto); }
.settings-select select { margin: 0; padding: 9px 10px; }
.api-settings-card button:disabled { opacity: .5; cursor: not-allowed; }
.settings-footer { display: grid; grid-template-columns: auto 1fr auto; }
.settings-footer > span { color: #9fc2f4; text-align: center; }

@media (max-width: 1050px) {
    .workflow-grid { grid-template-columns: repeat(3, minmax(125px, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; grid-template-rows: none; }
    .dashboard-main, .dashboard-side { grid-template-rows: none; grid-row: auto; }
    .dashboard-side { grid-template-columns: 1fr 1fr; }
    .h3-parameter-grid { grid-template-columns: 1fr; }
    .job-card { grid-template-columns: 58px minmax(120px, .8fr) minmax(180px, 1.4fr) auto; }
    .job-card .job-actions { grid-column: 2 / -1; }
    .reference-media-card.audio-reference-card { grid-template-columns: 1fr 1fr; }
    .audio-clip-editor { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
    .topbar { height: auto; min-height: 82px; align-items: flex-start; padding: 16px; }
    .top-actions { justify-content: flex-end; }
    .tool-button { padding: 8px 10px; }
    main { padding: 18px 14px; }
    .dashboard-heading, .workspace-header { align-items: flex-start; flex-direction: column; }
    .workflow-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
    .dashboard-side, .workflow-workspace { grid-template-columns: 1fr; }
    .render-summary { position: static; }
    .option-grid { grid-template-columns: 1fr; }
    .picto-source-grid { grid-template-columns: 1fr; }
    .flux-style-groups { grid-template-columns: 1fr; }
    .dual-media-grid, .h3-director-grid, .director-categories, .motion-controls, .motion-mode-switch { grid-template-columns: 1fr; }
    .h3-run-mode-switch { grid-template-columns: 1fr; }
    .avatar-columns { grid-template-columns: 1fr; }
    .avatar-result-grid { grid-template-columns: repeat(3, minmax(110px, 1fr)); }
    .wide-card { grid-column: auto; }
    .multi-picture-grid { grid-template-columns: 1fr 1fr; }
    .reference-media-card { grid-template-columns: 1fr; }
    .builder-row.dialogue-row { grid-template-columns: 1fr 1fr; }
    .camera-controls { grid-template-columns: 1fr; }
    .builder-row.sound-row { grid-template-columns: 1fr 1fr; }
    .builder-row.take-row { grid-template-columns: 1fr; }
    .builder-actions { justify-content: flex-end; }
    .builder-row.dialogue-row label:nth-of-type(6), .builder-row.sound-row label:nth-of-type(6) { grid-column: 1 / -1; }
    .asset-browser-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
    .settings-grid { grid-template-columns: 1fr; }
    .system-detail-grid { grid-template-columns: 1fr; }
    .system-detail-card.wide { grid-column: auto; }
    .settings-card-wide { grid-column: auto; }
    .settings-footer { grid-template-columns: 1fr; justify-items: stretch; }
    .settings-footer > span { text-align: left; }
    .database-head { display: none; }
    .database-row { grid-template-columns: 1fr 1fr; }
}
/* Neon-blue product skin: subtle light, crisp edges, no raster dependencies. */
.studio-icon-library { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.workflow-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(57,170,255,.45)); }
.workflow-icon { width: 42px; height: 42px; box-shadow: inset 0 1px rgba(200,233,255,.2), inset 0 0 12px rgba(35,130,255,.15), 0 0 10px rgba(20,122,255,.16); }
.workflow-card:not(.stop-render-card)::after {
    background: linear-gradient(120deg, transparent 60%, rgba(72,167,255,.06) 60.4%, transparent 61%), radial-gradient(ellipse at 100% 100%, rgba(20,118,255,.12), transparent 65%);
    border-top-color: rgba(158,216,255,.18);
}
.workflow-card:not(.stop-render-card):hover { border-color: #62c0ff; box-shadow: var(--button-glow), 0 0 16px rgba(32,145,255,.23); }
.workflow-card:not(.stop-render-card):hover .workflow-icon { color: #fff; border-color: #96dbff; }

:is(.segmented-control, .chip-row, .segment-row, .media-source-buttons, .h3-run-mode-switch, .motion-mode-switch) button,
.avatar-state-edit, .surface > button:not(.danger-button), .inset-card > button:not(.danger-button),
#h3MultiMedia .multi-toolbar .media-source-buttons button {
    color: #e6f2ff;
    border-color: var(--button-edge);
    background: var(--button-surface);
    box-shadow: var(--button-glow);
}
:is(.tool-button, .raised-button, .wide-button, .back-button, .filter-button, .icon-button):not(.danger-button):not(:disabled):hover,
:is(.segmented-control, .chip-row, .segment-row, .media-source-buttons, .h3-run-mode-switch, .motion-mode-switch) button:not(:disabled):hover,
#h3MultiMedia .multi-toolbar .media-source-buttons button:hover {
    color: #fff;
    border-color: #62c0ff;
    background: var(--button-surface);
    box-shadow: var(--button-glow), 0 0 12px rgba(57,170,255,.24);
}
:is(.segmented-control, .chip-row, .segment-row, .media-source-buttons, .h3-run-mode-switch, .motion-mode-switch) button:is(.active, .selected),
#h3MacroChips button.selected, #h3DirectorCategories .chip-row button.selected {
    color: #fff;
    border-color: #73caff;
    background: radial-gradient(ellipse at 20% 0%, rgba(70,182,255,.23), transparent 75%), linear-gradient(#193c60, #10243a);
    box-shadow: inset 0 0 0 1px rgba(118,210,255,.14), 0 0 10px rgba(32,143,255,.2);
}
.render-button {
    color: #fff;
    border-color: #61c4ff;
    background: radial-gradient(ellipse at 50% 0%, rgba(100,211,255,.22), transparent 75%), linear-gradient(#12538a, #103250 65%, #0a2037);
    box-shadow: inset 0 1px rgba(188,234,255,.35), inset 0 -2px rgba(0,0,0,.3), 0 0 14px rgba(15,137,255,.22), 0 5px 12px rgba(0,0,0,.35);
    text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.render-button:not(:disabled):hover { border-color: #b7e8ff; box-shadow: var(--button-glow), 0 0 20px rgba(39,157,255,.38); }
.progress-bar { background: linear-gradient(90deg, #176bc7, #39aaff, #9cddff); box-shadow: 0 0 10px rgba(57,170,255,.4); }
.preview-art { background: radial-gradient(circle at 68% 25%, rgba(35,146,255,.22), transparent 38%), linear-gradient(145deg, #122239, #080f19); }
.preview-frame.rendering .preview-empty { color: #d3ecff; }
.active-render-title { color: #86d4ff; text-shadow: 0 0 8px rgba(57,170,255,.3); animation: none; }
.job-list { scrollbar-color: #426e97 #0b1522; }
.job-list::-webkit-scrollbar-thumb { background: #426e97; border-color: #0b1522; }
.text-button, .flux-style-group > strong, .flux-quality output, .effect-head output { color: #9edaff; }
.settings-toggle input { accent-color: var(--accent); }
:is(.jobs-modal, .settings-modal, .system-details-modal) { background: linear-gradient(145deg, #1a2a3e, #0c1522); border-color: var(--line); }
:is(.settings-card, .system-detail-card, .inset-card, .effect-control, .multi-picture-card, .motion-result-item) { background: linear-gradient(145deg, #182739, #101b29); border-color: var(--line); }
:is(.job-card, .database-head, .system-detail-check, .avatar-batch-item, .asset-card, .drop-zone) { background: #101b29; border-color: #304d6b; }
:is(textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select), .settings-field input, .job-name-cell input { background: #0b1421; border-color: #35516e; }
.danger-button { color: #ffd7d7; border-color: #a35b65; background: linear-gradient(#35232e, #201722); }
.danger-button:not(:disabled):hover { border-color: #ff8b8b; box-shadow: 0 0 10px rgba(255,100,120,.2); }
button:disabled { filter: saturate(.4); box-shadow: none; }
@media (prefers-reduced-motion: reduce) {
    button, .view { transition: none !important; animation: none !important; }
    button:not(:disabled):hover, button:not(:disabled):active { transform: none; }
}

@media (max-width: 480px) {
    .brand-block p { display: none; }
    .top-actions .tool-button:first-child { display: none; }
    .workflow-grid { grid-template-columns: 1fr; }
    .workflow-card { min-height: 100px; }
    .project-tools { width: 100%; }
    .project-tools button { flex: 1; }
}
