/* Schematic workspace chrome and explicit, view-only display choices.
   Engineering colours, symbol assets, geometry and exports stay native. */
/* One compact command strip; secondary tools and long readouts are disclosed
   on demand. The same native commands are used in full and paired views. */
:is(.schematic-workspace-v171,.design-pair-native) .schematic-toolbox{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:6px!important;overflow:visible!important}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-primary-tools{width:auto!important;flex:0 0 auto;overflow:visible!important}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-workbench-actions{width:auto!important;max-width:100%;flex:1 1 auto!important;flex-wrap:wrap!important;overflow:visible!important;gap:5px}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-command-menu{position:relative;flex:0 0 auto;color:var(--menu-ink);font:650 12px/1.4 var(--menu-font);z-index:65}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-command-menu>summary{display:flex;align-items:center;gap:8px;padding:6px 9px;min-height:34px;box-sizing:border-box;cursor:pointer;list-style:none;background:var(--menu-surface);border:1px solid var(--menu-border-strong);border-radius:8px}
.schematic-command-menu>summary::-webkit-details-marker{display:none}.schematic-command-menu>summary::after{content:'⌄';color:var(--menu-muted)}
.schematic-command-menu[open]>summary{color:var(--menu-accent);background:var(--menu-selected);border-color:var(--menu-selected-border)}
.schematic-command-content{position:absolute;left:0;top:calc(100% + 6px);min-width:210px;max-width:min(300px,calc(100vw - 32px));padding:7px;display:grid;gap:4px;background:var(--menu-surface);color:var(--menu-ink);border:1px solid var(--menu-border-strong);border-radius:10px;box-shadow:var(--menu-shadow);z-index:75}
[data-schematic-command-menu=more] .schematic-command-content{left:auto;right:0}
.schematic-command-content :is(button,.schematic-tool-btn){display:flex!important;align-items:center;gap:8px;width:100%;min-height:34px;padding:7px 9px!important;text-align:left;color:var(--menu-ink);background:transparent;border:1px solid transparent;border-radius:6px;font:650 12px/1.4 var(--menu-font)}
.schematic-command-content button:not(:disabled):hover{background:var(--menu-hover);border-color:var(--menu-hover-border)}
.schematic-command-content button:disabled{opacity:.4;cursor:not-allowed}.schematic-command-content svg{width:16px;height:16px;flex:0 0 16px}
.schematic-command-content .schematic-tool-btn>span{display:inline!important}.schematic-command-content label{display:grid;gap:5px;border-top:1px solid var(--menu-border);padding:8px;color:var(--menu-muted);font-size:11px}
.schematic-command-content select{width:100%;min-height:34px;background:var(--menu-surface);color:var(--menu-ink);border:1px solid var(--menu-border-strong);border-radius:7px;padding:5px;font:inherit}
.schematic-command-menu>summary:focus-visible,.schematic-command-content button:focus-visible{outline:2px solid var(--menu-accent);outline-offset:2px}
.schematic-inspector-info>summary{cursor:pointer;list-style:inside;padding:9px 2px;font-size:12px;font-weight:700;color:var(--menu-ink)}
.schematic-inspector-info:not([open])>summary{margin:0}.schematic-inspector-info[open]>summary{margin-bottom:8px}
.schematic-inspector-info .schematic-inspector-section-head{margin-top:0}
@media(max-width:759px){.schematic-command-menu>summary,.schematic-command-content button{min-height:44px!important}.schematic-command-content{max-height:calc(100dvh - 220px);overflow:auto}}
/* Setup, temperatures and native repair controls remain in their original
   DOM nodes. Opening this overlay never consumes the drawing's flex track. */
:is(.schematic-workspace-v171,.design-pair-native) .schematic-context-drawer{position:relative;z-index:50;flex:0 0 auto;min-width:0;color:var(--menu-ink);font-family:var(--menu-font)}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-context-drawer>summary{display:flex;align-items:center;gap:8px;min-height:34px;box-sizing:border-box;padding:5px 9px;cursor:pointer;list-style:none;background:var(--menu-subtle);border:1px solid var(--menu-border-strong);border-radius:8px;font-size:11px}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-context-drawer>summary::-webkit-details-marker{display:none}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-context-drawer>summary>strong{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-context-drawer>summary>:is(span,small,b){flex:0 0 auto;font-size:10px}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-context-warning{padding:3px 5px;border-radius:5px;color:var(--menu-ink);background:var(--menu-selected);border:1px solid var(--menu-selected-border)}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-context-drawer>summary::after{content:'⌄';font-size:14px;color:var(--menu-muted)}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-context-drawer[open]>summary{border-color:var(--menu-selected-border);color:var(--menu-accent)}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-context-drawer>summary:focus-visible{outline:2px solid var(--menu-accent);outline-offset:2px}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-context-content{position:absolute;right:0;top:calc(100% + 5px);z-index:60;box-sizing:border-box;width:min(660px,100%);max-height:min(460px,calc(100dvh - 260px));overflow:auto;overscroll-behavior:contain;display:grid;gap:10px;padding:12px;background:var(--menu-surface);color:var(--menu-ink);border:1px solid var(--menu-border-strong);border-radius:10px;box-shadow:var(--menu-shadow)}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-context-content :is(.schematic-reference-content,.schematic-connection-issues){position:relative!important;top:auto!important;right:auto!important;width:100%!important;max-height:none;box-shadow:none}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-context-content .schematic-reference-panel{flex:1 0 100%}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-context-content .schematic-connection-health details{flex:1 0 100%}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-toolbox{container-type:inline-size}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-primary-tools{display:flex;align-items:center;gap:5px;width:100%;min-width:0;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;padding:2px}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-primary-tools>*{flex-shrink:0}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-workbench-actions{flex:1 1 auto!important;flex-wrap:wrap!important;justify-content:flex-start!important;width:auto;max-width:100%;min-width:0;margin-left:0!important;overflow:visible!important;padding:2px}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-workbench-actions>*{flex-shrink:0}
:is(.schematic-workspace-v171,.design-pair-native) .schematic-workbench-toolbar-message:empty{display:none}
@container(max-width:650px){.schematic-primary-tools .schematic-tool-btn>span{display:none}.schematic-primary-tools .schematic-tool-btn{min-width:32px}}
@media(max-width:759px){:is(.schematic-workspace-v171,.design-pair-native) .schematic-context-drawer>summary{min-height:44px}:is(.schematic-workspace-v171,.design-pair-native) .schematic-context-content{max-height:calc(100dvh - 240px)}:is(.schematic-workspace-v171,.design-pair-native) .schematic-context-drawer>summary>span{display:none}}
.schematic-workspace-v171 { --schematic-columns: 260px minmax(0, 1fr); }
.schematic-workspace-v171 [hidden] { display: none !important; }
.studio-shell.schematic-shell { min-width: 0; max-width: 100%; grid-template-columns: minmax(0, 1fr); }
.studio-shell.schematic-shell > :is(.topbar, .modebar) { min-width: 0; }
.studio-shell.schematic-shell .workspace.schematic-workspace-shell.schematic-workspace-v171 {
  position: relative;
  display: grid;
  grid-template-areas: none;
  grid-template-columns: var(--schematic-columns);
  align-items: stretch;
  gap: 8px;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 8px;
  overflow: hidden;
  background: var(--menu-subtle);
}
.schematic-workspace-v171:is(.schematic-zone-drawing, .schematic-library-collapsed) { --schematic-columns: minmax(0, 1fr); }
.schematic-workspace-v171.schematic-library-collapsed > .schematic-library-panel,
.schematic-workspace-v171.schematic-details-collapsed > .schematic-selection-panel { display: none; }
.schematic-workspace-v171 > :is(.schematic-library-panel, .schematic-stage, .schematic-selection-panel) { grid-area: auto; min-width: 0; min-height: 0; }
.schematic-workspace-v171 :is(.schematic-library-panel, .schematic-toolbox, .schematic-selection-panel, .schematic-workbench-popover, .schematic-zone-node-picker, .schematic-pipe-tool-panel) {
  box-sizing: border-box;
  color: var(--menu-ink);
  font-family: var(--menu-font);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  border-color: var(--menu-border) !important;
  background: var(--menu-surface) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.schematic-workspace-v171 :is(.schematic-library-panel, .schematic-selection-panel) { padding: 10px; border-radius: 10px !important; }
.schematic-workspace-v171 .schematic-library-panel { display: flex; flex-direction: column; isolation: isolate; overflow: hidden; }
.schematic-workspace-v171 .schematic-library-panel > :is(.schematic-panel-head, .schematic-library-controls, .schematic-plant-room-mode) { flex: 0 0 auto; }
.schematic-workspace-v171 .schematic-panel-head { position: relative; gap: 3px; padding: 0 36px 9px 0; }
.schematic-workspace-v171 :is(.schematic-panel-head > span, .schematic-selection-head > div > span) { color: var(--menu-muted); font-size: 10px; font-weight: 650; letter-spacing: .025em; line-height: 1.35; text-transform: none; }
.schematic-workspace-v171 :is(.schematic-panel-head > strong, .schematic-selection-head > div > strong) { color: var(--menu-ink); font-size: 16px; font-weight: 850; line-height: 1.3; overflow-wrap: anywhere; }
.schematic-workspace-v171 .schematic-panel-head > small { max-width: none; color: var(--menu-muted); font-size: 11px; font-weight: 650; line-height: 1.4; }
.schematic-workspace-v171 .schematic-library-collapse { position: absolute; top: 0; right: 0; }
.schematic-workspace-v171 :is(.schematic-library-collapse, .schematic-selection-head > button, .schematic-workbench-head > button) {
  flex: 0 0 32px; display: grid; place-items: center; width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 0 !important;
  color: var(--menu-muted); background: var(--menu-surface); border: 1px solid var(--menu-border-strong); border-radius: 8px; font: 650 18px/1 var(--menu-font);
}
.schematic-workspace-v171 :is(.schematic-library-collapse, .schematic-selection-head > button, .schematic-workbench-head > button) svg { width: 16px; height: 16px; }
.schematic-workspace-v171 :is(.schematic-library-collapse, .schematic-selection-head > button, .schematic-workbench-head > button):not(:disabled):hover { color: var(--menu-ink); background: var(--menu-hover); border-color: var(--menu-hover-border); transform: none; }
.schematic-workspace-v171 .schematic-library-controls { gap: 7px; padding: 9px 0; }
.schematic-workspace-v171 :is(.schematic-library-controls label > span, .schematic-reference-field > span, .schematic-pipe-tool-panel label > span, .schematic-workbench-controls label > span) { color: var(--menu-muted); font-size: 11px; font-weight: 760; line-height: 1.35; letter-spacing: 0; text-transform: none; }
.schematic-workspace-v171 :is(.schematic-library-controls, .schematic-selection-panel, .schematic-pipe-tool-panel, .schematic-workbench-controls) :is(input, select):not([type="checkbox"]):not([type="radio"]):not([type="range"]) {
  box-sizing: border-box; min-width: 0; width: 100%; height: 34px; min-height: 34px; padding: 6px 9px;
  color: var(--menu-ink); background: var(--menu-surface); border: 1px solid var(--menu-border-strong); border-radius: 8px;
  font: 650 12px/1.4 var(--menu-font); box-shadow: none;
}
.schematic-workspace-v171 .schematic-library-search-row { height: 36px; border-color: var(--menu-border-strong); border-radius: 8px; background: var(--menu-surface); box-shadow: none; }
.schematic-workspace-v171 .schematic-library-search-row input { min-height: 32px; height: 32px; padding: 0 3px; border: 0 !important; background: transparent !important; }
.schematic-workspace-v171 .schematic-library-search-clear { min-width: 30px; min-height: 30px; padding: 0 !important; }
.schematic-workspace-v171 .schematic-library-quick-filters { gap: 5px; scrollbar-width: thin; padding-bottom: 3px; }
.schematic-workspace-v171 .schematic-library-filter-chip { height: 28px; min-height: 28px; padding: 3px 8px; font-size: 11px; font-weight: 760; box-shadow: none; }
.schematic-workspace-v171 .schematic-library-filter-chip small { min-width: 17px; height: 17px; font-size: 9px; }
.schematic-workspace-v171 .schematic-plant-room-mode { margin-top: 8px; padding: 8px; gap: 7px; border-color: var(--menu-selected-border); border-radius: 8px; background: var(--menu-selected); box-shadow: none; }
.schematic-workspace-v171 .schematic-plant-room-mode strong { color: var(--menu-ink); font-size: 12px; font-weight: 760; line-height: 1.35; }
.schematic-workspace-v171 .schematic-plant-room-mode span { color: var(--menu-muted); font-size: 11px; font-weight: 650; line-height: 1.4; }
.schematic-workspace-v171 .schematic-mode-switch { padding: 3px; background: var(--menu-surface); border-color: var(--menu-selected-border); border-radius: 8px; }
.schematic-workspace-v171 .schematic-mode-switch button { min-height: 30px; padding: 5px 8px; font: 760 12px/1.3 var(--menu-font); }
.schematic-workspace-v171 .schematic-symbol-list { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: 2px; }
.schematic-workspace-v171 .schematic-symbol-card { grid-template-columns: 54px minmax(0, 1fr); gap: 8px; min-height: 78px; padding: 7px; border-color: var(--menu-border); border-radius: 8px; background: var(--menu-surface); }
.schematic-workspace-v171 .schematic-symbol-card .schematic-product-visual { width: 54px; height: 58px; border-color: var(--menu-border); border-radius: 7px; background: #fff; }
.schematic-workspace-v171 .schematic-symbol-copy strong { color: var(--menu-ink); font: 760 12px/1.35 var(--menu-font); }
.schematic-workspace-v171 .schematic-symbol-copy small { color: var(--menu-muted); font: 650 10px/1.35 var(--menu-font); }
.schematic-workspace-v171 .schematic-symbol-kicker { color: var(--menu-accent); font-size: 9px; font-weight: 760; line-height: 1.25; letter-spacing: 0; text-transform: none; }
.schematic-workspace-v171 .schematic-symbol-card-footer :is(em, span) { color: var(--menu-muted); font-size: 10px; font-weight: 650; line-height: 1.3; }
.schematic-workspace-v171 .schematic-library-picker-host { padding: 8px; background: var(--menu-surface); }
.schematic-workspace-v171 .schematic-library-results-summary { color: var(--menu-muted); font-size: 11px; }

/* Keep the canvas as the flexible region; tools and status never scroll it
   out of view or become additional permanent workspace columns. */
.schematic-workspace-v171 .schematic-stage {
  display: flex; flex-direction: column; gap: 8px; padding: 10px; min-width: 0; min-height: 0;
  background: var(--menu-surface) !important; border-color: var(--menu-border) !important; border-radius: 10px; box-shadow: none !important; backdrop-filter: none; -webkit-backdrop-filter: none;
}
.schematic-workspace-v171 .schematic-canvas-head { position: relative; z-index: 40; flex: 0 0 auto; gap: 8px 14px; padding: 0 0 7px; border-bottom: 1px solid var(--menu-border); color: var(--menu-ink); font-family: var(--menu-font); }
.schematic-workspace-v171 .schematic-canvas-head > div { flex: 1 1 160px; min-width: 0; gap: 2px; }
.schematic-workspace-v171 .schematic-canvas-head > div > span { color: var(--menu-muted); font-size: 10px; font-weight: 650; line-height: 1.3; letter-spacing: 0; text-transform: none; }
.schematic-workspace-v171 .schematic-canvas-head > div > strong { color: var(--menu-ink); font-size: 16px; font-weight: 850; line-height: 1.25; overflow-wrap: anywhere; }
.schematic-workspace-v171 .schematic-canvas-head > div > small { color: var(--menu-muted); font-size: 11px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.schematic-workspace-v171 .schematic-canvas-head dl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-width: 0; }
.schematic-workspace-v171 .schematic-canvas-head dl > div { display: grid; gap: 2px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.schematic-workspace-v171 .schematic-canvas-head dt { color: var(--menu-muted); font-size: 10px; font-weight: 650; line-height: 1.3; text-transform: none; }
.schematic-workspace-v171 .schematic-canvas-head dd { margin: 0; color: var(--menu-ink); font-size: 12px; font-weight: 760; line-height: 1.3; overflow-wrap: anywhere; }
.schematic-workspace-v171 .schematic-design-temperatures { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; min-width: 0; overflow-x: auto; padding: 1px 0 4px; color: var(--menu-ink); font-family: var(--menu-font); scrollbar-width: thin; }
.schematic-workspace-v171 .schematic-design-temperatures > span:first-child { flex: 0 0 auto; margin-right: 3px; color: var(--menu-muted); font-size: 10px; font-weight: 750; white-space: nowrap; }
.schematic-workspace-v171 .schematic-design-temperature { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; min-height: 25px; padding: 3px 7px; border: 1px solid var(--menu-border); border-radius: 6px; background: var(--menu-subtle); font-size: 10px; white-space: nowrap; }
.schematic-workspace-v171 .schematic-design-temperature i { width: 13px; border-top: 3px solid var(--schematic-reference-color); border-radius: 2px; }
.schematic-workspace-v171 .schematic-design-temperature strong { font-weight: 650; }
.schematic-workspace-v171 .schematic-design-temperature b { color: var(--menu-accent); font-weight: 800; }
.schematic-workspace-v171 .schematic-service-legend { width: auto; gap: 5px; }
.schematic-workspace-v171 .schematic-service-legend > span { min-height: 25px; padding: 3px 6px; background: var(--menu-subtle); border-color: var(--menu-border); border-radius: 5px; color: var(--menu-ink); }
.schematic-workspace-v171 .schematic-service-legend > span strong { color: var(--menu-ink); font-size: 10px; font-weight: 650; }
.schematic-workspace-v171 .schematic-reference-panel { position: relative; flex: 0 0 auto; min-width: 0; font-family: var(--menu-font); }
.schematic-workspace-v171 .schematic-reference-panel span { text-transform: none; letter-spacing: 0; }
.schematic-workspace-v171 .schematic-reference-panel > summary {
  display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 5px 10px;
  color: var(--menu-ink); background: var(--menu-surface); border: 1px solid var(--menu-border-strong); border-radius: 8px;
  font: 760 11px/1.3 var(--menu-font); list-style: none; white-space: nowrap; cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease;
}
.schematic-workspace-v171 .schematic-reference-panel > summary::-webkit-details-marker { display: none; }
.schematic-workspace-v171 .schematic-reference-panel > summary::after { content: ""; width: 6px; height: 6px; margin: -3px 1px 0 3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 120ms ease; }
.schematic-workspace-v171 .schematic-reference-panel[open] > summary::after { margin-top: 3px; transform: rotate(225deg); }
.schematic-workspace-v171 .schematic-reference-panel > summary:hover,
.schematic-workspace-v171 .schematic-reference-panel[open] > summary { color: var(--menu-accent); background: var(--menu-selected); border-color: var(--menu-selected-border); }
.schematic-workspace-v171 .schematic-reference-panel > summary:focus-visible { outline: 2px solid var(--menu-accent); outline-offset: 2px; }
.schematic-workspace-v171 .schematic-reference-panel > summary > span { color: inherit; font: inherit; }
.schematic-workspace-v171 .schematic-reference-panel > summary small { color: var(--menu-muted); font: 650 10px/1.3 var(--menu-font); }
.schematic-workspace-v171 .schematic-reference-summary-mark { display: flex; align-items: center; gap: 2px; }
.schematic-workspace-v171 .schematic-reference-summary-mark i { display: block; width: 12px; height: 3px; border-radius: 3px; }
.schematic-workspace-v171 .schematic-reference-summary-mark i.empty { background: var(--menu-border-strong); }
.schematic-workspace-v171 .schematic-reference-content {
  position: absolute; z-index: 50; top: calc(100% + 6px); right: 0; box-sizing: border-box;
  width: min(440px, calc(100vw - 34px)); max-height: min(62vh, 560px); overflow: auto; overscroll-behavior: contain;
  display: grid; gap: 0; padding: 12px; color: var(--menu-ink); background: var(--surface-solid, #fff);
  border: 1px solid var(--menu-border-strong); border-radius: 10px; box-shadow: var(--menu-shadow);
}
.schematic-workspace-v171 .schematic-reference-heading { display: grid; gap: 2px; padding: 1px 2px 9px; }
.schematic-workspace-v171 .schematic-reference-heading strong { font: 830 14px/1.3 var(--menu-font); }
.schematic-workspace-v171 .schematic-reference-heading span { color: var(--menu-muted); font: 600 11px/1.35 var(--menu-font); }
.schematic-workspace-v171 .schematic-reference-content section { padding: 10px 2px; border-top: 1px solid var(--menu-border); }
.schematic-workspace-v171 .schematic-reference-content h3,
.schematic-workspace-v171 .schematic-reference-content h4 { margin: 0 0 7px; color: var(--menu-ink); font: 780 11px/1.3 var(--menu-font); }
.schematic-workspace-v171 .schematic-reference-content h4 { margin: 0 0 5px; color: var(--menu-muted); font-size: 10px; }
.schematic-workspace-v171 .schematic-reference-content ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; margin: 0; padding: 0; list-style: none; }
.schematic-workspace-v171 .schematic-reference-content li { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 25px; color: var(--menu-ink); font: 650 11px/1.3 var(--menu-font); }
.schematic-workspace-v171 .schematic-reference-content li > :is(.schematic-reference-label, span:last-child) { min-width: 0; color: var(--menu-ink); font: inherit; overflow-wrap: anywhere; }
.schematic-workspace-v171 .schematic-reference-content li > .schematic-reference-temperature { margin-left: auto; color: var(--menu-accent); font: 800 10px/1.3 var(--menu-font); white-space: nowrap; }
.schematic-workspace-v171 .schematic-reference-swatch { flex: 0 0 22px; height: 0; border-top: 3px solid var(--schematic-reference-color); border-radius: 3px; }
.schematic-workspace-v171 .schematic-reference-symbol-list svg { flex: 0 0 32px; width: 32px; height: 24px; color: var(--menu-ink); }
.schematic-workspace-v171 .schematic-reference-catalogue { display: grid; gap: 9px; }
.schematic-workspace-v171 .schematic-reference-empty { margin: 0; color: var(--menu-muted); font: 600 11px/1.35 var(--menu-font); }
.schematic-workspace-v171 .schematic-toolbox { position: relative; z-index: 12; flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; align-content: center; gap: 5px; max-height: none; overflow: visible; padding: 0 0 7px; border: 0; border-bottom: 1px solid var(--menu-border); border-radius: 0; }
.schematic-workspace-v171 .schematic-tool-btn,
.schematic-workspace-v171 .schematic-workbench-actions > button {
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: auto; min-width: 0; min-height: 34px; padding: 6px 9px;
  border: 1px solid var(--menu-border-strong); border-radius: 8px; color: var(--menu-ink); background: var(--menu-surface);
  font: 760 12px/1.3 var(--menu-font); text-align: center; white-space: normal; cursor: pointer; box-shadow: none;
  transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease;
}
.schematic-workspace-v171 .schematic-tool-btn svg,
.schematic-workspace-v171 .schematic-workbench-actions > button svg { width: 16px; height: 16px; flex: 0 0 16px; }
.schematic-workspace-v171 .schematic-tool-btn span { font: inherit; line-height: 1.3; }
.schematic-workspace-v171 .schematic-workbench-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-width: 0; margin-left: auto; }
.schematic-canvas-command-store[hidden]{display:none!important}
.schematic-canvas-control-tabs{display:flex;flex-wrap:wrap;gap:4px;padding:4px;border:1px solid var(--menu-border);border-radius:9px;background:var(--menu-subtle)}
.schematic-canvas-control-tabs>button{flex:1 1 54px;min-width:0;min-height:32px;padding:6px;font:700 12px/1.3 var(--font-ui,system-ui,sans-serif);border:1px solid var(--menu-border);border-radius:7px;background:var(--menu-surface);color:var(--menu-ink);white-space:normal}
.schematic-canvas-control-tabs>button[aria-selected=true]{background:var(--menu-selected)!important;color:var(--menu-accent)!important;border-color:var(--menu-selected-border)!important}
@media (min-width: 1001px) {
  /* Keep selection-only actions from adding a toolbar row and shifting the canvas. */
  .schematic-workspace-v171 .schematic-toolbox { align-content: flex-start; }
  .schematic-workspace-v171 .schematic-workbench-actions { flex: 1 0 100%; justify-content: flex-end; margin-left: 0; }
}
.schematic-workspace-v171 :is(.schematic-tool-btn, .schematic-workbench-actions > button, .schematic-workbench-row, .schematic-zone-node-option):not(:disabled):not([aria-disabled="true"]):hover { color: var(--menu-ink); background: var(--menu-hover); border-color: var(--menu-hover-border); transform: none; }
.schematic-workspace-v171 :is(.schematic-tool-btn, .schematic-workbench-actions > button, .schematic-library-filter-chip, .schematic-mode-switch > button, .schematic-symbol-card, .schematic-zone-node-option):is(.active, [aria-pressed="true"], [aria-expanded="true"]) { color: var(--menu-accent) !important; background: var(--menu-selected) !important; border-color: var(--menu-selected-border) !important; box-shadow: inset 0 0 0 1px var(--menu-selected-border) !important; }
.schematic-workspace-v171 :is(.schematic-tool-btn, .schematic-workbench-actions > button, .schematic-library-filter-chip, .schematic-mode-switch > button, .schematic-symbol-card, .schematic-zone-node-option):is(.active, [aria-pressed="true"], [aria-expanded="true"]):not(:disabled):not([aria-disabled="true"]):hover { background: var(--menu-selected-hover) !important; border-color: var(--menu-accent) !important; }
.schematic-workspace-v171 :is(.schematic-tool-btn, .schematic-workbench-actions > button, .schematic-workbench-row):is(:disabled, [aria-disabled="true"]) { color: var(--menu-muted) !important; background: var(--menu-subtle) !important; border-color: var(--menu-border) !important; cursor: not-allowed; transform: none; }
.schematic-workspace-v171 :is(.schematic-toolbox, .schematic-workbench-popover, .schematic-library-panel, .schematic-selection-panel) :is(button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--menu-accent); outline-offset: 2px; }
.schematic-workspace-v171 .schematic-canvas-wrap { flex: 1 1 auto; min-width: 0; min-height: 0; border-color: var(--menu-border); border-radius: 8px; box-shadow: none; }
.schematic-workspace-v171 .schematic-status { flex: 0 0 auto; flex-wrap: wrap; align-items: baseline; gap: 3px 12px; min-height: 20px; height: auto; padding: 0; overflow: visible; color: var(--menu-muted); font: 650 10px/1.4 var(--menu-font); }
.schematic-workspace-v171 .schematic-status > span { min-width: 0; max-width: 100%; }
.schematic-workspace-v171 .schematic-status [data-schematic-placement-prompt] { flex: 1 0 100%; order: -1; white-space: normal; overflow-wrap: anywhere; font-size: 11px; }
.schematic-workspace-v171 .schematic-status strong { color: var(--menu-ink); font-weight: 760; }

/* Plant schematic: keep drawing state beside the drawing, with diagnostics
   available on demand rather than consuming a permanent sidebar. */
.schematic-workspace-v171 .schematic-canvas-head .schematic-plant-room-mode {
  position: relative; flex: 0 0 auto; display: flex; align-items: center; gap: 7px; min-width: 0;
  margin: 0; padding: 5px 7px; background: var(--menu-subtle); border: 1px solid var(--menu-border);
}
.schematic-workspace-v171 .schematic-canvas-head .schematic-plant-room-mode > span { display: block; color: var(--menu-muted); font-size: 11px; font-weight: 760; line-height: 1.25; text-transform: none; }
.schematic-workspace-v171 .schematic-canvas-head .schematic-mode-switch { flex: 0 0 auto; }
.schematic-workspace-v171 .schematic-canvas-head #tidyAllSchematicPlantBranches {
  flex: 0 0 auto; min-height: 27px; padding: 3px 8px; border: 1px solid var(--menu-border);
  border-radius: 6px; background: var(--menu-panel); color: var(--menu-accent);
  font: 750 11px/1.2 var(--menu-font); cursor: pointer;
}
.schematic-workspace-v171 .schematic-canvas-head #tidyAllSchematicPlantBranches:hover:not(:disabled) {
  border-color: var(--menu-selected-border); background: var(--menu-selected);
}
.schematic-workspace-v171 .schematic-canvas-head #tidyAllSchematicPlantBranches:disabled { opacity: .55; cursor: default; }
.schematic-workspace-v171 .schematic-connection-health {
  position: relative; z-index: 30; display: flex; align-items: center; flex-wrap: wrap; gap: 5px 12px;
  min-height: 28px; padding: 5px 9px; color: var(--menu-muted); background: var(--menu-subtle);
  border: 1px solid var(--menu-border); border-radius: 8px; font: 650 11px/1.4 var(--menu-font);
}
.schematic-workspace-v171 .schematic-connection-health.needs-attention { color: var(--menu-ink); border-color: var(--menu-selected-border); }
.schematic-workspace-v171 .schematic-connection-health details { margin-left: auto; }
.schematic-workspace-v171 .schematic-connection-health summary { color: var(--menu-accent); font-weight: 760; cursor: pointer; }
.schematic-workspace-v171 .schematic-connection-issues {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 20; display: grid; gap: 4px;
  width: min(360px, 100%); max-height: min(48vh, 440px); overflow: auto; padding: 8px;
  background: var(--menu-surface); border: 1px solid var(--menu-border-strong); border-radius: 9px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .14);
}
.schematic-workspace-v171 .schematic-connection-issues button {
  display: grid; gap: 2px; width: 100%; padding: 7px 9px; text-align: left; color: var(--menu-ink);
  background: var(--menu-surface); border: 1px solid var(--menu-border); border-radius: 7px; cursor: pointer;
}
.schematic-workspace-v171 .schematic-connection-issues button:hover { background: var(--menu-hover); border-color: var(--menu-hover-border); }
.schematic-workspace-v171 .schematic-connection-issues small { color: var(--menu-muted); }
.schematic-workspace-v171 .schematic-guidance-panel {
  position: relative; z-index: 29; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px;
  min-height: 32px; padding: 6px 9px; border: 1px solid var(--menu-border); border-radius: 8px;
  background: var(--menu-surface); color: var(--menu-ink); font: 650 11px/1.35 var(--menu-font);
}
.schematic-workspace-v171 .schematic-guidance-heading { display: flex; align-items: center; gap: 9px; min-width: 0; }
.schematic-workspace-v171 .schematic-guidance-heading > div { display: grid; gap: 1px; }
.schematic-workspace-v171 .schematic-guidance-heading strong { font-weight: 780; }
.schematic-workspace-v171 .schematic-guidance-heading small { color: var(--menu-muted); font-size: 10px; font-weight: 570; }
.schematic-workspace-v171 .schematic-guidance-heading button {
  min-height: 25px; padding: 3px 7px; color: var(--menu-accent); background: var(--menu-subtle);
  border: 1px solid var(--menu-border); border-radius: 6px; font: 740 10px/1.2 var(--menu-font); cursor: pointer;
}
.schematic-workspace-v171 .schematic-guidance-panel details { margin-left: auto; }
.schematic-workspace-v171 .schematic-guidance-panel summary { color: var(--menu-accent); cursor: pointer; font-weight: 760; }
.schematic-workspace-v171 .schematic-guidance-popover {
  position: absolute; top: calc(100% + 5px); right: 0; z-index: 25; width: min(480px, 100%);
  max-height: min(55vh, 520px); overflow: auto; padding: 12px; box-sizing: border-box;
  background: var(--menu-surface); border: 1px solid var(--menu-border-strong); border-radius: 9px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .14);
}
.schematic-workspace-v171 .schematic-guidance-popover > p { margin: 0 0 10px; color: var(--menu-muted); font-size: 11px; font-weight: 550; }
.schematic-workspace-v171 .schematic-guidance-list { display: grid; gap: 7px; }
.schematic-workspace-v171 .schematic-guidance-list article {
  display: flex; gap: 9px; padding: 8px; border: 1px solid var(--menu-border); border-radius: 8px;
  background: var(--menu-subtle);
}
.schematic-workspace-v171 .schematic-guidance-code {
  display: grid; place-items: center; flex: 0 0 34px; height: 27px; border: 1px dashed #a36f27;
  border-radius: 7px; color: #764c16; background: #fffaf0; font-size: 10px; font-weight: 800;
}
.schematic-workspace-v171 .schematic-guidance-list article > div { display: grid; gap: 3px; min-width: 0; }
.schematic-workspace-v171 .schematic-guidance-list small { color: var(--menu-muted); font-size: 10px; }
.schematic-workspace-v171 .schematic-guidance-list strong { font-size: 11px; }
.schematic-workspace-v171 .schematic-guidance-list p { margin: 0; color: var(--menu-ink); font-size: 11px; font-weight: 540; }
.schematic-workspace-v171 .schematic-guidance-list em { color: var(--menu-muted); font-size: 10px; font-style: normal; }
.schematic-workspace-v171 .schematic-guidance-list a { color: var(--menu-accent); font-size: 10px; }
.schematic-workspace-v171 .schematic-service-legend i.heating-flow { color: var(--heat-loss); }
.schematic-workspace-v171 .schematic-service-legend i.heating-return { color: var(--heat-gain); }
.schematic-workspace-v171 .schematic-auto-selection-menu {
  position: absolute; top: 10px; right: 10px; z-index: 9; display: flex; align-items: center; gap: 8px;
  max-width: calc(100% - 20px); padding: 5px 7px; color: var(--menu-ink); background: var(--menu-surface);
  border: 1px solid var(--menu-border-strong); border-radius: 8px; font: 650 11px/1.35 var(--menu-font);
  box-shadow: 0 4px 16px rgba(15, 23, 42, .1);
}
.schematic-workspace-v171 .schematic-auto-selection-menu button {
  min-height: 27px; padding: 4px 7px; color: var(--menu-accent); background: var(--menu-selected);
  border: 1px solid var(--menu-selected-border); border-radius: 6px; font: 760 11px/1.2 var(--menu-font); cursor: pointer;
}
.schematic-workspace-v171 .schematic-branch-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 9px;
  border: 1px solid var(--menu-border); border-radius: 8px; background: var(--menu-subtle);
}
.schematic-workspace-v171 .schematic-branch-actions button {
  min-height: 30px; padding: 5px 9px; color: var(--menu-accent); background: var(--menu-surface);
  border: 1px solid var(--menu-selected-border); border-radius: 6px; font: 750 11px/1.2 var(--menu-font); cursor: pointer;
}
.schematic-workspace-v171 .schematic-branch-actions button:disabled { opacity: .65; cursor: default; }
.schematic-workspace-v171 .schematic-branch-actions small { flex-basis: 100%; color: var(--menu-muted); font: 550 10px/1.4 var(--menu-font); }
@media (max-width: 1100px) {
  .schematic-workspace-v171 .schematic-canvas-head .schematic-plant-room-mode { order: 3; }
}

/* Context menus have one bounded scrolling surface. No hard-coded vertical
   offset based on a presumed tool button height. */
.schematic-workspace-v171 :is(.schematic-zone-node-picker, .schematic-pipe-tool-panel) { position: absolute; top: calc(100% + 6px); left: 0; right: auto; width: min(320px, 100%); max-width: 100%; max-height: min(440px, 56dvh); overflow-y: auto; overscroll-behavior: contain; gap: 8px; padding: 10px; border-radius: 10px !important; box-shadow: var(--menu-shadow) !important; }
.schematic-workspace-v171 :is(.schematic-zone-node-picker-head, .schematic-pipe-tool-head) { color: var(--menu-muted); font-size: 11px; font-weight: 760; letter-spacing: 0; text-transform: none; }
.schematic-workspace-v171 .schematic-zone-node-option { min-height: 44px; gap: 3px; padding: 8px 10px; border-radius: 8px; background: var(--menu-surface); box-shadow: none; }
.schematic-workspace-v171 .schematic-zone-node-option span { font-size: 12px; font-weight: 760; }
.schematic-workspace-v171 .schematic-zone-node-option small { color: var(--menu-muted); font-size: 11px; font-weight: 650; }
.schematic-workspace-v171 .schematic-pipe-tool-panel :is(dd, p) { font-size: 11px; font-weight: 650; line-height: 1.4; }
.schematic-workspace-v171 .schematic-pipe-tool-panel dl > div { padding: 6px 8px; background: var(--menu-subtle); border-color: var(--menu-border); border-radius: 7px; }
.schematic-workspace-v171 .schematic-pipe-tool-panel .schematic-pipe-tool-check { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; color: var(--menu-ink); background: var(--menu-subtle); border: 1px solid var(--menu-border); border-radius: 8px; text-transform: none; }
.schematic-workspace-v171 .schematic-pipe-tool-panel .schematic-pipe-tool-check input { flex: 0 0 auto; width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--menu-accent); }
.schematic-workspace-v171 .schematic-pipe-tool-panel .schematic-pipe-tool-check span { font-size: 11px; font-weight: 680; line-height: 1.35; }
.schematic-workspace-v171 .schematic-pipe-tool-panel .schematic-pipe-finish { min-height: 32px; padding: 5px 10px; border: 1px solid var(--menu-accent); border-radius: 8px; background: var(--menu-accent); color: #fff; font: 750 11px/1.2 var(--menu-font); cursor: pointer; }
.schematic-workspace-v171 .schematic-pipe-tool-panel .schematic-pipe-finish:hover { filter: brightness(1.06); }
.schematic-workspace-v171 .schematic-pipe-pair-preview .schematic-pipe-draft-line { opacity: .82; stroke-dasharray: 9 5; }
.schematic-workspace-v171 .schematic-pipe-tool-panel .schematic-pipe-status { padding: 8px 9px; color: var(--menu-ink); background: var(--menu-subtle); border: 1px solid var(--menu-border); border-left: 3px solid var(--menu-accent); border-radius: 8px; font-weight: 700; }
.schematic-workspace-v171 .schematic-pipe-tool-panel .schematic-pipe-status[hidden] { display: none; }
.schematic-workspace-v171 .schematic-pipe-draft.is-blocked .pipe-guide-point,
.schematic-workspace-v171 .schematic-pipe-snap-target.is-blocked circle { fill: #fff1f2; stroke: #dc2626; stroke-width: 2.5; }

/* The Valve tool opens one bounded library, rather than another permanent
   sidebar.  Keep the CAD symbol previews on a light drawing surface in both
   themes so fine valve linework has the same contrast as the canvas. */
.schematic-workspace-v171 :is(#schematicValvePalette, #schematicSensorPalette, #schematicMeterPalette).schematic-valve-palette {
  box-sizing: border-box;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 24;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(420px, 100%);
  max-width: 100%;
  max-height: min(560px, 62dvh);
  min-width: 0;
  padding: 11px;
  overflow: hidden;
  color: var(--menu-ink);
  background: var(--menu-surface);
  border: 1px solid var(--menu-border-strong);
  border-radius: 10px;
  box-shadow: var(--menu-shadow);
  font: 650 12px/1.4 var(--menu-font);
}
.schematic-workspace-v171 .schematic-sensor-model-field { display: grid; gap: 5px; min-width: 0; color: var(--menu-muted); font: 750 11px/1.35 var(--menu-font); }
.schematic-workspace-v171 .schematic-sensor-model-field select { box-sizing: border-box; width: 100%; min-width: 0; min-height: 35px; padding: 6px 9px; color: var(--menu-ink); background: var(--menu-surface); border: 1px solid var(--menu-border-strong); border-radius: 8px; font: 650 12px/1.4 var(--menu-font); }
.schematic-workspace-v171 .schematic-sensor-model-field select:focus-visible { outline: 2px solid var(--menu-accent); outline-offset: 2px; }
.schematic-workspace-v171 .schematic-sensor-palette .schematic-valve-grid { max-height: 280px; }
.schematic-workspace-v171 .schematic-valve-palette :is(h2, h3, p) { margin: 0; }
.schematic-workspace-v171 .schematic-valve-palette :is(h2, h3) { color: var(--menu-ink); font: 850 15px/1.3 var(--menu-font); }
.schematic-workspace-v171 .schematic-valve-palette p { color: var(--menu-muted); font-size: 11px; line-height: 1.4; }
.schematic-workspace-v171 .schematic-valve-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  min-width: 0;
  padding: 3px;
  background: var(--menu-subtle);
  border: 1px solid var(--menu-border);
  border-radius: 8px;
}
.schematic-workspace-v171 .schematic-valve-tabs > button {
  min-width: 0;
  min-height: 32px;
  padding: 5px 8px;
  color: var(--menu-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  box-shadow: none;
  font: 760 11px/1.3 var(--menu-font);
  cursor: pointer;
}
.schematic-workspace-v171 .schematic-valve-tabs > button:not(:disabled):hover { color: var(--menu-ink); background: var(--menu-hover); }
.schematic-workspace-v171 .schematic-valve-tabs > button:is(.active, [aria-selected="true"], [aria-pressed="true"]) {
  color: var(--menu-accent);
  background: var(--menu-surface);
  border-color: var(--menu-selected-border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}
.schematic-workspace-v171 .schematic-valve-search { box-sizing: border-box; display: flex; align-items: center; gap: 6px; min-width: 0; }
.schematic-workspace-v171 .schematic-valve-search:is(input),
.schematic-workspace-v171 .schematic-valve-search input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 35px;
  min-height: 35px;
  padding: 6px 9px;
  color: var(--menu-ink);
  background: var(--menu-surface);
  border: 1px solid var(--menu-border-strong);
  border-radius: 8px;
  box-shadow: none;
  font: 650 12px/1.4 var(--menu-font);
}
.schematic-workspace-v171 .schematic-valve-search:is(input):focus,
.schematic-workspace-v171 .schematic-valve-search input:focus { border-color: var(--menu-accent); }
.schematic-workspace-v171 .schematic-valve-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 7px;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 1px 2px 2px 1px;
}
.schematic-workspace-v171 .schematic-valve-choice {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 62px;
  padding: 7px;
  text-align: left;
  color: var(--menu-ink);
  background: var(--menu-surface);
  border: 1px solid var(--menu-border);
  border-radius: 8px;
  box-shadow: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.schematic-workspace-v171 .schematic-valve-choice:not(:disabled):hover { background: var(--menu-hover); border-color: var(--menu-hover-border); }
.schematic-workspace-v171 .schematic-valve-choice:is(.active, .selected, [aria-pressed="true"], [aria-selected="true"]) {
  color: var(--menu-accent);
  background: var(--menu-selected);
  border-color: var(--menu-selected-border);
  box-shadow: inset 0 0 0 1px var(--menu-selected-border);
}
.schematic-workspace-v171 .schematic-valve-choice:disabled { opacity: .55; cursor: not-allowed; }
.schematic-workspace-v171 .schematic-valve-choice-preview {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 52px;
  height: 44px;
  overflow: hidden;
  color: #1f2937;
  background: #fff;
  border: 1px solid #dce5f1;
  border-radius: 6px;
}
.schematic-workspace-v171 .schematic-valve-choice-preview :is(svg, img) { display: block; width: 100%; max-width: 45px; height: 100%; max-height: 36px; object-fit: contain; }
.schematic-workspace-v171 .schematic-valve-choice-preview .schematic-cad-valve-glyph { color: #1f2937; }
.schematic-workspace-v171 .schematic-valve-choice-preview .schematic-cad-valve-occluder { fill: #fff; }
.schematic-workspace-v171 :is(.schematic-valve-choice-title, .schematic-valve-choice-detail) { display: block; min-width: 0; overflow-wrap: anywhere; }
.schematic-workspace-v171 .schematic-valve-choice-title { color: inherit; font: 760 11px/1.3 var(--menu-font); }
.schematic-workspace-v171 .schematic-valve-choice-detail { margin-top: 3px; color: var(--menu-muted); font: 600 10px/1.35 var(--menu-font); }
.schematic-workspace-v171 .schematic-valve-palette-foot {
  flex: 0 0 auto;
  padding-top: 8px;
  color: var(--menu-muted);
  border-top: 1px solid var(--menu-border);
  font: 600 10px/1.4 var(--menu-font);
  overflow-wrap: anywhere;
}
.schematic-workspace-v171 .schematic-valve-palette :is(button, input):focus-visible { outline: 2px solid var(--menu-accent); outline-offset: 2px; }
.schematic-workspace-v171 .schematic-valve-group-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; color: var(--menu-muted); font: 650 10px/1.35 var(--menu-font); }
.schematic-workspace-v171 .schematic-valve-group-toolbar button,
.schematic-workspace-v171 .schematic-valve-custom-actions button,
.schematic-workspace-v171 .schematic-valve-group-capture button { min-height: 28px; padding: 5px 9px; color: var(--menu-accent); background: var(--menu-surface); border: 1px solid var(--menu-selected-border); border-radius: 7px; box-shadow: none; font: 750 10px/1.2 var(--menu-font); cursor: pointer; }
.schematic-workspace-v171 .schematic-valve-group-toolbar button:hover,
.schematic-workspace-v171 .schematic-valve-custom-actions button:hover,
.schematic-workspace-v171 .schematic-valve-group-capture button:hover { background: var(--menu-selected); }
.schematic-workspace-v171 .schematic-valve-custom-choice { display: grid; align-content: start; gap: 4px; min-width: 0; }
.schematic-workspace-v171 .schematic-valve-custom-actions { display: flex; gap: 5px; justify-content: flex-end; }
.schematic-workspace-v171 .schematic-valve-custom-actions button { min-height: 24px; padding: 3px 6px; font-size: 9px; }
.schematic-workspace-v171 .schematic-valve-group-capture { display: grid; gap: 4px; padding: 9px; background: var(--menu-subtle); border: 1px solid var(--menu-border); border-radius: 8px; }
.schematic-workspace-v171 .schematic-valve-group-capture button { justify-self: start; }
.schematic-workspace-v171 .schematic-valve-group-capture small { color: var(--menu-muted); font: 600 10px/1.35 var(--menu-font); }
.schematic-workspace-v171 #schematicValvePalette.is-group-builder { width: min(620px, calc(100vw - 32px)); max-width: min(620px, calc(100vw - 32px)); max-height: min(760px, 82dvh); overflow-y: auto; }
.schematic-workspace-v171 .schematic-valve-group-builder { display: grid; gap: 12px; min-width: 0; }
.schematic-workspace-v171 .schematic-valve-group-builder-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.schematic-workspace-v171 .schematic-valve-group-builder-head > div { min-width: 0; }
.schematic-workspace-v171 .schematic-valve-group-builder-head > button { flex: 0 0 auto; width: 28px; height: 28px; padding: 0; color: var(--menu-muted); background: var(--menu-surface); border: 1px solid var(--menu-border); border-radius: 7px; font: 800 19px/1 var(--menu-font); cursor: pointer; }
.schematic-workspace-v171 .schematic-valve-group-builder-fields,
.schematic-workspace-v171 .schematic-valve-group-part-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.schematic-workspace-v171 .schematic-valve-group-builder :is(label, .schematic-valve-group-part-fields label) { display: grid; align-content: start; gap: 4px; min-width: 0; color: var(--menu-muted); font: 700 10px/1.25 var(--menu-font); }
.schematic-workspace-v171 .schematic-valve-group-builder label span small { font-weight: 550; }
.schematic-workspace-v171 .schematic-valve-group-builder :is(input, select, output) { box-sizing: border-box; display: block; width: 100%; min-width: 0; min-height: 34px; padding: 6px 8px; color: var(--menu-ink); background: var(--menu-surface); border: 1px solid var(--menu-border-strong); border-radius: 7px; font: 650 11px/1.3 var(--menu-font); }
.schematic-workspace-v171 .schematic-valve-group-builder :is(input, select):focus-visible { outline: 2px solid var(--menu-accent); outline-offset: 1px; }
.schematic-workspace-v171 .schematic-valve-group-wide { grid-column: 1 / -1; }
.schematic-workspace-v171 .schematic-valve-group-preview { display: grid; place-items: center; min-height: 94px; padding: 8px; background: #fff; border: 1px solid #dce5f1; border-radius: 8px; overflow: hidden; }
.schematic-workspace-v171 .schematic-valve-group-preview svg { display: block; width: min(100%, 540px); height: 104px; }
.schematic-workspace-v171 .schematic-valve-group-parts-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--menu-ink); font: 800 11px/1.3 var(--menu-font); }
.schematic-workspace-v171 .schematic-valve-group-parts-head span { color: var(--menu-muted); font: 600 10px/1.3 var(--menu-font); text-align: right; }
.schematic-workspace-v171 .schematic-valve-group-parts { display: grid; gap: 7px; max-height: 245px; overflow-y: auto; overscroll-behavior: contain; }
.schematic-workspace-v171 .schematic-valve-group-part { display: grid; gap: 7px; min-width: 0; padding: 9px; background: var(--menu-subtle); border: 1px solid var(--menu-border); border-radius: 8px; }
.schematic-workspace-v171 .schematic-valve-group-part-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font: 800 11px/1.3 var(--menu-font); }
.schematic-workspace-v171 .schematic-valve-group-part-head > div { display: flex; gap: 4px; }
.schematic-workspace-v171 .schematic-valve-group-part-head button { width: 26px; height: 25px; padding: 0; color: var(--menu-accent); background: var(--menu-surface); border: 1px solid var(--menu-selected-border); border-radius: 6px; font: 800 13px/1 var(--menu-font); cursor: pointer; }
.schematic-workspace-v171 .schematic-valve-group-part-head button:disabled { opacity: .45; cursor: default; }
.schematic-workspace-v171 .schematic-valve-group-add { display: flex; flex-wrap: wrap; gap: 5px; }
.schematic-workspace-v171 .schematic-valve-group-add button,
.schematic-workspace-v171 .schematic-valve-group-actions button { min-height: 30px; padding: 5px 9px; color: var(--menu-accent); background: var(--menu-surface); border: 1px solid var(--menu-selected-border); border-radius: 7px; font: 750 10px/1.2 var(--menu-font); cursor: pointer; }
.schematic-workspace-v171 .schematic-valve-group-actions { display: flex; justify-content: flex-end; gap: 7px; padding-top: 8px; border-top: 1px solid var(--menu-border); }
.schematic-workspace-v171 .schematic-valve-group-actions .primary-btn { color: #fff; background: var(--menu-accent); border-color: var(--menu-accent); }
.schematic-workspace-v171 .schematic-valve-group-message:empty { display: none; }
.schematic-workspace-v171 .schematic-valve-group-message:not(:empty) { padding: 8px; color: #991b1b; background: #fff4f4; border: 1px solid #fecaca; border-radius: 7px; }
@media (max-width: 580px) { .schematic-workspace-v171 .schematic-valve-group-builder-fields, .schematic-workspace-v171 .schematic-valve-group-part-fields { grid-template-columns: minmax(0, 1fr); } .schematic-workspace-v171 .schematic-valve-group-wide { grid-column: auto; } }

/* A placed arrangement remains one selection, while its constituent valves
   stay legible and individually editable in the inspector. */
.schematic-workspace-v171 .schematic-valve-assembly-panel { display: grid; gap: 9px; min-width: 0; }
.schematic-workspace-v171 .schematic-valve-assembly-panel :is(h2, h3, p) { margin: 0; }
.schematic-workspace-v171 .schematic-valve-assembly-panel :is(h2, h3) { color: var(--menu-ink); font: 800 13px/1.35 var(--menu-font); }
.schematic-workspace-v171 .schematic-valve-assembly-panel p { color: var(--menu-muted); font: 600 11px/1.4 var(--menu-font); }
.schematic-workspace-v171 .schematic-valve-component-row {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding: 10px;
  color: var(--menu-ink);
  background: var(--menu-subtle);
  border: 1px solid var(--menu-border);
  border-radius: 8px;
}
.schematic-workspace-v171 .schematic-valve-component-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-width: 0; }
.schematic-workspace-v171 .schematic-valve-component-head > div { min-width: 0; }
.schematic-workspace-v171 .schematic-valve-component-head :is(strong, small) { display: block; overflow-wrap: break-word; }
.schematic-workspace-v171 .schematic-valve-component-head button { flex: 0 0 auto; }
.schematic-workspace-v171 .schematic-valve-component-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 8px; min-width: 0; }
.schematic-workspace-v171 .schematic-valve-field-wide, .schematic-workspace-v171 .schematic-valve-component-remove { grid-column: 1 / -1; }
.schematic-workspace-v171 .schematic-valve-component-row :is(strong, span, small) { min-width: 0; }
.schematic-workspace-v171 .schematic-valve-component-row strong { font: 760 11px/1.35 var(--menu-font); }
.schematic-workspace-v171 .schematic-valve-component-row small { color: var(--menu-muted); font: 600 10px/1.35 var(--menu-font); }
.schematic-workspace-v171 .schematic-valve-component-row :is(button, select, input) { min-width: 0; max-width: 100%; }
.schematic-workspace-v171 .schematic-valve-component-row button { min-height: 29px; padding: 4px 7px; color: var(--menu-accent); background: var(--menu-surface); border: 1px solid var(--menu-selected-border); border-radius: 6px; font: 750 10px/1.2 var(--menu-font); cursor: pointer; }
.schematic-workspace-v171 .schematic-valve-component-row button:not(:disabled):hover { background: var(--menu-selected-hover); border-color: var(--menu-accent); }
.schematic-workspace-v171 .schematic-valve-component-row.active { border-color: var(--menu-selected-border); background: var(--menu-selected); }
.schematic-workspace-v171 .schematic-valve-component-row label { display: grid; gap: 3px; min-width: 0; }
.schematic-workspace-v171 .schematic-valve-component-row label small { white-space: nowrap; }
.schematic-workspace-v171 .schematic-valve-component-row :is(input, select) { box-sizing: border-box; width: 100%; min-height: 30px; padding: 4px 6px; color: var(--menu-ink); background: var(--menu-surface); border: 1px solid var(--menu-border-strong); border-radius: 6px; font: 650 11px/1.3 var(--menu-font); }
.schematic-workspace-v171 .schematic-placement-valve-assembly .schematic-placement-hitbox,
.schematic-workspace-v171 .schematic-placement-valve-assembly:is(:hover, .selected) .schematic-placement-hitbox { fill: transparent; stroke: none; }
.schematic-workspace-v171 .schematic-placement-valve-assembly .schematic-valve-component { cursor: pointer; }
.schematic-workspace-v171 .schematic-placement-valve-assembly .schematic-valve-component-backdrop { stroke: #e2e8f0; stroke-width: .6; }
.schematic-workspace-v171 .schematic-placement-valve-assembly .schematic-valve-component:hover .schematic-valve-component-backdrop { stroke: #0a84ff; stroke-width: 1.6; }
.schematic-workspace-v171 .schematic-placement-valve-assembly .schematic-valve-component-pipe-break { stroke: var(--surface-solid, #fff); pointer-events: none; }
.schematic-workspace-v171 .schematic-placement-valve-assembly .schematic-valve-component-inline:is(:hover, :focus-visible) .schematic-valve-component-symbol,
.schematic-workspace-v171 .schematic-placement-valve-assembly.selected .schematic-valve-component-inline .schematic-valve-component-symbol { filter: drop-shadow(0 0 3px var(--schematic-valve-color, #0a84ff)); }
.schematic-workspace-v171 .schematic-placement-valve-assembly .schematic-valve-component-hit { pointer-events: all; }
.schematic-cad-canvas .schematic-placement-valve-assembly :is(.schematic-valve-branch-line, .schematic-drain-tee path, .schematic-drain-ball-valve) {
  vector-effect: non-scaling-stroke;
}
.schematic-cad-canvas .schematic-placement-valve-assembly .schematic-valve-branch-line { stroke-width: 1.4px; }
.schematic-cad-canvas .schematic-placement-valve-assembly .schematic-drain-tee path { stroke-width: 1.4px; }
.schematic-cad-canvas .schematic-placement-valve-assembly .schematic-drain-ball-valve { stroke-width: 1.4px; }
.schematic-cad-canvas .schematic-placement-valve-assembly .schematic-connection-point {
  vector-effect: non-scaling-stroke;
  stroke-width: 1.4px;
}
.schematic-cad-canvas .schematic-placement-valve-assembly .schematic-valve-component-symbol .hamwic-dwg-symbol polyline {
  vector-effect: non-scaling-stroke;
  stroke-width: 1.4px;
}
.schematic-workspace-v171 .schematic-placement-valve-assembly text.schematic-valve-assembly-title { fill: #22324a; font-size: 8.5px; font-weight: 800; }
.schematic-workspace-v171 .schematic-placement-valve-assembly .schematic-valve-component text:not(.schematic-valve-component-reference) { fill: #263448; font-size: 7px; font-weight: 750; }
.schematic-workspace-v171 .schematic-placement-valve-assembly .schematic-valve-component-reference { fill: var(--schematic-valve-color, #263448); stroke: var(--surface-solid, #fff); font-size: 8.5px; font-weight: 800; }
.schematic-workspace-v171 .schematic-placement-pipe-sensor .schematic-placement-hitbox,
.schematic-workspace-v171 .schematic-placement-pipe-sensor:is(:hover, .selected) .schematic-placement-hitbox { fill: transparent; stroke: none; }
.schematic-workspace-v171 .schematic-placement-pipe-sensor:is(:hover, .selected) .schematic-sensor-symbol { filter: drop-shadow(0 0 3px #0a84ff); }
.schematic-workspace-v171 .schematic-placement-pipe-sensor .schematic-pipe-sensor-reference { font-size: 8.5px; paint-order: stroke; stroke: #fff; stroke-width: 2.4px; }
.schematic-placement-pipe-meter .schematic-pipe-meter-reference { font-size: 7.2px; }
.schematic-placement-valve-assembly .schematic-flushing-bypass-reference { font-size: 8.5px; }
.schematic-workspace-v171 .schematic-placement-pipe-meter .schematic-placement-hitbox,
.schematic-workspace-v171 .schematic-placement-pipe-meter:is(:hover, .selected) .schematic-placement-hitbox { fill: transparent; stroke: none; }

.schematic-workspace-v171 .schematic-draggable,
.schematic-workspace-v171 .schematic-draggable .schematic-valve-component { cursor: grab; }
.schematic-workspace-v171 .schematic-placement:not(.schematic-draggable) { cursor: pointer; }
.schematic-workspace-v171 .schematic-draggable:active,
.schematic-workspace-v171 .schematic-draggable:active .schematic-valve-component { cursor: grabbing; }
.schematic-workspace-v171 .schematic-draggable:focus-visible .schematic-placement-hitbox { stroke: var(--menu-accent); stroke-width: 1.5; }
.schematic-workspace-v171 .schematic-linked-valve-edit { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--menu-border); border-radius: 8px; background: var(--menu-subtle); }
.schematic-workspace-v171 .schematic-linked-valve-edit .danger-btn { justify-self: start; }
.schematic-workspace-v171 .schematic-placement-pipe-meter:is(:hover, .selected) circle { filter: drop-shadow(0 0 3px #0a84ff); }
.schematic-workspace-v171 .schematic-placement-pipe-meter text { paint-order: stroke; stroke: #fff; stroke-width: 1.6px; }
.schematic-workspace-v171 #schematicMeterPalette .schematic-guidance-heading { flex: 0 0 auto; padding: 8px; border: 1px solid var(--menu-border); border-radius: 8px; background: var(--menu-subtle); }
.schematic-workspace-v171 #schematicMeterPalette .schematic-valve-grid { max-height: 280px; }
.schematic-workspace-v171 .schematic-workbench-popover { position: absolute; z-index: 20; top: 12px; right: 12px; left: auto; transform: none; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100% - 24px)); max-width: calc(100% - 24px); max-height: calc(100% - 24px); padding: 12px; border: 1px solid var(--menu-border); border-radius: 10px; box-shadow: var(--menu-shadow) !important; overflow-y: auto; overscroll-behavior: contain; }
.schematic-workspace-v171 .schematic-workbench-head { display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; }
.schematic-workspace-v171 .schematic-workbench-head > :not(button) { min-width: 0; margin: 0; }
.schematic-workspace-v171 .schematic-workbench-head :is(h2, h3, strong) { margin: 0; color: var(--menu-ink); font: 850 16px/1.3 var(--menu-font); }
.schematic-workspace-v171 .schematic-workbench-controls { display: grid; flex: 0 0 auto; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.schematic-workspace-v171 .schematic-workbench-controls label { display: grid; min-width: 0; gap: 4px; }
.schematic-workspace-v171 .schematic-workbench-controls select { white-space: nowrap; text-overflow: ellipsis; }
.schematic-workspace-v171 .schematic-workbench-controls select:not(:disabled):is(:hover, :focus-visible) { background: var(--menu-selected); border-color: var(--menu-selected-border); }
.schematic-workspace-v171 .schematic-workbench-controls select option { color: var(--menu-ink); background: var(--menu-surface); }
.schematic-workspace-v171 .schematic-workbench-controls select option:checked { color: var(--menu-accent); background: var(--menu-selected); }
.schematic-workspace-v171 .schematic-workbench-controls:has(:is(#schematicWorkbenchSearch, #schematicChecksSearch)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.schematic-workspace-v171 .schematic-workbench-controls:has(:is(#schematicWorkbenchSearch, #schematicChecksSearch)) > label:first-child { grid-column: 1 / -1; }
.schematic-workspace-v171 .schematic-workbench-list { display: grid; flex: 0 0 auto; gap: 6px; min-width: 0; }
.schematic-workspace-v171 .schematic-workbench-results { display: grid; flex: 1 1 auto; gap: 6px; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.schematic-workspace-v171 .schematic-workbench-popover[data-schematic-workbench-section="checks"] { overflow: hidden; }
.schematic-workspace-v171 .schematic-workbench-popover[data-schematic-workbench-section="checks"] > [role="tabpanel"] { display: flex; flex-direction: column; flex: 1 1 auto; gap: 10px; min-width: 0; min-height: 0; overflow: hidden; }
/* Only the results viewport shrinks. Its finding cards, notices and actions
   retain their content height instead of compressing into overlapping tracks. */
.schematic-workspace-v171 .schematic-workbench-popover[data-schematic-workbench-section="checks"] .schematic-workbench-results { display: flex; flex-direction: column; align-items: stretch; }
.schematic-workspace-v171 .schematic-workbench-popover[data-schematic-workbench-section="checks"] .schematic-workbench-results > * { flex: 0 0 auto; height: auto; min-height: max-content; }
.schematic-workspace-v171 .schematic-workbench-popover[data-schematic-workbench-section="checks"] .schematic-workbench-results .schematic-workbench-link-actions[aria-label="Current drawing check"] { position: static; }
/* A Canvas review owns navigation; selecting a note must not cover its target
   with a second editor. Details closes this pane and reveals the native editor. */
.schematic-workspace-v171:has(.schematic-workbench-popover) .drawing-note-panel { display: none; }
.schematic-workspace-v171 .schematic-workbench-results > p[role="status"] { margin: 0; color: var(--menu-muted); font: 650 11px/1.35 var(--menu-font); }
.schematic-workspace-v171 .schematic-workbench-toolbar-message { flex: 1 0 100%; min-width: 0; margin: 0; color: var(--menu-muted); font: 650 11px/1.4 var(--menu-font); overflow-wrap: anywhere; }
.schematic-workspace-v171 .schematic-workbench-toolbar-message:empty { display: none; }
.schematic-workspace-v171 .schematic-workbench-row { display: grid; align-content: start; justify-items: start; gap: 3px; min-width: 0; width: 100%; min-height: 42px; padding: 9px 10px; text-align: left; white-space: normal; overflow-wrap: anywhere; border: 1px solid var(--menu-border); border-radius: 8px; color: var(--menu-ink); background: var(--menu-surface); font: 650 12px/1.4 var(--menu-font); box-shadow: none; }
.schematic-workspace-v171 .schematic-workbench-row > :is(strong, span) { min-width: 0; max-width: 100%; font-size: 12px; font-weight: 760; }
.schematic-workspace-v171 .schematic-workbench-row small { display: block; color: var(--menu-muted); font-size: 11px; font-weight: 650; line-height: 1.4; }
.schematic-workspace-v171 .schematic-workbench-row[aria-current="true"] { background: var(--menu-selected); border-color: var(--menu-selected-border); }
.schematic-workspace-v171 .schematic-workbench-row:is(.warning, [data-tone="warning"]) { border-left: 3px solid #b87916; }
.schematic-workspace-v171 .schematic-workbench-row:is(.error, [data-tone="error"]) { border-left: 3px solid var(--menu-danger); }
.schematic-workspace-v171 .schematic-workbench-row:is(.success, [data-tone="success"]) { border-left: 3px solid var(--menu-success); }
.schematic-workspace-v171 .schematic-workbench-linked-row { border-left: 3px solid var(--menu-success); }
.schematic-workspace-v171 .schematic-workbench-link-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.schematic-workspace-v171 .schematic-workbench-link-actions button { border: 1px solid var(--menu-border); border-radius: 6px; padding: 5px 8px; background: var(--menu-subtle); color: var(--menu-ink); font: 700 11px/1.2 var(--menu-font); cursor: pointer; }
.schematic-workspace-v171 .schematic-workbench-link-actions button:hover { background: var(--menu-hover); }
.schematic-workspace-v171 .schematic-workbench-link-actions[aria-label="Current drawing check"] { position: sticky; top: 0; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-block: 4px; background: var(--menu-surface); }
.schematic-workspace-v171 .schematic-workbench-link-actions[aria-label="Current drawing check"] button { min-width: 0; white-space: normal; }
.schematic-workspace-v171 .schematic-calculation-trace { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--menu-border); border-radius: 10px; background: var(--menu-subtle); }
.schematic-workspace-v171 .schematic-calculation-trace summary { color: var(--menu-ink); font-weight: 800; cursor: pointer; }
.schematic-workspace-v171 .schematic-calculation-trace ol { margin: 10px 0; padding-left: 19px; }
.schematic-workspace-v171 .schematic-calculation-trace li { margin: 5px 0; padding-left: 3px; color: var(--menu-ink); font-size: 12px; }
.schematic-workspace-v171 .schematic-calculation-trace li strong { display: block; }
.schematic-workspace-v171 .schematic-calculation-trace li span { color: var(--menu-muted); }
.schematic-workspace-v171 .schematic-calculation-trace p { margin: 8px 0 0; color: var(--menu-muted); font-size: 11px; }
.schematic-workspace-v171 .schematic-primary-change-preview { margin: 8px 0; padding: 10px 12px; border: 1px solid #8bb8e8; border-radius: 10px; background: #f1f7ff; color: var(--menu-ink); }
.schematic-workspace-v171 .schematic-primary-change-preview[hidden], .schematic-workspace-v171 .schematic-primary-change-apply[hidden] { display: none; }
.schematic-workspace-v171 .schematic-primary-change-preview > strong { display: block; margin-bottom: 7px; font-size: 12px; }
.schematic-workspace-v171 .schematic-primary-change-preview dl { margin: 0; display: grid; gap: 5px; }
.schematic-workspace-v171 .schematic-primary-change-preview dl > div { display: flex; justify-content: space-between; gap: 9px; font-size: 11px; }
.schematic-workspace-v171 .schematic-primary-change-preview dt { color: var(--menu-muted); }
.schematic-workspace-v171 .schematic-primary-change-preview dd { margin: 0; text-align: right; font-weight: 750; }
.schematic-workspace-v171 .schematic-primary-change-preview small { display: block; margin-top: 8px; line-height: 1.4; color: var(--menu-muted); }
.schematic-workspace-v171 .schematic-primary-change-apply { width: 100%; margin: 0 0 10px; padding: 8px 10px; border: 1px solid #0b74d1; border-radius: 8px; background: #096abb; color: #fff; font-size: 12px; font-weight: 800; cursor: pointer; }
.schematic-workspace-v171 .schematic-primary-change-apply:disabled { opacity: .48; cursor: not-allowed; }
.schematic-workspace-v171 .schematic-valve-impact-hover { fill: #183153; stroke: #fff; stroke-width: 3px; paint-order: stroke; text-anchor: middle; font-size: 8px; font-weight: 800; }
.schematic-workspace-v171 .schematic-pipe-run.schematic-calculation-route .schematic-pipe-line { stroke-width: 4 !important; filter: drop-shadow(0 0 3px currentColor); }
.schematic-workspace-v171 .schematic-tidy-ghost { fill: none; stroke: #9956d8; stroke-width: 3; stroke-dasharray: 8 5; opacity: .85; }
.schematic-workspace-v171 .schematic-tidy-preview-notice { display: inline-block; max-width: 240px; color: var(--menu-muted); font-size: 11px; line-height: 1.25; }
.schematic-workspace-v171 .schematic-tidy-preview-panel { position: absolute; z-index: 8; top: 100%; left: 0; width: min(350px, 90vw); max-height: 280px; overflow: auto; padding: 10px; background: var(--menu-surface, #fff); border: 1px solid var(--menu-selected-border, #becde5); border-radius: 9px; box-shadow: 0 8px 24px #172a4430; }
.schematic-workspace-v171 .schematic-tidy-preview-panel > span { display: block; margin: 3px 0 8px; }
.schematic-workspace-v171 .schematic-tidy-preview-actions { display: grid; gap: 5px; margin-bottom: 8px; }
.schematic-workspace-v171 .schematic-tidy-preview-actions button { text-align: left; }
.schematic-batch-overlay { position: fixed; inset: 0; z-index: 10020; display: grid; place-items: center; background: rgba(15, 23, 42, .36); }
.schematic-batch-progress { display: grid; gap: 10px; width: min(360px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--menu-border, #cbd5e1); border-radius: 12px; background: var(--menu-surface, #fff); color: var(--menu-ink, #172033); box-shadow: 0 16px 48px #0f172a45; }
.schematic-batch-progress strong { font-size: 16px; }
.schematic-batch-progress span { font-size: 13px; }
.schematic-batch-progress progress { width: 100%; accent-color: var(--menu-accent, #1765bf); }
.schematic-batch-progress button { justify-self: end; padding: 6px 12px; border: 1px solid var(--menu-border, #cbd5e1); border-radius: 6px; background: var(--menu-panel, #fff); color: inherit; cursor: pointer; }
.schematic-export-health { max-height: 230px; overflow: auto; margin: 8px 16px; padding: 10px 12px; border: 1px solid #d29b44; border-radius: 8px; background: #fff8eb; color: #553b17; font-size: 12px; }
.schematic-export-health strong { display: block; font-size: 13px; }
.schematic-export-health p { margin: 4px 0 6px; }
.schematic-export-health ul { margin: 0; padding-left: 18px; }
.schematic-workspace-v171 :is(.schematic-workbench-empty, .schematic-workbench-hint) { margin: 0; min-width: 0; color: var(--menu-muted); font: 650 11px/1.45 var(--menu-font); overflow-wrap: anywhere; }
.schematic-workspace-v171 .schematic-workbench-empty { padding: 12px; border: 1px dashed var(--menu-border-strong); border-radius: 8px; background: var(--menu-subtle); }
.schematic-workspace-v171 .schematic-selection-menu { top: 10px; right: 10px; bottom: auto; left: auto; box-sizing: border-box; min-width: 0; width: auto; max-width: calc(100% - 20px); padding: 6px; gap: 6px; border-color: var(--menu-border); border-radius: 8px; background: var(--menu-surface); box-shadow: var(--menu-shadow); backdrop-filter: none; -webkit-backdrop-filter: none; }
.schematic-workspace-v171 .schematic-selection-menu-copy { max-width: 190px; padding: 0 2px; }
.schematic-workspace-v171 .schematic-selection-menu-copy small { font-size: 9px; font-weight: 650; text-transform: none; }
.schematic-workspace-v171 .schematic-selection-menu-copy strong { color: var(--menu-ink); font-size: 11px; font-weight: 760; }
.schematic-workspace-v171 .schematic-selection-delete { height: auto; min-height: 32px; min-width: 0; padding: 6px 9px; color: var(--menu-danger) !important; background: var(--menu-danger-soft) !important; border-color: var(--menu-danger-border) !important; font: 760 11px/1.3 var(--menu-font); white-space: normal; }
.schematic-workspace-v171 .schematic-selection-delete:not(:disabled):hover { background: var(--menu-danger-hover) !important; border-color: var(--menu-danger) !important; transform: none; }
.schematic-workspace-v171 .schematic-selection-panel { display: flex; flex-direction: column; gap: 10px; overflow: auto; scrollbar-width: thin; overscroll-behavior: contain; }
.schematic-workspace-v171 .schematic-selection-panel > * { flex: 0 0 auto; }
.schematic-workspace-v171 .schematic-inspector-edit,
.schematic-workspace-v171 .schematic-inspector-info { display: grid; align-content: start; gap: 9px; min-width: 0; }
.schematic-workspace-v171 .schematic-inspector-edit { padding: 11px; border: 1px solid var(--menu-selected-border); border-radius: 9px; background: var(--menu-selected); }
.schematic-workspace-v171 .schematic-inspector-info { padding: 10px 1px 0; border-top: 1px solid var(--menu-border); }
.schematic-workspace-v171 .schematic-inspector-section-head { display: grid; gap: 2px; min-width: 0; }
.schematic-workspace-v171 .schematic-inspector-section-head strong { color: var(--menu-ink); font: 800 12px/1.35 var(--menu-font); }
.schematic-workspace-v171 .schematic-inspector-section-head small { color: var(--menu-muted); font: 600 10px/1.4 var(--menu-font); }
.schematic-workspace-v171 .schematic-inspector-info > :is(.schematic-model-card, .schematic-buffer-accessory-content) { min-width: 0; }
.schematic-workspace-v171 .schematic-inspector-edit > .schematic-plant-equipment-editor { padding: 0; border: 0; background: none; }
.schematic-workspace-v171 .schematic-inspector-edit > .schematic-valve-component-row { min-width: 0; }
/* A docked inspector narrowed the stage and wrapped its toolbars whenever a
   symbol was selected. Float it over the drawing so the canvas does not jump. */
.schematic-workspace-v171.schematic-selection-open:not(.schematic-details-collapsed) > .schematic-selection-panel {
  position: absolute;
  z-index: 25;
  top: var(--schematic-inspector-top, 160px);
  right: 8px;
  bottom: 8px;
  width: min(300px, calc(100% - 16px));
  max-height: calc(100% - var(--schematic-inspector-top, 160px) - 8px);
  box-shadow: var(--menu-shadow) !important;
}
@media (min-width: 1001px) {
  .schematic-workspace-v171.schematic-selection-open:not(.schematic-details-collapsed) .schematic-selection-menu {
    left: 10px;
    right: auto;
  }
}
.schematic-workspace-v171 .schematic-plant-equipment-editor { gap: 10px; padding: 11px; border-color: var(--menu-border); border-radius: 8px; background: var(--menu-subtle); box-shadow: none; }
.schematic-workspace-v171 .schematic-plant-equipment-editor-head { gap: 3px; }
.schematic-workspace-v171 .schematic-plant-equipment-editor-head > strong { display: block; color: var(--menu-ink); font: 800 12px/1.3 var(--menu-font); }
.schematic-workspace-v171 .schematic-plant-equipment-editor-head > small { display: block; color: var(--menu-muted); font: 650 10px/1.4 var(--menu-font); }
.schematic-workspace-v171 .schematic-plant-equipment-placement-status { display: grid; gap: 3px; padding: 8px; border: 1px solid var(--menu-selected-border); border-radius: 7px; background: var(--menu-selected); }
.schematic-workspace-v171 .schematic-plant-equipment-placement-status strong { color: var(--menu-ink); font: 760 11px/1.35 var(--menu-font); }
.schematic-workspace-v171 .schematic-plant-equipment-placement-status small { color: var(--menu-muted); font: 650 10px/1.4 var(--menu-font); }
.schematic-workspace-v171 .schematic-plant-equipment-editor-actions > button { min-height: 32px; padding: 6px 9px; border: 1px solid var(--menu-border-strong); border-radius: 8px; color: var(--menu-ink); background: var(--menu-surface); font: 760 11px/1.3 var(--menu-font); }
.schematic-workspace-v171 .schematic-plant-equipment-editor-actions > button.danger { color: var(--menu-danger); border-color: var(--menu-danger-border); background: var(--menu-danger-soft); }
.schematic-workspace-v171 .schematic-plant-equipment-editor-actions > button:not(:disabled):hover { background: var(--menu-hover); border-color: var(--menu-hover-border); }
.schematic-workspace-v171 .schematic-plant-equipment-editor-actions > button.danger:not(:disabled):hover { background: var(--menu-danger-hover); border-color: var(--menu-danger); }
.schematic-workspace-v171 .schematic-selection-head { position: sticky; z-index: 2; top: -10px; flex: 0 0 auto; margin: -10px -10px 0; padding: 10px; background: var(--menu-surface); border-color: var(--menu-border); }
.schematic-workspace-v171 .schematic-readonly-note { padding: 8px; color: var(--menu-muted); background: var(--menu-selected); border-color: var(--menu-selected-border); font-size: 11px; font-weight: 650; box-shadow: none; }
.schematic-workspace-v171 .schematic-primary-orientation { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--menu-selected-border); border-radius: 8px; background: var(--menu-selected); }
.schematic-workspace-v171 .schematic-primary-orientation > div { display: grid; gap: 2px; }
.schematic-workspace-v171 .schematic-primary-orientation strong { color: var(--menu-ink); font-size: 12px; font-weight: 760; }
.schematic-workspace-v171 .schematic-primary-orientation label { display: grid; gap: 4px; color: var(--menu-ink); font-size: 11px; font-weight: 760; }
.schematic-workspace-v171 .schematic-primary-orientation small { color: var(--menu-muted); font-size: 11px; font-weight: 650; line-height: 1.4; }
.schematic-workspace-v171 .schematic-model-hero { grid-template-columns: 54px minmax(0, 1fr); gap: 8px; padding: 8px; border-color: var(--menu-border); background: var(--menu-subtle); border-radius: 8px; box-shadow: none; }
.schematic-workspace-v171 .schematic-model-hero > :is(img, span) { width: 54px; height: 48px; }
.schematic-workspace-v171 .schematic-model-hero strong { color: var(--menu-ink); font-size: 13px; font-weight: 760; white-space: normal; overflow-wrap: anywhere; }
.schematic-workspace-v171 .schematic-model-hero small { color: var(--menu-muted); font-size: 11px; white-space: normal; }
.schematic-workspace-v171 .schematic-model-facts > div { min-width: 0; padding: 7px 8px; border-color: var(--menu-border); background: var(--menu-subtle); }
.schematic-workspace-v171 .schematic-model-facts :is(dt, dd) { font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.schematic-workspace-v171 .schematic-model-facts dt { color: var(--menu-muted); font-weight: 650; }
.schematic-workspace-v171 .schematic-model-facts dd { color: var(--menu-ink); font-weight: 760; }

/* Display settings affect only the live schematic. Hiding a pipe annotation
   removes its entire pill, not just text that would leave an empty label. */
.schematic-workspace-v171 [data-schematic-label-density="compact"] .schematic-placement > text:is(.muted, .schematic-device-subtitle),
.schematic-workspace-v171 [data-schematic-label-density="compact"] .schematic-annotation-caption > text:is(.muted, .schematic-device-subtitle) { display: none; }
.schematic-workspace-v171 [data-schematic-label-density="hidden"] .schematic-placement > text,
.schematic-workspace-v171 [data-schematic-label-density="hidden"] :is(.schematic-annotation-caption, .schematic-annotation-leader),
.schematic-workspace-v171 [data-schematic-label-density="hidden"] .schematic-pipe-label { display: none; }
/* Design is readable at overview scale; Issue deliberately retains all tags. */
.schematic-workspace-v171 #schematicCanvas[data-schematic-display-profile="design"][data-schematic-zoom-band="overview"] :is(
  .schematic-pipe-label, .schematic-valve-component-reference, .schematic-valve-assembly-title,
  .schematic-pipe-sensor-reference, .schematic-flushing-bypass-reference,
  .schematic-distribution-part-reference
) { display: none; }
.schematic-workspace-v171 #schematicCanvas .schematic-workbench-muted { opacity: .16; }
.schematic-workspace-v171 #schematicCanvas .schematic-workbench-muted,
.schematic-workspace-v171 #schematicCanvas .schematic-workbench-muted * { pointer-events: none !important; }

/* As in the native canvas editor, temporarily yield only the launcher buttons
   to a drawing popup. Conversation panels, drafts and recording stay intact. */
body:has(.schematic-workspace-v171 .schematic-workbench-popover) :is(.workspace-assistant-launcher, .my-day-designer-comments-toggle) { visibility: hidden !important; pointer-events: none !important; }

.studio-shell.schematic-shell:has(.schematic-workspace-v171) .schematic-bottombar { box-sizing: border-box; min-width: 0; width: 100%; flex-wrap: wrap; gap: 6px 12px; padding: 7px 10px; background: var(--menu-surface); border-color: var(--menu-border); box-shadow: none; }
.studio-shell.schematic-shell:has(.schematic-workspace-v171) .schematic-bottombar > :is(.bottom-tools, .zoom-tools, .view-tools) { min-width: 0; max-width: 100%; flex-wrap: wrap; gap: 5px; }
.studio-shell.schematic-shell:has(.schematic-workspace-v171) .schematic-bottombar button { min-width: 0; min-height: 32px; padding: 5px 8px; font: 760 12px/1.3 var(--menu-font); white-space: normal; }

@media (max-width: 1200px) {
  .schematic-workspace-v171 .schematic-workbench-actions { margin-left: 0; }
  .schematic-workspace-v171 .schematic-tool-btn { padding: 6px 8px; }
}
@media (max-width: 1000px) {
  .studio-shell.schematic-shell .workspace.schematic-workspace-shell.schematic-workspace-v171 { --schematic-columns: minmax(0, 1fr); }
  .schematic-workspace-v171 > :is(.schematic-library-panel, .schematic-selection-panel) { position: absolute; z-index: 25; top: 8px; bottom: 8px; max-height: calc(100% - 16px); width: min(300px, calc(100% - 16px)); box-shadow: var(--menu-shadow) !important; }
  .schematic-workspace-v171 > .schematic-library-panel { left: 8px; }
  .schematic-workspace-v171 > .schematic-selection-panel { right: 8px; }
  .schematic-workspace-v171 .schematic-library-picker-host { position: absolute; inset: 0; }
  .schematic-workspace-v171 .schematic-reference-content { right: 48px; }
}
@media (max-width: 700px) {
  html[data-workspace="schematic"]:has(.schematic-workspace-v171),
  html[data-workspace="schematic"]:has(.schematic-workspace-v171) body { overflow: auto; }
  .studio-shell.schematic-shell:has(.schematic-workspace-v171) { height: auto; min-height: 100dvh; overflow: visible; grid-template-rows: auto auto minmax(0, 1fr) auto; }
  .studio-shell.schematic-shell .workspace.schematic-workspace-shell.schematic-workspace-v171 { height: auto; min-height: 460px; padding: 6px; overflow: visible; }
  .schematic-workspace-v171 .schematic-stage { padding: 8px; min-height: 450px; }
  .schematic-workspace-v171 .schematic-canvas-wrap { min-height: 300px; }
  .schematic-workspace-v171 .schematic-canvas-head { gap: 6px 10px; }
  .schematic-workspace-v171 .schematic-canvas-head > div > strong { font-size: 14px; }
  .schematic-workspace-v171 .schematic-canvas-head dl { gap: 8px; }
  .schematic-workspace-v171 .schematic-reference-content { max-height: min(56vh, 410px); }
  .schematic-workspace-v171 .schematic-toolbox { gap: 5px; }
  .schematic-workspace-v171 .schematic-workbench-actions { width: 100%; gap: 5px; }
  .schematic-workspace-v171 .schematic-tool-btn,
  .schematic-workspace-v171 .schematic-workbench-actions > button { flex: 0 1 auto; min-height: 34px; padding: 6px 7px; font-size: 11px; }
  .schematic-workspace-v171 .schematic-tool-btn svg { width: 15px; height: 15px; flex-basis: 15px; }
  .schematic-workspace-v171 .schematic-status > span:not([data-schematic-placement-prompt]) { font-size: 10px; }
  .schematic-workspace-v171 .schematic-selection-menu { right: 7px; top: 7px; bottom: auto; max-width: calc(100% - 14px); grid-template-columns: minmax(0, 1fr) 32px auto; }
  .schematic-workspace-v171 .schematic-selection-menu-copy { max-width: 125px; }
  .schematic-workspace-v171 .schematic-workbench-popover { top: 8px; width: calc(100% - 16px); max-width: calc(100% - 16px); max-height: calc(100% - 16px); gap: 6px; padding: 10px; }
  .schematic-workspace-v171 .schematic-workbench-controls { gap: 5px; }
  .schematic-workspace-v171 .schematic-workbench-controls label { gap: 2px; }
  .schematic-workspace-v171 :is(#schematicValvePalette, #schematicSensorPalette, #schematicMeterPalette).schematic-valve-palette {
    width: min(420px, calc(100vw - 28px));
    max-height: min(430px, 58dvh);
    padding: 9px;
  }
  .studio-shell.schematic-shell:has(.schematic-workspace-v171) .schematic-bottombar { position: relative; bottom: auto; padding: 7px 8px calc(7px + env(safe-area-inset-bottom, 0px)); justify-content: flex-start; }
  .studio-shell.schematic-shell:has(.schematic-workspace-v171) .schematic-bottombar > :is(.bottom-tools, .view-tools) { width: 100%; }
}
@media (max-width: 440px) {
  .schematic-workspace-v171 .schematic-reference-content ul { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .schematic-workspace-v171 .schematic-valve-grid { grid-template-columns: minmax(0, 1fr); }
  .schematic-workspace-v171 .schematic-valve-choice { min-height: 52px; }
  .schematic-workspace-v171 .schematic-valve-component-row { grid-template-columns: minmax(0, 1fr); }
}
@media (pointer: coarse) {
  .schematic-workspace-v171 :is(.schematic-tool-btn, .schematic-workbench-actions > button, .schematic-workbench-row, .schematic-zone-node-option, .schematic-library-collapse, .schematic-selection-head > button, .schematic-workbench-head > button) { min-height: 44px; }
  .schematic-workspace-v171 :is(.schematic-library-collapse, .schematic-selection-head > button, .schematic-workbench-head > button) { width: 44px; min-width: 44px; height: 44px; flex-basis: 44px; }
  .schematic-workspace-v171 .schematic-panel-head { padding-right: 48px; }
  .schematic-workspace-v171 :is(.schematic-library-controls, .schematic-selection-panel, .schematic-pipe-tool-panel, .schematic-workbench-controls) :is(input, select):not([type="checkbox"]):not([type="radio"]):not([type="range"]) { min-height: 44px; height: 44px; font-size: 16px; }
  .schematic-workspace-v171 .schematic-library-search-row { height: 46px; }
  .schematic-workspace-v171 .schematic-valve-tabs > button,
  .schematic-workspace-v171 .schematic-valve-choice,
  .schematic-workspace-v171 .schematic-valve-component-row button { min-height: 44px; }
  .schematic-workspace-v171 .schematic-valve-search:is(input),
  .schematic-workspace-v171 .schematic-valve-search input { min-height: 44px; height: 44px; font-size: 16px; }
  .studio-shell.schematic-shell:has(.schematic-workspace-v171) .schematic-bottombar button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .schematic-workspace-v171 :is(.schematic-tool-btn, .schematic-workbench-actions > button, .schematic-workbench-row, .schematic-symbol-card, .schematic-zone-node-option, .schematic-valve-choice) { transition: none; }
}

html[data-theme="dark"] .schematic-workspace-v171 .schematic-valve-choice-preview {
  color: #1f2937;
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* Plant-room sheets use the service-layer palette and restrained linework of
   the Hamwic CAD template, while retaining the app's larger selectable hit areas. */
.schematic-cad-canvas.schematic-technical-plant .schematic-pipe-line {
  stroke-linecap: butt;
  stroke-linejoin: miter;
  filter: none;
}
.schematic-cad-canvas.schematic-technical-plant .schematic-pipe-run.pipe-flow .schematic-pipe-line { stroke: #e60706; }
.schematic-cad-canvas.schematic-technical-plant .schematic-pipe-run.pipe-return .schematic-pipe-line { stroke: #13c1d9; }
.schematic-cad-canvas.schematic-technical-plant .schematic-pipe-run.pipe-domestic-hot-water .schematic-pipe-line { stroke: #d946ef; }
.schematic-cad-canvas.schematic-technical-plant .schematic-pipe-run.pipe-domestic-cold-water .schematic-pipe-line { stroke: #2bcb22; }
.schematic-cad-canvas.schematic-technical-plant .schematic-pipe-run.pipe-secondary-return .schematic-pipe-line { stroke: #e28a13; }
.schematic-cad-canvas.schematic-technical-plant .schematic-pipe-run.pipe-gas .schematic-pipe-line { stroke: #c59b00; }
.schematic-cad-canvas.schematic-technical-plant .schematic-pipe-junction.pipe-flow { fill: #e60706; stroke: #fff; stroke-width: .8; }
.schematic-cad-canvas.schematic-technical-plant .schematic-pipe-junction.pipe-return { fill: #13c1d9; stroke: #fff; stroke-width: .8; }
.schematic-cad-canvas.schematic-technical-plant .schematic-generated-valve.pipe-flow { color: #e60706; }
.schematic-cad-canvas.schematic-technical-plant .schematic-generated-valve.pipe-return { color: #13c1d9; }
.schematic-cad-canvas.schematic-technical-plant .schematic-generated-valve.pipe-domestic-hot-water { color: #d946ef; }
.schematic-cad-canvas.schematic-technical-plant .schematic-generated-valve.pipe-domestic-cold-water { color: #2bcb22; }
.schematic-cad-canvas.schematic-technical-plant .schematic-generated-valve.pipe-secondary-return { color: #e28a13; }
.schematic-cad-canvas.schematic-technical-plant .schematic-generated-valve.pipe-gas { color: #c59b00; }
/* Neutral technical tags match the app/floor-plan theme. Service colour is
   carried by the explicit small dot; it never recolours text or the border.
   Collision geometry and user position/scale remain renderer-owned. */
.schematic-cad-canvas .schematic-pipe-label {
  --schematic-label-ink: #0f172a;
  --schematic-label-border: #cbd5e1;
  --schematic-label-fill: #fff;
  filter: none;
}
.schematic-cad-canvas .schematic-pipe-label .pipe-size-label-pill-bg {
  fill: var(--schematic-label-fill);
  fill-opacity: .86;
  stroke: var(--schematic-label-border);
  stroke-width: clamp(0.35px, calc(1px * var(--schematic-zoom-inverse, 1)), 1px);
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.schematic-cad-canvas .schematic-pipe-label .pipe-size-label {
  fill: var(--schematic-label-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: .01em;
  paint-order: normal;
  stroke: none;
}
.schematic-cad-canvas .schematic-pipe-label .pipe-size-label-secondary {
  fill: #334155;
  font-weight: 500;
  opacity: 1;
}
/* The design canvas keeps these paper-white badges in dark UI mode too. */
html[data-theme="dark"] #schematicCanvas .schematic-pipe-label .pipe-size-label-pill-bg {
  fill: var(--schematic-label-fill);
  stroke: var(--schematic-label-border);
}
html[data-theme="dark"] #schematicCanvas .schematic-pipe-label .pipe-size-label {
  fill: var(--schematic-label-ink);
  stroke: none;
}
html[data-theme="dark"] #schematicCanvas .schematic-pipe-label .pipe-size-label-secondary {
  fill: #334155;
}
html[data-theme="dark"] #schematicCanvas .schematic-pipe-label {
  filter: none;
}
.schematic-cad-canvas.schematic-technical-plant .schematic-cad-valve-occluder {
  fill: var(--surface-solid, #fff);
  stroke: none;
}
.schematic-cad-canvas.schematic-technical-plant .schematic-cad-valve-glyph {
  fill: var(--surface-solid, #fff);
  stroke: currentColor;
  stroke-width: .8;
  stroke-linecap: square;
  stroke-linejoin: miter;
  vector-effect: non-scaling-stroke;
}
.schematic-cad-canvas.schematic-technical-plant .schematic-cad-valve-line { fill: none; }
.schematic-cad-canvas.schematic-technical-plant .schematic-heat-pump-symbol { fill: none; stroke: #334155; stroke-linecap: square; stroke-linejoin: miter; pointer-events: none; }
.schematic-cad-canvas.schematic-technical-plant .schematic-heat-pump-symbol * { vector-effect: non-scaling-stroke; }
.schematic-cad-canvas.schematic-technical-plant .schematic-heat-pump-casing { fill: #fff; stroke-width: 1.5; }
.schematic-cad-canvas.schematic-technical-plant .schematic-heat-pump-panel,
.schematic-cad-canvas.schematic-technical-plant .schematic-heat-pump-fan-ring { stroke-width: 1.05; }
.schematic-cad-canvas.schematic-technical-plant .schematic-heat-pump-fan-hub { fill: #fff; stroke-width: 1; }
.schematic-cad-canvas.schematic-technical-plant .schematic-heat-pump-fan-blades,
.schematic-cad-canvas.schematic-technical-plant .schematic-heat-pump-grille,
.schematic-cad-canvas.schematic-technical-plant .schematic-heat-pump-feet { stroke-width: .8; }
.schematic-cad-canvas.schematic-technical-plant .schematic-low-loss-header-symbol { fill: none; stroke: #334155; stroke-linecap: square; stroke-linejoin: miter; pointer-events: none; }
.schematic-cad-canvas.schematic-technical-plant .schematic-low-loss-header-symbol * { vector-effect: non-scaling-stroke; }
.schematic-cad-canvas.schematic-technical-plant .schematic-low-loss-header-shell { fill: #fff; stroke-width: 1.4; }
.schematic-cad-canvas.schematic-technical-plant .schematic-low-loss-header-ports { stroke-width: 1; }
.schematic-cad-canvas.schematic-technical-plant .schematic-low-loss-header-baffle { stroke: #94a3b8; stroke-width: .8; stroke-dasharray: 3 3; }
.schematic-stage .schematic-plate-heat-exchanger-symbol { color: var(--text); stroke: currentColor; pointer-events: none; }
.schematic-stage .schematic-plate-heat-exchanger-symbol * { vector-effect: non-scaling-stroke; }
.schematic-stage .schematic-phe-shell { fill: var(--surface-solid, #ffffff); stroke: currentColor; }
.schematic-stage .schematic-phe-labels { fill: currentColor; }
.schematic-stage .schematic-phe-plate-frame { fill: var(--surface, #f8fafc); stroke: var(--border, #cbd5e1); }
.schematic-equipment-label-controls {
  display: grid; grid-template-columns: 1fr 110px; gap: 10px; padding: 14px;
  border: 1px solid var(--border, #dbe3ec); border-radius: 12px; background: var(--surface, #f8fafc);
}
.schematic-equipment-label-controls > strong, .schematic-equipment-label-controls > small { grid-column: 1 / -1; }
.schematic-equipment-label-controls label { display: grid; gap: 5px; min-width: 0; }
.schematic-equipment-label-controls small { color: var(--muted, #64748b); line-height: 1.45; }
.schematic-equipment-label-controls input, .schematic-equipment-label-controls select { min-width: 0; width: 100%; color: var(--text); background: var(--surface-solid); }
.schematic-stage.schematic-technical-plant .schematic-service-legend i.heating-flow { color: #e60706; }
.schematic-stage.schematic-technical-plant .schematic-service-legend i.heating-return { color: #13c1d9; }

/* A drop preview is only green when the same candidate used by placement is valid. */
#schematicCanvas .schematic-inline-hover-ghost { color: #0f766e; opacity: .9; }
#schematicCanvas .schematic-inline-hover-ghost.is-blocked { color: #dc2626; }
#schematicCanvas .schematic-inline-hover-halo { fill: #f0fdfa; stroke: currentColor; stroke-width: 1.5; stroke-dasharray: 4 3; }
#schematicCanvas .schematic-inline-hover-ghost.is-blocked .schematic-inline-hover-halo { fill: #fff1f2; }
#schematicCanvas .schematic-inline-hover-body { fill: #fff; stroke: currentColor; stroke-width: 2; }
#schematicCanvas .schematic-inline-hover-meter,
#schematicCanvas .schematic-inline-hover-flow { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#schematicCanvas .schematic-inline-hover-glyph { fill: currentColor; font-size: 9px; font-weight: 800; }
#schematicCanvas .schematic-inline-hover-label { fill: currentColor; font-size: 9px; font-weight: 750; paint-order: stroke; stroke: #fff; stroke-width: 3; stroke-linejoin: round; }

#schematicCanvas #schematicPlantHoverGhost { color: #0f766e; opacity: .74; }
#schematicCanvas #schematicPlantHoverGhost.is-blocked { color: #dc2626; }
#schematicCanvas .schematic-plant-hover-footprint { fill: #f0fdfa; stroke: currentColor; stroke-width: 1.5; stroke-dasharray: 6 4; }
#schematicCanvas #schematicPlantHoverGhost.is-blocked .schematic-plant-hover-footprint { fill: #fff1f2; }
#schematicCanvas .schematic-plant-hover-name { fill: #0f172a; font-size: 12px; font-weight: 800; paint-order: stroke; stroke: #fff; stroke-width: 3; }
#schematicCanvas .schematic-plant-hover-hint { fill: currentColor; font-size: 9px; font-weight: 700; paint-order: stroke; stroke: #fff; stroke-width: 3; }
#schematicCanvas .schematic-plant-hover-port circle { fill: #fff; stroke: currentColor; stroke-width: 2; }
#schematicCanvas .schematic-plant-hover-port text { fill: currentColor; font-size: 8px; font-weight: 750; paint-order: stroke; stroke: #fff; stroke-width: 3; }

/* Shared schematic / plant-room thermal what-if inspector. */
.vessel-thermal-panel { display: grid; gap: 10px; padding: 12px; border: 1px solid #cbd5e1; border-radius: 12px; background: #f8fafc; color: #17243a; }
.vessel-thermal-panel > header { display: grid; gap: 2px; }
.vessel-thermal-panel > header strong { font-size: 14px; }
.vessel-thermal-panel > header small, .vessel-thermal-note, .vessel-thermal-caveat { color: #53657e; font-size: 11px; line-height: 1.4; }
.vessel-thermal-panel p { margin: 0; }
.vessel-thermal-immersion { display: grid; gap: 7px; padding: 9px; border: 1px solid #c9d9e9; border-radius: 9px; background: #fff; }
.vessel-thermal-immersion-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vessel-thermal-immersion-head span { display: grid; gap: 2px; }
.vessel-thermal-immersion-head strong { font-size: 12px; color: #203650; }
.vessel-thermal-immersion-head small, .vessel-thermal-immersion-empty { font-size: 10px; color: #64748b; }
.vessel-thermal-immersion button { min-height: 29px; padding: 4px 8px; border: 1px solid #bbd1e6; border-radius: 7px; background: #f3f8fd; color: #12518a; font-size: 10px; font-weight: 800; cursor: pointer; }
.vessel-thermal-immersion button:disabled { opacity: .5; cursor: default; }
.vessel-thermal-immersion-list { display: grid; gap: 6px; }
.vessel-thermal-immersion-row { display: grid; grid-template-columns: auto minmax(72px, 1fr) minmax(68px, 1fr) minmax(66px, 1fr) auto; align-items: end; gap: 5px; padding: 6px; border: 1px solid #e0e8f0; border-radius: 7px; background: #f8fbff; }
.vessel-thermal-immersion-row > strong { align-self: center; color: #b45309; font-size: 11px; }
.vessel-thermal-immersion-row label { display: grid; gap: 3px; min-width: 0; color: #53657e; font-size: 9px; font-weight: 700; }
.vessel-thermal-immersion-row input, .vessel-thermal-immersion-row select { box-sizing: border-box; width: 100%; min-width: 0; height: 29px; padding: 3px 5px; border: 1px solid #b9c9dc; border-radius: 6px; background: #fff; color: #10233c; font-size: 10px; }
@media (max-width: 520px) { .vessel-thermal-immersion-row { grid-template-columns: auto repeat(2, minmax(0, 1fr)); } .vessel-thermal-immersion-row > button { grid-column: 3; } }

/* Size the project title from its actual text. A fixed flex basis inside a
   shrink-wrapped brand row squeezed the wordmark beneath the title and clipped
   even a short save status while the rest of the header had plenty of room. */
.studio-shell:not(.dashboard-shell) { min-width: 0; max-width: 100%; grid-template-columns: minmax(0, 1fr); }
.studio-shell:not(.dashboard-shell) > .topbar { flex-wrap: wrap; gap: 8px 16px; min-height: 58px; padding-block: 8px; }
.studio-shell > .topbar > .brand-lockup { min-width: 0; max-width: 100%; flex: 0 0 auto; }
.studio-shell > .topbar .brand-lockup > :is(.brand-menu-button, .divider, .project-context-stage, .project-context-save) { flex: 0 0 auto; }
.studio-shell:not(.dashboard-shell) > .topbar > .top-actions { flex: 0 1 auto; flex-wrap: wrap; max-width: 100%; min-width: 0; overflow: visible; }
.studio-shell:not(.dashboard-shell) > .topbar > .top-actions > button { flex: 0 0 auto; }
.project-context-name { flex: 0 1 auto; min-width: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; color: #1b3552; }
.project-context-stage { border: 1px solid #a9c6e2; border-radius: 999px; background: #edf6ff; color: #15518a; padding: 5px 10px; font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.project-context-stage.needs-review { border-color: #e4bd72; background: #fff8e8; color: #805009; }
/* Reserve the longest save label so Saving/Saved cannot rewrap the header. */
.project-context-save { min-width: 96px; color: #63758a; font-size: 11px; font-weight: 700; white-space: nowrap; }
.project-context-save[data-save-status="error"] { color: #b42318; }
.dashboard-stage-badge.needs-review { border-color: #e4bd72; background: #fff8e8; color: #805009; }
.project-workflow-settings { display: grid; gap: 16px; padding: 14px; color: #19324e; }
.project-workflow-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.project-workflow-summary > div { display: grid; gap: 3px; border: 1px solid #d2e0ee; background: #f7fbff; border-radius: 10px; padding: 12px; }
.project-workflow-summary small, .project-workflow-summary span { color: #63758a; font-size: 11px; }
.project-workflow-summary strong { font-size: 17px; }
.project-workflow-review { border: 1px solid #e4bd72; border-radius: 10px; background: #fffaf0; padding: 12px; }
.project-workflow-review p { margin: 6px 0 10px; font-size: 12px; line-height: 1.5; }
.project-workflow-review label, .project-workflow-status { display: grid; gap: 6px; font-size: 12px; font-weight: 750; }
.project-workflow-review select, .project-workflow-status select { width: 100%; min-height: 36px; border: 1px solid #b8cce0; border-radius: 8px; background: #fff; color: #19324e; padding: 5px 9px; font: inherit; }
.project-workflow-progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.project-workflow-progress > div { display: grid; gap: 4px; padding: 8px; border: 1px solid #d7e3ee; border-radius: 7px; background: #f9fcff; }
.project-workflow-progress small { color: #67798b; font-size: 10px; }
.project-workflow-progress strong { color: #174e82; font-size: 13px; }
.project-workflow-readiness { border: 1px solid #d2e0ee; border-radius: 10px; padding: 12px; background: #fff; }
.project-workflow-readiness ul { display: grid; gap: 6px; list-style: none; padding: 0; margin: 10px 0; }
.project-workflow-readiness li { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.project-workflow-readiness li span { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; font-weight: 900; }
.project-workflow-readiness li.ready span { background: #dcf5e9; color: #13804f; }
.project-workflow-readiness li.warning span { background: #fff1ce; color: #9b6500; }
.project-workflow-readiness small, .project-workflow-document-note { color: #63758a; font-size: 11px; }
.project-workflow-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.project-workflow-actions button { border: 1px solid #8db8df; border-radius: 8px; background: #eaf5ff; color: #15518a; padding: 8px 12px; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.project-workflow-actions button:last-child { background: #1475c8; color: #fff; border-color: #1475c8; }
.project-workflow-actions button:disabled { cursor: default; opacity: .5; }
@media (max-width: 740px) { .project-context-save { display: none; } .project-context-name { max-width: 120px; } .project-workflow-summary { grid-template-columns: 1fr; } }
@media (max-width: 740px) { .project-workflow-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.project-item-finder-backdrop { position: fixed; inset: 0; z-index: 2900; display: grid; place-items: start center; padding: min(14vh, 100px) 15px 20px; background: #1029438c; }
.project-item-finder { width: min(600px, 100%); max-height: min(70vh, 700px); display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid #c2d6e9; border-radius: 14px; background: #fff; box-shadow: 0 20px 70px #10243d40; }
.project-item-finder > header { display: flex; justify-content: space-between; align-items: center; }
.project-item-finder > header strong { font-size: 17px; color: #19324e; }
.project-item-finder > header button { border: 0; background: transparent; color: #536b83; font-size: 24px; cursor: pointer; }
.project-item-finder-current { display: grid; gap: 7px; padding: 9px 11px; border: 1px solid #d6e4f0; border-radius: 8px; background: #f6faff; }
.project-item-finder-current > span { display: grid; gap: 2px; min-width: 0; }
.project-item-finder-current small { color: #66788d; font-size: 10px; }
.project-item-finder-current strong { color: #19324e; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-item-finder-current > div { display: flex; flex-wrap: wrap; gap: 5px; }
.project-item-finder-current button { border: 1px solid #bed3e7; border-radius: 6px; background: #fff; color: #16558d; padding: 4px 7px; font: inherit; font-size: 10px; font-weight: 750; cursor: pointer; }
.project-item-finder > input { width: 100%; box-sizing: border-box; min-height: 40px; padding: 8px 11px; border: 1px solid #a9c5df; border-radius: 8px; color: #19324e; font: inherit; }
.project-item-finder-results { display: grid; gap: 4px; min-height: 40px; max-height: 55vh; overflow: auto; }
.project-item-finder-results button { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 1px solid #e0e9f1; border-radius: 8px; background: #f9fcff; color: #19324e; text-align: left; padding: 8px; font: inherit; font-size: 12px; cursor: pointer; }
.project-item-finder-results button:hover, .project-item-finder-results button:focus-visible { background: #eaf5ff; border-color: #87b5df; }
.project-item-finder-results button small { color: #6b7d8f; }
.project-item-finder-results p { padding: 10px; color: #63758a; font-size: 12px; }
.project-item-finder > p { margin: 0; color: var(--muted, #63758a); font-size: 12px; line-height: 1.4; }
[data-project-item-navigation-message] { max-width: 260px; color: var(--muted, #63758a); font-size: 11px; line-height: 1.35; }
[data-project-item-navigation-back][hidden], [data-project-item-navigation-message][hidden] { display: none; }
body.dark .project-item-finder { background: var(--surface-solid, #152236); color: var(--text, #e6edf5); }
@media (pointer: coarse) { .project-item-finder button, .project-item-finder-current button { min-height: 44px; } }
@media (max-width: 740px) { .project-item-finder-results button { grid-template-columns: 70px minmax(0, 1fr); } .project-item-finder-results button small { grid-column: 2; } }
.vessel-thermal-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.vessel-thermal-fact { display: grid; gap: 2px; min-width: 0; padding: 6px 8px; border: 1px solid #d5e0ed; border-radius: 7px; background: #fff; }
.vessel-thermal-fact small { color: #64748b; font-size: 10px; }
.vessel-thermal-fact strong { color: #18324e; font-size: 12px; overflow-wrap: anywhere; }
.vessel-thermal-volume { display: grid; gap: 4px; padding: 8px; border: 1px solid #c9d9e9; border-radius: 7px; background: #fff; color: #253b56; font-size: 11px; font-weight: 800; }
.vessel-thermal-volume input { box-sizing: border-box; width: 100%; height: 32px; padding: 4px 7px; border: 1px solid #b9c9dc; border-radius: 7px; background: #fff; color: #10233c; font: inherit; }
.vessel-thermal-volume small { color: #61718a; font-size: 10px; font-weight: 500; line-height: 1.35; }
.vessel-thermal-missing { padding: 8px; border: 1px solid #e7c899; border-radius: 7px; background: #fff8ec; color: #76511b; font-size: 11px; line-height: 1.4; }
.vessel-thermal-demand { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.vessel-thermal-demand button { min-height: 30px; padding: 4px; border: 1px solid #bed0e5; border-radius: 7px; background: #fff; color: #24517e; font-size: 11px; font-weight: 800; cursor: pointer; }
.vessel-thermal-demand button.active { color: #fff; border-color: #0b72ce; background: #0b72ce; }
.vessel-thermal-duty { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.vessel-thermal-duty span { display: grid; gap: 2px; min-width: 0; padding: 7px; border: 1px solid #c9d9e9; border-radius: 7px; background: #eaf4fc; }
.vessel-thermal-duty span:last-child { grid-column: 1 / -1; }
.vessel-thermal-duty small { color: #52647b; font-size: 9px; font-weight: 700; }
.vessel-thermal-duty strong { color: #153b5d; font-size: 11px; overflow-wrap: anywhere; }
.vessel-thermal-start { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.vessel-thermal-start button { min-height: 35px; padding: 5px; border: 1px solid #bed0e5; border-radius: 7px; background: #fff; color: #24517e; font-size: 10px; font-weight: 800; cursor: pointer; }
.vessel-thermal-start button.active { border-color: #0b72ce; background: #e8f4ff; color: #075b9f; }
.vessel-thermal-time { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 800; color: #41516b; }
.vessel-thermal-time span { display: inline-flex; align-items: center; gap: 5px; }
.vessel-thermal-time input { box-sizing: border-box; width: 65px; height: 30px; padding: 3px 6px; border: 1px solid #b9c9dc; border-radius: 7px; background: #fff; color: #10233c; font: inherit; }
.vessel-thermal-time button { min-height: 30px; padding: 4px 9px; border: 1px solid #0b72ce; border-radius: 7px; background: #0b72ce; color: #fff; font-size: 10px; font-weight: 800; cursor: pointer; }
.vessel-thermal-view-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.vessel-thermal-view-switch button { min-height: 30px; border: 1px solid #bed0e5; border-radius: 7px; background: #fff; color: #24517e; font-size: 11px; font-weight: 800; cursor: pointer; }
.vessel-thermal-view-switch button.active { border-color: #0b72ce; background: #e8f4ff; color: #075b9f; }
.vessel-thermal-visual { min-width: 0; border: 1px solid #d5e0ed; border-radius: 9px; background: linear-gradient(#fff, #f4f8fc); overflow: hidden; }
.vessel-thermal-diagram { display: block; width: min(100%, 340px); height: auto; margin: auto; }
.vessel-thermal-3d { display: grid; min-width: 0; justify-items: center; }
.vessel-thermal-3d canvas { display: block; width: 100%; height: 245px; touch-action: none; cursor: grab; }
.vessel-thermal-3d canvas:active { cursor: grabbing; }
.vessel-thermal-3d-loading { display: grid; place-items: center; min-height: 245px; padding: 10px; color: #53657e; font-size: 11px; text-align: center; }
.vessel-thermal-3d-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; padding: 0 5px 7px; color: #53657e; font-size: 10px; }
.vessel-thermal-3d-legend span { display: inline-flex; align-items: center; gap: 4px; }
.vessel-thermal-3d-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.vessel-thermal-3d-legend i.hot { background: #ec5555; }
.vessel-thermal-3d-legend i.cool { background: #1680da; }
.vessel-thermal-3d-legend i.immersion { background: #d97706; }
.vessel-thermal-3d-ports { padding: 0 8px 8px; color: #52647b; font-size: 10px; text-align: center; }
.vessel-thermal-visual-caption { display: block; padding: 0 8px 7px; color: #64748b; font-size: 10px; text-align: center; }
.vessel-thermal-playback { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 7px; }
.vessel-thermal-playback button { min-width: 58px; min-height: 30px; padding: 4px 8px; border: 1px solid #0b72ce; border-radius: 7px; background: #0b72ce; color: #fff; font-size: 11px; font-weight: 800; cursor: pointer; }
.vessel-thermal-playback button:disabled { opacity: .45; cursor: default; }
.vessel-thermal-playback input { width: 100%; accent-color: #0b72ce; }
.vessel-thermal-playback span { min-width: 51px; color: #43536b; font-size: 10px; font-variant-numeric: tabular-nums; text-align: right; }
.vessel-thermal-readout { display: grid; align-content: center; gap: 7px; min-width: 0; }
.vessel-thermal-readout > span { display: grid; gap: 1px; padding: 6px 7px; border: 1px solid #d5e0ed; border-radius: 7px; background: #fff; }
.vessel-thermal-readout small { color: #64748b; font-size: 10px; }
.vessel-thermal-readout strong { font-size: 13px; }
.vessel-thermal-case-table { display: grid; gap: 0; border: 1px solid #d5e0ed; border-radius: 8px; overflow: hidden; font-size: 10px; }
.vessel-thermal-case-table > div { display: grid; grid-template-columns: .65fr 1fr 1fr; gap: 4px; padding: 5px 7px; background: #fff; }
.vessel-thermal-case-table > div:nth-child(odd) { background: #edf3f9; }
.vessel-thermal-case-table b { color: #43536b; }

/* Transient canvas guidance stays legible without changing issued linework. */
#schematicCanvas .schematic-port-caption rect { fill: var(--panel-bg, #fff); stroke: #a8bed8; stroke-width: 1; }
#schematicCanvas .schematic-port-caption text { fill: var(--text, #17263c); stroke: none; font: 600 12px Inter, sans-serif; paint-order: normal; }
#schematicCanvas .schematic-port-caption .schematic-port-caption-hint { fill: #61748c; font-size: 10px; font-weight: 500; }
#schematicCanvas .schematic-route-drag-preview { pointer-events: none; }
#schematicCanvas .schematic-pipe-run.active { cursor: move; }
.schematic-span-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-width: 0; max-width: 100%; font-size: 11px; color: var(--muted, #64748b); }
.schematic-span-controls label { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 5px; margin: 0; font-size: 11px; }
.schematic-span-controls input { width: auto; margin: 0; }
.schematic-span-controls button { width: auto; min-height: 28px; padding: 4px 8px; font-size: 11px; }

/* Workflow and guided navigation are HTML menus, not drawing geometry. Their
   legacy light cards must follow the same dark palette as their parent menus. */
html[data-theme="dark"] .project-settings-popover .project-workflow-settings {
  color: var(--menu-ink);
}
html[data-theme="dark"] .project-settings-popover .project-workflow-summary > div,
html[data-theme="dark"] .project-settings-popover .project-workflow-progress > div,
html[data-theme="dark"] .project-settings-popover .project-workflow-readiness {
  background: var(--menu-subtle);
  border-color: var(--menu-border);
  color: var(--menu-ink);
}
html[data-theme="dark"] .project-settings-popover .project-workflow-settings :is(strong, p, label, li) {
  color: var(--menu-ink);
}
html[data-theme="dark"] .project-settings-popover .project-workflow-settings :is(small, .project-workflow-summary span) {
  color: var(--menu-muted);
}
html[data-theme="dark"] .project-settings-popover .project-workflow-progress strong {
  color: var(--menu-accent);
}
html[data-theme="dark"] .project-settings-popover .project-workflow-review {
  background: #352e22;
  border-color: #8d703e;
  color: var(--menu-ink);
}
html[data-theme="dark"] .project-settings-popover .project-workflow-review > strong {
  color: #f6d493;
}
html[data-theme="dark"] .project-settings-popover :is(.project-workflow-review, .project-workflow-status) select {
  color-scheme: dark;
  color: var(--menu-ink);
  background: var(--menu-surface);
  border-color: var(--menu-border-strong);
}
html[data-theme="dark"] .project-settings-popover .project-workflow-readiness li.ready span {
  color: var(--menu-success);
  background: var(--menu-success-soft);
}
html[data-theme="dark"] .project-settings-popover .project-workflow-readiness li.warning span {
  color: #f6d493;
  background: #352e22;
}
html[data-theme="dark"] .project-settings-popover .project-workflow-actions button {
  background: var(--menu-selected) !important;
  color: var(--menu-accent) !important;
  border-color: var(--menu-selected-border) !important;
}
html[data-theme="dark"] .project-settings-popover .project-workflow-actions button:not(:disabled):hover {
  background: var(--menu-selected-hover) !important;
  border-color: var(--menu-accent) !important;
}
html[data-theme="dark"] .project-settings-popover .project-workflow-actions button:last-child {
  background: var(--menu-primary) !important;
  color: #fff !important;
  border-color: var(--menu-primary) !important;
}
html[data-theme="dark"] .project-settings-popover .project-workflow-actions button:last-child:not(:disabled):hover {
  background: var(--menu-primary-hover) !important;
  border-color: var(--menu-primary-hover) !important;
}
html[data-theme="dark"] .project-settings-popover .project-workflow-settings :is(button, select):focus-visible {
  outline: 2px solid var(--menu-accent);
  outline-offset: 2px;
}
html[data-theme="dark"] .project-settings-popover .project-workflow-actions button:disabled {
  opacity: 1;
  color: var(--menu-muted) !important;
  background: var(--menu-subtle) !important;
  border-color: var(--menu-border) !important;
  cursor: not-allowed;
}
html[data-theme="dark"] .project-context-name { color: var(--menu-ink); }
html[data-theme="dark"] .project-context-save { color: var(--menu-muted); }
html[data-theme="dark"] .project-context-save[data-save-status="error"] { color: var(--menu-danger); }
html[data-theme="dark"] .project-context-stage {
  color: var(--menu-accent);
  background: var(--menu-selected);
  border-color: var(--menu-selected-border);
}
html[data-theme="dark"] :is(.project-context-stage, .dashboard-stage-badge).needs-review {
  color: #f6d493 !important;
  background: #352e22 !important;
  border-color: #8d703e !important;
}
html[data-theme="dark"] .project-item-finder {
  color: var(--menu-ink);
  background: var(--menu-surface);
  border-color: var(--menu-border);
  box-shadow: var(--menu-shadow);
}
html[data-theme="dark"] .project-item-finder > header strong,
html[data-theme="dark"] .project-item-finder-current strong {
  color: var(--menu-ink);
}
html[data-theme="dark"] .project-item-finder > header button,
html[data-theme="dark"] .project-item-finder :is(small, p) {
  color: var(--menu-muted);
}
html[data-theme="dark"] .project-item-finder-current,
html[data-theme="dark"] .project-item-finder-results button {
  color: var(--menu-ink);
  background: var(--menu-subtle);
  border-color: var(--menu-border);
}
html[data-theme="dark"] .project-item-finder > input,
html[data-theme="dark"] .project-item-finder-current button {
  color-scheme: dark;
  color: var(--menu-ink);
  background: var(--menu-surface);
  border-color: var(--menu-border-strong);
}
html[data-theme="dark"] .project-item-finder > input::placeholder { color: var(--menu-muted); opacity: 1; }
html[data-theme="dark"] .project-item-finder button:not(:disabled):hover {
  background: var(--menu-hover);
  border-color: var(--menu-hover-border);
}
html[data-theme="dark"] .project-item-finder :is(button, input):focus-visible {
  outline: 2px solid var(--menu-accent);
  outline-offset: 2px;
}
.schematic-stage { --cad-ink: #20354a; }
:root[data-theme="dark"] .schematic-stage, :root[data-theme="dark"] .cad-symbol-dialog { --cad-ink: #e2e8f0; }
.cad-workbench-panel, .cad-symbol-dialog {
  --cad-ink: #20354a;
  color: var(--menu-ink, #20354a); background: var(--surface-solid, #fff);
  border: 1px solid var(--menu-line, #cbd5e1); border-radius: 12px;
  box-shadow: 0 12px 35px #0f172a26; font-family: Inter, Arial, sans-serif;
}
.cad-workbench-panel { position:absolute; z-index:55; top:80px; right:16px; width:min(330px,calc(100% - 32px)); max-height:calc(100% - 120px); overflow:auto; padding:14px; }
.cad-panel-head, .cad-symbol-dialog header, .cad-options, .cad-actions, .cad-library-controls { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.cad-panel-head, .cad-symbol-dialog header { justify-content:space-between; margin-bottom:12px; }
.cad-tool-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin:8px 0; }
.cad-workbench-panel button, .cad-symbol-dialog button, [data-cad-action="open"] { min-height:36px; border:1px solid var(--menu-line,#cbd5e1); border-radius:7px; background:var(--surface-solid,#fff); color:inherit; padding:7px 10px; cursor:pointer; font:600 12px Inter,Arial,sans-serif; }
.cad-workbench-panel button[aria-pressed="true"], .cad-symbol-dialog button[aria-pressed="true"] { color:#147dff; border-color:#147dff; background:#147dff12; }
.cad-workbench-panel button:disabled, .cad-symbol-dialog button:disabled { opacity:.45; cursor:default; }
.cad-workbench-panel label, .cad-symbol-dialog label { display:grid; gap:5px; font-size:12px; margin:8px 0; }
.cad-workbench-panel input:not([type="checkbox"]), .cad-workbench-panel textarea, .cad-symbol-dialog input:not([type="checkbox"]), .cad-symbol-dialog textarea, .cad-workbench-panel select, .cad-symbol-dialog select { width:100%; box-sizing:border-box; border:1px solid var(--menu-line,#cbd5e1); border-radius:6px; padding:8px; color:inherit; background:var(--surface-solid,#fff); font:13px Inter,Arial,sans-serif; }
.cad-options label { display:flex; align-items:center; gap:5px; }
.cad-options select { width:auto; }
.cad-workbench-panel p, .cad-symbol-dialog p, .cad-workbench-panel small, .cad-symbol-dialog small { color:var(--text-muted,#64748b); font-size:11px; line-height:1.5; }
.cad-workbench-panel details { border-top:1px solid var(--border,#cbd5e1); margin-top:12px; padding-top:10px; }
.cad-workbench-panel summary { cursor:pointer; font-size:12px; font-weight:600; }
.cad-workbench-panel textarea, .cad-symbol-dialog textarea { min-height:75px; resize:vertical; }
.cad-symbol-dialog { width:min(960px,calc(100vw - 40px)); max-height:calc(100vh - 40px); padding:20px; }
.cad-symbol-dialog::backdrop { background:#0f172a66; }
.cad-symbol-dialog h2 { margin:0; font-size:18px; }
.cad-editor-layout { display:grid; grid-template-columns:minmax(0,1fr) 260px; gap:20px; }
[data-cad-editor-canvas] { width:100%; height:clamp(180px,43vh,350px); border:1px solid var(--menu-line,#cbd5e1); border-radius:8px; background:var(--surface-solid,#fff); color:var(--cad-ink); touch-action:none; }
.cad-symbol-dialog .cad-primary { background:#147dff; color:#fff; }
.cad-block-tile { display:grid; grid-template-columns:120px 1fr; gap:14px; padding:12px; border:1px solid var(--border,#cbd5e1); border-radius:8px; margin:10px 0; }
.cad-block-tile svg { width:120px; height:80px; color:var(--cad-ink); }
.cad-block-tile small { display:block; margin:5px 0; }
.cad-block-tile button { margin-right:6px; }
.cad-library-tabs { display:flex; flex-wrap:wrap; gap:6px; margin:12px 0; }
.cad-submission-preview { width:100%; height:220px; color:var(--cad-ink); }
.cad-file-button input { max-width:200px; }
.schematic-cad-drafting [data-cad-object] { cursor:grab; touch-action:none; }
.block-studio-dialog { width:min(1400px,calc(100vw - 32px)); --studio-grid:#cbd5e1; overflow:hidden; }
:root[data-theme="dark"] .block-studio-dialog { --studio-grid:#485466; }
.block-studio-layout { display:grid; grid-template-columns:minmax(0,1fr) 290px; gap:16px; height:min(76vh,900px); min-height:400px; }
.block-studio-drawing { display:flex; flex-direction:column; min-width:0; min-height:0; }
.block-studio-toolbar { display:flex; flex-wrap:wrap; gap:4px; padding-bottom:8px; }
.block-studio-toolbar button { width:34px; min-height:34px; padding:6px; display:grid; place-items:center; }
.block-studio-toolbar svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round; }
.block-studio-canvas-wrap { position:relative; flex:1; min-height:240px; border:1px solid var(--menu-line,#cbd5e1); border-radius:8px; overflow:hidden; }
[data-studio-canvas] { width:100%; height:100%; display:block; color:var(--cad-ink); touch-action:none; }
.block-studio-inspector { min-height:0; overflow:auto; padding-right:4px; }
.block-studio-inspector details { border-top:1px solid var(--menu-line,#cbd5e1); margin:10px 0; padding-top:10px; }
.block-studio-inspector summary { cursor:pointer; font-size:13px; font-weight:650; }
.block-studio-inspector label:has(> input[type="checkbox"]) { display:flex; align-items:center; gap:8px; }
.block-studio-inspector label > input[type="checkbox"] { width:auto; margin:0; flex:none; }
.block-studio-snaps { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.block-studio-snaps label { display:flex; align-items:center; gap:4px; }
.block-studio-snaps select,.block-studio-snaps input[type="number"] { width:72px; padding:5px; }
.block-studio-snaps output { font-size:11px; margin-left:auto; font-variant-numeric:tabular-nums; }
.studio-field-pair { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px; }
.studio-guides { stroke:#d99323; stroke-dasharray:3 3; stroke-width:.5; }
.studio-port { fill:var(--surface-solid,#fff); stroke:#138378; stroke-width:1; cursor:crosshair; }
.studio-port text { fill:var(--cad-ink); stroke:none; }
.studio-port.selected { stroke:#147dff; }
/* Keep destructive selection actions out from under the floating inspector,
   including its collapsed header and the incremental selection refresh path. */
.schematic-workspace-v171 .schematic-selection-menu { left:10px!important; right:auto!important; }
.studio-inline-text { position:absolute; z-index:2; width:220px!important; box-shadow:0 3px 15px #0003; }
.block-studio-save { display:grid; gap:8px; padding:12px 0; }
.studio-close-confirm { position:absolute; bottom:20px; left:20px; right:20px; padding:16px; border:1px solid var(--menu-line); border-radius:8px; background:var(--surface-solid,#fff); box-shadow:0 0 25px #0005; display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
[data-studio-ports] { display:grid; gap:5px; margin-top:10px; }
@media(max-width:800px){.block-studio-dialog { overflow:auto; }.block-studio-layout { grid-template-columns:1fr; height:auto; }.block-studio-canvas-wrap { height:50vh; flex:none; }.block-studio-inspector { max-height:50vh; }.block-studio-toolbar button { width:40px; min-height:40px; }}
@media(max-width:700px) {
 .cad-editor-layout { grid-template-columns:1fr; }
 .cad-workbench-panel { top:110px; max-height:calc(100% - 145px); }
 .cad-workbench-panel button, .cad-symbol-dialog button { min-height:44px; }
 [data-cad-editor-canvas] { height:240px; }
}
