/* styles.css : Childress Hollow planner
 * Screen layout (top bar, library, canvas, totals bar, right panels), dialogs, toasts, and
 * the print stylesheet that lays each floor out at exactly 1/8 in = 1 ft on US Letter.
 */

:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --line: #d6dae0;
  --text: #1f2328;
  --muted: #6b7280;
  --accent: #1c4e9e;
  --accent-soft: #dae6fa;
  --orange: #ff6a00;
  --ok: #1f7a3d;
  --warn: #b26a00;
  --over: #c92a2a;
  --hard: #c92a2a;
  --soft: #b26a00;
  --radius: 6px;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 13px;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.hint { color: var(--muted); font-size: 12px; }
.hint.ok { color: var(--ok); }
.muted { color: var(--muted); }
.err { color: var(--over); min-height: 1.2em; }
h4 { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }

/* ---- buttons ---- */
.btn { border: 1px solid var(--line); background: #fff; border-radius: var(--radius); padding: 6px 10px; cursor: pointer; line-height: 1.2; }
.btn:hover { background: #f0f3f8; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: default; }
.btn[aria-disabled="true"]:hover { background: #fff; }
.btn.small { padding: 4px 8px; font-size: 12px; }
.btn.tiny { padding: 2px 6px; font-size: 11px; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: #163d7c; }
.btn.danger { color: var(--over); border-color: #f0b4b4; }
.btn.danger.primary { background: var(--over); color: #fff; }
.btn.warn { color: var(--warn); border-color: #f2d3a0; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.garage-status { display: flex; align-items: center; gap: 8px; margin: 8px 0; padding: 6px 8px; border-radius: 6px; font-size: 12px; background: #f2f3f5; }
.garage-status .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #999; }
.garage-status.attached .dot { background: #2a7; }
.garage-status.detached .dot { background: #d9480f; }
.garage-status .garage-status-text { flex: 1; }
.icon-btn { border: none; background: transparent; cursor: pointer; color: var(--muted); padding: 0 4px; }
.icon-btn:hover { color: var(--over); }
.check { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
.num { width: 100%; }
input.num.tiny { width: 70px; }
input[type=number], input[type=text], input[type=search], select, textarea { border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; background: #fff; }
input[type=number] { text-align: right; }
textarea { width: 100%; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 3px; margin: 6px 0; }
.field > span { font-size: 11px; color: var(--muted); }
.row { display: flex; gap: 8px; }
.row > .field { flex: 1; }
.slider-row { display: flex; gap: 8px; align-items: center; }
.slider-row input[type=range] { flex: 1; }
.slider-row input[type=number] { width: 80px; }
/* a value that follows another field (the basement length while linked to the main length): grayed, still typeable */
.slider-row input[type=number].linked { color: var(--muted); background: #f2f3f5; border-style: dashed; }

/* ---- login ---- */
.login { position: fixed; inset: 0; display: grid; place-items: center; background: linear-gradient(160deg, #e9eef7, #f7f7f2); }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 28px 30px; width: min(380px, 92vw); display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
.login-card h1 { margin: 0; font-size: 20px; }
.login-card input { padding: 8px 10px; font-size: 15px; }

/* ---- app frame ---- */
.app { display: flex; flex-direction: column; height: 100vh; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar .group { display: flex; align-items: center; gap: 4px; }
.topbar .group.right { margin-left: auto; }
.brand { display: flex; align-items: baseline; gap: 8px; margin-right: 8px; }
.brand-name { font-weight: 700; font-size: 14px; }
/* the plan name is a button that opens the Versions panel (plan switcher) */
.ver-name { color: var(--muted); max-width: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid var(--border, #d5dbe5); background: #fff; border-radius: var(--radius); padding: 3px 10px; cursor: pointer; font: inherit; }
.ver-name::after { content: " \25BE"; color: var(--accent); }
.ver-name:hover { background: #f0f3f8; }
/* a locked plan (2026-10-05): the padlock beside its name in the title bar, the plan menu and the Plans cards */
.lock-glyph { display: inline-block; vertical-align: -1px; margin-left: 4px; color: #8a6d1f; line-height: 0; }
.lock-glyph svg { display: inline-block; }
/* the plan switcher dropdown under the plan name (built by main.js toggleVerMenu) */
.ver-menu { position: fixed; z-index: 60; min-width: 300px; max-width: min(460px, 92vw); max-height: 70vh; overflow-y: auto;
  background: #fff; border: 1px solid var(--border, #d5dbe5); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(20, 30, 50, 0.18); padding: 4px; }
.ver-menu-item { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; text-align: left;
  border: 0; background: transparent; padding: 7px 10px; border-radius: 6px; cursor: pointer; font: inherit; color: inherit; }
.ver-menu-item:hover, .ver-menu-item:focus { background: #f0f3f8; outline: none; }
.ver-menu-item.current { background: #eaf1ff; cursor: default; }
.ver-menu-item.reference .ver-menu-name { color: var(--muted); }
.ver-menu-item.more { border-top: 1px solid var(--border, #d5dbe5); border-radius: 0 0 6px 6px; margin-top: 4px; color: var(--accent); }
.ver-price { margin-left: auto; font-weight: 700; color: var(--accent); white-space: nowrap; }
.ver-menu-group { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 2px; }
.ver-menu-group + .ver-menu-item { margin-top: 0; }
.ver-search { position: sticky; top: 0; z-index: 2; background: var(--panel, #fff); padding: 0 0 6px; }
.ver-search-row { display: flex; gap: 6px; align-items: center; }
.ver-search-input { flex: 1; min-width: 0; width: 100%; box-sizing: border-box; padding: 6px 8px; border: 1px solid var(--border, #d5dbe5); border-radius: var(--radius); font: inherit; }
.ver-sort { flex: none; max-width: 42%; padding: 5px 4px; font: inherit; font-size: 12px; }
.ver-fold-all { display: block; margin: 4px 0 0 auto; padding: 0; border: none; background: none; color: var(--accent); font: inherit; font-size: 11px; cursor: pointer; text-decoration: underline; }
.ver-fold-all[hidden] { display: none; }
/* group headers are accordions (2026-10-05): chevron, name, count; collapsed adds the total and the newest date */
.ver-group { display: flex; align-items: baseline; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 10px 2px 2px; border-bottom: 1px solid var(--border, #d5dbe5); margin-bottom: 6px; cursor: pointer; user-select: none; }
.ver-group:hover { color: var(--text); }
.ver-group:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ver-group.none { color: #9aa3b2; }
.ver-group.none:hover { color: var(--text); }
.ver-chev { display: inline-block; width: 10px; transform: rotate(90deg); transition: transform 0.12s; }
.ver-group.folded .ver-chev { transform: none; }
.ver-group-name { flex: 1; min-width: 0; }
.ver-group-count { font-weight: 600; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.tag.grp { background: #e6eefc; color: #2b4a7a; }
.ver-menu-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ver-menu-meta { flex: none; font-size: 11px; color: var(--muted); white-space: nowrap; }
/* fixed width so the top bar does not reflow (and buttons do not jump) when "* unsaved" appears or disappears */
.dirty { display: inline-block; min-width: 8ch; color: var(--orange); font-weight: 700; white-space: nowrap; }
.tab { border: 1px solid transparent; background: transparent; padding: 5px 10px; border-radius: var(--radius); cursor: pointer; }
.tab:hover { background: #f0f3f8; }
.tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.tab:disabled { opacity: 0.4; cursor: default; }
.floor-vis { display: inline-flex; gap: 6px; margin-left: 6px; font-size: 12px; }
.count:not(:empty) { background: var(--over); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
.count.soft { background: var(--warn); }

/* the right panel's width is a variable so the splitter can set it (persisted in localStorage, main.js) */
.layout { --right-w: 360px; display: grid; grid-template-columns: 300px 1fr 6px var(--right-w); flex: 1; min-height: 0; }
.splitter { cursor: col-resize; background: var(--line); position: relative; touch-action: none; }
.splitter::after { content: ""; position: absolute; top: 0; bottom: 0; left: -3px; right: -3px; }
.splitter:hover, .splitter.dragging { background: var(--accent); }
body.splitting { cursor: col-resize; user-select: none; }
body.splitting iframe, body.splitting svg { pointer-events: none; }
.side { background: var(--panel); overflow: auto; min-height: 0; }
.side.left { border-right: 1px solid var(--line); padding: 8px; }
.side.right { border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 4px; gap: 2px; flex-wrap: wrap; }
.tab-body { padding: 10px; overflow: auto; flex: 1; }
.center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.banner { background: #fff4e0; color: #7a3b00; border-bottom: 1px solid #f2d3a0; padding: 6px 12px; display: flex; gap: 10px; align-items: center; }
.banner.flash { animation: flash 0.6s; }
@keyframes flash { 0% { background: #ffd7a8; } 100% { background: #fff4e0; } }

/* ---- canvases ---- */
.canvas-area { flex: 1; display: flex; gap: 6px; padding: 6px; min-height: 0; }
.canvas-area.column { flex-direction: column; }
.canvas-area.placing .floor-svg { cursor: crosshair; }
.canvas-area.measuring .floor-svg { cursor: crosshair; }
.canvas-area.walling .floor-svg { cursor: crosshair; }
.canvas-area.sectioning .floor-svg { cursor: crosshair; }
.canvas-area.walling .wall-g { cursor: move; }
.canvas-wrap { position: relative; flex: 1; min-width: 0; min-height: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.canvas-wrap.panning .floor-svg { cursor: grabbing; }
.canvas-wrap.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.floor-svg { width: 100%; height: 100%; display: block; cursor: default; }
.canvas-label { position: absolute; left: 8px; bottom: 6px; background: rgba(255,255,255,0.9); border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; font-size: 12px; pointer-events: none; }
.compare-col { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 4px; }
.compare-col .canvas-wrap { flex: 1; }
.compare-notes { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; }
.compare-notes textarea { flex: 1; min-height: 44px; }
.compare-notes .stats { min-width: 150px; color: var(--muted); }

/* ---- totals bar ---- */
.totals { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 8px; background: var(--panel); border-top: 1px solid var(--line); align-items: stretch; flex: none; }
.tot-floor { border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 8px; min-width: 150px; cursor: pointer; }
.tot-floor.active { border-color: var(--accent); background: var(--accent-soft); }
.tot-floor.summary { cursor: default; background: #fafafa; }
.tot-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12px; }
.tot-actions { display: none; gap: 4px; }
.tot-floor:hover .tot-actions { display: inline-flex; }
.tot-line { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.stat { display: inline-flex; flex-direction: column; line-height: 1.1; }
.stat-label { font-size: 10px; color: var(--muted); text-transform: uppercase; }
.stat-val { font-weight: 600; font-size: 13px; }
.stat.warn .stat-val { color: var(--warn); }
.stat.over .stat-val { color: var(--over); }
/* a floor turned OFF for the price (shell.floorsOn): grayed card, dashes for its sf */
.tot-floor.off { background: #f3f3f3; border-style: dashed; color: var(--muted); }
.tot-floor.off .stat-val { color: var(--muted); }
.tot-hint { font-size: 10px; color: var(--muted); margin-top: 3px; max-width: 320px; }
.tag.off { background: #efe3d6; color: #7a3b00; }
.w-floor.off { color: #7a3b00; }
/* floor on/off switch (a checkbox styled as a toggle): Shell panel rows and the totals-bar cards */
.switch { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 11px; color: var(--muted); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { position: relative; width: 28px; height: 16px; border-radius: 8px; background: #c9ced6; transition: background 0.15s; flex: none; }
.switch-knob { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.25); transition: left 0.15s; }
.switch.on .switch-track { background: var(--ok); }
.switch.on .switch-knob { left: 14px; }
.switch.on .switch-text { color: var(--ok); font-weight: 600; }
.switch input:disabled ~ .switch-track { opacity: 0.4; }
.switch input:focus-visible ~ .switch-track { outline: 2px solid var(--accent); outline-offset: 1px; }
.switch.tiny .switch-track { width: 24px; height: 14px; }
.switch.tiny .switch-knob { width: 10px; height: 10px; }
.switch.tiny.on .switch-knob { left: 12px; }
.floors-on { display: flex; flex-direction: column; gap: 4px; margin: 4px 0; }
.floors-on-row { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 12px; }
.floors-on-row strong { min-width: 80px; }
.floors-on-row.off { background: #f6f6f6; border-style: dashed; }
table.price.floors tr.off td { color: var(--muted); }
table.price.floors tr.absent td { color: var(--muted); font-style: italic; }
.tot-cost { margin-left: auto; border-radius: var(--radius); padding: 4px 12px; min-width: 210px; text-align: right; color: #fff; }
.tot-cost.ok { background: var(--ok); }
.tot-cost.warn { background: var(--warn); }
.tot-cost.over { background: var(--over); }
.cost-big { font-size: 20px; font-weight: 700; line-height: 1.1; }
.cost-markers { display: flex; gap: 8px; justify-content: flex-end; font-size: 11px; opacity: 0.95; flex-wrap: wrap; }

/* ---- library ---- */
.lib-head { display: flex; gap: 6px; margin-bottom: 8px; align-items: center; }
.lib-search { flex: 1; }
.lib-group { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 6px; background: #fff; }
.lib-group summary { display: flex; align-items: center; gap: 8px; padding: 6px 8px; cursor: pointer; font-weight: 600; list-style: none; }
.lib-group summary::-webkit-details-marker { display: none; }
.lib-group summary::before { content: "\25B8"; color: var(--muted); font-size: 11px; }
.lib-group[open] summary::before { content: "\25BE"; }
.lib-count { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 11px; }
.lib-items { padding: 0 8px 6px; }
.side.left { padding-bottom: 24px; }
.swatch { display: inline-block; width: 14px; height: 14px; border: 1.5px solid #888; border-radius: 3px; }
.lib-row { padding: 5px 0; border-top: 1px dashed #e6e8ec; }
.lib-row:first-child { border-top: none; }
.lib-row.placed .lib-row-head .name { color: var(--muted); }
.lib-row.placed .variants .chip:not(.placed-variant) { opacity: 0.55; }
.lib-row-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.lib-row-head .num { font-weight: 700; min-width: 20px; }
.lib-row-head .name { flex: 1 1 120px; }
.tag { font-size: 10px; background: #e8ecf3; color: #445; border-radius: 10px; padding: 1px 7px; white-space: nowrap; }
.tag.dup { background: #ffe1e1; color: var(--over); font-weight: 700; }
.tag.ref { background: #fff1d6; color: #7a3b00; }
.tag.cur { background: var(--accent-soft); color: var(--accent); }
.variants { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 2px 8px; font-size: 11px; cursor: grab; white-space: nowrap; }
.chip:hover { border-color: var(--accent); background: #f4f7fd; }
.chip.armed { background: var(--orange); border-color: var(--orange); color: #fff; }
.chip.placed-variant { border-color: var(--accent); background: var(--accent-soft); }
/* wall types: symbol + text rows; clicking one arms the wall tool */
.wall-row { display: flex; align-items: center; gap: 8px; cursor: pointer; border-radius: 4px; padding: 5px 4px; }
.wall-row:hover { background: #f4f7fd; }
.wall-row.armed { background: var(--accent-soft); }
.wall-symbol { width: 64px; height: 16px; flex: none; }
.wall-row-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.wall-row-text .name { font-weight: 600; font-size: 12px; }

/* ---- properties ---- */
.prop-title { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.code-chip { color: #fff; font-size: 10px; font-weight: 700; border-radius: 4px; padding: 2px 6px; }
.prop-warns { margin-top: 10px; padding: 8px; background: #fff8f0; border: 1px solid #f2d3a0; border-radius: var(--radius); }
.prop-warns ul, .tips { margin: 6px 0 0; padding-left: 18px; }
/* one warning per row, with a rule between rows so each starts and ends visibly (owner, 2026-10-05) */
.prop-warns li { padding: 7px 0; border-top: 1px solid #ecc98f; line-height: 1.35; }
.prop-warns li:first-child { border-top: none; padding-top: 4px; }
.prop-warns li + li { margin-top: 0; }
.w-hard { color: var(--hard); }
.w-soft { color: var(--soft); }

/* ---- warnings ---- */
.warn-list { list-style: none; padding: 0; margin: 0; }
/* Three columns: severity, floor ("plan" for a plan-wide warning), text; the rule id under the text.
   Every span is pinned to its column (2026-10-04): a warning without a floor used to drop its text
   into the 34 px floor column, where it wrapped one word per line. The text column takes the rest of
   the row at any panel width (min-width 0 so the grid can shrink below the longest word). */
.warn-list li { display: grid; grid-template-columns: 42px minmax(34px, auto) minmax(0, 1fr) auto; gap: 2px 6px; padding: 8px 4px; border-bottom: 1px solid #d9dee6; cursor: pointer; align-items: start; line-height: 1.35; }
.warn-list li:nth-child(even) { background: #fafbfd; }
.warn-list li:hover { background: #f6f8fb; }
.w-sev { grid-column: 1; font-size: 10px; font-weight: 700; border-radius: 3px; padding: 1px 4px; text-align: center; color: #fff; }
li.w-hard .w-sev { background: var(--hard); }
li.w-soft .w-sev { background: var(--soft); }
.w-floor { grid-column: 2; font-size: 11px; color: var(--muted); white-space: nowrap; }
.w-floor.plan { color: #999; font-style: italic; }
.w-text { grid-column: 3; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.w-rule { grid-column: 3; font-size: 10px; color: var(--muted); }
/* dismissals (2026-10-04): the hide / show control takes a fourth column (empty on a hard row) */
.w-hide { grid-column: 4; grid-row: 1 / span 2; align-self: center; }
.warn-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.warn-head .hint { margin: 4px 0; }
.warn-hide-hint { font-size: 11px; margin: 0 0 6px; }
.warn-hidden-head { margin-top: 12px; border-top: 1px solid #e3e6ea; padding-top: 6px; }
.warn-hidden-head h4 { margin: 0; }
.hidden-list li { opacity: 0.75; }
/* grouped by floor (2026-10-04): a collapsible header per group with its count */
.warn-group { margin-bottom: 4px; }
.warn-group-head { display: flex; align-items: center; gap: 6px; width: 100%; border: none; background: #f2f4f7; border-radius: 4px; padding: 4px 6px; margin: 6px 0 2px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; color: var(--text); text-align: left; }
.warn-group-head:hover { background: #e8ecf1; }
.warn-caret { display: inline-block; width: 12px; text-align: center; color: var(--muted); font-weight: 700; }
.warn-group-label { flex: 1; }
.warn-group-count { font-size: 11px; font-weight: 600; color: var(--muted); }
.warn-group-count.hard { color: var(--hard); }

/* ---- pricing ---- */
.price-total { border-radius: var(--radius); padding: 10px 12px; color: #fff; margin-bottom: 8px; }
.price-total.ok { background: var(--ok); }
.price-total.warn { background: var(--warn); }
.price-total.over { background: var(--over); }
.price-total .big { font-size: 26px; font-weight: 700; }
.price-total .muted { color: rgba(255,255,255,0.85); font-size: 11px; }
.marker-bar { position: relative; height: 18px; background: #e9ecf1; border-radius: 9px; margin: 14px 0 4px; }
.marker-bar .fill { height: 100%; border-radius: 9px; }
.marker-bar .fill.ok { background: var(--ok); }
.marker-bar .fill.warn { background: var(--warn); }
.marker-bar .fill.over { background: var(--over); }
.marker-bar .mark { position: absolute; top: -4px; width: 2px; height: 26px; background: #333; }
.marker-bar .mark span { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font-size: 10px; white-space: nowrap; color: #333; }
.marker-legend { display: flex; gap: 10px; font-size: 11px; flex-wrap: wrap; }
.marker-legend .ok { color: var(--ok); }
.marker-legend .over { color: var(--over); }
table.mini, table.price { width: 100%; border-collapse: collapse; font-size: 12px; }
table.mini td, table.price td, table.price th { padding: 3px 4px; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
table.price th { text-align: left; font-size: 10px; text-transform: uppercase; color: var(--muted); }
td.num, th.num { text-align: right; white-space: nowrap; }
/* a number column is as narrow as its widest figure (the 1% width is the table-layout way of saying
   "shrink to content"); the label column takes everything else, so a label never wraps word by word
   while the figure sits alone on the right (2026-10-04) */
table.mini td.num, table.price td.num, table.price th.num { width: 1%; }
table.mini td:first-child, table.price td:first-child, table.price th:first-child { min-width: 60%; }
table.price input.num { width: 80px; }

/* Price panel and Rates tab lines (2026-10-04): two columns, the label (with its detail line under it)
   taking at least 60% and the figure right-aligned and never wrapping. Replaces the five-column tables
   that squeezed "Porches, concrete" to one word per line at 280 px. */
.plines { display: flex; flex-direction: column; margin: 2px 0 6px; }
.pline { display: grid; grid-template-columns: minmax(60%, 1fr) auto; gap: 2px 10px; align-items: start; padding: 5px 2px; border-bottom: 1px solid #eef0f3; font-size: 12px; }
.pline:last-child { border-bottom: none; }
.pline.head { font-size: 10px; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); padding: 2px; }
.pline .pl-label { min-width: 0; }
.pline .pl-label .check { white-space: normal; align-items: flex-start; }
.pline .pl-label .check input { margin-top: 2px; flex: none; }
.pline .pl-sub { font-size: 11px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: center; margin-top: 2px; }
.pline .pl-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pline .pl-num .hint { display: block; font-size: 10px; }
.pline .pl-num input.num { width: 84px; }
.pline .pl-num input.num.tiny { width: 72px; }
.pline.inactive .pl-label, .pline.inactive .pl-num, .pline.replaced .pl-label, .pline.replaced .pl-num { color: var(--muted); }
.pline.replaced .cfg { text-decoration: line-through; }
.pline.total { font-weight: 700; border-top: 2px solid var(--line); }
.pline .tag { vertical-align: middle; }

/* ---- versions ---- */
.ver-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ver-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.ver-card.current { border-color: var(--accent); background: #f7f9fe; }
.ver-card.reference { background: #fffaf2; }
.ver-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ver-meta { font-size: 11px; color: var(--muted); margin: 3px 0; }
.ver-notes { font-size: 12px; color: #444; white-space: pre-wrap; }
.compare-row { align-items: center; margin: 8px 0; }
.compare-row select { flex: 1; }

/* ---- dialogs and toasts ---- */
.dlg { border: 1px solid var(--line); border-radius: 10px; padding: 0; width: min(460px, 94vw); box-shadow: 0 12px 40px rgba(0,0,0,0.2); }
.dlg::backdrop { background: rgba(20, 24, 32, 0.35); }
.dlg-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.dlg-body h3 { margin: 0 0 4px; font-size: 16px; }
.dlg-body p { margin: 0; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.dlg-choices { display: flex; flex-direction: column; gap: 6px; }
/* a long checkbox label in a form dialog wraps inside the dialog instead of running past its edge */
.dlg .checks .check { white-space: normal; align-items: flex-start; }
.dlg .checks .check input { margin-top: 2px; flex: none; }
/* Elevations dialog (2026-10-04): the four sheets stacked, each a live SVG laid out for the print page */
.dlg.dlg-elev { width: min(1280px, 96vw); max-height: 94vh; }
.dlg-elev .dlg-body { max-height: 92vh; }
.elev-top { display: flex; align-items: center; gap: 10px; }
.elev-top h3 { margin: 0 auto 0 0; }
.elev-views { overflow: auto; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.elev-view { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; background: #fff; }
.elev-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.elev-head .btn { margin-left: auto; }
.elev-svg { display: block; width: 100%; height: auto; }
/* Roof tab (2026-10-04): the ceiling table, the section list and the live section box */
.roof-numbers { margin-top: 2px; }
.ceil-floor { font-weight: 600; margin: 8px 0 4px; font-size: 12px; }
.ceil-table { display: flex; flex-direction: column; gap: 4px; }
.ceil-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 6px; align-items: center; padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; font-size: 12px; }
.ceil-row.vaulted { background: #f6f2fb; border-color: #d9cdea; }
.ceil-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ceil-fields { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.ceil-fields:empty { display: none; }
.ceil-field { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #555; }
.ceil-num { width: 62px; }
.ceil-desc { grid-column: 1 / -1; margin: 0; font-size: 11px; }
.ceil-report { background: #f5f9f2; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 6px; }
.sect-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.sect-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12px; padding: 3px 4px; border-radius: var(--radius); }
.sect-row.on { background: #fdf0e8; }
.sect-row .sect-name { width: 42px; }
.sect-row .sect-pos { width: 64px; }
/* Dormers (2026-10-04): one bordered block per dormer, its fields wrapping at narrow widths */
.dormer-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.dormer-row { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 4px 6px; font-size: 12px; }
.dormer-row.bad { border-color: #e0a3a3; background: #fdf4f4; }
.dormer-row .row { flex-wrap: wrap; align-items: flex-end; }
.dormer-row .row > .field { flex: 1 1 90px; min-width: 0; }
.dormer-row .num.dormer-num { width: 100%; max-width: 90px; }
.dormer-row .sect-name { width: 56px; }
.dormer-desc { margin: 4px 0 0; font-size: 11px; }
.door-summary, .window-summary { margin-top: 2px; }
.section-box { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 6px; }
.section-box:empty { display: none; }
.section-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.section-head .btn { margin-left: auto; }
.ceiling-opts select { margin-left: 2px; }
.btn.choice { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; }
.btn.choice .hint { font-weight: 400; }
.checks { display: flex; gap: 10px; flex-wrap: wrap; }
.toast-host { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 1000; }
.toast { background: #23272e; color: #fff; padding: 8px 12px; border-radius: 6px; opacity: 0; transform: translateY(6px); transition: all 0.25s; max-width: 380px; font-size: 12px; }
.toast.show { opacity: 1; transform: none; }
.toast-ok { background: var(--ok); }
.toast-error { background: var(--over); }
.toast-warn { background: var(--warn); }

/* ---- help ---- */
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12px; }
.help-grid kbd { background: #f0f2f5; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; font-family: inherit; }

/* ---- responsive ---- */
@media (max-width: 1200px) {
  .layout { grid-template-columns: 250px 1fr 6px var(--right-w); }
}
@media (max-width: 900px) {
  /* one column: library, canvas + totals, right panels. The center row gets a real minimum
     height and the whole layout scrolls, so the canvas can never sit on top of the tab strip. */
  .app { height: auto; min-height: 100vh; }
  .layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(45vh, auto) auto; overflow: auto; }
  .splitter { display: none; }
  .side.left, .side.right { max-height: 40vh; }
  .center { min-height: 45vh; }
  .canvas-area { min-height: 40vh; }
  .tot-cost { margin-left: 0; }
}

/* ---- print: exactly 1/8 in = 1 ft on US Letter landscape ---- */
#print-root { display: none; }
@page { size: letter landscape; margin: 0.4in; }
@media print {
  html, body { background: #fff; height: auto; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; }
  /* one sheet per page: the printable area is 11 x 8.5 in minus the 0.4 in margins = 10.2 x 7.7 in. The page is
     pinned to that height with overflow hidden, so a wrapped header line or a long note can never push the
     ruler or the notes onto a second sheet (the drawing's own height budget is PRINT_MAX_H_IN in exports.js). */
  .print-page { page-break-after: always; break-after: page; page-break-inside: avoid; break-inside: avoid; box-sizing: border-box;
    height: 7.65in; max-height: 7.65in; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 0.04in; font-family: Arial, Helvetica, sans-serif; color: #111; }
  .print-page:last-child { page-break-after: auto; break-after: auto; }
  .print-head { width: 100%; display: flex; justify-content: space-between; gap: 0.2in; font-size: 9pt; border-bottom: 1px solid #999; padding-bottom: 0.04in; margin-bottom: 0.04in; }
  .print-head strong { font-size: 11pt; }
  .print-compass { font-size: 8pt; font-weight: 700; letter-spacing: 0.06em; color: #333; display: flex; justify-content: space-between; gap: 0.2in; }
  .print-compass.top, .print-compass.bottom { width: 100%; max-width: 10.2in; }
  .print-mid { display: flex; align-items: center; justify-content: center; }
  .print-svg { display: block; }
  .print-elev .print-mid { flex: none; }
  .print-foot { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 0.2in; margin-top: 0.08in; }
  .print-legend { display: flex; gap: 0.12in; font-size: 7pt; flex-wrap: wrap; }
  .print-legend i { display: inline-block; width: 0.14in; height: 0.1in; border: 1px solid #888; margin-right: 0.04in; vertical-align: middle; }
  .print-notes { font-size: 8pt; width: 100%; margin: 0.04in 0 0; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .toast-host, .dlg { display: none !important; }
}

/* ---- Site tab, Rates tab, read-only Price panel (2026-10-04) ---- */
.site-wrap { background: #e9ece6; }
.site-compass { position: absolute; right: 10px; top: 8px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; }
.site-north { font-weight: 700; font-size: 13px; color: #111; background: rgba(255,255,255,0.85); border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; display: flex; align-items: center; gap: 4px; }
.site-north .arrow { display: inline-block; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 12px solid #111; }
.site-scale { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.85); border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; font-size: 11px; }
.site-scale .bar { display: inline-block; height: 4px; background: #111; width: 60px; }
.hint.strong { color: var(--text); font-weight: 600; margin: 10px 0 2px; }
table.mini.walls th { text-align: left; font-size: 10px; text-transform: uppercase; color: var(--muted); padding: 3px 4px; }
table.mini.walls th.num { text-align: right; }
.site-warns { margin: 4px 0 0; padding-left: 18px; }
.site-warns li { margin: 4px 0; }
.bends { display: flex; flex-direction: column; gap: 4px; margin: 4px 0; }
.bend-row { display: flex; align-items: center; gap: 6px; }
.bend-row .hint { min-width: 46px; }
.field.inline { flex-direction: row; align-items: center; gap: 6px; margin: 0; }
.choice-pair { display: inline-flex; gap: 2px; flex-wrap: wrap; }
.site-switches { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.switch-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: #fafbfd; }
.switch-row > strong { min-width: 84px; }
.switch-row .implied { flex-basis: 100%; }
select.tiny { padding: 2px 4px; font-size: 11px; }
table.price tr.inactive td, table.price tr.replaced td { color: var(--muted); }
table.price tr.inactive td .hint, table.price tr.replaced td .hint { font-size: 10px; }
table.price tr.replaced td.cfg { text-decoration: line-through; }
table.mini.totals tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
table.price.rates input.num { width: 90px; }
table.price.rates input.num.tiny { width: 72px; }
table.price.rates td.hint { color: var(--muted); font-size: 11px; }
.tag.pub { background: #dff3e4; color: #1f7a3d; }
.tag.assume { background: #fff1d6; color: #7a3b00; }
/* a unit line that is not on Dustin's sheet (2026-10-08): the same dimmed mark on every such line */
.tag.offsheet { background: transparent; color: var(--muted); border: 1px dashed #c9ced8; opacity: 0.85; }
table.price.baths td { vertical-align: top; }

/* Heights per floor, computed stair length, duct soffit clear height (2026-10-03) */
.stair-computed { margin: 6px 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: #f7f5fb; font-size: 12px; }
.stair-computed.custom { border-color: #e4c48f; background: #fff8f0; }
.stair-computed-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.stair-computed .hint { margin: 2px 0; }
.hint.soffit-clear.low, .hint.heights-derived.low { color: #7a3b00; }
table.price tr.ceilings td .hint { font-size: 10px; margin-top: 2px; }
.hint.ceiling-note { margin-top: 4px; }

.hint.warn { color: var(--warn); }

/* Outdoor pieces (porches, decks, patios) and window markers (2026-10-04) */
.lib-row .swatch.outdoor { background: #eaf2e4; border-color: #4f7a3a; border-style: dashed; }
.outdoor-opts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: #f5f9f2; font-size: 12px; }
.outdoor-opts .check { white-space: normal; }
.win-sizes { display: flex; flex-wrap: wrap; gap: 4px; }
.hint.site-height { margin: 4px 0; }

/* stacking order (2026-10-04): the Piece panel row and the canvas's right-click menu (js/zmenu.js) */
.zorder { margin: 6px 0; }
.zorder .btn-row { margin: 4px 0 2px; }
.ctx-menu { position: fixed; z-index: 50; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,0.18); padding: 4px; display: flex; flex-direction: column; }
.ctx-menu .ctx-title { font-size: 11px; color: var(--muted); padding: 4px 8px 6px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.ctx-menu .ctx-item { display: flex; justify-content: space-between; gap: 16px; align-items: center; border: 0; background: none; padding: 6px 8px; border-radius: 5px; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.ctx-menu .ctx-item:hover:not(:disabled) { background: #f1f3f5; }
.ctx-menu .ctx-item:disabled { color: #aaa; cursor: default; }
.ctx-menu kbd { font-size: 11px; color: var(--muted); font-family: inherit; }

/* see-through (top bar, 2026-10-04): every piece fill at about 70% on the canvas; print and PDF build
   their own SVGs without the class, so they stay opaque */
.floor-svg.see-through .piece, .floor-svg.see-through .piece-overlay, .floor-svg.see-through .marker-chimney,
.floor-svg.see-through .marker-stack, .floor-svg.see-through .carve, .floor-svg.see-through .soffit,
.floor-svg.see-through .outdoor, .floor-svg.see-through .unfinished { fill-opacity: 0.7; }

/* sticky notes (2026-10-04): the Note tool's cursor, the color menu, the Piece panel and the print column */
.canvas-area.noting .floor-svg { cursor: copy; }
.sticky-color-menu { min-width: 150px; }
.sticky-color-menu .ctx-item { justify-content: flex-start; gap: 8px; }
.sticky-color-menu .ctx-item.on { font-weight: 600; }
.sticky-color-menu .swatch { display: inline-block; width: 16px; height: 12px; border: 1px solid; border-radius: 3px; }
.sticky-props textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; }
.sticky-colors { display: flex; gap: 6px; align-items: center; margin: 6px 0; }
.sticky-colors .swatch-btn { width: 22px; height: 18px; border: 1px solid; border-radius: 4px; cursor: pointer; padding: 0; }
.sticky-colors .swatch-btn.on { outline: 2px solid #ff6a00; outline-offset: 1px; }
.print-stickies { font-size: 7.5pt; line-height: 1.25; color: #111; overflow: hidden; }
.print-stickies h5 { margin: 0 0 0.03in; font-size: 8pt; }
.print-stickies ol { margin: 0; padding-left: 0.2in; }
.print-stickies li { margin: 0 0 0.02in; break-inside: avoid; }
.print-stickies li.done { color: #777; }
.print-stickies .more { font-style: italic; color: #555; margin: 0.02in 0 0; }
.print-stickies.below { width: 100%; max-width: 10.2in; columns: 3; column-gap: 0.25in; }
.print-mid.with-stickies { width: 100%; max-width: 10.2in; justify-content: flex-start; align-items: flex-start; gap: 0.2in; }

/* the Piece panel's warnings block (2026-10-05): a hide control per soft row, the item's hidden ones under it */
.prop-warns li { display: flex; align-items: flex-start; gap: 6px; }
.prop-warns li .pw-text { flex: 1; min-width: 0; }
.prop-warns li .w-hide { flex: none; }
.prop-warns-hidden { margin-top: 6px; border-top: 1px solid #f2d3a0; padding-top: 4px; }
.prop-warns-hidden li { opacity: 0.75; }

/* Exterior tab (2026-10-05): finishes, the window schedule, schemes; the pitch presets on the Roof tab */
.pitch-pair { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pitch-pair .num { width: 64px; flex: none; }
.pitch-pair select { min-width: 0; flex: 1; max-width: 100%; }
.ext-stone-area.on { color: #6b4f2a; }
.sched-scroll { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); }
.sched-scroll.wide { max-height: 72vh; overflow: auto; }
table.sched { border-collapse: collapse; font-size: 12px; width: 100%; }
table.sched th, table.sched td { padding: 2px 4px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: middle; }
table.sched th { position: sticky; top: 0; background: #f6f7f9; font-weight: 600; }
table.sched td.c { text-align: center; }
table.sched .sched-num { width: 54px; }
table.sched select { font-size: 12px; max-width: 110px; }
table.sched .sched-room { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
/* Style mode's Windows group (2026-10-05 polish): the rows grouped by face under a heading row */
table.sched tr.sched-face td { background: #eef2f8; font-weight: 600; padding-top: 6px; }
table.sched .sched-where { max-width: 260px; }
.dlg.dlg-sched { width: min(1180px, 96vw); max-height: 94vh; }
.dlg-sched table.sched .sched-room { max-width: none; }
.dlg.dlg-scheme { width: min(720px, 96vw); max-height: 90vh; }
.scheme-scroll { max-height: 62vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; }
.scheme-list { margin: 0; padding-left: 18px; font-size: 13px; }
.scheme-list > li { margin-bottom: 6px; }
.scheme-list ul { padding-left: 16px; margin: 2px 0 0; }
.scheme-list li.muted { color: #888; }
.ext-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 10px; }
.ext-grid .field { min-width: 0; }
.ext-grid select, .ext-grid input { max-width: 100%; }

/* 2026-10-05: price chips beside every setting that feeds the price (ui.js priceChip) */
.price-chip { display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 8px; font-size: 10px; line-height: 14px; font-weight: 600; color: #2f7d4a; background: rgba(31, 122, 61, 0.10); border: 1px solid rgba(31, 122, 61, 0.25); cursor: help; vertical-align: middle; opacity: 0.8; }
.price-chip:hover { opacity: 1; }
/* click-to-locate (canvas.js locate): a ring pulsing three times, never taking clicks */
svg .locate-ring { fill: none; stroke: #ff6a00; stroke-width: 4px; vector-effect: non-scaling-stroke; pointer-events: none; opacity: 0; animation: locate-pulse 0.65s ease-in-out 3; }
@keyframes locate-pulse { 0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 0; } }
.sched-room.locatable { cursor: pointer; }
.sched-room.locatable:hover span:first-child { text-decoration: underline; }
/* the Rates tab: a changed rate's reset control; clamp notes beside a field */
.rate-field { display: inline-flex; align-items: center; gap: 3px; }
.rate-field.changed input { border-color: var(--accent); }
.btn.rate-reset { padding: 0 4px; font-size: 10px; }
.field-with-note { display: flex; flex-direction: column; gap: 2px; }
.clamp-note { font-size: 11px; }
tr.sched-note td { padding-top: 0; }

/* ---- the canvas mode switch and the Elevation canvas (2026-10-05, js/elevcanvas.js) ---- */
.topbar .group.seg { gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg-btn { border: 0; border-right: 1px solid var(--line); background: #fff; padding: 4px 9px; font-size: 12px; cursor: pointer; line-height: 1.2; }
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { background: #f0f3f8; }
.seg-btn.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg.pinned .seg-btn.on { box-shadow: inset 0 -2px 0 var(--accent); }
.elev-nav { position: absolute; top: 6px; left: 8px; right: 8px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none; }
.elev-nav .btn { pointer-events: auto; background: rgba(255,255,255,0.96); white-space: nowrap; }
.elev-name { display: flex; flex-direction: column; align-items: center; background: rgba(255,255,255,0.92); border: 1px solid var(--line); border-radius: 4px; padding: 2px 10px; font-size: 12px; text-align: center; }
.elev-name .elev-seen { color: var(--muted); font-size: 11px; }
svg .elev-bg { fill: #e9ecf0; }
/* the Elevation canvas fills its frame (the dialog's .elev-svg is height: auto), so the fitted sheet sits centered (2026-10-05, stage 5) */
.elev-wrap .elev-svg { height: 100%; }
svg .elev-sel { fill: rgba(255,106,0,0.10); stroke: #ff6a00; stroke-width: 2px; vector-effect: non-scaling-stroke; pointer-events: none; }
svg .elev-hover { fill: none; stroke: #1c4e9e; stroke-width: 1.5px; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; pointer-events: none; }
svg .elev-handle { fill: #fff; stroke: #ff6a00; stroke-width: 2px; vector-effect: non-scaling-stroke; }
svg .elev-label { fill: #d9480f; font-weight: 700; text-anchor: middle; paint-order: stroke; stroke: #fff; font-family: "Segoe UI", Arial, sans-serif; pointer-events: none; }
svg .elev-measure { stroke: #d9480f; stroke-width: 2px; vector-effect: non-scaling-stroke; pointer-events: none; }
svg .elev-measure-dot { fill: #d9480f; pointer-events: none; }
svg .elev-error { fill: var(--over); }
.ctx-menu .ctx-sep { height: 1px; background: var(--line); margin: 3px 4px; }
@keyframes flash-row { 0% { background: #ffd9b3; } 100% { background: transparent; } }
.flash-row { animation: flash-row 1.8s ease-out 1; }

/* block shells (2026-10-05, stage 1): the Shell tab's Blocks group */
.block-card { border: 1px solid #d6dae0; border-radius: 6px; padding: 8px 10px; margin: 8px 0; background: #fafbfc; }
.block-card.wing { border-left: 3px solid #1f6feb; }
.block-card.add { border-style: dashed; }
.block-card.notch { border-left: 3px solid #8a8f98; background: #fff; }
.block-card.notch.bad { border-left-color: #d9480f; }
.block-card .notch-head { margin-top: 8px; font-size: 12px; }
.block-card .warn-text { color: #a33a00; }
.block-card .wing-name { width: 100%; min-width: 0; }
.block-card select { max-width: 100%; }

/* Style mode (block shells stage 5, 2026-10-05, js/stylemode.js): the elevation and one Style panel; the floor tabs, the
   floor views, the plan-only tools, the library and the tab strip are hidden */
.style-toggle.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
body.style-mode #floor-tabs, body.style-mode #view-btns, body.style-mode #right-tabs, body.style-mode .side.left { display: none; }
/* the plan-only toolbar items and the floor cards under the canvas (2026-10-05 polish): Undo / Redo, Fit, zoom, labels,
   guides and the exports stay */
body.style-mode #tools, body.style-mode #snap, body.style-mode #zoom .plan-only, body.style-mode #totals { display: none; }
body.style-mode .layout { grid-template-columns: 1fr 6px var(--right-w); }
@media (max-width: 900px) { body.style-mode .layout { grid-template-columns: 1fr; } }
#tab-style { padding-bottom: 0; }
.style-head { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; margin-bottom: 8px; border-left: 3px solid var(--accent); background: #f4f7fc; border-radius: 4px; }
.style-head .style-save { color: var(--text); }
.style-compare { margin-bottom: 6px; }
.style-compare select { max-width: 100%; }
.style-chips { display: flex; flex-wrap: wrap; gap: 3px; margin: 4px 0 8px; }
.style-group { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 10px; scroll-margin-top: 4px; }
.style-group-head { font-size: 14px; margin: 2px 0 4px; display: flex; align-items: center; gap: 8px; }
.style-sel .style-selected { border: 1px solid #d6dae0; border-radius: 6px; padding: 6px 8px; background: #fffdf6; }
.style-porch .row { flex-wrap: wrap; }
.style-price { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 12px -10px 0; padding: 8px 12px; background: #24292f; color: #fff; z-index: 2; }
.style-price-total { font-size: 18px; font-weight: 700; }
.style-price-delta { font-size: 12px; color: rgba(255,255,255,0.85); }
.style-price.up .style-price-delta { color: #ffb4a8; }
.style-price.down .style-price-delta { color: #a6e3b0; }
.elev-compare { pointer-events: none; mix-blend-mode: multiply; opacity: 0.9; }
.elev-compare-tag { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 3px 8px; font-size: 12px; color: #0b4fa8; background: rgba(255,255,255,0.94); border: 1px solid #b9cdea; border-radius: 4px; pointer-events: none; }

/* Budget first (2026-10-08): the solver block on the Price tab */
details.bf { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; margin: 10px 0; background: #fff; }
details.bf > summary { cursor: pointer; font-size: 12px; list-style: none; }
details.bf > summary::-webkit-details-marker { display: none; }
details.bf > summary::before { content: "\25B8"; color: var(--muted); font-size: 11px; margin-right: 6px; }
details.bf[open] > summary::before { content: "\25BE"; }
.bf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px 10px; margin: 8px 0; }
.bf-cell { display: flex; flex-direction: column; gap: 2px; }
.bf-label { font-size: 10px; text-transform: uppercase; color: var(--muted); }
.bf-cell input.num.tiny { width: 100%; }
.bf-cell select.tiny { width: 100%; }
.bf-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; margin: 4px 0 8px; }
.bf-chk { display: inline-flex; align-items: center; gap: 4px; }
.bf-result { border-left: 3px solid var(--accent); padding: 4px 10px; margin: 8px 0; font-size: 12px; }
.bf-result .big { font-size: 18px; font-weight: 700; }
