/* Desktop workbench: stable viewport, progressive detail in native dialogs. */
:root {
  --wb-bg:oklch(97.1% .009 238); --wb-paper:oklch(99.4% .003 238);
  --wb-ink:oklch(29% .038 243); --wb-muted:oklch(53% .031 241);
  --wb-line:oklch(90% .014 239); --wb-accent:oklch(57% .14 239);
  --wb-soft:oklch(95.8% .025 237); --wb-success:oklch(48% .10 166);
}
html {background:var(--wb-bg);}
body {background:var(--wb-bg);color:var(--wb-ink);}
button,a,input,textarea { -webkit-tap-highlight-color:transparent; }
.workbench {height:100dvh;min-width:1040px;display:grid;grid-template-rows:72px minmax(0,1fr) 54px;font-size:13px;line-height:1.5;overflow:hidden;}
.workbench button,.workbench input {font:inherit;}
.workbench button {cursor:pointer;}
.workbench button:disabled {cursor:not-allowed;}
.workbench button:focus-visible,.workbench a:focus-visible,.wb-dialog button:focus-visible {outline:2px solid var(--wb-accent);outline-offset:3px;}
.wb-topbar {display:flex;align-items:center;gap:30px;padding:0 28px;background:var(--wb-paper);border-bottom:1px solid var(--wb-line);}
.wb-brand {display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--wb-ink);flex-shrink:0;}
.wb-logo {height:36px;width:36px;border-radius:10px;display:grid;place-content:center;background:var(--wb-accent);color:var(--wb-paper);font-size:26px;font-weight:750;line-height:1;position:relative;}
.wb-logo>span{position:absolute;right:5px;bottom:3px;font-size:24px;color:oklch(83% .10 224);}
.wb-brand b {display:block;font-size:17px;font-weight:700;letter-spacing:.02em;}
.wb-brand small {display:block;color:var(--wb-muted);font-size:10px;letter-spacing:.08em;margin-top:2px;}
.wb-top-note {display:flex;align-items:center;gap:8px;color:var(--wb-muted);font-size:12px;}
.wb-top-note>span {height:6px;width:6px;background:oklch(68% .11 220);border-radius:50%;}
.wb-top-actions {margin-left:auto;display:flex;align-items:center;gap:8px;}
.wb-top-actions>button {padding:8px 12px;border:1px solid transparent;border-radius:7px;background:transparent;color:var(--wb-muted);font-weight:550;white-space:nowrap;}
.wb-top-actions>button:hover {background:var(--wb-soft);color:var(--wb-accent);}
.wb-top-actions #caseCount {display:inline-block;font-size:10px;margin-left:4px;min-width:18px;text-align:center;background:var(--wb-soft);border-radius:4px;}
.wb-top-actions .wb-login {border-color:var(--wb-line);color:var(--wb-ink);background:var(--wb-paper);}
.wb-board {display:grid;grid-template-columns:minmax(260px,.94fr) minmax(430px,1.9fr) minmax(245px,.94fr);gap:22px;padding:16px 26px 20px;min-height:0;}
.wb-board>section {min-width:0;min-height:0;display:grid;grid-template-rows:48px minmax(0,1fr);}
.wb-column-head {display:flex;align-items:center;justify-content:space-between;gap:8px;}
.wb-column-head>div {display:flex;align-items:center;gap:9px;}
.wb-column-head h1,.wb-column-head h2 {font-size:16px;letter-spacing:.01em;margin:0;font-weight:700;line-height:1.4;}
.wb-step-number {font-size:11px;color:var(--wb-accent);font-weight:750;font-variant-numeric:tabular-nums;}
.wb-column-head>span {font-size:11px;color:var(--wb-muted);white-space:nowrap;}
.wb-input-form {padding:18px;background:var(--wb-paper);border:1px solid var(--wb-line);border-radius:12px;display:flex;flex-direction:column;gap:14px;min-height:0;}
.wb-field {display:grid;gap:6px;}
.wb-field>span,.wb-label-row>b {font-size:12px;font-weight:650;color:var(--wb-ink);}
.wb-field em,.wb-label-row em {font-size:10px;font-weight:450;font-style:normal;margin-left:5px;color:var(--wb-muted);}
.workbench input:not([type=file]) {width:100%;min-width:0;height:36px;min-height:0;padding:0 10px;background:var(--wb-paper);border:1px solid var(--wb-line);border-radius:6px;color:var(--wb-ink);font-size:12px;box-shadow:none;}
.workbench input::placeholder {color:oklch(63% .022 240);font-weight:400;}
.wb-label-row {display:flex;align-items:center;justify-content:space-between;gap:6px;margin-bottom:7px;}
.wb-label-row>span {font-size:10px;color:var(--wb-muted);}
.wb-reference-input,.wb-product-input {min-width:0;}
.wb-source-tabs {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding:3px;gap:2px;margin-bottom:7px;border:1px solid var(--wb-line);border-radius:7px;background:var(--wb-bg);}
.wb-source-tabs button {font-size:11px;border:0;min-height:25px;padding:3px 0;border-radius:4px;color:var(--wb-muted);background:transparent;}
.wb-source-tabs button.is-active {background:var(--wb-paper);color:var(--wb-accent);box-shadow:0 1px 3px oklch(25% .025 240 / .09);font-weight:650;}
.wb-optional-inputs,.wb-benchmark-files {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
.workbench .upload-box {position:relative;min-width:0;min-height:0;height:auto;padding:12px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:3px;border:1px dashed oklch(82% .035 236);border-radius:8px;background:var(--wb-bg);box-shadow:none;overflow:hidden;isolation:isolate;cursor:pointer;}
.workbench .upload-box:hover,.workbench .upload-box.is-dragover {background:var(--wb-soft);border-color:var(--wb-accent);}
.workbench .upload-box::before,.workbench .upload-box::after {display:none;}
.workbench .upload-box input[type=file] {position:absolute;inset:0;opacity:0;cursor:pointer;z-index:1;width:100%;height:100%;}
.workbench .upload-box .upload-title {font-size:12px;font-weight:600;line-height:1.4;position:static;max-width:100%;color:var(--wb-ink);}
.workbench .upload-box .upload-help {font-size:10px;color:var(--wb-muted);line-height:1.4;position:static;}
.workbench .upload-box>b {font-size:10px;line-height:1.4;color:var(--wb-muted);font-weight:400;position:static;min-height:0;border:0;background:none;padding:0;margin:0;text-align:center;}
.workbench .wb-product-upload {height:clamp(98px,15vh,168px);flex:none;}
.wb-upload-mark {font-size:22px;line-height:1.2;font-weight:400;color:var(--wb-accent);}
.workbench .wb-file-tile {height:82px;padding:8px;}
.workbench .wb-benchmark-files .wb-file-tile {height:50px;gap:2px;}
.workbench .wb-benchmark-files .wb-file-tile .upload-title {font-size:11px;}
.workbench .upload-box.has-preview {border-style:solid;}
.workbench .wb-product-upload.has-preview>.upload-title,.workbench .wb-product-upload.has-preview>.upload-help,.workbench .wb-product-upload.has-preview>.wb-upload-mark {display:none;}
.workbench .upload-preview-grid {position:relative;z-index:2;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:minmax(0,1fr);gap:4px;width:100%;height:100%;margin:0;inset:auto;padding:0;pointer-events:none;}
.workbench .upload-preview-grid figure {position:relative;min-width:0;min-height:0;margin:0;overflow:hidden;border-radius:4px;border:0;aspect-ratio:auto;background:var(--wb-paper);}
.workbench .upload-preview-grid img {width:100%;height:100%;min-height:0;object-fit:contain;cursor:zoom-in;pointer-events:auto;border:0;}
.workbench .upload-preview-grid figcaption {display:none;}
.wb-upload-caption {display:flex;justify-content:space-between;align-items:center;margin-top:6px;font-size:10px;color:var(--wb-muted);}
.wb-upload-caption button {border:0;background:transparent;color:var(--wb-accent);padding:0;font-size:10px;}
.workbench .wb-file-tile>img,.workbench .wb-file-tile>video,.workbench .wb-file-tile>audio {position:absolute;inset:0;width:100%;height:100%;max-height:none;min-height:0;object-fit:cover;z-index:0;pointer-events:none;opacity:.25;}
.workbench .wb-file-tile>audio,.workbench #voicePreview {display:none;}
.workbench .wb-file-tile.has-preview>.upload-help,.workbench .wb-file-tile.has-preview>b {display:none;}
.workbench .wb-file-tile.has-preview>.upload-title {position:relative;z-index:2;font-size:11px;pointer-events:none;}
.workbench .wb-upload-preview {display:none;position:relative;z-index:3;background:var(--wb-paper);color:var(--wb-accent);border:1px solid var(--wb-line);border-radius:5px;padding:2px 8px;font-size:10px;line-height:1.4;}
.workbench .has-preview>.wb-upload-preview {display:block;}
.wb-notes-button {display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--wb-line);border-radius:6px;background:transparent;color:var(--wb-ink);padding:8px 10px;text-align:left;min-height:34px;}
.wb-notes-button small {font-size:10px;color:var(--wb-muted);}
.wb-notes-button>span:last-child {font-size:10px;color:var(--wb-accent);}
.wb-start-area {margin-top:auto;}
.workbench #startButton {width:100%;display:flex;align-items:center;justify-content:center;gap:16px;height:40px;min-height:0;background:var(--wb-accent);color:var(--wb-paper);border:0;border-radius:7px;box-shadow:none;font-size:13px;font-weight:650;padding:0 12px;}
.workbench #startButton:hover {background:oklch(50% .13 239);transform:none;}
.workbench #startButton:disabled {opacity:.55;}
.wb-start-area p {margin:7px 0 0;text-align:center;color:var(--wb-muted);font-size:10px;}
.wb-artifact-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:14px;min-height:0;}
.wb-artifact {display:grid;grid-template-rows:auto minmax(0,1fr) 34px;min-width:0;min-height:0;overflow:hidden;background:var(--wb-paper);border:1px solid var(--wb-line);border-radius:12px;padding:16px 16px 0;color:var(--wb-ink);text-align:left;transition:border-color .16s,box-shadow .16s;}
.wb-artifact:hover {border-color:oklch(73% .07 237);box-shadow:0 3px 14px oklch(40% .03 239 / .05);}
.wb-artifact.needs-action {border-color:var(--wb-accent);}
.wb-artifact header {display:flex;justify-content:space-between;align-items:center;gap:6px;padding-bottom:12px;}
.wb-artifact header small {font-size:10px;color:var(--wb-muted);letter-spacing:.015em;}
.wb-artifact h3 {margin:3px 0 0;font-size:15px;font-weight:650;line-height:1.5;}
.wb-state {display:inline-flex;align-items:center;gap:4px;font-size:10px;line-height:1.5;padding:3px 6px;border-radius:4px;background:var(--wb-bg);color:var(--wb-muted);white-space:nowrap;font-weight:500;}
.wb-state.ready {color:var(--wb-success);background:oklch(96% .02 166);}
.wb-state.working,.wb-state.action {color:var(--wb-accent);background:var(--wb-soft);}
.wb-state.failed {color:oklch(47% .15 25);background:oklch(96% .02 25);}
.wb-state.working::before {content:'';height:4px;width:4px;border-radius:50%;background:currentColor;}
.wb-artifact-preview {min-width:0;min-height:0;overflow:hidden;}
.wb-artifact footer {display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--wb-muted);font-size:10px;}
.wb-artifact:hover footer,.wb-artifact.needs-action footer {color:var(--wb-accent);}
.wb-artifact footer svg {width:13px;height:13px;}
.wb-empty-artifact {height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:oklch(98% .007 238);border-radius:7px;text-align:center;gap:6px;padding:10px;}
.wb-empty-icon {width:34px;height:34px;display:grid;place-items:center;color:oklch(65% .065 235);margin-bottom:3px;}
.wb-empty-icon svg {width:29px;height:29px;}
.wb-empty-artifact b {font-size:12px;color:oklch(45% .035 238);font-weight:500;}
.wb-empty-artifact>span:last-child {font-size:10px;color:var(--wb-muted);line-height:1.6;}
.wb-analysis-summary {height:100%;display:flex;flex-direction:column;gap:8px;overflow:hidden;}
.wb-category {align-self:flex-start;font-size:10px;color:var(--wb-accent);padding:3px 7px;border-radius:4px;background:var(--wb-soft);max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.wb-analysis-summary h4 {font-size:15px;line-height:1.45;margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.wb-analysis-summary p {font-size:12px;line-height:1.7;color:var(--wb-muted);margin:0;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;}
.wb-summary-tags {display:flex;gap:5px;margin-top:auto;overflow:hidden;flex-shrink:0;}
.wb-summary-tags span {padding:3px 6px;background:var(--wb-bg);border-radius:4px;font-size:10px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:50%;}
.wb-image-preview,.wb-reference-video {height:100%;width:100%;position:relative;border-radius:7px;overflow:hidden;background:var(--wb-bg);display:grid;place-items:center;}
.wb-image-preview img,.wb-reference-video video {height:100%;width:100%;min-height:0;object-fit:contain;}
.wb-image-caption {position:absolute;bottom:5px;left:5px;max-width:calc(100% - 10px);padding:3px 7px;background:var(--wb-paper);color:var(--wb-muted);border-radius:4px;font-size:9px;}
.wb-reference-video>span {position:absolute;display:grid;place-items:center;background:var(--wb-paper);width:34px;height:34px;border-radius:50%;color:var(--wb-accent);}
.wb-reference-video svg {width:18px;height:18px;}
.wb-script-summary {height:100%;overflow:hidden;}
.wb-script-meta {display:flex;justify-content:space-between;align-items:center;padding:0 0 9px;gap:6px;}
.wb-script-meta b {font-size:12px;font-weight:600;}.wb-script-meta>span {font-size:10px;color:var(--wb-muted);}
.wb-script-line {display:flex;gap:9px;align-items:flex-start;padding:8px 0;border-top:1px solid var(--wb-line);}
.wb-script-line>span {font-size:10px;color:var(--wb-accent);font-variant-numeric:tabular-nums;padding-top:2px;}
.wb-script-line p {font-size:11px;line-height:1.6;color:var(--wb-muted);margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.wb-final {min-height:0;display:flex;flex-direction:column;padding:16px;background:var(--wb-paper);border:1px solid var(--wb-line);border-radius:12px;gap:14px;}
.wb-final-top {display:flex;justify-content:space-between;align-items:center;gap:6px;flex:none;}
.wb-final-top>span:last-child {color:var(--wb-muted);font-size:10px;}
.wb-final-preview {flex:1;min-height:0;min-width:0;background:var(--wb-bg);border:0;border-radius:8px;padding:12px;display:flex;align-items:center;justify-content:center;overflow:hidden;}
.wb-video-canvas {height:100%;max-width:100%;aspect-ratio:9/16;position:relative;display:flex;align-items:center;justify-content:center;background:oklch(95.5% .017 238);border:1px solid var(--wb-line);border-radius:6px;overflow:hidden;}
.wb-final-empty {display:flex;flex-direction:column;gap:10px;align-items:center;text-align:center;padding:12px;color:var(--wb-muted);}
.wb-final-empty svg {width:32px;height:32px;margin-bottom:8px;color:oklch(68% .04 240);}
.wb-final-empty b {font-size:12px;font-weight:550;line-height:1.6;}
.wb-final-empty span {font-size:10px;line-height:1.7;max-width:18ch;}
.wb-frame-corner {position:absolute;width:16px;height:16px;border:1px solid oklch(76% .03 239);}
.wb-frame-corner.top-left{top:12px;left:12px;border-right:0;border-bottom:0;}
.wb-frame-corner.bottom-right{bottom:12px;right:12px;border-left:0;border-top:0;}
.wb-video-canvas video {position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:oklch(17% .012 240);}
.wb-play-overlay {position:absolute;width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:var(--wb-paper);color:var(--wb-accent);box-shadow:0 2px 15px oklch(20% .015 240 / .2);}
.wb-play-overlay svg {width:22px;height:22px;transform:translateX(-2px);}
.wb-final-caption {display:flex;flex-direction:column;gap:4px;min-width:0;flex:none;}
.wb-final-caption b {font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.wb-final-caption span {font-size:10px;color:var(--wb-muted);}
.wb-final-actions {display:flex;gap:7px;flex:none;}
.wb-download {flex:1;text-align:center;text-decoration:none;display:flex;align-items:center;justify-content:center;border:1px solid var(--wb-accent);border-radius:6px;min-height:36px;background:var(--wb-accent);color:var(--wb-paper);font-size:12px;font-weight:600;}
.wb-download:disabled {background:var(--wb-bg);color:oklch(65% .023 239);border-color:var(--wb-line);}
.wb-expand-video {display:grid;place-items:center;width:36px;min-height:36px;border:1px solid var(--wb-line);border-radius:6px;background:var(--wb-paper);color:var(--wb-accent);}
.wb-expand-video:disabled {color:oklch(74% .02 239);}
.wb-expand-video svg {width:16px;height:16px;}
.wb-statusbar {display:flex;align-items:center;gap:11px;padding:0 28px;background:var(--wb-paper);border-top:1px solid var(--wb-line);min-width:0;}
.wb-status-dot {flex:none;width:7px;height:7px;border-radius:50%;background:oklch(70% .022 239);}
.wb-status-dot.working {background:var(--wb-accent);}.wb-status-dot.ready {background:var(--wb-success);}.wb-status-dot.failed{background:oklch(56% .17 25);}
.wb-status-copy {min-width:0;display:flex;align-items:center;gap:18px;flex:1;}
.wb-status-copy b {font-size:12px;font-weight:550;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:55%;}
.wb-status-copy>span {font-size:10px;color:var(--wb-muted);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}
.wb-progress {display:flex;align-items:center;gap:8px;width:160px;flex:none;}
.wb-progress .progress-bar {height:4px;flex:1;background:var(--wb-line);border:0;border-radius:3px;overflow:hidden;}
.wb-progress .progress-bar i {display:block;height:100%;background:var(--wb-accent);box-shadow:none;}
.wb-progress>b {font-size:10px;min-width:28px;text-align:right;font-variant-numeric:tabular-nums;color:var(--wb-muted);}
.wb-statusbar>button {padding:5px 9px;font-size:11px;border-radius:5px;border:1px solid var(--wb-line);background:var(--wb-paper);color:var(--wb-muted);white-space:nowrap;}
.wb-statusbar #workflowAction {background:var(--wb-soft);border-color:oklch(82% .04 239);color:var(--wb-accent);}
/* Native dialogs keep keyboard focus and all long content away from the board. */
.wb-dialog {width:min(1060px,calc(100vw - 80px));max-width:none;max-height:calc(100dvh - 72px);padding:0;border:1px solid var(--wb-line);border-radius:14px;background:var(--wb-paper);color:var(--wb-ink);box-shadow:0 24px 100px oklch(20% .035 238 / .18);overflow:hidden;}
.wb-dialog[open] {display:flex;flex-direction:column;}
.wb-dialog::backdrop {background:oklch(23% .035 240 / .38);}
.wb-dialog-head {display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 24px;border-bottom:1px solid var(--wb-line);background:var(--wb-paper);flex:none;}
.wb-dialog-head h2 {margin:0;font-size:20px;line-height:1.5;}
.wb-dialog-head>div>span {display:block;font-size:11px;color:var(--wb-muted);margin-bottom:4px;}
.wb-dialog-head>div:last-child {display:flex;align-items:center;gap:12px;}
.wb-dialog-head button {font:inherit;border:1px solid var(--wb-line);border-radius:7px;background:var(--wb-paper);color:var(--wb-muted);cursor:pointer;padding:6px 10px;}
.wb-dialog-head [data-dialog-close] {height:34px;width:34px;padding:0;font-size:24px;line-height:1;flex:none;}
.wb-dialog-body {overflow:auto;min-height:0;padding:24px;overscroll-behavior:contain;}
.wb-dialog-body .section-stack {gap:20px;}
.wb-dialog-body .result-card {padding:0 0 20px;background:none;border:0;border-bottom:1px solid var(--wb-line);box-shadow:none;border-radius:0;}
.wb-dialog-body .metric-grid {gap:12px;}
.wb-dialog-body .metric {padding:12px;border:0;background:var(--wb-bg);border-radius:6px;min-height:0;}
.wb-dialog-body .metric>b {color:var(--wb-muted);font-size:11px;}
.wb-dialog-body .metric>span {color:var(--wb-ink);font-size:13px;line-height:1.8;}
.wb-dialog-body .skill-select-panel {border:0;padding:0;background:none;}
.wb-dialog-body .formula-option {background:var(--wb-bg);border-color:var(--wb-line);box-shadow:none;}
.wb-dialog-body .formula-option.is-active {background:var(--wb-soft);border-color:var(--wb-accent);}
.wb-dialog-body .formula-option span,.wb-dialog-body .formula-option b {color:var(--wb-ink);}
.wb-dialog-body .formula-option small,.wb-dialog-body .formula-option i {color:var(--wb-muted);}
.wb-dialog-body .formula-option.is-active::after {background:var(--wb-accent);color:var(--wb-paper);}
.wb-dialog-body .primary-button {background:var(--wb-accent);color:var(--wb-paper);box-shadow:none;}
.wb-dialog-body img[data-safe-image] {cursor:zoom-in;}
.wb-dialog-body .shot {background:var(--wb-bg);border-color:var(--wb-line);border-radius:7px;}
.wb-dialog-body .shot-num {background:var(--wb-soft);border-color:var(--wb-line);}
.wb-dialog-body .shot-num b {color:var(--wb-accent);}
.wb-dialog-body .shot-readonly>div {border-color:var(--wb-line);background:none;}
.wb-dialog-body .shot-readonly p {color:var(--wb-ink);}
.wb-dialog-body .shot-readonly span {color:var(--wb-muted);}
.wb-dialog-body .script-group {background:none;border:0;padding:0;}
.wb-dialog-body .script-group-head {background:var(--wb-soft);border:0;border-radius:6px;padding:12px;}
.wb-dialog-body .script-group-head b {color:var(--wb-ink);}
.wb-dialog-body .script-group-head span,.wb-dialog-body .script-group-head small {color:var(--wb-muted);}
.wb-dialog-body .video-layout {grid-template-columns:minmax(200px,340px) minmax(0,1fr);}
.wb-dialog-body .phone-frame {min-height:0;max-height:60vh;height:60vh;width:auto;aspect-ratio:9/16;margin:auto;background:oklch(17% .012 240);}
.wb-dialog-body .phone-frame video,.wb-dialog-body .phone-frame img {height:100%;min-height:0;object-fit:contain;}
.wb-detail-image {display:block;max-width:100%;max-height:65vh;margin:auto;object-fit:contain;}
.wb-detail-hint {font-size:12px;color:var(--wb-muted);margin:0 0 12px;}
.wb-detail-empty {min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;text-align:center;}
.wb-detail-empty svg {width:44px;height:44px;color:var(--wb-accent);}
.wb-detail-empty h3 {font-size:18px;margin:0;}.wb-detail-empty p{font-size:13px;color:var(--wb-muted);margin:0;}
.wb-script-detail-heading {display:flex;align-items:center;justify-content:space-between;margin-bottom:18px;}
.wb-script-detail-heading p {font-size:12px;color:var(--wb-muted);}
.wb-media-dialog {width:min(1160px,calc(100vw - 64px));height:calc(100dvh - 64px);}
.wb-media-body {padding:20px;min-height:0;flex:1;display:flex;align-items:center;justify-content:center;overflow:auto;background:var(--wb-bg);}
.wb-media-body img,.wb-media-body video {max-width:100%;max-height:100%;object-fit:contain;border-radius:4px;}
.wb-media-body audio {width:min(620px,100%);}
.wb-notes-dialog {width:560px;}
.wb-notes-dialog textarea {background:var(--wb-bg);color:var(--wb-ink);border-color:var(--wb-line);font-size:14px;line-height:1.8;}
.wb-notes-dialog .primary-button {margin-top:18px;}
@media (min-width:1040px) {html,body{height:100%;overflow:hidden;}}
@media (max-height:820px) {
  .workbench{grid-template-rows:62px minmax(0,1fr) 46px;}
  .wb-board{gap:16px;padding:10px 22px 14px;}
  .wb-board>section{grid-template-rows:42px minmax(0,1fr);}
  .wb-input-form{padding:14px;gap:10px;}
  .workbench .wb-product-upload{height:100px;}
  .workbench .wb-file-tile{height:64px;}
  .wb-artifact{padding:12px 12px 0;grid-template-rows:auto minmax(0,1fr) 30px;}
  .wb-artifact header{padding-bottom:9px;}
  .wb-artifact h3{font-size:14px;}
  .wb-artifact-grid{gap:12px;}
  .wb-final{padding:12px;gap:10px;}
  .wb-analysis-summary{gap:5px;}
  .wb-analysis-summary p{-webkit-line-clamp:2;}
  .wb-script-line{padding:6px 0;}
}
@media (max-height:700px) {
  .workbench{grid-template-rows:54px minmax(0,1fr) 40px;}
  .wb-board{padding-top:4px;padding-bottom:10px;}
  .wb-board>section{grid-template-rows:36px minmax(0,1fr);}
  .wb-input-form{padding:10px;gap:7px;}
  .workbench .wb-product-upload{height:80px;}
  .workbench .wb-file-tile{height:54px;}
  .workbench input:not([type=file]){height:32px;}
  .wb-start-area p{display:none;}
  .workbench #startButton{height:34px;}
  .wb-upload-mark{font-size:17px;}
  .wb-summary-tags{display:none;}
  .wb-artifact header small{display:none;}
  .wb-top-note{display:none;}
}
@media (max-width:1200px) {
  .wb-board{grid-template-columns:260px minmax(410px,1fr) 230px;gap:14px;padding-left:18px;padding-right:18px;}
  .wb-top-note{display:none;}
  .wb-column-head>span{font-size:10px;}
  .wb-status-copy>span{display:none;}
}
@media (prefers-reduced-motion:reduce) {*{scroll-behavior:auto!important;transition:none!important;}}

.wb-media-unavailable {display:flex;align-items:center;justify-content:center;min-height:100px;padding:16px;color:var(--wb-muted);font-size:12px;text-align:center;}
.wb-video-canvas>.wb-media-unavailable {position:relative;padding-bottom:100px;}
@media(max-height:820px){.workbench .wb-product-upload>b{display:none}.workbench .wb-file-tile>.upload-help{display:none}.workbench .wb-file-tile>b{max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.wb-empty-artifact{gap:4px}}
.workbench .wb-file-tile.has-preview>.upload-title {opacity:1;}
.workbench #modelDropzone.has-preview>img {position:absolute;inset:0;width:100%;height:100%;min-height:0;max-height:none;object-fit:cover;opacity:.2;filter:none;z-index:0;}
.workbench #productPreview {grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));}
.workbench #productPreview:not(:has(figure:nth-child(4))) {grid-template-rows:minmax(0,1fr);}
.workbench #productPreview figure:first-child {grid-column:auto;grid-row:auto;}
.wb-play-overlay {left:50%;top:50%;transform:translate(-50%,-50%);}

.wb-dialog-feedback {position:absolute;bottom:18px;left:50%;transform:translateX(-50%);z-index:20;max-width:80%;padding:10px 16px;border-radius:7px;background:var(--wb-ink);color:var(--wb-paper);font-size:12px;box-shadow:0 5px 18px oklch(20% .02 240 / .15);pointer-events:none;}
.workbench #modelDropzone.has-preview>.upload-title {display:block;opacity:1;}

/* Keep portrait media inside its own grid track, including tall desktop windows. */
.wb-dialog-body .video-layout {grid-template-columns:minmax(0,340px) minmax(0,1fr);gap:24px;align-items:start;}
.wb-dialog-body .phone-frame {width:100%;max-width:min(340px,calc((100dvh - 240px)*.5625));height:auto;max-height:none;min-width:0;aspect-ratio:9/16;margin:0 auto;overflow:hidden;}
.wb-dialog-body .phone-frame video,.wb-dialog-body .phone-frame img {display:block;width:100%;height:100%;max-width:100%;object-fit:contain;}
.wb-dialog-body .video-side {min-width:0;}
/* Workflow connectors occupy the gutters and never cover module content. */
.wb-board {--flow-gap:22px;gap:var(--flow-gap);}
.wb-process-column,.wb-result-column {position:relative;}
.wb-process-column::before,.wb-result-column::before {content:'→';position:absolute;left:calc(-1 * var(--flow-gap));top:50%;width:var(--flow-gap);text-align:center;color:var(--wb-accent);font-size:18px;pointer-events:none;}
.wb-artifact-grid {position:relative;}
.wb-artifact-grid::before,.wb-artifact-grid::after {content:'↓';position:absolute;top:50%;transform:translate(-50%,-50%);color:var(--wb-accent);font-size:15px;line-height:14px;pointer-events:none;}
.wb-artifact-grid::before {left:25%;}
.wb-artifact-grid::after {left:75%;}
.wb-analysis-card {cursor:default;}
.wb-formula-content {min-height:0;display:flex;flex-direction:column;gap:7px;justify-content:center;}
.wb-analysis-detail {display:flex;align-items:center;justify-content:space-between;gap:8px;border:0;background:none;padding:0;text-align:left;color:var(--wb-ink);font-size:11px;line-height:1.5;}
.wb-analysis-detail span {flex-shrink:0;color:var(--wb-accent);font-size:10px;}
.wb-formula-label {font-size:10px;color:var(--wb-muted);}
.wb-formulas {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;}
.wb-formula {min-width:0;border:1px solid var(--wb-line);background:var(--wb-bg);color:var(--wb-ink);border-radius:5px;padding:6px 3px;font-size:11px;line-height:1.3;white-space:nowrap;}
.wb-formula.is-active {background:var(--wb-soft);border-color:var(--wb-accent);color:var(--wb-accent);font-weight:650;}
.wb-formula:disabled {opacity:.55;cursor:default;}
.wb-formula-apply {border:0;border-radius:5px;background:var(--wb-accent);color:white;padding:8px 4px;font-size:11px;line-height:1.4;font-weight:600;}
.wb-formula-apply:disabled {background:var(--wb-soft);color:var(--wb-muted);cursor:default;}
@media(max-height:820px) {
 .wb-board {--flow-gap:16px;}
 .wb-analysis-card {padding-top:10px;}
 .wb-analysis-card header {padding-bottom:5px;}
 .wb-formula-content {gap:4px;}
 .wb-formula {padding:4px 2px;font-size:10px;}
 .wb-formula-apply {padding:6px 3px;}
}
@media(max-width:1200px) {.wb-board {--flow-gap:14px;}}
