/* Canvas editing surfaces: media first, one scrolling writing area, anchored menus. */
.canvas-bottom-left { gap: 4px; padding: 5px; }
.canvas-bottom-left button, .canvas-bottom-left #toggle-node-snap { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; padding: 7px; }
.canvas-bottom-left button svg { display: block; width: 18px; height: 18px; flex: 0 0 18px; }
.canvas-bottom-left #zoom-value { width: 58px; border-left: 1px solid var(--line); border-radius: 0 5px 5px 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.canvas-bottom-left button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
#app .canvas-top-controls { flex-wrap: nowrap; align-items: flex-start; }
#app .canvas-top-controls .topbar-right { width: auto; margin-left: auto; justify-content: flex-end; overflow: visible; padding: 0; }
.flow-node .node-heading { position: absolute; z-index: 8; left: 0; bottom: calc(100% + 7px); display: flex; align-items: center; gap: 8px; height: 22px; width: calc(100% / clamp(1,var(--inverse-zoom),2.4)); transform: scale(clamp(1,var(--inverse-zoom),2.4)); transform-origin: left bottom; }
.flow-node .node-heading .node-title { position: static; flex: 1; width: auto; min-width: 0; }
.flow-node > .node-subfunctions { top: auto; bottom: calc(100% + 7px + 22px * clamp(1,var(--inverse-zoom),2.4) + 8px * var(--inverse-zoom)); }
.flow-node .node-heading > .node-meta { display: block; flex: 0 1 auto; min-width: 0; max-width: 70%; margin-left: auto; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--text); font-size: 11px; font-weight: 500; line-height: 22px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-node .node-heading > .node-meta[hidden] { display: none; }
.composer-overlay .node-focus-card:is(.node-focus-image_stage,.node-focus-video_stage,.node-focus-audio_stage) { width: min(680px,calc(100vw - 48px),calc((100dvh - 230px) * 16 / 9)); aspect-ratio: 16 / 9; height: auto; max-height: none; }
.composer-overlay .node-focus-card:has(.video-composer) .node-focus-body { display: flex; overflow: visible; min-height: 0; padding: 10px 14px 12px; }
.composer-overlay .node-focus-card:has(.video-composer) .node-focus-editor { display: flex; flex: 1; flex-direction: column; min-height: 0; min-width: 0; }
.composer-overlay .node-focus-card .video-composer { display: flex; flex-direction: column; gap: 10px; min-height: 0; flex: 1; }
.composer-overlay .node-focus-card .composer-tool-row { display: none; }
.composer-overlay .node-focus-card .composer-refs { flex: none; display: flex; flex-wrap: nowrap; gap: 8px; max-height: 66px; min-height: 44px; overflow-x: auto; overflow-y: hidden; padding: 2px; }
.composer-overlay .composer-ref, .composer-overlay .composer-add-ref { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 7px; }
.composer-overlay .node-focus-card .video-composer .composer-prompt-wrap { display: flex; flex: 1 1 auto; min-height: 0; overflow: visible; box-shadow: none; }
.composer-overlay .node-focus-card .video-composer .composer-prompt { flex: 1; width: 100%; min-height: 0; height: 100%; max-height: none; overflow-y: auto; padding: 8px 4px 14px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; font-size: 15px; font-weight: 400; line-height: 1.8; }
.composer-overlay .node-focus-card .composer-bottom-bar { flex: none; min-height: 46px; padding-top: 8px; border-top: 1px solid var(--line); align-items: center; }
.composer-overlay .node-focus-card .composer-bottom-left { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 6px; width: auto; min-width: 0; }
.composer-overlay .node-focus-card .composer-bottom-left > .composer-flyout { display: block; flex: 0 1 auto; min-width: 0; }
.composer-overlay .node-focus-card .composer-bottom-left > .composer-flyout > .composer-compact-trigger { width: auto; }
.composer-overlay .node-focus-card .composer-bottom-left > .node-unified-model { padding-right: 10px; margin-right: 4px; border-right: 1px solid var(--line); }
.composer-overlay .node-focus-card .composer-compact-trigger .menu-chevron { margin-left: 8px; }
.composer-overlay .node-focus-card :is(.image-composer,.audio-composer) .composer-bottom-left { grid-template-columns: minmax(120px,1fr) minmax(100px,1fr); }
.composer-overlay .node-focus-card :is(.image-composer,.audio-composer) .composer-flyout.settings-panel > .composer-compact-trigger { grid-column: 2; grid-row: 1; }
.composer-overlay .node-focus-card .composer-compact-trigger { min-height: 36px; max-width: none; font-size: 12px; }
.composer-overlay .node-focus-card .composer-generate { width: 40px; height: 40px; bottom: 1px; right: 0; box-shadow: none; font-size: 25px; }
.composer-overlay .node-focus-card.prompt-expanded { width: min(1280px,calc(100vw - 48px),calc((100dvh - 48px) * 16 / 9)); aspect-ratio: 16 / 9; max-height: calc(100dvh - 48px); }
.composer-overlay .node-focus-card.prompt-expanded .video-composer .composer-prompt { height: 100%; max-height: none; min-height: 0; line-height: 1.9; }
.composer-overlay .node-focus-card .composer-flyout.open > .composer-popover { overscroll-behavior: contain; scrollbar-width: thin; }
.composer-overlay .node-focus-card .composer-flyout.open > .model-choice-menu { width: min(264px,calc(100vw - 24px)); padding: 6px; overflow: hidden; display: flex; align-items: stretch; gap: 0; }
.model-menu-list { flex: 0 0 248px; min-height: 0; overflow-y: auto; scrollbar-width: thin; padding: 2px; }
.model-menu-choice[aria-pressed="true"] { box-shadow: inset 2px 0 color-mix(in srgb,var(--text) 55%,transparent); }
.model-menu-choice i { color: var(--muted); font-size: 18px; }
.composer-bottom-bar > .model-parameters-flyout,
.composer-overlay .node-focus-card .composer-bottom-bar > .model-parameters-flyout { display: block; position: relative; flex: 0 0 auto; align-self: center; margin-left: auto; min-width: 0; }
.composer-bottom-bar .node-model-parameters { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 44px; min-height: 44px; padding: 0 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 550; white-space: nowrap; cursor: pointer; }
.composer-bottom-bar .node-model-parameters > svg { display: block; width: 16px; height: 16px; flex: 0 0 16px; color: currentColor; }
.composer-bottom-bar .node-model-parameters:is(:hover,[aria-expanded="true"]):not(:disabled) { border-color: var(--line); background: var(--panel-2); color: var(--text); }
.composer-bottom-bar .node-model-parameters:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; background: var(--panel-2); color: var(--text); }
.composer-bottom-bar .node-model-parameters:disabled { opacity: .45; cursor: default; }
.model-parameters-flyout.open > .model-parameters-panel { width: min(360px,calc(100vw - 24px)); max-height: min(552px,calc(100dvh - 24px)); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); box-shadow: 0 14px 40px #0004; }
.model-parameters-panel > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 13px; }
.model-parameters-panel > header > span { display: grid; min-width: 0; gap: 2px; }
.model-parameters-panel > header small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-parameters-panel > header > button { min-width: 36px; min-height: 36px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.model-parameters-panel > header > button:is(:hover,:focus-visible) { background: var(--panel-2); color: var(--text); }
.model-parameters-panel > header + .h3-strength { margin-top: 0; padding-top: 2px; border-top: 0; }
.model-parameters-panel .composer-popover-title:not(:first-child) { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.h3-model-cluster { display: flex; align-items: center; flex: 0 0 auto; gap: 2px; min-width: 0; margin-left: auto; }
.composer-bottom-bar .h3-model-cluster .model-parameters-flyout { margin-left: 0; }
.composer-overlay .h3-model-cluster .h3-model-parameters { display: block; position: relative; }
.h3-dual-inline, .h3-panel-dual, .h3-panel-reset { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.h3-dual-inline svg, .h3-panel-dual svg, .h3-panel-reset svg { display: block; width: 17px; height: 17px; }
.h3-dual-inline.active, .h3-panel-dual.active { color: var(--yellow); }
.h3-dual-inline:is(:hover,:focus-visible), .h3-panel-dual:is(:hover,:focus-visible), .h3-panel-reset:is(:hover,:focus-visible) { background: var(--panel-2); }
.h3-dual-inline:focus-visible, .h3-panel-dual:focus-visible, .h3-panel-reset:focus-visible, .h3-panel-model:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.composer-bottom-bar .h3-model-parameters .node-model-parameters { min-height: 36px; gap: 5px; padding: 0 7px; color: var(--text); font-weight: 500; }
.h3-model-parameters .node-model-parameters strong { color: var(--yellow); font-weight: 650; }
.h3-model-parameters .node-model-parameters .menu-chevron { margin-left: 2px; }
.h3-model-parameters.open > .h3-model-parameters-panel { width: min(290px,calc(100vw - 24px)); max-height: min(480px,calc(100dvh - 24px)); padding: 10px 12px; overflow: hidden; }
.composer-overlay .h3-model-cluster .h3-model-parameters.open > .h3-model-parameters-panel { display: block; position: fixed; width: min(290px,calc(100vw - 24px)); max-height: min(480px,calc(100dvh - 24px)); margin: 0; overflow: hidden; box-shadow: 0 14px 40px #0004; }
.h3-model-parameters-panel > .h3-panel-toolbar { display: grid; grid-template-columns: 36px minmax(0,1fr) 36px; gap: 6px; align-items: center; margin: 0; }
.h3-model-parameters-panel .h3-panel-model { display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; min-width: 0; min-height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; }
.h3-model-parameters-panel .h3-panel-model:is(:hover,[aria-expanded="true"]) { background: var(--panel-2); }
.h3-model-parameters-panel .h3-panel-model strong { color: var(--yellow); font-size: 13px; line-height: 18px; }
.h3-model-parameters-panel .h3-panel-model small { color: var(--muted); font-size: 11px; line-height: 15px; }
.h3-model-parameters-panel .h3-panel-model .menu-chevron { position: absolute; right: 4px; top: 16px; transform: rotate(-90deg); }
.h3-model-parameters-panel .h3-panel-model[aria-expanded="true"] .menu-chevron { transform: rotate(90deg); }
.h3-model-parameters-panel .h3-panel-reset svg { width: 18px; height: 18px; }
.h3-model-parameters-panel .h3-strength { padding: 0; margin-top: 4px; }
.h3-model-parameters-panel .h3-strength-control { min-height: 38px; }
.h3-model-parameters-panel .h3-strength input[type="range"] { height: 38px; min-height: 38px; }
.h3-model-submenu { max-height: min(340px,calc(100dvh - 150px)); margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); overflow-y: auto; scrollbar-width: thin; }
.h3-model-submenu .composer-popover-title { font-size: 11px; padding: 6px 8px; }
.h3-model-unavailable { padding: 8px 4px 0; color: var(--muted); font-size: 11px; }
@media (max-width: 620px) {
  .composer-bottom-bar .node-model-parameters { width: 44px; padding-inline: 0; }
  .composer-bottom-bar .node-model-parameters .composer-trigger-label { display: none; }
  .model-parameters-flyout.open > .model-parameters-panel { width: min(340px,calc(100vw - 24px)); }
  .composer-bottom-bar .h3-model-parameters .node-model-parameters { width: auto; padding-inline: 6px; }
  .h3-model-trigger-name { display: none; }
  .h3-model-parameters.open > .h3-model-parameters-panel { width: min(290px,calc(100vw - 24px)); }
}
.h3-strength { --h3-strength-color: #f2c94c; --h3-strength-glow: #f2c94c38; display: grid; gap: 2px; padding: 4px 0 8px; color: var(--text); }
.h3-strength[data-strength-level="1"] { --h3-strength-color: #ab9a76; --h3-strength-glow: #ab9a761a; }
.h3-strength[data-strength-level="2"] { --h3-strength-color: #c9aa5c; --h3-strength-glow: #c9aa5c28; }
.h3-strength[data-strength-level="3"] { --h3-strength-color: #f2c94c; --h3-strength-glow: #f2c94c38; }
.h3-strength[data-strength-level="4"] { --h3-strength-color: #ffb22c; --h3-strength-glow: #ffb22c52; }
.h3-strength[data-strength-level="5"] { --h3-strength-color: #ff911f; --h3-strength-glow: #ff911f70; }
[data-theme="light"] .h3-strength[data-strength-level="1"] { --h3-strength-color: #a69164; --h3-strength-glow: #a6916424; }
[data-theme="light"] .h3-strength[data-strength-level="2"] { --h3-strength-color: #b99648; --h3-strength-glow: #b9964830; }
[data-theme="light"] .h3-strength[data-strength-level="3"] { --h3-strength-color: #d49e1f; --h3-strength-glow: #d49e1f40; }
[data-theme="light"] .h3-strength[data-strength-level="4"] { --h3-strength-color: #e28e16; --h3-strength-glow: #e28e1652; }
[data-theme="light"] .h3-strength[data-strength-level="5"] { --h3-strength-color: #ee7910; --h3-strength-glow: #ee791064; }
.h3-strength-control { display: flex; align-items: center; min-height: 44px; cursor: pointer; }
.h3-strength-note { margin: 0 2px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.h3-strength .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.model-parameters-panel .h3-strength input[type="range"] { appearance: none; width: 100%; height: 44px; min-height: 44px; padding: 0; margin: 0; border: 0; background: transparent; cursor: pointer; }
.h3-strength input[type="range"]::-webkit-slider-runnable-track { height: 24px; border-radius: 99px; background: linear-gradient(to right,#8d8066 0%,var(--h3-strength-color) var(--h3-strength-progress),var(--panel-3) var(--h3-strength-progress),var(--panel-3) 100%); box-shadow: 0 0 14px var(--h3-strength-glow); }
.h3-strength input[type="range"]::-moz-range-track { height: 24px; border-radius: 99px; background: linear-gradient(to right,#8d8066 0%,var(--h3-strength-color) var(--h3-strength-progress),var(--panel-3) var(--h3-strength-progress),var(--panel-3) 100%); box-shadow: 0 0 14px var(--h3-strength-glow); }
.h3-strength input[type="range"]::-webkit-slider-thumb { appearance: none; width: 28px; height: 28px; margin-top: -2px; border: 2px solid var(--h3-strength-color); border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--h3-strength-glow),0 1px 5px #0005; transition: box-shadow .15s,transform .15s; }
.h3-strength input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border: 2px solid var(--h3-strength-color); border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--h3-strength-glow),0 1px 5px #0005; transition: box-shadow .15s,transform .15s; }
.h3-strength input[type="range"]:focus-visible { outline: none; }
.h3-strength input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--panel),0 0 0 5px var(--focus-ring),0 1px 5px #0005; }
.h3-strength input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--panel),0 0 0 5px var(--focus-ring),0 1px 5px #0005; }
@media (prefers-reduced-motion: reduce) { .h3-strength input[type="range"]::-webkit-slider-thumb { transition: none; } }
.model-parameters-panel .composer-choice-list button { font-size: 12px; overflow-wrap: anywhere; white-space: normal; min-height: 40px; }
.model-parameters-panel .composer-choice-list button > span { min-width: 0; }
.model-parameters-panel .composer-choice-list button > i { flex: none; }
.model-parameters-panel .composer-choice-list button.active { background: var(--panel-2); color: var(--text); box-shadow: inset 2px 0 color-mix(in srgb,var(--text) 55%,transparent); }
.model-parameters-panel .composer-choice-list button.active i { color: var(--text); }
.model-parameters-panel .composer-choice-list button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.model-parameters-panel .cloud-creation-settings { display: grid; grid-template-columns: 1fr; gap: 12px; }
.model-parameters-panel .cloud-creation-settings .node-cloud-field { display: grid; grid-template-columns: minmax(0,1fr); gap: 6px; min-width: 0; color: var(--muted); font-size: 12px; }
.model-parameters-panel .cloud-creation-settings :is(input,select) { width: 100%; max-width: none; min-height: 36px; padding: 6px 9px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; }
.composer-overlay .composer-mention-menu { position: fixed; z-index: 650; width: min(300px,calc(100vw - 24px)); right: auto; padding: 7px; overflow: auto; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 12px 36px #0004; scrollbar-width: thin; }
.composer-mention-menu .mention-search { border: 0; height: 30px; font-size: 11px; color: var(--muted); }
.composer-mention-menu .mention-options { max-height: 216px; }
.composer-mention-menu .mention-options button { min-height: 50px; grid-template-columns: 38px minmax(0,1fr); padding: 6px; }
.composer-mention-menu .mention-options img, .composer-mention-menu .mention-options button > span { width: 38px; height: 38px; }
.composer-mention-menu .mention-options b { font-size: 12px; color: var(--text); }
.composer-mention-menu .mention-options small { font-size: 10px; color: var(--muted); }
.composer-mention-menu .mention-options button:is(:hover,.is-current) { background: var(--panel-2); }
.composer-mention-menu .mention-library { border-top: 1px solid var(--line); margin-top: 5px; font-size: 12px; color: var(--text); }
.mention-no-results { display: none; padding: 14px 8px; color: var(--muted); font-size: 12px; }
.composer-mention-menu.no-match .mention-no-results { display: block; }
.composer-mention-menu [hidden] { display: none !important; }
.composer-overlay .node-focus-card .node-cloud-composer .composer-bottom-bar { padding-right: 0; gap: 10px; }
.composer-overlay .node-focus-card .node-cloud-composer .composer-bottom-left { display: flex; flex: 1; min-width: 0; }
.composer-overlay .node-cloud-composer .node-unified-model > .composer-compact-trigger { width: auto; max-width: 200px; }
.composer-overlay .node-focus-card .node-cloud-panel { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 0 1 auto; padding: 0; border: 0; }
.composer-overlay .node-focus-card .node-cloud-panel .composer-generate { position: static; flex: none; }
.cloud-creation-settings { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cloud-creation-settings .node-cloud-field { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.cloud-creation-settings :is(select,input) { width: auto; max-width: 130px; min-height: 36px; padding: 6px 8px; border: 1px solid transparent; border-radius: 6px; color: var(--text); background: transparent; font-size: 12px; }
.cloud-creation-settings :is(select,input):hover { border-color: var(--line); background: var(--panel-2); }
.model-default-settings { display: block; padding: 12px; color: var(--muted); font-size: 12px; }
.node-cloud-panel .cloud-availability { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.node-cloud-panel .cloud-availability { max-width: 130px; font-size: 11px; color: var(--muted); }
.node-cloud-panel .cloud-compact-cost { white-space: nowrap; font-size: 11px; color: var(--muted); }
.node-cloud-panel .node-cloud-billing { position: fixed; z-index: 650; display: grid; gap: 12px; width: min(340px,calc(100vw - 24px)); overflow-y: auto; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 12px 36px #0004; font-size: 12px; }
.node-cloud-billing > header { display: flex; justify-content: space-between; align-items: center; }
.node-cloud-billing > header button { width: 28px; height: 28px; border: 0; border-radius: 5px; background: transparent; color: var(--text); font-size: 20px; }
.composer-overlay .node-cloud-panel .node-cloud-button { min-height: 36px; font-size: 12px; }
.composer-overlay .node-cloud-panel .node-cloud-button.is-primary { background: var(--text); border-color: var(--text); color: var(--panel); }
.composer-overlay .node-cloud-panel .node-cloud-button.is-primary:hover { opacity: .85; background: var(--text); }
.composer-overlay .node-cloud-panel .node-cloud-task { padding: 0; border: 0; background: transparent; }
.node-cloud-panel .node-cloud-task > p { display: none; }
.node-cloud-panel .node-cloud-billing .node-cloud-task > p { display: block; }
.composer-overlay .node-cloud-panel .node-cloud-task > strong { font-size: 11px; font-weight: 400; }
.composer-overlay .node-cloud-panel .node-cloud-task > :is(strong,small) { flex-basis: auto; }
.node-focus-function .pool-properties > div { max-height: min(420px,60dvh); }
.node-focus-function .pool-item-row { display: grid; grid-template-columns: minmax(0,1fr) 30px; align-items: center; gap: 6px; margin-block: 6px; }
.node-focus-function .pool-item-row > button:first-child { display: grid; grid-template-columns: 68px minmax(0,1fr); grid-template-rows: 1fr 1fr; gap: 4px 12px; padding: 6px; border: 1px solid var(--line); background: transparent; border-radius: 8px; text-align: left; min-height: 64px; }
.node-focus-function .pool-item-row > button.active { border-color: var(--focus-ring); background: var(--panel-2); }
.node-focus-function .pool-item-preview { grid-row: 1 / 3; display: grid; place-items: center; width: 68px; height: 52px; border-radius: 5px; overflow: hidden; background: var(--panel-2); }
.pool-item-preview :is(img,video) { width: 100%; height: 100%; object-fit: cover; }
.pool-item-preview svg { width: 24px; height: 24px; }
.node-focus-function .pool-item-row b { color: var(--text); font-size: 12px; align-self: end; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-focus-function .pool-item-row i { font-size: 11px; color: var(--muted); font-style: normal; }
.node-focus-function .pool-item-delete { width: 28px; height: 32px; font-size: 18px; }
.composer-overlay .node-focus-card:has(.pool-properties) { width: min(420px,calc(100vw - 24px)); }
.composer-overlay .media-tool-panel label { font-size: 12px; }
.composer-overlay .trim-create { min-height: 38px; font-size: 12px; background: var(--text); color: var(--panel); border: 0; border-radius: 7px; }
.composer-overlay .media-tool-panel .trim-create:hover { background: var(--text); color: var(--panel); opacity: .85; }
.composer-overlay .trim-tool input[type="text"]:focus { border-color: var(--muted); box-shadow: none; }
.composer-overlay .media-tool-panel { padding: 8px 0; border: 0; background: transparent; }
.video-trim-times { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.video-trim-times label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
.video-trim-times input { width: 100%; padding: 8px 10px; min-height: 36px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); color: var(--text); }
@media (max-width: 680px) {
  .composer-overlay .node-focus-card:is(.node-focus-image_stage,.node-focus-video_stage,.node-focus-audio_stage) { width: calc(100vw - 24px); aspect-ratio: auto; height: min(380px,calc(100dvh - 140px)); }
  .composer-overlay .node-focus-card.prompt-expanded { width: calc(100vw - 24px); aspect-ratio: auto; height: calc(100dvh - 48px); }
  .composer-overlay .node-focus-card .composer-bottom-left { grid-template-columns: minmax(95px,1fr) max-content; }
  .composer-overlay .node-focus-card .composer-bottom-bar { flex-wrap: nowrap; }
  .composer-overlay .node-focus-card .composer-flyout.settings-panel > .composer-compact-trigger { grid-column: 1 / -1; grid-row: 2; }
  .model-menu-list { flex-basis: 100%; }
  .node-cloud-panel .cloud-availability { display: none; }
  .composer-overlay .node-focus-card .node-cloud-composer .composer-bottom-bar { position: relative; }
  .composer-overlay .node-focus-card .node-cloud-composer .composer-bottom-left { display: flex; flex: 1 1 auto; width: auto; min-width: 0; }
  .composer-overlay .node-focus-card .node-cloud-composer .node-unified-model { width: max-content; max-width: 100%; border: 0; }
  .cloud-creation-settings { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .cloud-creation-settings .node-cloud-field { display: grid; gap: 2px; }
  .cloud-creation-settings :is(select,input) { width: 100%; max-width: none; padding: 4px; }
  .composer-overlay .node-focus-card .node-cloud-panel { position: static; flex: none; }
}
@media (max-height: 650px) {
  .composer-overlay .node-focus-card .video-composer .composer-prompt { height: 100%; }
  .composer-overlay .node-focus-card.prompt-expanded .video-composer .composer-prompt { height: 100%; }
}

.pool-empty { display: flex; width: 100%; height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; background: linear-gradient(145deg,color-mix(in srgb,var(--accent) 4%,var(--panel)),var(--panel)); }
.pool-empty > svg { width: 38px; height: 38px; color: var(--accent); padding: 7px; border: 1px solid color-mix(in srgb,var(--accent) 24%,transparent); border-radius: 10px; background: color-mix(in srgb,var(--accent) 8%,transparent); }
.pool-empty > strong { font-size: 14px; font-weight: 550; color: var(--text); }
.pool-empty > span { font-size: 11px; color: var(--muted); }
.flow-node .pool-count { padding: 5px 9px; font-size: 10px; color: var(--muted); border-color: var(--line); background: var(--panel); }
.pool-stack:has(.pool-empty) > i { box-shadow: none; opacity: .45; }

.media-theater { inset: 0; z-index: 1000; width: 100vw; height: 100dvh; background: #08090b; backdrop-filter: none; }
.media-theater-shell { min-height: 0; min-width: 0; height: 100dvh; grid-template-rows: 52px minmax(0,1fr) 64px; }
.media-theater[data-media-type="image"][data-crop="false"] .media-theater-shell { grid-template-rows: 52px minmax(0,1fr); }
.media-theater-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; padding: 0; }
.media-theater-stage > video { position: absolute; inset: 0; width: 100%; height: 100%; max-width: 100%; max-height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.media-theater-image-wrap { position: absolute; display: block; min-width: 0; min-height: 0; max-width: none; max-height: none; touch-action: none; }
.media-theater-image-wrap > img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }
.media-theater-shell > header { padding-inline: 18px; }
.media-theater-shell > header strong { font-size: 13px; }
.media-theater-shell > header small { font-size: 11px; }
.media-theater-shell > header button { width: 40px; height: 40px; }
.media-theater-image-controls { gap: 10px; }
.media-crop-ratio { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #bbbfc7; }
.media-crop-ratio select { min-height: 38px; border: 1px solid #444850; border-radius: 6px; background: #25282d; color: #fff; padding: 6px 10px; }
.media-theater-image-controls button { height: 38px; font-size: 12px; }
.media-crop-selection:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 4px; }
.media-crop-selection i { width: 16px; height: 16px; z-index: 2; }
.media-crop-selection i::after { content: ''; position: absolute; inset: -10px; }
.media-theater[data-crop="true"] .media-theater-image-wrap { cursor: crosshair; }
.media-crop-selection i[data-crop-handle="n"] { left: calc(50% - 8px); top: -8px; cursor: ns-resize; }
.media-crop-selection i[data-crop-handle="s"] { left: calc(50% - 8px); bottom: -8px; cursor: ns-resize; }
.media-crop-selection i[data-crop-handle="w"] { left: -8px; top: calc(50% - 8px); cursor: ew-resize; }
.media-crop-selection i[data-crop-handle="e"] { right: -8px; top: calc(50% - 8px); cursor: ew-resize; }
.media-crop-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--crop-divisions,1),1fr); grid-template-rows: repeat(var(--crop-divisions,1),1fr); pointer-events: none; }
.media-crop-grid > span { border: 1px solid #ffffff99; padding: 10px; font-size: 13px; color: #fff; text-shadow: 0 1px 4px #000; }
.media-crop-selection[data-divisions="2"]::before, .media-crop-selection[data-divisions="2"]::after, .media-crop-selection[data-divisions="3"]::before, .media-crop-selection[data-divisions="3"]::after { display: none; }
.media-crop-presets { display: flex; align-items: center; padding: 3px; gap: 3px; border: 1px solid #393d45; border-radius: 8px; }
.media-theater-image-controls .media-crop-presets button { min-width: 54px; height: 32px; border: 0; background: transparent; color: #c8cad0; padding: 4px 9px; }
.media-theater-image-controls .media-crop-presets button[aria-pressed="true"] { background: #3c424e; color: #fff; }
.media-theater-image-controls #media-crop-size { margin-left: auto; margin-right: 0; font-size: 12px; color: #bfc3cc; white-space: nowrap; }
.media-theater-image-controls button:disabled { opacity: .45; cursor: default; }
.media-crop-hint { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); padding: 9px 16px; border-radius: 20px; background: #14171ddd; color: #f1f2f5; font-size: 13px; pointer-events: none; white-space: nowrap; }
@media(max-width:1000px) {
  .media-theater[data-crop="true"] .media-theater-shell { grid-template-rows: 52px minmax(0,1fr) 112px; }
  .media-theater-image-controls { flex-wrap: wrap; justify-content: center; padding: 10px; }
  .media-theater-image-controls #media-crop-size { margin-left: 0; }
}
@media(max-width:680px) {
  .media-theater[data-crop="true"] .media-theater-shell { grid-template-rows: 52px minmax(0,1fr) 160px; }
  .media-theater-image-controls { flex-wrap: wrap; justify-content: flex-start; padding: 10px; gap: 8px; }
  .media-theater-image-controls > span { margin-left: auto; margin-right: 0; }
  .media-theater-shell > footer input { min-width: 0; }
}
.desktop-size-options button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 58px; }
.desktop-size-options button > span { font-size: 12px; }
.desktop-size-options button > small { font-size: 11px; font-variant-numeric: tabular-nums; }
.desktop-size-hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
.image-upscale-editor { display: grid; gap: 12px; padding: 16px; color: var(--text); }
.image-upscale-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.image-upscale-heading strong { font-size: 15px; }
.image-upscale-heading span, .image-upscale-note { font-size: 12px; color: var(--muted); }
.image-upscale-scales { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.image-upscale-scales button { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 16px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.image-upscale-scales button strong { font-size: 22px; }
.image-upscale-scales button span { font-size: 12px; }
.image-upscale-scales button[aria-pressed="true"] { border-color: var(--focus-ring); background: var(--panel-2); }
.image-upscale-editor button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.image-upscale-size { display: flex; justify-content: center; align-items: center; gap: 16px; padding: 10px; border-radius: 8px; background: var(--panel-2); font-size: 14px; font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.image-upscale-size > span, .image-upscale-size > b { color: var(--muted); }
.image-upscale-note, .image-upscale-error { margin: 0; line-height: 1.6; }
.image-upscale-error { color: var(--text); font-size: 12px; }
.image-upscale-run, .image-upscale-download { min-height: 44px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 13px; }
.image-upscale-run { background: var(--text); color: var(--panel); }
.image-upscale-download { background: var(--panel-2); color: var(--text); }
.image-upscale-editor button:disabled { opacity: .5; cursor: default; }
.image-upscale-actions { display: flex; gap: 8px; }
.image-upscale-actions .image-upscale-run { flex: 1; }
.image-upscale-cancel { min-height: 44px; padding: 0 18px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
