/* WBBubblechart — compact card workspace. This file owns the visible application shell. */
:root {
  --radius: 20px; --sidebar-w: calc((100vw - 52px) * .2); --context-w: calc((100vw - 52px) * .2); --shell-gap: 14px; --tabbar-h: 12px;
  --wb-ink: #1c1c1e; --wb-muted: #73737a; --wb-border: #e5e5ea; --wb-accent: #ff9500;
  --wb-gray: #f2f2f7; --wb-well: #f6f6f9; --surface: #fff;
  --wb-warm: #fff7eb; --wb-warm-selected: #fff0db; --wb-warm-hover: #fff0df; --wb-warm-ink: #805218;
  --shadow: 0 4px 24px #1c1c1e06, 0 1px 3px #1c1c1e03;
  --text-main: #1c1c1e; --text-sub: #73737a; --bg-body: #f2f2f7;
}
html { scroll-padding-top: 12px; }
body.wb-shell { background: var(--wb-gray); color: var(--wb-ink); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 13px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea, summary { touch-action: manipulation; }
:where(button,input,select,textarea,summary):focus-visible { outline: 2px solid #007aff; outline-offset: 3px; }
:where(.wb-context-panel,#wb-stage-slot,#sidebar) { scrollbar-width: thin; scrollbar-color: #d5d5dc transparent; }

/* Shared controls: one size, one hierarchy, throughout all four stages. */
.studio-btn, .btn-modern { min-height: 34px; padding: 7px 12px; border: 1px solid transparent; border-radius: 11px; background: var(--wb-gray); color: #48484e; font-size: 12px; line-height: 1.4; font-weight: 500; box-shadow: none; transition: background .18s, box-shadow .18s, transform .18s; }
.studio-btn:hover:not(:disabled), .btn-modern:hover:not(:disabled) { background: #e9e9ef; transform: translateY(-1px); box-shadow: 0 3px 8px #1c1c1e08; }
.studio-btn:active:not(:disabled), .btn-modern:active:not(:disabled) { transform: scale(.98); }
.studio-btn.primary, .btn-primary-m { background: var(--wb-ink); border-color: var(--wb-ink); color: #fff; box-shadow: 0 3px 8px #1c1c1e0d; }
.studio-btn.primary:hover:not(:disabled), .btn-primary-m:hover:not(:disabled) { background: #343436; }
.studio-btn.compact { min-height: 30px; padding: 5px 9px; font-size: 11px; border-radius: 9px; }
.studio-btn.full { width: 100%; margin-top: 10px; }
.studio-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; text-align: center; white-space: normal; overflow-wrap: anywhere; }
.studio-btn:disabled, .btn-modern:disabled, .studio-icon-btn:disabled { cursor: default; opacity: .4; transform: none; box-shadow: none; }
.studio-btn.danger { color: #d23e38; background: #fff0ef; }
.studio-text-btn { color: #73737a; font-size: 11px; }
.studio-text-btn:hover { color: #007aff; }
.studio-icon-btn { background: var(--wb-gray); color: #74747b; border-radius: 9px; }
.studio-card, .wb-setting-card { min-width: 0; padding: 14px; border: 1px solid #fff; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.studio-card h3, .wb-setting-card h3 { margin: 0; color: var(--wb-ink); font-size: 13px; font-weight: 600; letter-spacing: -.15px; line-height: 1.5; }
.studio-canvas-toolbar { gap: 8px; margin-bottom: 12px; }
.studio-canvas-toolbar .studio-footnote { margin: 0; }
.studio-footnote, .wb-field-hint { color: var(--wb-muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.studio-empty { padding: 20px 12px; color: var(--wb-muted); font-size: 12px; }
.studio-field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 10px 0; }
.studio-field-grid label, .studio-field { min-width: 0; color: var(--wb-muted); font-size: 11px; }
.studio-field-grid input:not([type=checkbox]):not([type=color]), .studio-field input:not([type=checkbox]):not([type=color]), .studio-field-grid select, .studio-toolbar select, #studio-editor-asset { height: 34px; padding: 7px 10px; color: var(--wb-ink); font-size: 12px; border: 1px solid #e5e5ea; border-radius: 10px; background: var(--wb-well); }
.studio-field-grid label.studio-check, .studio-check { display: flex; flex-direction: row; align-items: center; gap: 7px; margin: 9px 0; font-size: 11px; color: #626269; }
.studio-check input { width: 14px !important; height: 14px !important; flex: none; margin: 0; accent-color: #1c1c1e; }
.studio-pill, .studio-kind { border: 0; color: var(--wb-muted); background: var(--wb-gray); font-size: 10px; }
.studio-table th, .studio-table td { padding: 8px 10px; font-size: 11px; border-color: #eeeef2; }
.studio-table th { background: var(--wb-well); color: var(--wb-muted); font-weight: 500; }
.studio-page-head { gap: 12px; margin-bottom: 12px; }
.studio-page-head h2 { font-size: 22px; }
.studio-page-head p { font-size: 12px; }
.wb-panel-heading h3 { display: flex; align-items: center; gap: 8px; }
.wb-panel-heading h3 > i { color: #8e8e93; font-size: 14px; font-weight: 400; }

/* Permanent navigation and files: a single frosted rail, no top bar. */
.wb-guided-shell .app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0,1fr); gap: var(--shell-gap); width: 100%; padding: 12px; margin: 0; }
.wb-guided-shell .wb-rail { position: sticky; top: 12px; display: flex; min-width: 0; height: calc(100dvh - 24px); max-height: none; }
.wb-guided-shell #sidebar { position: sticky; inset: auto; top: 12px; display: flex; flex-direction: column; min-width: 0; width: 100%; height: 100%; max-height: none; z-index: 230; overflow: visible; background: #ffffffb8; border: 1px solid #ffffffb3; border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition: none; }
.wb-sidebar-intro { display: flex; flex-direction: column; flex: none; gap: 12px; padding: 20px 16px 16px; }
.wb-sidebar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wb-brand-mark { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; color: #fff; border: 1px solid #ffffff60; border-radius: 50%; background: linear-gradient(145deg,#ffb341,#f28d00); box-shadow: 0 4px 12px #f29b1924, inset 0 1px #ffffff70; }
.wb-brand-mark svg { width: 25px; height: 25px; }
.wb-brand-copy { display: grid; gap: 2px; min-width: 0; line-height: 1.4; }
.wb-brand-copy strong { color: var(--wb-ink); font-size: 16px; letter-spacing: -.5px; font-weight: 650; }
.wb-brand-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: #8e8e93; }
#wf-save-state { align-self: flex-start; gap: 6px; padding: 5px 9px; color: #248b43; background: #effaf1; border: 1px solid #d9efdd; border-radius: 999px; font-size: 10px; white-space: nowrap; }
#wf-save-state[data-mode=loading] { color: #8e8e93; background: #f2f2f7; border-color: #e8e8ed; }
#wf-save-state[data-mode=warning] { color: #ad6a10; background: #fff7e8; border-color: #f3dfbc; }
.wb-four-step .wb-return { display: none; }
.wb-guided-shell #sidebar > .wb-guided-steps { display: grid; }
.wb-guided-steps { grid-template-columns: minmax(0,1fr); gap: 5px; flex: none; margin: 0 12px; padding: 0 0 16px; border-bottom: 1px solid #e8e8ee; }
.wb-guided-steps > button { display: grid; grid-template-columns: 30px minmax(0,1fr); grid-template-rows: auto auto; align-items: center; gap: 1px 10px; min-width: 0; min-height: 48px; padding: 7px 10px; border: 1px solid transparent; border-radius: 14px; background: transparent; text-align: left; transition: background .18s, box-shadow .18s; }
.wb-guided-steps > button:hover:not(.is-active) { background: #f0f0f5; }
.wf-step-number { grid-row: 1 / 3; display: grid; place-items: center; width: 30px; height: 30px; background: #f0f0f5; color: #8e8e93; border-radius: 50%; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wf-step-name { color: #45454c; font-size: 12px; font-weight: 600; white-space: nowrap; }
.wf-step-state { color: #8e8e93; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-guided-steps > .is-active { background: #1c1c1e; box-shadow: 0 4px 12px #1c1c1e12; }
.wb-guided-steps > .is-active .wf-step-name { color: #fff; }
.wb-guided-steps > .is-active .wf-step-state { color: #bcbcc2; }
.wb-guided-steps > .is-active .wf-step-number { background: #ffffff1a; color: #fff; }
.wb-guided-steps > .is-complete:not(.is-active) .wf-step-number { background: #eaf8ee; color: #29994a; font-size: 0; }
.wb-guided-steps > .is-complete:not(.is-active) .wf-step-number::before { content: '✓'; font-size: 14px; }
.wb-guided-steps > button[data-wb-action=open-guide] { background: var(--wb-warm); }
.wb-guided-steps > button[data-wb-action=open-guide]:hover { background: var(--wb-warm-hover); }
.wb-guided-steps > [data-wb-action=open-guide] .wf-step-name, .wb-guided-steps > [data-wb-action=open-guide] .wf-step-state { color: var(--wb-warm-ink); }
.wb-guided-steps > [data-wb-action=open-guide] .wf-step-number { background: var(--wb-warm-selected); color: var(--wb-warm-ink); }
.wb-membrane-picker { flex: none; padding: 12px 14px 0; }
.wb-source-picker { display: grid; gap: 5px; font-size: 10px; color: var(--wb-muted); }
.wb-source-picker select { width: 100%; min-width: 0; height: 32px; border: 1px solid var(--wb-border); border-radius: 9px; background: #fff; font-size: 11px; }
.sidebar-top { padding: 16px 16px 10px; }
.sidebar-heading-title { color: #48484e; font-size: 11px; font-weight: 600; }
.sidebar-heading-title > i { color: #8e8e93; margin-right: 4px; }
.wb-guided-shell .sidebar-heading-desc { display: block; margin-top: 4px; color: #8e8e93; font-size: 10px; }
.workspace-panel { min-height: 0; padding: 0 12px 12px; }
.workspace-folder-hint { margin: 0 0 10px; padding: 0 3px; color: #d23e38; background: transparent; font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.workspace-actions { gap: 6px; }
.workspace-icon-btn { min-height: 32px; padding: 6px; color: #68686f; background: #ffffffb3; border: 1px solid #e5e5eb; border-radius: 10px; font-size: 10px; }
.workspace-footer-actions .workspace-icon-btn { justify-content: center; padding-inline: 6px; }
.workspace-icon-btn:hover { color: var(--wb-ink); background: #f2f2f7; }
.workspace-scope-note { margin: 7px 3px; font-size: 9px; color: #8e8e93; }
.workspace-tree { min-height: 50px; padding: 0 0 6px; }
.workspace-folder-row { min-height: 32px; padding: 5px 6px; background: #fff; color: var(--wb-ink); }
.workspace-folder-row.is-selected { background: #fff; color: var(--wb-ink); }
.workspace-folder-row:hover { background: var(--wb-well); }
.workspace-folder-row > i { color: #dca149; }
.workspace-analysis-list { padding-left: 12px; }
.workspace-analysis-row { min-height: 36px; padding: 6px 8px; margin: 4px 0; font-size: 11px; border: 0; border-radius: 11px; background: var(--wb-gray); }
.workspace-analysis-row.is-active { color: var(--wb-ink); background: var(--wb-gray); border: 0; box-shadow: none; }
.workspace-analysis-row.is-active > i { color: #ff9500; }
.workspace-local-badge { color: #8e8e93; }
.workspace-footer-actions { padding-top: 8px; border-color: #e8e8ee; }
.workspace-storage-note { gap: 7px; padding: 10px; margin-top: 10px; border-radius: 12px; background: #f2f2f780; color: #8e8e93; font-size: 9px; }
.wb-sidebar-tools { position: relative; z-index: 250; display: flex; align-items: center; flex: none; gap: 6px; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid #e8e8ee; }
.wb-sidebar-tools > .studio-btn, .wb-utility-menu { flex: 1; }
.wb-utility-menu { position: relative; }
.wb-utility-menu > summary { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 32px; padding: 6px 10px; border: 1px solid #e5e5eb; border-radius: 10px; background: #ffffff80; color: #73737a; font-size: 11px; cursor: pointer; list-style: none; }
.wb-utility-menu > summary::-webkit-details-marker { display: none; }
.wb-utility-popover { position: fixed; inset: auto; z-index: 12000; display: grid; gap: 3px; width: 240px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow: auto; overscroll-behavior: contain; margin: 0; padding: 7px; border: 1px solid #fff; border-radius: 16px; color: var(--wb-ink); background: #ffffffed; box-shadow: 0 12px 40px #1c1c1e20; backdrop-filter: blur(20px); }
.wb-utility-popover[popover]:not(:popover-open) { display: none; }
.wb-utility-popover button { min-height: 36px; padding: 8px 11px; border: 0; border-radius: 10px; color: #48484e; background: transparent; text-align: left; font-size: 12px; }
.wb-utility-popover button:hover { background: var(--wb-gray); }
.wb-utility-popover button.danger { margin-top: 4px; color: #c9443d; background: #fff4f2; }
.wb-utility-popover button.danger:hover { background: #ffeae6; }

/* Resizable frame. Canvas geometry is still determined by the image engine. */
.wb-guided-shell #main { min-width: 0; }
.view-section { padding-bottom: 0; animation: none; }
.wb-stage-workarea { position: relative; display: grid; grid-template-columns: minmax(0,1fr) var(--context-w); gap: var(--shell-gap); min-width: 0; height: calc(100dvh - 24px); }
#wb-stage-slot { display: flex; flex-direction: column; align-items: stretch; gap: 12px; min-width: 0; min-height: 0; overflow: auto; }
.wb-panel-resizer { position: absolute; top: 0; bottom: 0; z-index: 235; width: 14px; cursor: col-resize; touch-action: none; border-radius: 8px; }
.wb-panel-resizer::before { content: ''; position: absolute; top: calc(50% - 20px); left: 5px; width: 4px; height: 40px; border-radius: 8px; background: #d5d5dd; transition: background .15s; }
.wb-panel-resizer:hover::before, .wb-panel-resizer:focus-visible::before, .wb-resizing .wb-panel-resizer::before { background: #8e8e93; }
#wb-resize-left { right: -14px; }
#wb-resize-right { right: var(--context-w); }
body.wb-resizing, .wb-resizing * { cursor: col-resize !important; user-select: none !important; }

/* Original membrane: compact toolbar, quiet work surface, local instructions. */
.wb-membrane-pane { display: flex; flex-direction: column; flex: none; min-width: 0; min-height: 0; overflow: hidden; border: 1px solid #fff; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.wb-stage-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 10px 14px; border-bottom: 1px solid #f0f0f4; }
.wb-stage-head > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.wb-stage-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--wb-ink); font-size: 12px; font-weight: 600; }
.wb-stage-head span { white-space: nowrap; color: #8e8e93; font-size: 10px; }
#wf-stage-source { padding: 4px 8px; border-radius: 999px; background: var(--wb-well); }
.wb-image-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 7px 14px; background: #fff; border-bottom: 1px solid #f0f0f4; }
.wb-image-toolbar label { display: flex; flex: 1 1 220px; align-items: center; gap: 8px; min-width: min(190px,100%); max-width: 360px; color: var(--wb-muted); font-size: 11px; }
.wb-image-toolbar input { flex: 1 1 140px; width: 140px; min-width: 110px; height: 24px; accent-color: #1c1c1e; }
.wb-image-toolbar output { flex: 0 0 34px; width: 34px; font-size: 10px; font-variant-numeric: tabular-nums; }
.wb-image-toolbar > [data-wb-action=upload] { margin-left: auto; }
#wb-image-stage { position: relative; height: clamp(220px,calc(100dvh - 154px),1200px); min-height: 0; flex: 1 1 auto; border: 0; border-radius: 0; background: #f6f6f9; padding-block: 30px; }
#wbCanvas { flex: none; max-width: none; touch-action: none; }
#empty-tip { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px; background: transparent; text-align: center; pointer-events: none; }
#empty-tip > strong { color: var(--wb-ink); font-size: 22px; font-weight: 650; letter-spacing: -.6px; }
#empty-tip > span { color: var(--wb-muted); font-size: 12px; }
.wb-empty-art { width: 200px; max-width: 70%; margin-bottom: 0; filter: drop-shadow(0 12px 12px #1c1c1e08); }
.wb-empty-art svg { width: 100%; height: auto; }
.wb-empty-shortcuts kbd { display: inline-block; padding: 2px 5px; border: 1px solid #e0e0e6; border-radius: 5px; background: #fff; color: #626269; font-family: inherit; font-size: 10px; box-shadow: 0 1px 2px #1c1c1e08; }
#empty-tip .wb-empty-upload { min-height: 36px; padding-inline: 16px; color: #fff; background: var(--wb-ink); pointer-events: auto; }
#empty-tip .wb-empty-upload:hover { background: #343436; }
.wb-empty-upload > i:last-child { margin-left: 8px; font-size: 10px; opacity: .65; }
.wb-empty-formats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 1px; }
.wb-empty-formats span { padding: 4px 8px; border: 1px solid #e7e7ed; border-radius: 999px; color: #8e8e93; background: #ffffff80; font-size: 9px; }
.wf-stage-instruction { flex: none; padding: 9px 14px; border-top: 1px solid #f0f0f4; color: var(--wb-muted); background: #fff; font-size: 11px; line-height: 1.5; }
.wf-stage-instruction::before { content: '↳'; margin-right: 7px; color: #a6a6ad; }
.wb-source-overlay { position: absolute; z-index: 3; display: block; max-width: none; overflow: visible; pointer-events: none; }
.wb-marker-overlay { z-index: 4; }
.wb-marker-overlay text { paint-order: stroke fill; stroke: #fff; stroke-width: 2px; stroke-linejoin: round; }

/* Independent setting cards, directly visible without disclosures. */
.wb-context-panel { display: flex; flex-direction: column; gap: 12px; container: settings / inline-size; min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; border: 0; border-radius: var(--radius); background: transparent; box-shadow: none; padding: 0; }
.wb-context-panel > * { flex: 0 0 auto; margin-top: 0; }
.wb-context-panel .view-section.active { display: grid; grid-auto-rows: max-content; align-content: start; gap: 12px; width: auto; }
.wb-setting-card { padding: 14px; margin: 0; display: flow-root; min-height: min-content; }
.wb-setting-head { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 10px; }
.wb-setting-head h3 { min-width: 0; margin: 0; font-size: 13px; font-weight: 600; }
.wb-section-icon { display: grid; place-items: center; flex: 0 0 27px; width: 27px; height: 27px; border-radius: 9px; background: var(--wb-gray); color: #68686f; font-size: 14px; }
.wb-card-tag { margin-left: auto; padding: 3px 7px; border-radius: 999px; color: #8e8e93; background: var(--wb-well); white-space: nowrap; font-size: 9px; }
.wb-context-panel :where(label:not(.studio-check):not(.wb-switch):not(.wf-marker-band)) { display: flex; flex-direction: column; gap: 5px; min-width: 0; margin-top: 8px; color: var(--wb-muted); font-size: 11px; }
.wb-context-panel input:not([type=checkbox]):not([type=range]), .wb-context-panel select, .wb-context-panel textarea { width: 100%; min-width: 0; height: 34px; padding: 7px 10px; border: 1px solid #e5e5eb; border-radius: 10px; background: var(--wb-well); color: var(--wb-ink); font-size: 12px; transition: border-color .15s, box-shadow .15s; }
.wb-context-panel .lab-custom-select { display: block; width: 100%; min-width: 0; max-width: 100%; color: var(--wb-ink); }
.wb-context-panel .lab-custom-select > button { box-sizing: border-box; display: block; min-width: 0; width: 100%; min-height: 34px; padding: 7px 30px 7px 10px; border: 1px solid #e5e5eb; border-radius: 10px; background: var(--wb-well); color: var(--wb-ink); font-family: inherit; font-size: 12px; line-height: 18px; }
.wb-context-panel .lab-custom-select > button:hover, .wb-context-panel .lab-custom-select.is-open > button { border-color: #b7cde8; background: #fff; }
.wb-context-panel .lab-custom-select > button:focus-visible { outline: 2px solid #007aff; outline-offset: 2px; }
.wb-context-panel .lab-custom-select > button:disabled { opacity: .45; cursor: default; }
.wb-context-panel .studio-field-grid { align-items: start; }
.wb-context-panel .wb-advanced { margin-block: 10px; }
.wb-context-panel .studio-footnote { margin-top: 8px; margin-bottom: 0; }
.wb-context-panel .wb-setting-head h3 { overflow-wrap: anywhere; }
.wb-context-panel input:not([type=range]):focus, .wb-context-panel select:focus { background: #fff; border-color: #99caff; }
.wb-context-panel input[type=checkbox] { accent-color: #1c1c1e; }
.wb-context-panel .studio-field-grid { margin: 8px 0; }
.wb-context-panel .studio-field-grid label { margin: 0; }
#grid-status { padding: 0; margin: 7px 0; background: transparent; font-size: 10px; line-height: 1.5; color: #8e8e93; }
#wb-auto-status:empty { display: none; }
#wb-auto-status { margin-top: 8px; font-size: 10px; }
.wb-measure-actions { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; margin-top: 10px; }
.wb-measure-actions > .studio-btn { min-width: 0; padding-inline: 10px; }
.wb-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.wb-context-panel .wb-setting-row > label:not(.wb-switch) { display: block; margin: 0; color: #626269; font-size: 11px; }
.wb-label-note { color: #a1a1a8; margin-left: 3px; font-size: 10px; }
.wb-switch { display: flex; align-items: center; gap: 6px; flex: none; margin: 0; color: #73737a; font-size: 10px; cursor: pointer; }
.wb-switch input { appearance: none; -webkit-appearance: none; position: relative; width: 30px; height: 18px; flex: none; margin: 0; border: 0; border-radius: 999px; background: #d8d8de; cursor: pointer; transition: background .18s; }
.wb-switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0002; transition: transform .18s; }
.wb-switch input:checked { background: #34c759; }
.wb-switch input:checked::after { transform: translateX(12px); }
.wb-range-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.wb-range-row input[type=range] { width: 100%; min-width: 0; accent-color: #1c1c1e; }
.wb-value-pill { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 42px; padding: 4px 7px; color: #626269; border-radius: 8px; background: var(--wb-gray); font-size: 10px; font-variant-numeric: tabular-nums; }
.wb-field-hint { margin: 0; font-size: 10px; color: #8e8e93; }
.wb-mask-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; color: #626269; font-size: 11px; }
.wb-mask-legend > span { display: inline-flex; align-items: center; gap: 4px; }
.wb-mask-legend i { width: 9px; height: 9px; border-radius: 3px; }
.wb-mask-legend .wb-legend-signal { background: #007aff; }
.wb-mask-legend .wb-legend-background { background: #e53935; }
#wb-lane-details > .studio-btn { margin: 7px 0 2px; }
#wb-lane-status { margin: 0; }
.wf-inline-fields { display: grid; gap: 0; }
.wf-experiment-bar { padding: 0 0 12px; margin-bottom: 12px; border-bottom: 1px solid #f0f0f4; }
.wf-experiment-bar label { margin-top: 0 !important; }
#wf-count { display: block; margin-top: 6px; font-size: 10px; }
.wf-step-instruction { padding: 16px; border: 1px solid #fff; border-radius: var(--radius); background: #ffffffd9; box-shadow: var(--shadow); }
#wf-step-kicker { color: #8e8e93; font-size: 10px; }
#wf-step-title { margin: 8px 0 7px; color: var(--wb-ink); font-size: 20px; font-weight: 650; letter-spacing: -.6px; }
#wf-step-copy { color: var(--wb-muted); font-size: 12px; line-height: 1.6; }
#wf-primary-action { position: relative; min-height: 36px; width: 100%; margin-top: 12px; padding-inline: 22px; }
#wf-primary-action::after { content: '→'; position: absolute; right: 12px; opacity: .7; }
body[data-wb-step=image] #wf-step-instruction { display: none; }
.wb-context-panel .wb-advanced { padding: 10px; border: 0; border-radius: 12px; background: var(--wb-well); }
.wb-context-panel .wb-advanced > h3 { margin-bottom: 8px; font-size: 11px; color: #73737a; }
.wb-context-panel .wb-context-body { padding: 0; }
.wb-context-panel .wb-context-body .studio-card { padding: 0; border: 0; border-radius: 0; box-shadow: none; }
.wb-context-panel .wb-context-body p { color: var(--wb-muted); font-size: 11px; line-height: 1.6; }
.wb-asset-choices { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(150px,100%),1fr)); gap: 5px; max-height: 150px; overflow: auto; margin: 8px 0; }
.wb-asset-choices > label, .wb-context-panel .wb-asset-choices > label { display: flex; flex-direction: row; align-items: center; gap: 7px; margin: 0; padding: 8px; border: 1px solid #e8e8ed; border-radius: 10px; font-size: 11px; }
.wb-asset-choices > label:has(input:checked) { background: var(--wb-well); border-color: #d8d8df; }
.wb-asset-choices span { overflow-wrap: anywhere; min-width: 0; }
.wb-asset-choices input { flex: none; }
#studio-batch-settings { display: grid; gap: 4px; margin: 8px 0; padding: 10px; background: var(--wb-well); border: 1px solid var(--wb-border); border-radius: 12px; color: #48484e; font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.wb-batch-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
#wb-batch-panel progress { display: block; width: 100%; margin: 8px 0; }
#wb-batch-assets label span { overflow-wrap: anywhere; }
#wb-lane-boundaries { display: block; width: 100%; min-height: 54px; resize: vertical; overflow: hidden; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.wb-required-note, .wb-local-next > strong { display: block; margin: 10px 0; color: #c2312a; font-size: 12px; font-weight: 700; line-height: 1.65; overflow-wrap: anywhere; }
.wb-local-next { margin-top: 10px; padding-top: 1px; border-top: 1px solid #f5e2df; }
.wb-local-next > strong { margin-bottom: 7px; }
.wb-required-tag { background: #fff0ee; color: #c2312a; font-weight: 700; }
.wb-setting-card[data-registration=pending] { border-color: #edc9c4; }
.wb-setting-card[data-registration=complete] #wf-register-hint { color: #248b43; }
.wb-setting-card[data-registration=complete] #wf-register-tag { color: #248b43; background: #effaf1; }
.wb-attention { outline: 2px solid #c2312a; outline-offset: -2px; }
#wf-step-copy.wb-required-note, #wf-export-status.wb-required-note, #wf-marker-guidance.wb-required-note { color: #c2312a; font-weight: 700; }

#wb-batch-panel progress { height: 5px; accent-color: #1c1c1e; }
@container settings (max-width: 290px) { .wb-card-tag { display: none; } .wb-setting-card { padding: 12px; } .wb-label-note { display: none; } }

/* Analysis data: present under the original image; scroll only inside the data card. */
#wf-stage-results { min-width: 0; padding: 14px; border: 1px solid #fff; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
#wf-stage-results .studio-canvas-toolbar { margin-bottom: 4px; }
#wf-stage-results .studio-footnote { margin: 4px 0; }
.wb-advanced, .wb-result-details { margin: 10px 0 0; padding-top: 5px; border-top: 1px solid #eeeef3; }
.wb-advanced > summary, .wb-lane-details > summary, .wb-result-details > summary { padding: 6px 0; color: #73737a; font-size: 11px; font-weight: 500; cursor: pointer; }
.wb-advanced[open] > summary { margin-bottom: 4px; }
#wb-results-panel .card-header-clean, #wb-results-panel .card-body-clean { padding: 7px 0; border: 0; }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px !important; }
.result-actions button { min-height: 30px; padding: 5px 8px !important; font-size: 10px; }
#result-scope { flex: 1 1 160px; min-width: 0; width: auto; max-width: 100%; height: 30px; padding: 5px 8px; background: var(--wb-well); color: #626269; font-size: 11px; border-radius: 9px; }
#res-table { font-size: 11px; }
#res-table thead { background: var(--wb-well); }
#res-table th { color: #8e8e93; font-size: 10px; font-weight: 500; }
.wb-lane-values { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; margin-top: 8px; }
.wb-lane-values > div { display: flex; justify-content: space-between; gap: 6px; padding: 8px; border-radius: 10px; background: var(--wb-well); font-size: 11px; }
.wb-lane-values span { color: var(--wb-muted); }
.wb-lane-values output { color: var(--wb-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
#wb-quick-chart { min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
#wb-quick-chart svg { display: block; width: 100%; height: auto; max-height: none; margin: 12px 0; }
.wb-context-tool { min-width: 0; border: 1px solid #fff; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.wb-context-tool > summary { padding: 13px 14px; color: #626269; font-size: 12px; font-weight: 500; cursor: pointer; }
.wb-context-tool[open] > summary { border-bottom: 1px solid #f0f0f4; }
.wb-context-body { padding: 12px; min-width: 0; }
.wb-context-body > .studio-card { padding: 12px; background: var(--wb-well); box-shadow: none; }
#wf-stage-results #wb-quality-panel { margin-top: 8px; border: 0; border-top: 1px solid #eeeef3; border-radius: 0; box-shadow: none; }
#wf-stage-results #wb-quality-panel > summary { padding: 9px 0; font-size: 11px; }
#wb-quality-panel canvas { display: block; width: 100%; height: auto; }
#studio-diagnosis-current { color: var(--wb-muted); font-size: 11px; line-height: 1.65; }

/* Samples and figure: the same card hierarchy and readable, local table scrolling. */
.wb-strip-panel { flex: none; }
.wf-strip { container-type: inline-size; padding: 12px; margin-top: 10px; border: 1px solid #ededf2; border-radius: 14px; background: #fafafc; }
.wf-strip:first-child { margin-top: 0; }
.wf-strip-head { display: grid; grid-template-columns: auto 60px minmax(80px,1fr) minmax(80px,1fr) auto 28px; align-items: end; gap: 7px; margin-bottom: 8px; }
.wf-strip-head label { display: flex; align-items: center; gap: 5px; min-width: 0; color: var(--wb-muted); font-size: 10px; }
.wf-strip-head .wf-name, .wf-strip-head .wf-run { flex-direction: column; align-items: stretch; gap: 4px; }
.wf-strip-head input:not([type=checkbox]) { width: 100%; min-width: 0; height: 30px; padding: 5px 7px; border: 1px solid #e3e3ea; border-radius: 8px; background: #fff; font-size: 11px; }
.wf-strip-head > label:first-child { grid-column: 1; grid-row: 1; }
.wf-strip-thumb { grid-column: 2; grid-row: 1; width: 60px; height: 30px; object-fit: contain; border: 1px solid #e5e5eb; border-radius: 8px; background: #fff; }
.wf-strip-head .wf-name { grid-column: 3; grid-row: 1; }.wf-strip-head .wf-run { grid-column: 4; grid-row: 1; }
.wf-strip-head > label:has([data-strip-field=isControl]) { grid-column: 5; grid-row: 1; }
.wf-strip-head > [data-strip-remove] { grid-column: 6; grid-row: 1; }
.wf-strip-head > [data-strip-download] { grid-column: 1 / 3; grid-row: 2; justify-self: start; }
.wf-strip-head .studio-btn { min-height: 28px; padding-inline: 7px; font-size: 10px; }
.wf-strip-head .studio-icon-btn { width: 28px; height: 28px; }
.wf-strip-source { color: #8e8e93; font-size: 10px; overflow-wrap: anywhere; }
/* A worksheet surface: the cell is the control, with a visible paste entry point. */
.wf-grid-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; margin: 10px 0; }
.wf-excel-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid #bbdfca; border-radius: 6px; background: #eaf6ee; color: #197447; font-size: 12px; font-weight: 650; }
.wf-paste-hint { margin: 0; color: #667085; font-size: 12px; line-height: 1.5; }
.wf-sample-toggle { display: inline-flex; align-items: center; justify-content: center; min-height: 30px; padding: 5px 9px; margin-left: auto; border: 1px solid #d7dde6; border-radius: 6px; background: #fff; color: #475467; font-size: 12px; line-height: 18px; text-align: center; }
.wf-sample-toggle:hover { background: #f0f4fa; border-color: #b5c5db; }
.wf-sample-toggle:focus-visible { outline: 2px solid #3279d6; outline-offset: 2px; }
.wf-sample-toggle[aria-pressed=true] { color: #245fa9; background: #edf4ff; border-color: #a9c4e9; }
.wf-repeat-hint { margin: 0 0 9px; color: #667085; font-size: 12px; line-height: 1.6; }
.wf-repeat-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0 0 9px; }
.wf-repeat-options label { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; color: #475467; font-size: 13px; cursor: pointer; }
.wf-repeat-options input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: #3279d6; }
.wf-repeat-options input[type=number] { box-sizing: border-box; width: 56px; height: 30px; padding: 4px 6px; border: 1px solid #d7dde6; border-radius: 6px; background: #fff; color: #34445c; text-align: center; }
.wf-lanes:not(:has([data-grid-column=bio],[data-grid-column=tech],[data-grid-column=sample])) { min-width: 300px; }
.wf-paste-status { margin: 6px 0; font-size: 12px; line-height: 1.6; color: #197447; overflow-wrap: anywhere; }
.wf-paste-status.wb-required-note { color: #c2312a; }
.wf-paste-status:empty { display: none; }
.wf-table-scroll { max-width: 100%; overflow: auto; border: 1px solid #cdd5e0; border-radius: 6px; scrollbar-width: thin; }
.wf-lanes { width: 100%; min-width: 540px; table-layout: fixed; border-collapse: collapse; font-size: 13px; background: #fff; }
.wf-lanes:has([data-grid-column=sample]) { min-width: 700px; }
.wf-lanes th, .wf-lanes td { height: 37px; padding: 0; border: 1px solid #e0e5ec; text-align: left; }
.wf-lanes thead th { position: sticky; top: 0; z-index: 1; height: 46px; padding: 5px 8px; background: #f0f3f8; color: #475467; font-weight: 600; white-space: nowrap; }
.wf-lanes thead th:first-child, .wf-lanes [data-grid-column=excluded] { text-align: center; }
.wf-lanes tbody th { padding: 0 5px; background: #f5f7fa; color: #667085; font-size: 12px; font-weight: 500; text-align: center; }
.wf-col-letter { display: block; margin-bottom: 2px; color: #8491a5; font-size: 10px; font-weight: 500; line-height: 12px; }
.wf-lanes input[type=text], .wf-lanes select { box-sizing: border-box; display: block; width: 100%; min-width: 0; max-width: 100%; height: 36px; margin: 0; padding: 7px 9px; border: 0; border-radius: 0; outline: none; box-shadow: none; background: transparent; color: #25344b; font-size: 13px; }
.wf-lanes .wf-repeat-native { display: none; }
.wf-cell-select { display: flex; align-items: center; height: 36px; min-width: 0; padding: 3px 5px; }
.wf-repeat-trigger { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; min-width: 0; height: 29px; padding: 4px 8px; border: 1px solid #e3e8ef; border-radius: 7px; background: #f5f7fb; color: #34445c; font: inherit; line-height: 18px; cursor: pointer; }
.wf-repeat-trigger span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-repeat-trigger svg { flex: none; width: 13px; height: 13px; fill: none; stroke: #8491a5; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.wf-repeat-trigger:hover, .wf-repeat-trigger[aria-expanded=true] { border-color: #abc6e9; background: #edf4ff; color: #245fa9; }
.wf-repeat-trigger:focus-visible { outline: 2px solid #3279d6; outline-offset: -1px; }
.wf-repeat-menu { box-sizing: border-box; position: fixed; z-index: 200000; display: grid; gap: 2px; margin: 0; padding: 5px; overflow: auto; overscroll-behavior: contain; border: 1px solid #dce3ed; border-radius: 11px; background: #fff; box-shadow: 0 8px 28px #25344b24; scrollbar-width: thin; }
.wf-repeat-menu[hidden] { display: none; }
.wf-repeat-menu [role=option] { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; padding: 6px 9px; border: 0; border-radius: 6px; background: transparent; color: #475467; font-family: inherit; font-size: 13px; line-height: 20px; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.wf-repeat-menu [role=option][aria-selected=true] { color: #245fa9; background: #edf4ff; font-weight: 600; }
.wf-repeat-menu [role=option][aria-selected=true]::after { content: '✓'; flex: none; }
.wf-repeat-menu [role=option]:hover, .wf-repeat-menu [role=option].is-active { background: #e8effa; color: #245fa9; }
@media (pointer: coarse) { .wf-repeat-menu [role=option] { min-height: 40px; font-size: 16px; }.wf-repeat-trigger { min-height: 30px; font-size: 16px; } }
.wf-lanes input::placeholder { color: #98a2b3; font-size: 12px; }
.wf-lanes .wf-readonly { padding: 0 9px; background: #f7f8fb; color: #667085; font-variant-numeric: tabular-nums; text-align: right; }
.wf-lanes .wf-exclusion { text-align: center; background: #f7f8fb; }
.wf-lanes .wf-exclusion input { margin: 0; }
.wf-lanes tr.is-excluded { opacity: .5; }
.wf-lanes tbody tr:hover td:not(.is-active) { background: #f4f8fe; }
.wf-lanes td.is-pasted { background: #edf4ff; }
.wf-lanes td.is-active { position: relative; outline: 2px solid #3279d6; outline-offset: -2px; background: #fff; }
.wf-lanes th.is-active { background: #dfeafb; color: #245fa9; }
.wf-figure { min-width: 0; padding: 14px; border: 1px solid #eeeef3; border-radius: 14px; background: var(--wb-well); }
.wf-figure svg { display: block; width: 100%; height: auto; max-height: clamp(180px,32vh,340px); }
body[data-wb-step=export] .wf-figure svg { max-height: min(52vh,480px); }
#wf-stat-chart svg { display: block; width: 100%; height: auto; }
#wf-excluded { margin-top: 8px; }
.wf-notice { color: #ae741c; }.wf-danger { color: #c5433d; }
body[data-wb-step=figure] #wb-image-stage { height: 240px; flex: none; }
@container (max-width: 479px) {
  .wf-strip-head { grid-template-columns: auto 60px minmax(0,1fr) 28px; }
  .wf-strip-head .wf-name { grid-column: 1 / 3; grid-row: 2; }
  .wf-strip-head .wf-run { grid-column: 3 / 5; grid-row: 2; }
  .wf-strip-head > label:has([data-strip-field=isControl]) { grid-column: 3; grid-row: 1; }
  .wf-strip-head > [data-strip-download] { grid-column: 1 / 3; grid-row: 3; }
  .wf-strip-head > [data-strip-remove] { grid-column: 4; grid-row: 1; }
}

@container (max-width: 300px) {
  .wf-strip-head { grid-template-columns: minmax(0,1fr) 28px; align-items: center; }
  .wf-strip-head > label:first-child { grid-column: 1; grid-row: 1; }
  .wf-strip-head > [data-strip-remove] { grid-column: 2; grid-row: 1; }
  .wf-strip-head .wf-strip-thumb { grid-column: 1; grid-row: 2; }
  .wf-strip-head > label:has([data-strip-field=isControl]) { grid-column: 1 / -1; grid-row: 3; min-height: 28px; }
  .wf-strip-head .wf-name { grid-column: 1 / -1; grid-row: 4; }
  .wf-strip-head .wf-run { grid-column: 1 / -1; grid-row: 5; }
  .wf-strip-head > [data-strip-download] { grid-column: 1 / -1; grid-row: 6; }
}

/* Marker layers remain separate from original image pixels. */
.wf-marker-toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 6px; }
.wf-marker-toolbar > label:nth-of-type(2) { grid-column: 1 / -1; }
#wf-marker-guidance { padding: 9px 10px; margin: 10px 0; border-radius: 10px; background: #fff8eb; color: #9b701e; }
.wf-marker-align { display: grid; gap: 7px; margin: 10px 0; }
#wf-marker-align-status { color: var(--wb-muted); font-size: 11px; }
.wf-marker-x-label input { width: 100%; accent-color: #1c1c1e; }
.wf-marker-bands { display: grid; gap: 6px; margin: 12px 0; }
.wf-marker-band { display: grid; grid-template-columns: 52px minmax(0,1fr) 38px; align-items: center; gap: 6px; color: var(--wb-muted); font-size: 11px; }
.wf-marker-band input { width: 100%; min-width: 0; height: 18px; accent-color: #1c1c1e; }
.wf-marker-band output { text-align: right; font-size: 10px; font-variant-numeric: tabular-nums; }
.wf-marker-editor a { color: #4381bc; text-decoration: underline; }
.wf-marker-editor > p:last-child { margin-top: 7px; font-size: 10px; }
.wf-export-options, .wf-export-buttons { display: grid; gap: 7px; margin: 12px 0; }
.wb-context-panel .wf-export-options label { display: flex; flex-direction: row; align-items: start; gap: 8px; margin: 0; padding: 10px; border: 1px solid #e8e8ee; border-radius: 12px; background: var(--wb-well); color: #48484e; font-size: 11px; cursor: pointer; transition: background .18s, border-color .18s; }
.wb-context-panel .wf-export-options label:hover { border-color: #d5d5de; background: var(--wb-gray); }
.wb-context-panel .wf-export-options label:has(input:not(:checked)) { color: #8e8e93; background: #fff; }
.wf-export-options input { flex: none; width: 14px; height: 14px; margin-top: 2px; accent-color: #1c1c1e; }
.wf-export p { margin-top: 7px; color: var(--wb-muted); font-size: 11px; line-height: 1.6; }
.wf-export-buttons { grid-template-columns: repeat(2,minmax(0,1fr)); }
.wf-export-buttons button { min-width: 0; white-space: normal; font-size: 11px; }

/* Editing tools live inside the figure workspace, styled with the same controls. */
.wb-figure-tool { flex: none; }
.wb-embedded-view { width: 100%; min-width: 0; }
.wb-embedded-view .studio-page-head { padding: 0 0 10px; gap: 8px; flex-wrap: wrap; }
.wb-embedded-view .studio-page-head h2, .wb-embedded-view .studio-eyebrow, .wb-embedded-view .studio-page-head > .studio-pill { display: none; }
.wb-embedded-view .studio-page-head p { margin: 0; font-size: 11px; line-height: 1.5; }
.wb-embedded-view .studio-page-head select { max-width: 100%; }
.wb-embedded-view .studio-editor-layout, .wb-embedded-view .studio-compose-layout { display: flex; flex-direction: column; gap: 12px; }
.wb-embedded-view .studio-editor-layout > *, .wb-embedded-view .studio-compose-layout > * { width: 100%; min-width: 0; }
.wb-embedded-view .studio-editor-controls { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(240px,100%),1fr)); gap: 10px; order: 2; }
.wb-embedded-view .studio-card { padding: 12px; border: 1px solid #eeeef3; border-radius: 14px; background: var(--wb-well); box-shadow: none; }
.wb-embedded-view .studio-canvas-wrap, .wb-embedded-view .studio-collage-preview { min-height: 220px; padding: 10px; border: 1px solid #eeeef3; border-radius: 14px; }
#view-editor .studio-editor-stage { position: static; inset: auto; flex: none; padding: 14px; }
#view-editor .studio-canvas-wrap { min-height: 0; height: clamp(150px,24dvh,240px); grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr); }
#view-editor .studio-canvas-wrap canvas { max-height: 100%; object-fit: contain; }
.wb-embedded-view .studio-card p { font-size: 11px; line-height: 1.6; }
#wb-bubble-panel .row { margin: 0; gap: 10px; }
#wb-bubble-panel .row > * { padding: 0; min-width: 0; }
#wb-bubble-panel .card-header-clean, #wb-bubble-panel .card-body-clean { padding: 12px; }

/* Help and notifications are lightweight surfaces rather than extra application pages. */
#wb-help-dialog { width: min(620px,calc(100vw - 24px)); max-height: min(700px,calc(100dvh - 32px)); margin: auto; padding: 20px; overflow: auto; border: 1px solid #fff; border-radius: 24px; color: var(--wb-ink); background: #fafafdeb; box-shadow: 0 20px 80px #1c1c1e25; backdrop-filter: blur(20px); }
#wb-help-dialog::backdrop { background: #1c1c1e38; backdrop-filter: blur(5px); }
#wb-help-dialog h2 { display: block; margin: 0; font-size: 18px; letter-spacing: -.4px; }
#wb-help-dialog .studio-card { padding: 14px; margin-bottom: 10px; box-shadow: none; }
.wb-help-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.wb-help-flow { padding-left: 20px; margin-bottom: 16px; font-size: 12px; line-height: 1.65; }
.wb-help-flow li + li { margin-top: 9px; }.wb-help-flow strong { display: block; color: #48484e; }
#wb-help-dialog .wb-advanced p { margin: 7px 0; font-size: 12px; line-height: 1.7; }
.wb-toast-stack { top: auto; bottom: 18px; right: 24px; gap: 5px; max-width: min(360px,calc(100vw - 32px)); }
.wb-toast { padding: 10px 12px; gap: 8px; border: 1px solid #fff; border-radius: 14px; font-size: 11px; box-shadow: 0 8px 30px #1c1c1e12; }
.wb-toast-icon { font-size: 14px; }
.wb-toast-stack .wb-toast:not(:last-child) { display: none; }
body #lab-cloud-backup { position: fixed !important; top: 18px !important; right: 20px !important; left: auto !important; bottom: auto !important; }
@media (max-width: 520px) {
  .wb-context-panel .lab-custom-select > button { min-height: 40px; padding-block: 9px; font-size: 16px; line-height: 20px; }
}
body:has(#lab-cloud-backup) #view-wb > .wb-control-section > .wb-setting-head { padding-right: 32px; }
body:has(#lab-cloud-backup):not([data-wb-step=image]) #wf-step-kicker { padding-right: 38px; }

.wf-protein-tabs { display:flex; flex-wrap:wrap; gap:7px; padding:12px 14px 8px; }
.wf-protein-tab { display:inline-flex; align-items:center; justify-content:center; min-height:36px; max-width:100%; padding:7px 15px; border:0; border-radius:11px; background:#f2f2f7; color:#5d5d66; font-family:inherit; font-size:13px; font-weight:600; line-height:1.4; overflow-wrap:anywhere; cursor:pointer; }
.wf-protein-tab:hover { background:#e8e8ef; }
.wf-protein-tab[aria-selected=true] { background:#1c1c1e; color:#fff; }
.wf-protein-tab:focus-visible { outline:2px solid #007aff; outline-offset:3px; }
.wf-control-row { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; padding:4px 14px 13px; border-bottom:1px solid #ededf2; }
.wf-control-row > label { margin:0; color:#48484e; font-size:12px; font-weight:600; }
.wf-control-row > select { min-width:150px; max-width:100%; min-height:34px; border:0; border-radius:10px; padding:7px 30px 7px 10px; background:#f2f2f7; color:#1c1c1e; font:inherit; font-size:12px; }
.wf-control-row > span { flex-basis:100%; color:#777780; font-size:11px; line-height:1.6; }
.wf-normalization-status { margin:12px 14px 0; color:#404047; font-size:12px; font-weight:600; }
.wf-strip[hidden],.wf-control-row[hidden] { display:none!important; }
@media (min-width:761px) { .wf-strip-head > [data-strip-download] { grid-column:5; grid-row:1; align-self:end; } }
@media (max-width:520px) { .wf-protein-tabs { padding-inline:10px; }.wf-control-row { padding-inline:10px; }.wf-protein-tab { min-height:40px; }.wf-control-row > select { flex:1; font-size:16px; } }

/* Source-relative visual lane editing, with touch and keyboard access. */
#wb-lane-overlay { position: absolute; z-index: 5; pointer-events: none; }
#wb-lane-overlay[hidden] { display: none; }
.wb-lane-divider { position: absolute; transform: translateX(-50%); width: 22px; min-height: 22px; margin: 0; padding: 0; border: 0; background: transparent; pointer-events: auto; touch-action: none; cursor: col-resize; }
.wb-lane-divider::before { content: ''; position: absolute; top: 0; bottom: 0; left: calc(50% - 1px); width: 1px; background: #378de5; pointer-events: none; }
.wb-lane-divider > span { position: absolute; top: -27px; left: 1px; display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid #378de5; border-radius: 6px; color: #2778ca; background: #fff; font-size: 13px; line-height: 1; box-shadow: 0 2px 5px #203b6020; }
.wb-lane-divider:hover > span, .wb-lane-divider:focus-visible > span { color: #fff; background: #2778ca; }
.wb-lane-divider:focus-visible { outline: 2px solid #2778ca; outline-offset: 2px; border-radius: 4px; }
@media (pointer:coarse) { .wb-lane-divider { width: 30px; }.wb-lane-divider > span { top: -29px; left: 3px; width: 24px; height: 24px; } }

/* Desktop keeps data in the lower third and settings in their own scroll column. */
@media (min-width: 761px) {
  .wb-toast-stack { left: calc(12px + var(--sidebar-w) + var(--shell-gap)); right: calc(12px + var(--context-w) + var(--shell-gap)); max-width: none; align-items: center; }
  .wb-toast-stack .wb-toast { max-width: min(360px,100%); }
  body.wb-four-step { height: 100dvh; overflow: hidden; }
  body[data-wb-step=image] #wb-stage-slot { overflow: hidden; }
  body[data-wb-step=image] .wb-membrane-pane { flex: 0 0 calc((100% - 12px) * 2 / 3); }
  body[data-wb-step=image] #wb-image-stage { height: auto; }
  .wb-stage-head, .wb-image-toolbar { flex-shrink: 0; }
  body[data-wb-step=image] #wf-stage-results { flex: 1 1 0; min-height: 0; overflow: auto; }
  body[data-wb-step=image] #wb-batch-panel { flex: 1 0 auto; }
}
@media (max-width: 1150px) and (min-width: 761px) {
  :root { --sidebar-w: calc((100vw - 44px) * .2); --context-w: calc((100vw - 44px) * .2); --shell-gap: 10px; }
  .wb-stage-head > span { display: none; }
  .wb-image-toolbar { gap: 6px; padding-inline: 10px; }
  .wb-panel-resizer { width: 10px; }#wb-resize-left { right: -10px; }.wb-panel-resizer::before { left: 3px; }
}
@media (max-height: 740px) and (min-width: 521px) {
  .wb-sidebar-intro { padding: 12px; gap: 9px; }
  .wb-guided-steps { padding-bottom: 10px; gap: 2px; }
  .wb-guided-steps > button { min-height: 39px; padding-block: 4px; }
  .sidebar-top { padding-block: 10px; }
  .workspace-storage-note { display: none; }
}
@media (max-width: 760px) {
  :root { --sidebar-w: 178px; --shell-gap: 10px; }
  .wb-guided-shell .app-shell { padding: 8px; }
  .wb-guided-shell .wb-rail { top: 8px; height: calc(100dvh - 16px); }
  .wb-guided-shell #sidebar { top: 8px; }
  .wb-sidebar-intro { padding: 14px 10px; }
  .wb-sidebar-brand { gap: 7px; }.wb-brand-mark { flex-basis: 30px; width: 30px; height: 30px; }.wb-brand-mark svg { width: 21px; height: 21px; }
  .wb-brand-copy strong { font-size: 13px; }
  .wb-guided-steps { margin-inline: 7px; }
  .wb-guided-steps > button { gap: 1px 7px; padding-inline: 7px; }
  .wf-step-number { width: 26px; height: 26px; }
  .wf-step-name { font-size: 11px; }
  .wb-stage-workarea { grid-template-columns: minmax(0,1fr); height: auto; }
  #wb-stage-slot { max-height: none; overflow: visible; }
  .wb-context-panel { overflow: visible; }
  #wb-image-stage { height: 300px; }
  .wb-stage-head > span { display: none; }
  .workspace-actions, .workspace-footer-actions { grid-template-columns: 1fr; }
  .wb-panel-resizer { display: none; }
  .wb-context-panel input:not([type=range]):not([type=checkbox]), .wb-context-panel select, .wb-context-panel textarea, .wf-lanes input[type=text], .wf-lanes select { height: 36px; font-size: 16px; }
  body:has(#lab-cloud-backup) .wb-stage-head { padding-right: 46px; }
}
@media (max-width: 520px) {
  .wb-guided-shell .app-shell { grid-template-columns: minmax(0,1fr); gap: 10px; padding: 8px; }
  .wb-guided-shell .wb-rail { position: sticky; top: 0; z-index: 230; height: auto; }
  .wb-guided-shell #sidebar { position: static; height: auto; max-height: none; border-radius: 18px; }
  .wb-sidebar-intro { flex-direction: row; align-items: center; justify-content: space-between; gap: 6px; padding: 9px 10px; }
  .wb-brand-copy strong { font-size: 13px; }.wb-brand-copy span { display: none; }
  #wf-save-state { align-self: auto; font-size: 9px; padding: 4px 7px; }
  .wb-guided-shell #sidebar > .wb-guided-steps { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 3px; margin: 0 7px; padding: 0 0 8px; }
  .wb-guided-steps > button { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 43px; padding: 6px 2px; border-radius: 11px; }
  .wf-step-number { display: none; }.wf-step-name { font-size: 10px; }.wf-step-state { max-width: 100%; font-size: 8px; }
  .wb-membrane-picker, .wb-guided-shell .sidebar-heading-desc { display: none !important; }
  .sidebar-top { padding: 6px 10px 4px; }.sidebar-heading-title { font-size: 10px; }
  .workspace-panel { display: grid; grid-template-columns: 100px minmax(0,1fr); gap: 6px; padding: 0 7px 7px; }
  .workspace-folder-hint { grid-column: 1 / -1; grid-row: 1; margin: 0; padding: 5px 7px; font-size: 10px; line-height: 1.4; }
  .workspace-panel-head { grid-column: 1; grid-row: 2; }
  .workspace-actions { gap: 4px; }.workspace-icon-btn { min-height: 28px; padding: 5px 3px; font-size: 10px; border-radius: 8px; }
  .workspace-tree { grid-column: 2; grid-row: 2 / 4; min-height: 0; max-height: 66px; padding: 0; }
  .workspace-folder-row, .workspace-analysis-row { min-height: 28px; padding-block: 4px; margin: 1px 0; }
  .workspace-footer-actions, .workspace-storage-note, .workspace-scope-note { display: none !important; }
  .wb-sidebar-tools { padding: 5px 8px; }.wb-sidebar-tools > .studio-btn { flex: 0 1 auto; min-height: 26px; padding: 3px 8px; font-size: 10px; }
  .wb-utility-menu { flex: 0 0 auto; margin-left: auto; }.wb-utility-menu > summary { min-height: 26px; padding: 3px 9px; font-size: 10px; }
  #wb-image-stage { height: 250px; }
  #empty-tip { gap: 8px; padding: 14px; }#empty-tip > strong { font-size: 19px; }#empty-tip > span { font-size: 11px; }.wb-empty-art { width: 145px; }
  #empty-tip .wb-empty-upload { min-height: 34px; font-size: 11px; }.wb-empty-formats { gap: 4px; }.wb-empty-formats span { font-size: 8px; padding: 3px 6px; }
  .wb-stage-head { min-height: 34px; padding: 7px 10px; }.wb-stage-head span { font-size: 9px; }
  .wb-image-toolbar { gap: 6px 8px; padding: 8px 9px; }.wb-image-toolbar label { flex-basis: 100%; max-width: none; gap: 8px; font-size: 11px; }.wb-image-toolbar output { font-size: 10px; }
  .wb-image-toolbar .studio-btn { min-height: 28px; padding-inline: 7px; font-size: 10px; }.wb-fit-button i, .wb-image-toolbar > [data-wb-action=upload] { display: none; }
  .wb-image-toolbar .wb-fit-button { order: 1; }
  .wf-stage-instruction { padding: 8px 10px; font-size: 10px; }
  .studio-canvas-toolbar { flex-wrap: wrap; }
  .result-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px !important; }
  #result-scope { width: 100%; grid-column: 1 / -1; height: 34px; font-size: 14px; }
  .result-actions button { min-height: 34px; }
  body.wb-four-step { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  #wf-primary-action { position: fixed; z-index: 240; left: 8px; bottom: max(8px,env(safe-area-inset-bottom)); width: calc(100% - 16px); min-height: 44px; box-shadow: 0 5px 24px #1c1c1e20; }
  body[data-wb-step=image] .wb-measure-actions { position: fixed; z-index: 240; left: 8px; right: 8px; bottom: max(8px,env(safe-area-inset-bottom)); margin: 0; padding: 5px; border: 1px solid #fff; border-radius: 16px; background: #ffffffda; box-shadow: 0 5px 24px #1c1c1e18; backdrop-filter: blur(20px); }
  body[data-wb-step=image] .wb-measure-actions > .studio-btn { min-height: 40px; }
  .wb-setting-card { padding: 14px; }
  #wb-help-dialog { padding: 14px; }
  body #lab-cloud-backup { top: 11px !important; right: 16px !important; }
  body:has(#lab-cloud-backup) .wb-sidebar-intro { padding-right: 46px; }
  body:has(#lab-cloud-backup) .wb-stage-head { padding-right: 10px; }
  .wb-toast-stack { bottom: 70px; right: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* Marker calibration stays a visible, local control beside the active membrane. */
.wf-marker-visible-actions { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:10px; font-size:12px; }
.wf-marker-band { grid-template-columns:58px minmax(30px,1fr) 44px 36px; gap:6px; min-width:0; }
.wf-marker-check { display:flex !important; flex-direction:row !important; align-items:center; gap:5px !important; margin:0 !important; font-size:12px !important; color:var(--wb-ink) !important; }
.wf-marker-band .wf-marker-check input { width:15px; height:15px; flex:none; }
.wf-marker-band .studio-btn { min-height:28px; padding:3px 6px; font-size:11px; justify-content:center; }
.wf-marker-band.is-muted { opacity:.5; }
.wf-marker-band output { font-size:10px; white-space:nowrap; }
.wf-marker-custom { margin-top:8px; padding:10px; background:#f2f2f7; border-radius:12px; }
.wf-marker-custom textarea { width:100%; resize:vertical; }
#view-editor .studio-canvas-wrap { position:relative; }
#studio-editor-markers { position:absolute; pointer-events:none; z-index:2; overflow:visible; }
.wf-marker-align .studio-btn[aria-pressed="true"], .wf-marker-band .studio-btn[aria-pressed="true"] { color:#fff; background:#1c1c1e; }
@container settings (max-width: 235px) {
  .wf-marker-band { grid-template-columns: minmax(0,1fr) 44px; gap: 4px 6px; }
  .wf-marker-band > input { grid-column: 1; grid-row: 2; }
  .wf-marker-band > output { grid-column: 2; grid-row: 2; }
  .wb-measure-actions { grid-template-columns: minmax(0,1fr); }
}
