.thermal-workbench, .thermal-launcher, .thermal-inline-controls, .thermal-setup-summary { --tt-bg: var(--panel-bg, #fff); --tt-ink: var(--text-primary, #172033); --tt-muted: var(--text-secondary, #617187); --tt-line: var(--border-color, #d9e3f1); color: var(--tt-ink); font: 650 12px/1.45 var(--font-ui, system-ui, sans-serif); }
.thermal-workbench { position: fixed; z-index: 160; right: 12px; top: 160px; bottom: 90px; width: min(470px, calc(100vw - 24px)); background: var(--tt-bg); border: 1px solid var(--tt-line); box-shadow: 0 12px 36px #102b5129; border-radius: 18px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; isolation: isolate; }
.thermal-workbench > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px 10px; flex: none; }
.thermal-workbench h2 { margin: 1px 0; font: 850 16px/1.3 var(--font-ui, system-ui, sans-serif); }
.thermal-workbench small { color: var(--tt-muted); font-size: 11px; font-weight: 650; }
.thermal-workbench h3 { font-size: 14px; font-weight: 850; margin: 0 0 8px; }
.thermal-workbench strong { font-weight: 850; }
.thermal-workbench p { margin: 6px 0 10px; }
.thermal-workbench button { min-height: 32px; height: auto; min-width: 0; width: auto; padding: 7px 11px; border: 1px solid var(--tt-line); border-radius: 8px; font: 760 12px/1.3 var(--font-ui, system-ui, sans-serif); background: var(--tt-bg); color: var(--tt-ink); box-shadow: none; text-transform: none; white-space: normal; }
.thermal-workbench button:hover { border-color: var(--menu-selected-border, #a5c7f5); color: var(--menu-accent, #075fc4); }
.thermal-workbench button:disabled { opacity: .5; cursor: not-allowed; }
.thermal-workbench button[type=submit], .thermal-workbench [data-commit-bulk], .thermal-workbench [data-commit-reuse] { background: #0879ed; color: white; border-color: #0879ed; }
.thermal-workbench button[type=submit]:hover, .thermal-workbench [data-commit-bulk]:hover, .thermal-workbench [data-commit-reuse]:hover { background:#0768ce; color:#fff; border-color:#0768ce; }
.thermal-workbench > nav { display: flex; padding: 0 12px 10px; gap: 4px; flex: none; border-bottom: 1px solid var(--tt-line); }
.thermal-workbench > nav button { flex: 1; padding-inline: 5px; }
.thermal-workbench > nav [aria-current=page] { background: #e9f3ff; color: #075fb9; border-color: #a7caff; }
.thermal-workbench-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 14px; scrollbar-gutter: stable; }
.thermal-workbench-body { scroll-behavior:auto; overflow-anchor:none; }
.thermal-workbench > footer { flex: none; padding: 10px 16px; border-top: 1px solid var(--tt-line); color: var(--tt-muted); background: var(--tt-bg); font-size: 12px; max-height: 100px; overflow: auto; }
.thermal-workbench label, .thermal-inline-controls label { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-weight: 760; font-size: 11px; }
.thermal-workbench input:not([type=checkbox]), .thermal-workbench select, .thermal-workbench textarea, .thermal-inline-controls select { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; border: 1px solid var(--tt-line); border-radius: 8px; background: var(--tt-bg); color: var(--tt-ink); min-height: 34px; height: auto; padding: 7px 9px; font: 650 12px/1.4 var(--font-ui, system-ui, sans-serif); box-shadow: none; }
.thermal-workbench textarea { resize: vertical; }
.thermal-workbench input[type=checkbox], .thermal-inline-controls input[type=checkbox] { width: 17px; height: 17px; min-width: 17px; margin: 0; accent-color: #0879ed; }
.thermal-workbench .thermal-check, .thermal-inline-controls .thermal-check { flex-direction: row; align-items: center; gap: 8px; margin: 9px 0; }
.thermal-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.thermal-workbench form { display: grid; gap: 10px; margin-bottom: 14px; }
.thermal-workbench section, .thermal-workbench details { border-top: 1px solid var(--tt-line); padding-top: 12px; margin-top: 14px; }
.thermal-workbench summary { cursor: pointer; font-weight: 760; margin-bottom: 10px; }
.thermal-note, .thermal-workbench .thermal-note { color: var(--tt-muted); font-size: 11px; font-weight: 650; line-height: 1.5; }
.thermal-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.thermal-table-wrap { overflow-x: auto; margin: 10px 0; border: 1px solid var(--tt-line); border-radius: 10px; }
.thermal-workbench table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.thermal-workbench th, .thermal-workbench td { padding: 8px 6px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--tt-line); overflow-wrap: anywhere; }
.thermal-workbench th:first-child { width: 24px; }.thermal-workbench th:nth-child(3) { width: 95px; }.thermal-workbench th:last-child { width: 38px; }
.thermal-workbench td small, .thermal-workbench td strong { display: block; }
.thermal-review-card { padding: 12px; border: 1px solid var(--tt-line); border-radius: 10px; margin-block: 10px; }
.thermal-review-card.is-error { border-color: #e76b6b; }
.thermal-preview, .thermal-lock { padding: 12px; border: 1px solid #9fc6fb; background: #eaf3ff; border-radius: 10px; }
.thermal-key { display: flex; gap: 6px 12px; flex-wrap: wrap; font-size: 11px; }.thermal-key span:nth-child(1) { color: #0678de; }.thermal-key span:nth-child(2) { color: #139258; }.thermal-key span:nth-child(3) { color: #8055cf; }
.thermal-reuse-rooms { max-height: 220px; overflow: auto; }
/* The launcher is an ordinary panel-reopen button, exactly like Calculation
   Results and Room / Zone. Only its icon layout is specific to this tool. */
.thermal-launcher { position: relative; max-width: min(410px, calc(100vw - 24px)); display: flex; flex-direction: column; align-items: stretch; gap: 8px; pointer-events: none; }
.thermal-launcher button, .thermal-launcher span { pointer-events: auto; }.thermal-launcher button { display: inline-flex; gap: 7px; align-items: center; justify-content: center; }.thermal-launcher svg { width: 16px; height: 16px; flex: none; }.thermal-launcher span { padding: 7px 10px; border: 1px solid var(--tt-line); border-radius: 8px; background: var(--tt-bg); }
.thermal-inline-controls { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px; max-width: 560px; }.thermal-inline-controls label { flex: 1 1 130px; }.thermal-inline-controls .thermal-check { flex: 0 0 auto; }
.thermal-overlay path { fill: none; stroke-width: 4px; vector-effect: non-scaling-stroke; }.thermal-boundary-external { stroke: #1685ee; }.thermal-boundary-internal { stroke: #15965b; }.thermal-boundary-linked { stroke: #8955d9; }.thermal-boundary-party, .thermal-boundary-unheated { stroke: #d89019; }
.thermal-room-preview { fill: #258afa20; stroke: #1685ee; stroke-width: 2; stroke-dasharray: 7 4; vector-effect: non-scaling-stroke; pointer-events: none; }.thermal-review-room { fill: #f2a72f20; stroke: #d58b10; stroke-width: 2; vector-effect: non-scaling-stroke; }
.thermal-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.thermal-setup-summary { padding: 12px; border: 1px solid var(--tt-line); border-radius: 12px; margin-block: 10px; background: var(--tt-bg); }.thermal-setup-summary p { margin: 4px 0; }.thermal-setup-summary .thermal-fields { align-items: end; }
[data-theme=dark] .thermal-workbench, [data-theme=dark] .thermal-launcher, [data-theme=dark] .thermal-inline-controls, [data-theme=dark] .thermal-setup-summary { --tt-bg:#171e28; --tt-ink:#e9eef6; --tt-muted:#a7b6ca; --tt-line:#354258; }
[data-theme=dark] .thermal-preview, [data-theme=dark] .thermal-lock { background:#162d4c; }
@media (max-width: 700px) { .thermal-workbench { top: 120px; bottom: 78px; right: 8px; width: min(430px, calc(100vw - 16px)); }.thermal-workbench-body { padding: 10px; }.thermal-launcher { max-width: 180px; }.thermal-inline-controls { max-width: 100%; } }
@media (max-height: 650px) { .thermal-workbench { top: 75px; bottom: 12px; }.thermal-workbench > header { padding-block: 8px; } }
@media print { .thermal-workbench, .thermal-launcher { display: none !important; } }
.thermal-import-dialog { width: min(1050px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--border-color, #d9e3f1); border-radius: 18px; background: var(--surface-solid, #fff); color: var(--text, #172033); font: 650 12px/1.5 var(--font-ui, system-ui, sans-serif); }
.thermal-import-dialog::backdrop { background: #11234066; }
.thermal-import-dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 44px); }
.thermal-import-dialog header, .thermal-import-dialog footer { flex: none; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.thermal-import-dialog h2 { margin: 0; font-size: 20px; }.thermal-import-dialog p { margin: 4px 0; }
.thermal-import-body { overflow: auto; min-height: 0; padding: 16px 20px; border-block: 1px solid var(--border-color, #d9e3f1); }
.thermal-import-body [data-pages] { display: grid; grid-template-columns: repeat(auto-fill,minmax(210px,1fr)); gap: 12px; margin-top: 14px; }
.thermal-import-page { display: grid; align-content: start; gap: 8px; border: 1px solid var(--border-color, #d9e3f1); border-radius: 10px; padding: 12px; min-width: 0; }.thermal-import-page label { display: block; font-size: 12px; overflow-wrap: anywhere; }.thermal-import-page img { height: 120px; max-width: 100%; object-fit: contain; }.thermal-import-page input:not([type=checkbox]), .thermal-import-page select { width: 100%; min-width: 0; }
.thermal-intake-list { display: flex; flex-direction: column; gap: 8px; max-height: 250px; overflow: auto; }.thermal-intake-list article { display: flex; justify-content: space-between; gap: 12px; align-items: center; }.thermal-intake-list button { display: flex; gap: 9px; align-items: center; text-align: left; min-width: 0; }.thermal-intake-list img { width: 74px; height: 50px; object-fit: contain; }.thermal-intake-list small { display: block; font-size: 11px; }.thermal-intake-list label { font-size: 12px; }
.thermal-workbench { z-index: 1600; }
.thermal-workbench > header > div { flex: 1; min-width: 0; }
.thermal-workbench[hidden], .thermal-workbench [hidden] { display:none !important; }
/* One contextual card at a time, sized to its contents rather than the screen. */
.thermal-workbench { top:154px; bottom:auto; width:min(390px,calc(100vw - 28px)); max-height:calc(100dvh - 248px); border-radius:16px; background:var(--tt-bg); }
.thermal-workbench[data-view="schedule"] { width:min(450px,calc(100vw - 28px)); }
.thermal-workbench > header { padding:12px 14px 8px; gap:6px; }
.thermal-workbench > header button { width:32px; min-width:32px; height:32px; min-height:32px; padding:4px; flex:none; display:grid; place-items:center; }
.thermal-workbench h2 { font-size:16px; overflow-wrap:break-word; }
.thermal-workbench > header small { display:block; font-size:10px; font-weight:760; line-height:1.4; margin-bottom:3px; }
.thermal-workbench > nav { gap:4px; padding:0 12px 10px; }
.thermal-workbench > nav button { flex:1 1 auto; white-space:nowrap; }
.thermal-workbench > nav select { flex:0 1 78px; width:78px; padding:6px; font-size:12px; }
.thermal-workbench-body { flex:0 1 auto; padding:12px; }
.thermal-workbench > footer { font-size:11px; padding:8px 14px; }
.thermal-context-title { display:flex; align-items:center; gap:10px; margin-bottom:14px; min-width:0; }
.thermal-context-title > div { flex:1; min-width:0; }
.thermal-context-title h3 { font-size:14px; line-height:1.3; overflow-wrap:break-word; margin:2px 0; }
.thermal-context-title small { display:block; overflow-wrap:anywhere; }
.thermal-context-title small:first-child { color:#0874de; font-size:10px; font-weight:700; letter-spacing:.06em; }
.thermal-context-icon { display:grid; place-items:center; width:36px; height:36px; flex:none; background:#e9f3ff; color:#0874de; border:1px solid #c4dfff; border-radius:10px; font-size:23px; }
.thermal-tool-choices { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; margin:14px 0; }
.thermal-tool-choices button { padding:12px 6px; text-align:left; background:var(--surface-soft,#f6f9fd); }
.thermal-tool-choices strong,.thermal-tool-choices small { display:block; }
.thermal-tool-choices small { font-size:10px; line-height:1.4; margin-top:5px; font-weight:650; }
.thermal-context-change { display:flex; align-items:center; gap:8px; padding:10px 12px; font-size:11px; border-bottom:1px solid #e9c578; background:#fff8e6; color:#704a0e; }
.thermal-context-change span { flex:1; }
.thermal-context-change button { flex:0 0 110px; font-size:11px; }
.thermal-workbench form details { margin:0; padding:10px; border:1px solid var(--tt-line); border-radius:10px; }
.thermal-workbench form details:not([open]) summary { margin:0; }
.thermal-workbench [data-edit-selected] { margin-left:auto; background:#e9f3ff; color:#075fb9; }
[data-theme="dark"] .thermal-context-icon { background:#162d4c; border-color:#354b69; color:#75b9ff; }
[data-theme="dark"] .thermal-context-change { background:#3a2e17; color:#ffe0a2; border-color:#735824; }
@media(max-width:700px){
  .thermal-workbench { top:auto; bottom:82px; right:8px; width:calc(100vw - 16px); max-height:min(62dvh,560px); }
  .thermal-workbench[data-view="schedule"] { width:calc(100vw - 16px); }
}
@media(max-height:650px) and (min-width:701px){.thermal-workbench { top:82px; max-height:calc(100dvh - 156px); }}
/* In a constrained workspace, show one floating tool family at a time.
   The navigation strip returns as soon as this card is closed. */
@media(max-width:1100px){body.thermal-workbench-expanded .canvas-workbench { visibility:hidden; pointer-events:none; }}
.thermal-preview li small { display:block; margin:4px 0 10px; overflow-wrap:anywhere; }
.thermal-host-wall { fill:none; stroke:#1685ee;stroke-width:5;stroke-opacity:.45;vector-effect:non-scaling-stroke;pointer-events:none; }
@media(min-width:900px){body.thermal-workbench-expanded .workspace-assistant-launcher, body.thermal-workbench-expanded .my-day-designer-comments {right:500px;}}
/* On narrow screens the expanded workbench occupies the drawing surface.
   Close it to reveal the other floating tools again. */
@media(max-width:899px){body.thermal-workbench-expanded .workspace-assistant-launcher, body.thermal-workbench-expanded .my-day-designer-comments {visibility:hidden;pointer-events:none;}}

/* Focused tools belong to the native side panel; they never cover the canvas
   or reserve a second floating-menu viewport. The parent owns scrolling. */
.thermal-workbench.thermal-embedded,
.thermal-workbench.thermal-embedded[data-view="schedule"] {
  position: static; inset: auto; z-index: auto; width: 100%; max-width: 100%;
  max-height: none; min-height: 0; margin: 10px 0 0; border-radius: 10px;
  box-shadow: none; box-sizing: border-box; isolation: auto; flex: none;
}
.thermal-embedded > header { padding: 10px 10px 8px; }
.thermal-embedded h2 { font-size: 13px; line-height: 1.35; }
.thermal-embedded .thermal-workbench-body { overflow: visible; padding: 10px; scrollbar-gutter: auto; }
.thermal-embedded > footer { max-height: none; overflow: visible; padding: 8px 10px; }
.thermal-embedded .thermal-fields { gap: 8px; }
.thermal-embedded .thermal-table-wrap { margin-inline: -4px; }
.thermal-embedded th:nth-child(3) { width: 70px; }
.thermal-workbench.thermal-setup-templates {
  position: fixed; inset: 0; margin: auto; width: min(470px, calc(100vw - 24px));
  max-height: min(720px, calc(100dvh - 40px)); height: fit-content;
}
.thermal-setup-templates::backdrop { background: #11234066; }
