/* Scoped node editor: same plane and host theme, no separate application surface. */
#board-studio .bn-panel {position:absolute;right:16px;top:112px;bottom:76px;width:min(420px,calc(100vw - 96px));z-index:8;overflow:auto;overscroll-behavior:contain;background:var(--bs-panel);border:1px solid var(--bs-line);border-radius:12px;box-shadow:0 10px 40px #0002;padding:18px;outline:none}
#board-studio .bn-header {display:flex;align-items:flex-start;gap:12px;border-bottom:1px solid var(--bs-line);padding-bottom:14px;margin-bottom:16px}
#board-studio .bn-header > div {flex:1;min-width:0}
#board-studio .bn-header h2 {font-size:17px;line-height:1.35;margin:4px 0 0;overflow-wrap:anywhere}
#board-studio .bn-header button {font-size:11px;white-space:normal;max-width:130px}
#board-studio .bn-type {color:var(--bs-muted);font-size:10px;letter-spacing:.07em;text-transform:uppercase}
#board-studio .bn-form {display:flex;flex-direction:column;gap:8px}
#board-studio .bn-form label {font-size:11px;font-weight:600;margin-top:6px}
#board-studio .bn-form input, #board-studio .bn-form textarea {width:100%;border:1px solid var(--bs-line);background:var(--bs-bg);border-radius:7px;padding:10px;line-height:1.6;resize:vertical}
#board-studio .bn-form :disabled, #board-studio .bn-form [readonly] {opacity:.65}
#board-studio .bn-form input:focus, #board-studio .bn-form textarea:focus {outline:2px solid var(--bs-accent);outline-offset:1px}
#board-studio .bn-actions {display:flex;gap:8px;flex-wrap:wrap;margin:5px 0}
#board-studio .bn-primary {background:var(--bs-accent);color:var(--bs-panel)}
#board-studio .bn-primary:hover {background:var(--bs-accent);filter:brightness(1.08)}
#board-studio .bn-message {font-size:12px;color:var(--bs-muted);margin:0;overflow-wrap:anywhere;white-space:pre-wrap}
#board-studio .bn-message:empty {display:none}
#board-studio .bn-info {border-top:1px solid var(--bs-line);padding-top:12px;margin-top:15px;font-size:12px}
#board-studio .bn-info h3 {font-size:12px;margin:0 0 10px}
#board-studio .bn-info h4 {font-size:11px;margin:14px 0 6px}
#board-studio .bn-info p {margin:6px 0;overflow-wrap:anywhere}
#board-studio .bn-help {font-size:11px;color:var(--bs-muted);line-height:1.6}
#board-studio .bn-sources {padding:0 0 12px;margin-bottom:14px;border-bottom:1px solid var(--bs-line)}
#board-studio .bn-sources h3 {font-size:12px;margin:0 0 7px}
#board-studio .bn-sources p {margin:6px 0;white-space:pre-line;overflow-wrap:anywhere}
#board-studio .bn-preferences label {display:block;margin-top:10px}
#board-studio .bn-preferences select {display:block;width:100%;margin-top:5px;border:1px solid var(--bs-line);background:var(--bs-bg);border-radius:7px;padding:8px 10px;line-height:1.5}
#board-studio .bn-wire {display:flex;gap:8px;flex-wrap:wrap}
#board-studio .bn-wire > span:first-child {flex:1}
#board-studio .bn-parameter {white-space:pre-wrap}
@media(max-width:600px) {#board-studio .bn-panel {right:8px;top:112px;bottom:76px;width:calc(100vw - 86px);padding:13px}}
/* Generation section: model, parameters, plan preview, cost and brakes. Same panel, same theme. */
#board-studio .bn-gen {display:flex;flex-direction:column;gap:8px}
#board-studio .bn-gen select, #board-studio .bn-gen input[type=number], #board-studio .bn-gen input[type=text] {width:100%;border:1px solid var(--bs-line);background:var(--bs-bg);border-radius:7px;padding:8px 10px;line-height:1.5}
#board-studio .bn-gen label {font-size:11px;font-weight:600;margin-top:4px;display:block}
#board-studio .bn-gen .bn-check {display:flex;align-items:center;gap:8px;font-weight:500;margin-top:4px}
#board-studio .bn-gen .bn-check input {width:auto}
#board-studio .bn-cost {display:flex;flex-wrap:wrap;gap:6px 14px;font-size:12px;padding:8px 10px;border:1px solid var(--bs-line);border-radius:8px;background:var(--bs-bg)}
#board-studio .bn-cost b {font-weight:600}
#board-studio .bn-brake {color:var(--bs-muted)}
#board-studio .bn-brake.bn-brake-off {color:#b4552d;font-weight:600}
#board-studio .bn-plan {white-space:pre-wrap;font-size:12px;border-left:2px solid var(--bs-accent);padding:4px 10px;margin:4px 0;max-height:220px;overflow:auto}
#board-studio .bn-gen-actions {display:flex;gap:8px;flex-wrap:wrap;margin-top:6px}
#board-studio .bn-output {display:flex;gap:10px;align-items:flex-start;font-size:12px}
#board-studio .bn-output img {width:96px;height:72px;object-fit:cover;border-radius:6px;border:1px solid var(--bs-line)}
/* Progressive disclosure keeps the model and its inputs in view, in both shell themes. */
#board-studio .bn-model-row {display:flex;align-items:center;gap:8px;min-width:0}
#board-studio .bn-model-row select {flex:1;min-width:0}
#board-studio .bn-guide-toggle {flex:none;width:27px;height:27px;border-radius:50%;font-family:Georgia,serif;font-style:italic;font-weight:700;padding:0}
#board-studio .bn-guide-toggle[aria-expanded=true] {outline:2px solid var(--bs-accent);outline-offset:2px}
#board-studio .bn-guide {border:1px solid var(--bs-line);border-radius:9px;padding:12px;background:var(--bs-bg)}
#board-studio .bn-guide[hidden], #board-studio .bn-field input[hidden] {display:none}
#board-studio .bn-guide-heading {display:flex;align-items:center;justify-content:space-between;gap:10px}
#board-studio .bn-guide-heading h3 {margin:0}
#board-studio .bn-guide-heading button {font-size:10px}
#board-studio .bn-panel.bn-guide-only > :not(.bn-guide) {display:none}
#board-studio .bn-panel.bn-guide-only .bn-guide {border:0;padding:0;background:transparent}
#board-studio .bn-guide h4 {margin:18px 0 7px}
#board-studio .bn-guide ul {padding-left:18px;margin:8px 0;line-height:1.55;font-size:12px}
#board-studio .bn-guide li {margin-bottom:6px;overflow-wrap:anywhere}
#board-studio .bn-guide-heading {align-items:flex-start}
#board-studio .bn-model-id {font-family:monospace;font-size:10px;color:var(--bs-muted);overflow-wrap:anywhere}
#board-studio .bn-capabilities, #board-studio .bn-prompt-rules {padding-left:18px;margin:8px 0;font-size:12px;line-height:1.65}
#board-studio .bn-prompt-rules li {margin:10px 0}
#board-studio .bn-prompt-rules small {display:block;margin-top:3px;font-size:10px}
#board-studio .bn-source-link {display:block;color:var(--bs-accent);font-size:12px;text-decoration:underline;text-underline-offset:3px;margin:8px 0;overflow-wrap:anywhere}
#board-studio .bn-inputs {border-bottom:1px solid var(--bs-line);padding-bottom:10px}
#board-studio .bn-inputs h4 {margin:8px 0 5px}
#board-studio .bn-input-link {display:block;text-align:left;width:100%;margin-top:5px;font-size:11px;overflow-wrap:anywhere}
#board-studio .bn-field label {margin-bottom:5px}
#board-studio .bn-field .bn-help {margin:3px 0;font-size:10px}
#board-studio .bn-field input[aria-invalid=true], #board-studio .bn-field select[aria-invalid=true] {border-style:dashed;border-width:2px}
#board-studio .bn-validation {font-size:11px;color:var(--bs-accent);white-space:pre-line;line-height:1.5}
#board-studio .bn-validation:empty {display:none}
#board-studio .bn-advanced summary, #board-studio .bn-budget summary {cursor:pointer;font-size:11px;color:var(--bs-muted);padding:8px 0}
#board-studio .bn-advanced .bn-field {margin:8px 0}
#board-studio .bn-panel :focus-visible {outline:2px solid var(--bs-accent);outline-offset:2px}
#board-studio .bn-budget .bn-cost {font-size:11px}
#board-studio .bn-rule-source summary {font-size:10px;color:var(--bs-muted);cursor:pointer}

/* Generator cards: one editor, compact controls, result and references on the canvas. */
#board-studio .bn-panel[hidden] {display:none}
#board-studio .bs-generator {overflow:visible;background:var(--bs-panel)}
#board-studio .bs-node-visual {position:absolute;inset:76px 14px auto 158px;height:138px;display:flex;flex-direction:column;gap:8px;min-width:0}
#board-studio .bs-generation-empty {height:64px;flex:none;display:flex;align-items:center;justify-content:center;gap:10px;border:1px dashed var(--bs-line);border-radius:9px;color:var(--bs-muted);font-size:11px;background:var(--bs-bg)}
#board-studio .bs-generation-empty svg {width:24px;height:24px;opacity:.65}
#board-studio .bs-result-preview {position:static;width:100%;height:118px;min-height:118px;padding:0;border:1px solid var(--bs-line);border-radius:9px;overflow:hidden;background:var(--bs-bg)}
#board-studio .bs-result-preview img {width:100%;height:100%;object-fit:contain}
#board-studio .bs-prompt-preview {font-size:11px;line-height:1.5;text-align:left;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;white-space:normal;padding:0;min-height:32px;max-height:34px;flex:none;color:var(--bs-muted);font-weight:400}
#board-studio .bs-reference-strip {display:flex;gap:5px;align-items:center;min-height:26px;max-height:28px;overflow:hidden;font-size:10px;color:var(--bs-muted)}
#board-studio .bs-reference-thumb {flex:none;width:27px;height:27px;padding:0;border:1px solid var(--bs-line);border-radius:5px;overflow:hidden;background:var(--bs-bg)}
#board-studio .bs-reference-thumb img {width:100%;height:100%;object-fit:cover}
#board-studio .bs-reference-thumb svg {width:15px;height:15px}
#board-studio .bs-node-summary, #board-studio .bs-node-controls {position:absolute;inset:224px 14px 42px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
#board-studio .bs-node-controls:empty {display:none}
#board-studio .bs-node-controls {overflow:hidden}
#board-studio .bs-editing-node .bs-node-summary {display:none}
#board-studio .bs-node-model {width:100%;text-align:left;justify-content:flex-start;padding:8px 10px;border:1px solid var(--bs-line);font-size:12px;background:var(--bs-bg)}
#board-studio .bs-node-values {display:flex;flex-wrap:wrap;gap:5px;margin:12px 0;font-size:10px;line-height:1.7}
#board-studio .bs-node-values dt {color:var(--bs-muted)}
#board-studio .bs-node-values dd {margin:0 8px 0 0;font-weight:600}
#board-studio .bs-node-estimate {font-size:12px;font-variant-numeric:tabular-nums;margin-top:16px;color:var(--bs-muted)}
#board-studio .bs-node-state {position:absolute;inset:auto 14px 28px;color:var(--bs-muted);font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#board-studio .bn-inline {position:relative;height:100%;min-height:0;gap:3px}
#board-studio .bn-inline > label {display:none}
#board-studio .bn-inline > .bn-gen {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;align-content:start;flex:1 1 auto;min-height:0;overflow:auto;scrollbar-width:thin}
#board-studio .bn-inline > .bn-model-row, #board-studio .bn-inline > .bn-node-tools, #board-studio .bn-inline > .bn-draft-status, #board-studio .bn-inline > .bn-validation {flex-shrink:0}
#board-studio .bn-inline .bn-gen select, #board-studio .bn-inline .bn-gen input {padding:5px 6px;font-size:11px;border-radius:6px;height:30px}
#board-studio .bn-inline label {font-size:9px;color:var(--bs-muted);font-weight:500;margin:0 0 3px}
#board-studio .bn-inline .bn-model-row select {padding:7px 9px;font-size:12px;background:var(--bs-bg)}
#board-studio .bn-inline .bn-field {min-width:0}
#board-studio .bn-inline .bn-field:has([aria-label="Funzione"]) {grid-column:1/-1}
#board-studio .bn-inline .bn-field .bn-help {display:none}
#board-studio .bn-inline .bn-check {font-size:10px;min-height:44px;display:flex;gap:5px;align-items:center;flex-direction:row-reverse;justify-content:flex-end}
#board-studio .bn-inline .bn-check input {height:16px;width:16px;padding:0;accent-color:var(--bs-accent)}
#board-studio .bn-node-tools {display:flex;gap:8px;margin-top:0}
#board-studio .bn-details-toggle {font-size:10px;color:var(--bs-muted);padding:3px 0;text-decoration:underline;text-underline-offset:3px}
#board-studio .bn-node-footer {position:static;margin-top:auto;flex-shrink:0;display:grid;grid-template-columns:1fr auto;gap:5px;align-items:center;border-top:1px solid var(--bs-line);padding-top:8px}
#board-studio .bn-node-footer .bn-estimate {grid-column:1/-1;font-size:12px;line-height:1.3;margin:0;color:inherit;display:block;white-space:normal;font-variant-numeric:tabular-nums}
#board-studio .bs-generator .bn-quote-reason {grid-column:1/-1;font-size:10px;line-height:1.5;margin:0;color:var(--bs-muted);white-space:pre-wrap;overflow-wrap:anywhere}
#board-studio .bn-quote-reason[hidden] {display:none}
#board-studio .bs-node-draft {display:block;margin-top:7px;color:var(--bs-accent);font-size:10px}
#board-studio .bn-inline .bn-draft-status {display:block;margin:0;color:var(--bs-accent);font-size:10px;line-height:1.3}
#board-studio .bn-draft-status[hidden] {display:none}
#board-studio .bn-node-footer button {font-size:10px;justify-content:center;padding:6px 8px;border-radius:6px}
#board-studio .bn-node-footer .bn-save-inline {border:1px solid var(--bs-line)}
#board-studio .bn-inline .bn-validation {font-size:10px;max-height:34px;overflow:auto;display:block;margin:0;line-height:1.5}
#board-studio .bn-inline .bn-validation:empty {display:none}
#board-studio .bn-inline :focus-visible {outline:2px solid var(--bs-accent);outline-offset:2px}
#board-studio .bn-panel .bn-form textarea {max-height:180px}
#board-studio .bn-field[hidden] {display:none}
#board-studio .bc-port-count {font-size:9px;opacity:.7;padding-left:4px}

#board-studio .bs-generator:has(.bs-result-preview) .bs-node-visual {height:192px}
#board-studio .bs-generator:has(.bs-result-preview) .bs-node-summary,
#board-studio .bs-generator:has(.bs-result-preview) .bs-node-controls {top:278px}
#board-studio .bc-ports[data-details=true] .bc-port[data-semantic=true] .bc-port-label {display:none;padding:4px 6px;border:1px solid var(--bs-line);background:var(--bs-panel);border-radius:5px}
#board-studio .bc-ports .bc-port:is(:hover,:focus-visible,[data-compatible=yes],[data-selected=true],[data-target=true]) .bc-port-label,
#board-studio .bc-ports[data-details=true] .bc-port[data-semantic=true]:is(:hover,:focus-visible,[data-compatible=yes],[data-selected=true],[data-target=true]) .bc-port-label {display:block}

/* Input labels occupy their own column; neither previews nor controls sit below them. */
#board-studio .bc-ports[data-details=true] .bc-port-in[data-rail=true] .bc-port-label,
#board-studio .bc-port-in[data-rail=true]:is(:hover,:focus-visible,[data-compatible=yes],[data-selected=true],[data-target=true]) .bc-port-label {
  display:flex;align-items:center;gap:5px;left:24px;right:auto;box-sizing:border-box;
  padding:4px 5px;border:1px solid var(--bs-line);background:var(--bs-panel);font-size:10px;line-height:16px;max-height:26px;
}
#board-studio .bc-port-name {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#board-studio .bc-port-count {flex:none;margin-left:auto;padding-left:0;font-variant-numeric:tabular-nums;opacity:1;color:var(--bs-muted)}
#board-studio .bc-port[data-legacy=true] .bc-port-label {color:var(--bs-amber,#a97735)}
#board-studio .bc-port-out .bc-port-label {left:25px!important;right:auto!important}
#board-studio .bs-generation-empty > span {min-width:0;white-space:normal;text-align:center}
#board-studio .bs-generation-empty {padding:6px;gap:6px}
#board-studio .bs-generation-empty svg {flex:none;width:20px;height:20px}

/* The footer is for the current quote/action. Details and historic output cost stay in the inspector. */
#board-studio .bs-generator .bs-node-state, #board-studio .bs-generator .bs-card-foot {display:none}
#board-studio .bs-generator .bs-node-controls, #board-studio .bs-generator .bs-node-summary {bottom:14px}
#board-studio .bn-settings-toggle {flex:none;width:22px;height:27px;padding:0;font-size:16px;color:var(--bs-muted)}
#board-studio .bn-node-footer {grid-template-columns:minmax(0,1fr) auto auto;gap:4px;padding-top:6px}
#board-studio .bn-node-footer .bn-estimate {grid-column:1;min-width:0;font-size:11px}
#board-studio .bn-node-footer .bn-primary {grid-column:3;grid-row:1}
#board-studio .bn-node-footer .bn-save-inline {grid-column:2;grid-row:1}
#board-studio .bn-node-footer [hidden] {display:none}
#board-studio .bn-inline .bn-validation {max-height:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;text-decoration:underline;text-underline-offset:2px}

/* A generator opens model help. Existing operations remain a secondary disclosure. */
#board-studio .bn-model-panel > .bn-guide {border:0;padding:0;background:transparent}
#board-studio .bn-guide-eyebrow {font-size:10px;text-transform:uppercase;letter-spacing:.1em;color:var(--bs-muted);margin:0 0 8px}
#board-studio .bn-guide-purpose {font-size:13px;line-height:1.65;margin:8px 0 12px}
#board-studio .bn-guide-steps {font-size:12px;line-height:1.65;padding-left:20px;margin:8px 0 18px}
#board-studio .bn-guide-sources {display:flex;flex-wrap:wrap;gap:5px 12px;margin:12px 0 18px}
#board-studio .bn-guide-sources .bn-source-link {font-size:11px;line-height:1.6;margin:0}
#board-studio .bn-guide > details, #board-studio .bn-management {border-top:1px solid var(--bs-line);margin-top:12px;padding-top:10px}
#board-studio .bn-guide > details > summary, #board-studio .bn-management > summary {cursor:pointer;font-size:12px;font-weight:600;padding:5px 0}
#board-studio .bn-guide-example > p {font-size:12px;line-height:1.7;background:var(--bs-bg);border-left:2px solid var(--bs-accent);padding:10px}
#board-studio .bn-guide-provenance {font-size:10px;color:var(--bs-muted);line-height:1.5;margin:16px 0;overflow-wrap:anywhere}
#board-studio .bn-management[open] > .bn-header {margin-top:15px}

/* Result-first nodes. Native media proportions; the control dock never covers the output. */
#board-studio .bs-generator {border-radius:14px;box-shadow:0 3px 12px #0000000a}
#board-studio .bs-generator > .bs-card-top {display:none}
#board-studio .bs-generator > h3 {margin:0;padding:12px 46px 10px 15px;height:44px;font-size:13px;line-height:20px;cursor:grab;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#board-studio .bs-generator > .bs-card-more {top:9px;right:10px}
#board-studio .bs-generator .bs-node-visual {inset:44px 1px auto;display:block;min-width:0;overflow:hidden;background:var(--bs-bg)}
#board-studio .bs-generator .bs-generation-empty {width:100%;height:100%;border:0;border-radius:0;flex-direction:column;color:var(--bs-muted);background:var(--bs-bg)}
#board-studio .bs-generator .bs-generation-empty svg {width:28px;height:28px;opacity:.45}
#board-studio .bs-result-preview {display:block;position:relative;width:100%;height:100%;min-height:0;padding:0;border:0;border-radius:0;overflow:hidden;background:#111116;isolation:isolate}
#board-studio .bs-result-preview > img, #board-studio .bs-result-preview > video {display:block;width:100%;height:100%;max-height:none;object-fit:contain;pointer-events:none}
#board-studio .bs-result-preview:focus-visible {outline:2px solid var(--bs-accent);outline-offset:-3px}
#board-studio .bs-media-meta, #board-studio .bs-media-time {position:absolute;right:10px;padding:4px 7px;background:#17171dd9;color:#fff;border-radius:5px;font-size:10px;line-height:1.5;font-variant-numeric:tabular-nums;pointer-events:none}
#board-studio .bs-media-meta {top:10px}
#board-studio .bs-media-time {bottom:11px}
#board-studio .bs-media-time:empty {display:none}
#board-studio .bs-result-preview[data-kind=video]::after {content:'';position:absolute;bottom:0;left:0;width:var(--bs-progress,0%);height:2px;background:#c5b6ff;pointer-events:none}
#board-studio .bs-media-actions {display:flex;gap:5px;position:absolute;bottom:10px;left:10px;opacity:0;transition:opacity .12s}
#board-studio .bs-result-preview:is(:hover,:focus-within) .bs-media-actions {opacity:1}
#board-studio .bs-media-actions button {width:29px;height:29px;padding:0;display:grid;place-items:center;border:1px solid #ffffff30;border-radius:50%;background:#17171dd9;color:#fff;font-size:12px}
#board-studio .bs-media-actions button[aria-pressed=true] {background:#7666c5}
#board-studio .bs-media-error {position:absolute;inset:0;display:grid;place-items:center;background:var(--bs-bg);color:var(--bs-muted);font-size:12px}
#board-studio .bs-media-error[hidden] {display:none}
#board-studio .bs-node-context {position:absolute;left:14px;right:14px;height:36px;display:flex;gap:10px;align-items:center;overflow:hidden}
#board-studio .bs-node-context .bs-prompt-preview {flex:1;min-width:0;font-size:11px;line-height:17px;min-height:0;max-height:34px}
#board-studio .bs-node-context .bs-reference-strip {max-width:135px;flex:none;min-height:32px;max-height:32px;overflow-x:auto;scrollbar-width:thin}
#board-studio .bs-node-context .bs-reference-thumb {width:30px;height:30px;border-radius:6px}
#board-studio .bs-generator .bs-node-controls {bottom:12px}
#board-studio .bs-generator.bs-with-work .bs-node-controls {bottom:54px}
#board-studio .bs-generator.bs-with-work .bs-node-summary {bottom:56px}
#board-studio .bs-generator .bn-inline {gap:5px}
#board-studio .bs-generator .bn-inline > .bn-gen {display:flex;flex-direction:row;flex-wrap:wrap;gap:6px;align-content:start;overflow:auto}
#board-studio .bs-generator .bn-inline .bn-field {flex:1 0 65px}
#board-studio .bs-generator .bn-inline .bn-field:has([aria-label="Funzione"]) {flex:2 0 155px}
#board-studio .bs-generator .bn-inline .bn-field[data-parameter="omni_reference_task_type"] {flex:2 0 180px}
#board-studio .bs-generator .bn-inline .bn-field:has(input[type=checkbox]) {flex:1 0 90px}
#board-studio .bs-generator .bn-inline .bn-check {min-height:43px;margin:0}
#board-studio .bs-generator .bn-inline label {font-size:9px;letter-spacing:.01em}
#board-studio .bs-generator .bn-inline .bn-model-row select {font-size:12px;border-radius:7px;padding:6px 8px}
#board-studio .bs-generator .bn-inline .bn-gen select, #board-studio .bs-generator .bn-inline .bn-gen input {font-size:11px;padding:4px 6px;height:28px;border-radius:6px}
#board-studio .bs-generator .bn-inline .bn-check input {width:15px;height:15px}
#board-studio .bs-generator .bn-node-footer {padding-top:5px}
#board-studio .bs-generator .bn-node-footer .bn-estimate {font-size:11px}
#board-studio .bs-generator .bn-quote-reason {font-size:9px;line-height:1.4}
/* Typed sockets stay on the edge. Labels open on hover/focus/connection, outside the result. */
#board-studio .bc-port[data-semantic=true] .bc-port-dot {width:20px;height:20px;background:var(--bs-panel);border:1px solid var(--bs-line);display:grid;place-items:center;color:var(--bs-muted)}
#board-studio .bc-port[data-kind=text] .bc-port-dot::after {content:'T';font-size:10px;font-weight:600}
#board-studio .bc-port[data-kind=image] .bc-port-dot::after {content:'▧';font-size:13px}
#board-studio .bc-port[data-kind=video] .bc-port-dot::after {content:'▶';font-size:8px}
#board-studio .bc-port[data-kind=audio] .bc-port-dot::after {content:'♪';font-size:12px}
#board-studio .bc-port-in[data-semantic=true] .bc-port-label {right:27px;left:auto}
#board-studio .bc-port[data-compatible=yes] .bc-port-dot, #board-studio .bc-port[data-target=true] .bc-port-dot {border-color:var(--bs-accent);color:var(--bs-accent)}
/* Extend the existing image viewer to video; it occupies the application viewport. */
#board-studio .bs-media-shade {padding:0;background:#121217f5;z-index:40}
#board-studio .bs-media-shade .bs-image-view {width:100%;height:100%;max-height:none;padding:18px 24px;border:0;border-radius:0;display:flex;flex-direction:column;gap:12px;background:var(--bs-bg)}
#board-studio .bs-media-heading {display:flex;align-items:center;gap:12px;flex:none}
#board-studio .bs-media-heading h2 {flex:1;margin:0;font-size:14px}
#board-studio .bs-media-heading button {flex:none}
#board-studio .bs-media-shade .bs-result-full {flex:1;min-height:0;height:auto;border-radius:8px}
#board-studio .bs-result-full > video {pointer-events:auto}
#board-studio .bs-result-full .bs-media-meta {top:8px;right:8px}
#board-studio .bs-result-full .bs-media-actions, #board-studio .bs-result-full .bs-media-time {display:none}
#board-studio .bs-media-shade footer {flex:none;margin:0;justify-content:flex-start}
@media(hover:none){#board-studio .bs-media-actions {opacity:1}}
.bn-history-result img,.bn-history-result video{display:block;max-width:100%;max-height:240px;object-fit:contain;margin:8px 0}
.bn-history pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}
.bn-history-attempt{border-top:1px solid var(--border);padding:8px 0}
#board-studio .bn-prompt-preparation { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--bs-line); }
#board-studio .bn-prompt-output { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow: auto; padding: 10px; user-select: text; }
#board-studio .bn-review-issue { color: var(--bs-danger,#b65b70); overflow-wrap: anywhere; }
#board-studio .bn-prompt-review .bn-prompt-output { font: inherit; line-height: 1.5; }
#board-studio .bn-prompt-price { font-weight: 600; overflow-wrap: anywhere; }
#board-studio .bn-prompt-questions { padding-left: 20px; }
#board-studio .bn-prepare-prompt { margin-top: 4px; font-size: 11px; width: 100%; flex-shrink: 0; }
#board-studio .bn-prompt-preparation[hidden], #board-studio .bn-prompt-preparation [hidden], #board-studio .bn-prepare-prompt[hidden] { display: none !important; }
.bn-history-picker{display:flex;gap:6px;flex-wrap:wrap;margin:12px 0}.bn-history-picker [aria-pressed=true]{font-weight:700;outline:1px solid currentColor}
.bn-history-panes{display:grid;gap:18px}.bn-history-panes>section{min-width:0}.bn-history-panes>section[hidden]{display:none}
.bn-history-reference{display:inline-block;vertical-align:top;width:48%;margin:8px 1% 8px 0}.bn-history-reference img{max-width:100%;max-height:95px;object-fit:contain;display:block;margin-top:6px}.bn-history-reference figcaption{font-size:12px}
.bn-history input[type=text]{background:var(--bs-bg);color:var(--bs-ink);border:1px solid var(--bs-line);border-radius:6px;padding:6px;max-width:170px}
#board-studio .bn-history-result video{max-height:160px}
.bn-history-prompt{white-space:pre-wrap;overflow-wrap:anywhere}
.bn-history-diff{border:1px solid var(--border);border-radius:8px;padding:12px;margin:12px 0 20px;overflow-wrap:anywhere}
.bn-history-diff[hidden]{display:none}
.bn-history-change{border-top:1px solid var(--border);padding-top:8px;margin-top:12px}
.bn-history-change h5{margin:4px 0 10px;font-size:13px}
.bn-history-change-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.bn-history-change-pair>div{min-width:0}
.bn-history-change-pair img{display:block;width:100%;max-height:130px;object-fit:contain}
.bn-history-change-pair p{margin:6px 0}
@media(max-width:480px){.bn-history-change-pair{grid-template-columns:1fr}}
#board-studio .bn-panel.bn-history-wide{width:min(970px,calc(100vw - 110px))}
#board-studio .bn-history-wide .bn-history-panes{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:650px){#board-studio .bn-panel.bn-history-wide{width:calc(100vw - 32px)}#board-studio .bn-history-wide .bn-history-panes{grid-template-columns:1fr}}
.bn-history-shortlist { position:sticky; top:0; z-index:2; padding:10px; background:var(--surface,#24232b); border:1px solid #726489; border-radius:8px; }
.bn-history-shortlist p { margin:0 0 6px; }
.bn-history-candidate { display:flex; align-items:center; gap:8px; padding:8px 0; cursor:pointer; }
.bn-history-candidate input { width:auto; }
.bn-subject-usage{padding:12px 0;overflow-wrap:anywhere}
.bn-subject-usage>button{margin:8px 0}
.bn-use-subject{display:grid;gap:8px;min-width:0;margin:8px 0;padding:10px;border:1px solid #9299a755;border-radius:6px}
.bn-use-subject label{display:grid;gap:4px}
.bn-use-subject select{box-sizing:border-box;min-width:0;width:100%;padding:8px;color:inherit;background:var(--bs-panel,transparent);border:1px solid #9299a755;border-radius:6px}
