/* Colours are tokens only, defined for both themes here. No hex in rules or templates. */
:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --text: #1d1f21;
  --muted: #6b6f73;
  --line: #d8d8d2;
  --accent: #2f6f8f;
  /* Drawing: measured vs estimated vs unknown dimensions must read differently. */
  --dim-measured: #1d1f21;
  --dim-estimated: #b26a00;
  --dim-unknown: #b3261e;
  /* The Staging badge (#987): loud on purpose. */
  --badge-staging-bg: #b26a00;
  --badge-staging-text: #ffffff;
  --chip-bg: #dbe7ed;
  --chip-text: #1f5068;
  --shadow: rgba(0, 0, 0, 0.12);
  --scrim: rgba(0, 0, 0, 0.32);
  --danger: #b3261e;

  /* The drawing is a blueprint in both themes (decision 2026-11-06-blueprint-drawing-calm-chrome). */
  --plan-ground: #17488c;
  --plan-room: #1a4d94;
  --plan-grid: #225aa3;
  --plan-grid-major: #3068b3;
  --plan-line: #f2f7fd;
  --plan-muted: #b9cfe9;
  --plan-fixture: rgba(242, 247, 253, 0.06);
  --plan-counter: #305e9f; /* solid, so a countertop can cover the lines between its pieces (#154) */
  --plan-estimated: #ffc35a;
  --plan-unknown: #ffb3aa;
  --plan-selection: #7fe3ff;
  --plan-selection-fill: rgba(127, 227, 255, 0.15);
  --plan-chalk: #fffdf2;
  --plan-chalk-wash: rgba(255, 253, 242, 0.22);
  --plan-changed: #8ff0b4;
  --plan-snapped: #c2f78f; /* where a drag or Move will land: lighter and yellower than --plan-changed's mint */
  --plan-snapped-wash: rgba(194, 247, 143, 0.16);
  --plan-structural: #ff4d3d; /* beams, posts and structural fixtures; brighter and redder than --plan-unknown's pink */
  /* The move pill (#352): a solid card over the blueprint, white in light mode and near-black in dark. */
  --pill-bg: #ffffff;
  --pill-text: #15181d;
  --pill-label: #5b616b;
  --pill-line: #e3e6ea;
  --pill-chip: #eef0f3;
  --pill-accent: #1d5fc9;
  --pill-estimated: #a65f00;
  --pill-unknown: #b3261e;
  --pill-change: #1e7a43;
  --pill-flag: #c62828;
  --pill-shadow: rgba(0, 0, 0, 0.28);
  /* The toast (#636): dark in both themes, so it reads over the plan, the panel and the chat. */
  --toast-bg: #1d2330;
  --toast-text: #f3f4f6;
  --toast-accent: #7fe3ff;
  --toast-warn: #ffc35a;
  --toast-flag: #ff8a80;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141517;
    --surface: #1c1e21;
    --text: #e6e6e3;
    --muted: #9a9ea3;
    --line: #34373b;
    --accent: #7fb6d3;
    --dim-measured: #e6e6e3;
    --dim-estimated: #f0a742;
    --dim-unknown: #f2827a;
    --badge-staging-bg: #f0a742;
    --badge-staging-text: #141517;
    --chip-bg: rgba(127, 182, 211, 0.18);
    --chip-text: #a9d3e8;
    --shadow: rgba(0, 0, 0, 0.4);
    --scrim: rgba(0, 0, 0, 0.55);
    --danger: #f2827a;
    --pill-bg: #15181d;
    --pill-text: #f3f4f6;
    --pill-label: #a3acb9;
    --pill-line: #2a2f37;
    --pill-chip: #2a2f37;
    --pill-accent: #7fe3ff;
    --pill-estimated: #ffc35a;
    --pill-unknown: #ffb3aa;
    --pill-change: #8ff0b4;
    --pill-flag: #ff6b5e;
    --pill-shadow: rgba(0, 0, 0, 0.45);
    --toast-bg: #2a2f37;
    --toast-text: #f3f4f6;
    --toast-accent: #7fe3ff;
    --toast-warn: #ffc35a;
    --toast-flag: #ff8a80;
  }
}

@font-face { font-family: "Patrick Hand SC"; font-weight: 400; font-display: swap; src: url("fonts/PatrickHandSC-400.woff2") format("woff2"); }

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.site-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand { color: var(--text); font-weight: 600; text-decoration: none; }

.site-badge {
  display: inline-block;
  margin: 0 0 0 0.5rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--badge-staging-bg);
  color: var(--badge-staging-text);
  font-size: 0.8rem;
  font-weight: 600;
}
p.site-badge { margin: 0 0 1rem; }

main { padding: 1rem; max-width: 60rem; margin: 0 auto; }

h1 { font-size: 1.4rem; margin: 0.5rem 0 1rem; }

a { color: var(--accent); }

.empty { color: var(--muted); }

.site-list { padding-left: 1.2rem; }

.hand { font-family: "Patrick Hand SC", cursive; font-weight: 400; }
.muted { color: var(--muted); }
.site-list li { margin: 0.25rem 0; }
.meta { color: var(--muted); font-size: 0.9rem; }
.rev-list { list-style: none; padding: 0; }
.rev-list li { padding: 0.4rem 0; border-bottom: 1px solid var(--line); }

/* --- Properties (#112) ---------------------------------------------------------------------- */

.props-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.props-head h1 { flex: 1; }
.archived-link { min-height: 44px; display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; text-decoration: none; }
.archived-link svg, .prop-add svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.prop-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, calc(50% - 0.4rem)), 1fr)); gap: 0.75rem; }
.prop-tile { position: relative; min-height: 12rem; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.prop-link:focus-visible, .prop-thumb:focus-visible, .prop-add:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.prop-thumb { flex: none; height: 6.5rem; display: block; background: var(--plan-ground); border-radius: 11px 11px 0 0; overflow: hidden; }
.prop-thumb svg { width: 100%; height: 100%; display: block; }
.prop-thumb-empty { height: 100%; display: flex; align-items: center; justify-content: center; background: var(--bg); color: var(--muted); font-size: 0.8rem; }
span.prop-thumb.prop-thumb-empty { height: 6.5rem; }
.prop-link { flex: 1; padding: 0.6rem 2.9rem 0.6rem 0.75rem; display: flex; flex-direction: column; gap: 0.1rem; color: var(--text); text-decoration: none; border-radius: 0 0 11px 11px; }
.prop-name { font-size: 0.95rem; font-weight: 600; line-height: 1.25; }
.prop-link .meta { font-size: 0.75rem; }
.prop-details { margin-top: auto; padding-top: 0.3rem; display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: 0.85rem; font-weight: 600; }
.prop-details svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.first-floor { margin: 0.25rem 0 0; padding: 0.75rem; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 0.6rem; }
.first-floor legend { padding: 0 0.3rem; font-weight: 600; }
.size-row { display: flex; align-items: flex-end; gap: 0.5rem; }
.size-row label { flex: 1; min-width: 0; }
.size-row .times { padding-bottom: 0.7rem; color: var(--muted); }
.sure-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.dv-form .chip-radio, .chip-radio { min-height: 44px; padding: 0 0.9rem; display: inline-flex; flex-direction: row; align-items: center; gap: 0.4rem; border: 1px solid var(--line); border-radius: 22px; }
.tile-menu-items form { margin: 0; display: flex; flex-direction: column; }
.archived-banner { margin: 0 0 1rem; padding: 0.5rem 0.5rem 0.5rem 0.85rem; display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-left-width: 1px; border-radius: 10px; font-size: 0.9rem; }
.archived-banner span { flex: 1; min-width: 12rem; }
.archived-banner form { margin: 0; }
.archived-banner .btn-quiet { width: auto; min-height: 44px; padding: 0 1rem; }
.archived-list { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.archived-row { padding: 0.75rem; display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.archived-name { flex: 1; min-width: 10rem; display: flex; flex-direction: column; gap: 0.15rem; color: var(--text); text-decoration: none; }
.archived-row form { margin: 0; }
.archived-row .btn-quiet { width: auto; min-height: 44px; padding: 0 1.1rem; }
.tile-menu { position: absolute; right: 2px; bottom: 0.45rem; }
.tile-menu summary { list-style: none; cursor: pointer; color: var(--muted); border-radius: 22px; }
.tile-menu summary::-webkit-details-marker { display: none; }
.tile-menu summary svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.tile-menu[open] summary { background: var(--bg); color: var(--text); }
.tile-menu-items { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 10.5rem; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px var(--shadow); display: flex; flex-direction: column; }
.tile-menu-items a, .tile-menu-items button { min-height: 44px; padding: 0 10px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 0.95rem; text-decoration: none; text-align: left; cursor: pointer; }
.tile-menu-items a:hover, .tile-menu-items button:hover { background: var(--bg); }
.tile-menu-items svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.prop-add-tile { background: none; border: 2px dashed var(--line); }
.prop-add { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; font-weight: 600; text-decoration: none; border-radius: 10px; }
.prop-add svg { width: 28px; height: 28px; }
@media (min-width: 48rem) {
  .prop-thumb, span.prop-thumb.prop-thumb-empty { height: 8rem; }
  .prop-tile { min-height: 13.5rem; }
}

/* --- Floor View --------------------------------------------------------------------------- */

body.floor-view { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.floor-view .site-header { display: none; }
.floor-view main { width: 100%; flex: 1; min-height: 0; max-width: none; padding: 0; display: flex; flex-direction: column; }

.fv-header {
  flex: none; display: flex; align-items: center; gap: 0.25rem; min-height: 56px; padding: 0 0.5rem 0 0.15rem;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.fv-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.fv-title .sub { font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fv-title h1 { margin: 0; font-size: 1.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  flex: none; width: 44px; height: 44px; border: 0; background: none; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; border-radius: 22px; text-decoration: none;
}
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: var(--bg); }
.icon-btn:disabled { color: var(--muted); opacity: 0.5; background: none; cursor: default; }
.undo-slot { display: contents; }
@media (max-width: 420px) {
  .fv-header .icon-btn { width: 38px; }
  .rev-select { max-width: 5.5rem; min-width: 4rem; } /* room for Undo and Redo (#304); still shows "Rev 12" */
  .fv-title { min-width: 5rem; } /* room for the Plans chip (#166), next to Undo and Redo (#304) */
  /* Room for the title next to History (#11): downloading is a desktop job. */
  .fv-header #download-link { display: none; }
}
.rev-select {
  flex: 0 1 auto; min-width: 0; max-width: 9.5rem; height: 32px; border: 1px solid var(--line); border-radius: 16px; padding: 0 0.6rem;
  background: var(--surface); color: var(--text); font: inherit; font-size: 0.8rem;
}

.fv-body { flex: 1; min-height: 0; position: relative; display: flex; }
.plan-area { flex: 1; min-width: 0; position: relative; background: var(--plan-ground); overflow: hidden; touch-action: none; }
.plan-area > svg { width: 100%; height: 100%; display: block; cursor: grab; user-select: none; -webkit-user-select: none; }
.plan-area > svg.dragging { cursor: grabbing; }
.plan-area > svg.space-pan .el { cursor: inherit; }

/* Overlays on the blueprint: they use the plan tokens, not the chrome. */
.plan-overlay { position: absolute; color: var(--plan-line); font-family: "Patrick Hand SC", cursive; letter-spacing: 0.06em; }
.north-arrow { top: 10px; right: 10px; width: 44px; height: 44px; border: 1px solid var(--plan-line); border-radius: 22px; display: flex; align-items: center; justify-content: center; background: var(--plan-ground); }
.north-arrow svg { width: 28px; height: 28px; }
.north-arrow path { fill: var(--plan-line); }
.north-arrow text { fill: var(--plan-line); font: 400 8px "Patrick Hand SC", cursive; text-anchor: middle; }
.title-block { left: 10px; bottom: 10px; display: flex; align-items: stretch; border: 1px solid var(--plan-line); background: var(--plan-ground); font-size: 0.75rem; text-transform: uppercase; max-width: calc(100% - 80px); }
.title-block > span { padding: 3px 7px; border-right: 1px solid var(--plan-line); white-space: nowrap; display: flex; align-items: center; }
.title-block > span:last-child { border-right: 0; }
.title-block .tb-name { font-family: "Patrick Hand SC", cursive; font-size: 0.85rem; letter-spacing: 0; text-transform: none; overflow: hidden; text-overflow: ellipsis; }
.scale-bar { gap: 5px; }
.scale-bar i { display: inline-block; height: 5px; border: 1px solid var(--plan-line); border-top: 0; }
.plan-tools { right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.plan-tools button, .plan-tools a {
  width: 44px; height: 44px; border: 1px solid var(--plan-line); border-radius: 20px; background: var(--plan-ground);
  color: var(--plan-line); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; text-decoration: none;
}
.plan-tools svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Drawing tools (#249): Select, Wall, Measure, under the north arrow. */
.draw-tools { right: 10px; top: 64px; display: flex; flex-direction: column; gap: 6px; }
.draw-tools button {
  width: 44px; height: 44px; border: 1px solid var(--plan-line); border-radius: 20px; background: var(--plan-ground);
  color: var(--plan-line); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.draw-tools button[aria-pressed="true"] { background: var(--plan-line); color: var(--plan-ground); }
.draw-tools button:disabled { opacity: 0.4; cursor: default; }
.draw-tools button:focus-visible { outline: 2px solid var(--plan-selection); outline-offset: 2px; }
.draw-tools svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tool-readout {
  padding: 6px 12px; background: var(--plan-ground); color: var(--plan-line); font-family: "Patrick Hand SC", cursive; letter-spacing: 0.06em;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 10px; align-items: baseline; font-size: 1rem;
}
.tool-readout[hidden] { display: none; }
.tool-readout b { font-weight: 400; font-size: 1.15rem; }
.tool-readout b.conf-estimated { color: var(--plan-estimated); }
.tool-readout b.conf-unknown { color: var(--plan-unknown); }
.tool-readout b.conf-designed { color: var(--plan-chalk); }
.tool-readout .readout-note { color: var(--plan-muted); font-size: 0.8rem; }
.plan-svg.drawing { cursor: crosshair; }
.tool-layer { pointer-events: none; }
.tool-layer * { vector-effect: non-scaling-stroke; }
.tool-layer .snap-mark { fill: none; stroke: var(--plan-selection); }
.tool-layer .measure-line { stroke: var(--plan-selection); stroke-linecap: round; }
.tool-layer .measure-line.conf-estimated { stroke-dasharray: 8 5; }
/* Previews are crisp and dashed, no chalk wobble (#727; decision 2026-11-22-crisp-dashed-previews). */
.tool-layer .wall-preview { fill: var(--plan-chalk-wash); stroke: var(--plan-chalk); stroke-dasharray: 6 4; }
/* Drawn from a railing or half wall, the preview carries on as one (decision 2026-11-14-walls-drawn-from-an-end-keep-their-type). */
.tool-layer .wall-preview.kind-railing { fill: none; }
.tool-layer .wall-preview.kind-half-wall { fill: var(--plan-muted); }
.wall-sheet {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.5rem 0.75rem; padding: 0.5rem 1rem 1rem; background: var(--surface); color: var(--text); font-size: 0.9rem;
}
.wall-sheet[hidden] { display: none; }
.wall-sheet > label[for] { font-weight: 600; }
.wall-sheet input[type="text"] { width: 8rem; min-height: 40px; padding: 0 0.6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 1rem; }
.wall-measured { display: inline-flex; align-items: center; gap: 0.35rem; }
.wall-from { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; }
.wall-from[hidden] { display: none; }
.wall-from label { display: flex; flex-direction: column; gap: 0.2rem; font-weight: 600; font-size: 0.8rem; }
.tool-layer .wall-ghost { stroke-dasharray: 4 3; opacity: 0.7; }
.tool-layer .tool-dim .dim-text { stroke: var(--plan-ground); stroke-width: 4px; paint-order: stroke; }
.wall-note { flex-basis: 100%; margin: 0; font-size: 0.8rem; color: var(--muted); }
.wall-error { flex-basis: 100%; margin: 0; color: var(--danger); font-size: 0.85rem; }
.wall-actions { margin-left: auto; display: flex; gap: 0.5rem; }
.room-ask { flex-basis: 100%; margin: 0; }
.room-sheet input[type="text"] { width: 12rem; }
.tool-layer .room-preview { fill: var(--plan-chalk-wash); stroke: var(--plan-chalk); stroke-dasharray: 6 4; }
/* Drag handles on the selected element (epic #310): screen-sized, finger-sized targets. */
.handle-layer .drag-handle { cursor: grab; }
.handle-layer .handle-hit { fill: transparent; stroke: none; }
.handle-layer .handle-mark { fill: var(--plan-ground); stroke: var(--plan-selection); vector-effect: non-scaling-stroke; stroke-linecap: round; }
.handle-layer .handle-middle .handle-mark { stroke: var(--plan-selection); }
.handle-layer .locked .handle-mark { fill: var(--plan-ground); stroke-dasharray: 3 2; }
.handle-layer .drag-lock rect { fill: var(--plan-selection); }
.handle-layer .drag-lock path { fill: none; stroke: var(--plan-selection); vector-effect: non-scaling-stroke; }
/* Drag and Move: where the edit will land, snapped, in light green; the offset puts its dashes in the white ghost's
   gaps, so both still show where they line up. */
.tool-layer .drag-follow { fill: var(--plan-snapped-wash); stroke: var(--plan-snapped); stroke-dasharray: 6 4; stroke-dashoffset: 5; }
.tool-readout a { color: var(--plan-line); }
.focus-exit { top: 10px; left: 10px; min-height: 36px; padding: 0 12px; border: 1px solid var(--plan-line); border-radius: 18px; background: var(--plan-ground); color: var(--plan-line); font-family: system-ui, -apple-system, sans-serif; letter-spacing: 0; font-size: 0.85rem; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.focus-exit svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.focus-exit:focus-visible { outline: 2px solid var(--plan-selection); outline-offset: 2px; }
.history-note { bottom: 48px; left: 10px; right: 64px; padding: 4px 8px; border: 1px dashed var(--plan-line); background: var(--plan-ground); font-size: 0.8rem; }
.history-note a { color: var(--plan-line); }

/* Inspector (#298): a sheet over the bottom of the plan on phones, the top of the side column on desktop.
   Layers and Plans: a bottom sheet on phones, a floating card on wider screens. Calm chrome, never blueprint. */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 60%; }
.inspector { position: relative; }
.inspector, .sheet {
  overflow: auto; z-index: 2;
  background: var(--surface); color: var(--text); border-radius: 16px 16px 0 0; box-shadow: 0 -4px 18px var(--shadow);
  padding: 0.5rem 1rem 1rem;
}
.inspector[hidden], .sheet[hidden] { display: none; }
.inspector .grip, .sheet .grip { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 0.5rem; }
.inspector header, .sheet header { display: flex; align-items: flex-start; gap: 0.5rem; }
.inspector h2, .sheet h2 { margin: 0; font-size: 1.4rem; }
.inspector .kind { font-size: 0.85rem; color: var(--muted); }
.inspector dl { margin: 0.75rem 0 0; display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.45rem 0.75rem; font-size: 0.9rem; }
.inspector dt { color: var(--muted); }
.inspector dd { margin: 0; }
.inspector-actions { display: flex; gap: 8px; margin: 0 0 0.75rem; }
.inspector .tag { font-size: 0.75rem; color: var(--muted); margin-left: 0.25rem; }
.inspector .mono { font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; }
.v-estimated { color: var(--dim-estimated); }
.v-unknown { color: var(--dim-unknown); }

/* Plans (#166): the chip in the header, the Plans sheet, the draft bar and the draft pages. */
.plans-chip { align-self: flex-start; max-width: 100%; display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; font: inherit; color: var(--muted); cursor: pointer; }
.plans-chip svg { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.plans-chip.in-draft { color: var(--text); padding: 0 6px; font-family: "Cabin Sketch", cursive; border: 1px dashed var(--muted); border-radius: 10px; }
.plan-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.plan-list li { display: flex; align-items: center; gap: 6px; min-height: 52px; padding: 0 4px 0 12px; border: 1px solid var(--line); border-radius: 10px; position: relative; }
.plan-list li.current { border: 2px solid var(--accent); }
.plan-list li > a:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 6px 0; color: var(--text); text-decoration: none; }
.plan-list .pl-name { font-size: 1rem; font-weight: 600; }
.plan-list .pl-name.hand { font-weight: 400; }
.plan-list .meta { font-size: 0.8rem; }
.pl-menu summary { list-style: none; cursor: pointer; }
.pl-menu summary::-webkit-details-marker { display: none; }
.pl-menu svg circle { fill: currentColor; }
.pl-actions { position: absolute; right: 4px; top: calc(100% - 4px); z-index: 3; min-width: 11rem; padding: 4px 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 18px var(--shadow); }
.pl-actions a { min-height: 44px; padding: 0 14px; display: flex; align-items: center; color: var(--text); text-decoration: none; }
.pl-actions a.danger { color: var(--danger); }
.draft-bar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface); border-bottom: 1px dashed var(--muted); }
.draft-bar .db-text { flex: 1 1 14rem; min-width: 0; display: flex; flex-direction: column; }
/* The buttons stay together and drop under the name when the bar is narrow (the desktop side column, a phone). */
.draft-bar .db-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.draft-bar .db-name { font-size: 1.05rem; }
.draft-bar .meta { font-size: 0.8rem; }
@media (max-width: 420px) { .title-block:has(.tb-draft) .tb-name { display: none; } }
.title-block .tb-draft { font-family: "Cabin Sketch", cursive; letter-spacing: 0; text-transform: none; }
.scope-pick { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.scope-pick legend { padding: 0; margin-bottom: 4px; font-size: 0.85rem; color: var(--muted); }
.room-picks { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 6px 1.6rem; }
.hist-plans { margin: 0.5rem 0; flex-wrap: wrap; }
.st-draft { border-style: dashed; }
.promote-rows { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 10px; }
.promote-rows li { padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 0.9rem; overflow-wrap: anywhere; }
.promote-rows li:last-child { border-bottom: 0; }
.promote-check { margin: 0; padding: 8px 12px; border-radius: 10px; font-size: 0.9rem; border: 1px solid var(--line); }
.promote-check.conflict { border-color: var(--danger); }
.promote-check.conflict ul { margin: 0.25rem 0; padding-left: 1.2rem; }
.draft-form .form-foot { display: flex; gap: 10px; justify-content: flex-end; align-items: center; }

/* Layers sheet: switches and the legend. */
.sheet h3 { margin: 1rem 0 0.25rem; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.layer-list { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.layer-list label { display: flex; align-items: center; justify-content: space-between; min-height: 44px; border-bottom: 1px solid var(--line); cursor: pointer; }
.layer-list input { appearance: none; -webkit-appearance: none; flex: none; width: 42px; height: 24px; margin: 0; border-radius: 12px; background: var(--line); position: relative; cursor: pointer; transition: background 0.15s; }
.layer-list input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 9px; background: var(--surface); transition: transform 0.15s; }
.layer-list input:checked { background: var(--accent); }
.layer-list input:checked::after { transform: translateX(18px); }
.layer-list input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.legend { list-style: none; margin: 0.25rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem 0.75rem; font-size: 0.85rem; }
.legend li { display: flex; align-items: center; gap: 0.5rem; }
.legend svg { flex: none; width: 44px; height: 18px; border-radius: 4px; background: var(--plan-ground); }

/* Layers and Plans are menus (#621): a card dropped from the top right on every width, never a bottom sheet. */
.sheet { left: auto; right: 8px; top: 8px; bottom: auto; width: min(22rem, calc(100% - 16px)); max-height: calc(100% - 16px); border-radius: 12px; box-shadow: 0 4px 18px var(--shadow); }
.sheet .grip { display: none; }
@media (min-width: 760px) {
  .sheet { right: 64px; top: 12px; max-height: calc(100% - 24px); }
}

/* The panel (#621, decision 2026-11-20-one-panel-at-a-time): the tool readout, the tools' sheets and the inspector,
   one at a time, in the side column: under the plan on phones (so the plan shrinks instead of being covered),
   at the top of the column on desktop. The chat stays beside it, since the selection informs the chat (#638). */
.fv-panel { display: flex; flex-direction: column; min-height: 0; }
.fv-panel:not(:has(> :not([hidden]))) { display: none; }
.fv-panel > .inspector, .fv-panel > .wall-sheet { overflow: auto; }
@media (max-width: 1023px) {
  .fv-panel { max-height: 45dvh; border-radius: 16px 16px 0 0; box-shadow: 0 -4px 18px var(--shadow); background: var(--surface); overflow: hidden; }
  .fv-panel > .inspector, .fv-panel > .wall-sheet { flex: 0 1 auto; min-height: 0; border-radius: 0; box-shadow: none; }
  .fv-panel > .tool-readout:first-child { border-radius: 16px 16px 0 0; }
  /* While dragging, the panel drops to its readout. */
  body.plan-dragging .fv-panel > :not(.tool-readout) { display: none; }
  .fv-panel:has(.edit-form) { max-height: 55dvh; }
  /* A short plan keeps its tools: zoom is a pinch on a phone, so its buttons step aside while a panel is open. */
  .fv-work:has(.fv-side.panel-open) .plan-tools { display: none; }
}
/* Every sheet's main button is filled, so it stands apart from Cancel (#651). */
.btn-sm[data-sheet-role="primary"] { background: var(--accent); color: var(--surface); }
.btn-sm[data-sheet-role="primary"]:disabled { opacity: 0.5; }
.btn-sm.btn-edit { gap: 0.35rem; min-height: 44px; }
.btn-edit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ef-est-hint { margin: 0 0 0.5rem; }
/* Sheet layout (#622): title on the left, Close at the top right; the main button last in the footer, full
   width on a phone and at the right on desktop, with Cancel or Reset just before it. */
.sheet-head { flex-basis: 100%; display: flex; align-items: center; gap: 0.5rem; }
.sheet-head h2 { flex: 1; margin: 0; font-size: 1.35rem; font-weight: 400; }
.move-head .icon-btn { order: 2; margin-left: auto; }
.move-head .move-picked { order: 3; flex-basis: 100%; }
.fv-panel .wall-actions { flex-basis: 100%; width: 100%; margin-left: 0; justify-content: flex-end; }
.fv-panel .wall-actions { position: sticky; bottom: 0; padding: 0.5rem 0 calc(0.25rem + env(safe-area-inset-bottom)); background: var(--surface); }
.fv-panel .inspector:has(.edit-form) { padding-bottom: 0; max-height: none; } /* the panel caps the height (#640) */
.fv-panel .edit-form > .edit-actions { padding-bottom: calc(0.5rem + env(safe-area-inset-bottom)); }
.move-picked button { min-width: 32px; min-height: 32px; }
@media (max-width: 1023px) {
  .wall-actions [data-sheet-role="primary"], .edit-actions [type="submit"] { flex: 1; justify-content: center; }
  .wall-actions .btn-sm, .edit-actions .btn-sm { min-height: 44px; }
}

/* Chat (#10): a sheet at peek height under the plan on phones, a column beside it on desktop. */
.fv-work { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.fv-side { flex: none; position: relative; display: flex; flex-direction: column; min-height: 0; }
.chat {
  flex: none; display: flex; flex-direction: column; min-height: 0; z-index: 3; position: relative;
  background: var(--surface); color: var(--text); border-top: 1px solid var(--line); box-shadow: 0 -4px 18px var(--shadow);
}
.chat-head { display: flex; align-items: center; gap: 0.5rem; padding: 0 0.75rem 0 0.25rem; }
.chat-toggle {
  flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 0.75rem; padding: 0 0.5rem;
  border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left;
}
.chat-toggle .grip { flex: none; width: 36px; height: 4px; border-radius: 2px; background: var(--line); }
.chat-toggle h2 { margin: 0; font-size: 1.1rem; }
.chat-log { list-style: none; margin: 0; padding: 0.5rem 1rem; display: none; flex-direction: column; gap: 0.6rem; overflow: auto; overscroll-behavior: contain; }
.chat[data-open="true"] .chat-log { display: flex; height: 40dvh; }
@media (max-width: 1023px) {
  /* On a phone the panel and the chat's input share the space under the plan; the conversation itself opens
     by folding the panel (floor.js), keeping the selection as the chat's chip (#638). */
  .fv-side.panel-open .chat[data-open="true"] .chat-log { display: none; }
}
.msg { font-size: 0.92rem; line-height: 1.45; overflow-wrap: anywhere; }
.msg-user { align-self: flex-end; max-width: 85%; padding: 0.45rem 0.75rem; border-radius: 14px 14px 4px 14px; background: var(--chip-bg); color: var(--chip-text); white-space: pre-wrap; }
.msg-agent { align-self: stretch; }
.msg-agent p { margin: 0 0 0.45rem; white-space: pre-wrap; }
.msg-working { color: var(--muted); font-style: italic; }
.msg-note { align-self: center; color: var(--muted); font-size: 0.85rem; text-align: center; }
.chat-error, .change-error { margin: 0.35rem 0 0; color: var(--danger); font-size: 0.85rem; }
.change-card {
  display: flex; flex-direction: column; gap: 0.45rem; margin: 0.45rem 0; padding: 0.55rem 0.7rem;
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; background: var(--bg);
}
.change-main { display: flex; gap: 0.5rem; align-items: baseline; }
.change-rev { flex: none; font-family: ui-monospace, Menlo, monospace; font-size: 0.8rem; font-weight: 600; }
.change-summary { min-width: 0; }
.change-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.change-undone { font-size: 0.8rem; color: var(--muted); }
.change-card.is-undone { border-left-color: var(--line); }
.change-card.is-undone .change-summary { text-decoration: line-through; color: var(--muted); }
.btn-ghost { border-color: var(--line); color: var(--text); }
.turn-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.5rem; margin: 0.45rem 0 0; font-size: 0.75rem; }
.model-chip { margin-left: 0; }
.chat-form { padding: 0.4rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom)); }
.chat[data-open="true"] .chat-form { border-top: 1px solid var(--line); }
.chat[data-open="false"] #chat-new { display: none; }
.chat-off { margin: 0 0 0.4rem; font-size: 0.8rem; color: var(--muted); }
.chat-chip {
  display: inline-flex; align-items: center; gap: 0.25rem; max-width: 100%; margin: 0 0 0.4rem; padding: 0 0 0 0.6rem;
  border-radius: 999px; background: var(--chip-bg); color: var(--chip-text); font-size: 0.8rem; font-weight: 600;
}
.chat-chip[hidden] { display: none; }
.chat-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-chip button { flex: none; width: 32px; height: 28px; border: 0; background: none; color: inherit; font-size: 1.1rem; cursor: pointer; }
.chat-input { display: flex; align-items: flex-end; gap: 0.5rem; }
.chat-input textarea {
  flex: 1; min-width: 0; min-height: 44px; max-height: 120px; resize: none; padding: 0.6rem 0.9rem; font: inherit; font-size: 1rem;
  line-height: 1.35; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 22px;
}
.chat-input textarea:disabled { opacity: 0.6; }
.chat-send {
  flex: none; width: 44px; height: 44px; border: 0; border-radius: 22px; background: var(--accent); color: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.chat-send:disabled { background: var(--line); color: var(--muted); cursor: default; }
.chat-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chat-brain {
  flex: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 22px; background: var(--bg); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.chat-brain[aria-pressed="true"] { background: var(--chip-bg); color: var(--chip-text); border-color: var(--accent); }
.chat-brain:disabled { opacity: 0.6; cursor: default; }
.chat-brain svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (min-width: 1024px) {
  .fv-work { flex-direction: row; }
  /* One side column (#298): the inspector on top (up to half), the draft bar, then the chat.
     Collapsed, only the Chat toggle shows; selecting something opens it (chat.js). */
  .fv-side { width: 24rem; border-left: 1px solid var(--line); background: var(--surface); }
  .fv-side:not(.panel-open):has(.chat[data-open="false"]) { width: auto; }
  .fv-panel { flex: 0 1 auto; overflow: auto; max-height: 55%; border-bottom: 1px solid var(--line); }
  .fv-panel > .inspector, .fv-panel > .wall-sheet { border-radius: 0; box-shadow: none; padding: 0.75rem 1rem 1rem; }
  .fv-panel .grip { display: none; }
  .fv-side.panel-open .chat { min-height: 0; }
  .chat { flex: 1; border-top: 0; box-shadow: none; }
  .chat-head { min-height: 48px; border-bottom: 1px solid var(--line); }
  .chat-toggle .grip { display: none; }
  .chat[data-open="true"] .chat-log { flex: 1; height: auto; }
  .chat[data-open="true"] .chat-form { margin-top: 0; }
  .chat[data-open="false"] { width: auto; }
  .chat[data-open="false"] .chat-form, .chat[data-open="false"] #chat-new { display: none; }
}

/* Change Review bar (#11, D2): calm chrome across the top of the plan. */
.review-bar {
  flex: none; display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.4rem 0.75rem; padding: 0.45rem 0.4rem 0.45rem 0.75rem; background: var(--surface); color: var(--text);
  border-bottom: 1px solid var(--line); font-size: 0.85rem;
}
.review-text { flex: 1 1 14rem; min-width: 0; display: flex; flex-wrap: wrap; gap: 0.15rem 0.5rem; align-items: baseline; }
.review-text .change-rev { color: var(--accent); }
.review-meta { flex-basis: 100%; color: var(--muted); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.review-actions form { margin: 0; }
.review-close { width: 36px; height: 36px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg a { min-height: 36px; display: inline-flex; align-items: center; padding: 0 0.7rem; color: var(--text); text-decoration: none; font-size: 0.85rem; }
.seg a[aria-current="page"] { background: var(--chip-bg); color: var(--chip-text); font-weight: 600; }

/* Revision History and a revision's diff (#11). */
.hist-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.hist-row {
  display: flex; flex-direction: column; gap: 0.25rem; padding: 0.6rem 0.75rem; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; text-decoration: none;
}
.hist-row:hover, .hist-row:focus-visible { border-color: var(--accent); }
.hist-row.is-undone .hist-summary { text-decoration: line-through; color: var(--muted); }
.hist-top { display: flex; gap: 0.5rem; align-items: baseline; }
.hist-summary { min-width: 0; overflow-wrap: anywhere; }
.hist-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; margin: 0; font-size: 0.8rem; color: var(--muted); }
.hist-request { margin: 0; font-size: 0.85rem; color: var(--muted); font-style: italic; overflow-wrap: anywhere; }
.who { font-weight: 600; color: var(--text); }
.who-agent { color: var(--accent); }
.rev-head { display: flex; flex-direction: column; gap: 0.35rem; }
.rev-head h2 { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.rev-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.diff-list { list-style: none; margin: 0.25rem 0 0; padding: 0; }
.diff-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 1rem; padding: 0.45rem 0; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.diff-what { min-width: 0; overflow-wrap: anywhere; }
.diff-vals { font-family: ui-monospace, Menlo, monospace; font-size: 0.82rem; overflow-wrap: anywhere; }
.diff-old { color: var(--muted); text-decoration: line-through; }
.diff-line { margin: 0.25rem 0; font-size: 0.88rem; }
.diff-tag { display: inline-block; padding: 0 0.45rem; border-radius: 6px; font-size: 0.75rem; font-weight: 600; border: 1px solid var(--line); }
.diff-add { background: var(--chip-bg); color: var(--chip-text); border-color: var(--chip-bg); }
.diff-del { color: var(--danger); border-color: var(--danger); }
.patch { margin: 0; max-height: 20rem; overflow: auto; padding: 0.6rem 0.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 0.75rem; }

/* --- The plan drawing. Also copied into downloaded SVGs (app/render.py export_css). --- */
/* plan:start */
.ground { fill: var(--plan-ground); }
.grid { fill: none; stroke: var(--plan-grid); }
.grid5 { fill: none; stroke: var(--plan-grid-major); }
.hatch-bg { fill: var(--plan-selection-fill); }
.hatch-line { stroke: var(--plan-selection); }
.room-fill { fill: var(--plan-room); stroke: none; }
.zone .room-fill { fill: none; stroke: var(--plan-muted); }
/* An outdoor space (#837): the ground shows through, dotted, and its edge is dashed like a zone's. */
.outdoor .room-fill { fill: url(#outdoor); stroke: var(--plan-muted); }
.outdoor-dot { fill: var(--plan-muted); }
.wall-body { fill: var(--plan-line); stroke: var(--plan-line); stroke-linejoin: round; } /* round: a mitre join spikes past a mitred corner's seam (#341) */
/* Railings and half walls (decision 2026-11-11-railings-and-half-walls): a railing is an open outline with its
   rail down the middle; a half wall is filled muted, lighter than a full wall. */
.kind-railing .wall-body { fill: none; }
.wall-rail { fill: none; stroke: var(--plan-line); stroke-linecap: butt; }
.kind-half-wall .wall-body { fill: var(--plan-muted); }
.fixture.structural .fixture-body { fill: none; stroke: var(--plan-structural); }
.hit { fill: transparent; stroke: none; }
.jamb, .pane, .leaf { fill: none; stroke: var(--plan-line); }
.swing { fill: none; stroke: var(--plan-muted); }
.fixture-body { fill: var(--plan-fixture); stroke: var(--plan-line); }
/* Overhead (#420): above the plan's cut line, so a dotted outline over what's below, clear but still tappable. */
.fixture.overhead .fixture-body { fill: transparent; stroke-linecap: round; }
/* Fixtures are a double line (#392): the inner line is inset inside the body, never tappable on its own. */
.fixture-inset { fill: none; stroke: var(--plan-line); pointer-events: none; }
.counter-body { fill: var(--plan-counter); stroke: none; }
.counter-edge { fill: none; stroke: var(--plan-line); pointer-events: none; }
.counter-labels { pointer-events: none; }
.el.in-top .counter-body { fill: var(--plan-selection-fill); }
.ghost .counter-edge { stroke: var(--plan-chalk); }
.label { font-family: "Patrick Hand SC", cursive; font-weight: 400; fill: var(--plan-line); text-anchor: middle; }
.room-area { font-weight: 400; fill: var(--plan-muted); }
.dim-text { font-family: "Patrick Hand SC", cursive; text-anchor: middle; fill: var(--plan-line); }
.ext { fill: none; stroke: var(--plan-muted); }
.dim-line, .tick { fill: none; stroke: var(--plan-line); }
.conf-estimated .dim-line, .conf-estimated .tick { stroke: var(--plan-estimated); }
.conf-estimated .dim-text, .room-area.conf-estimated { fill: var(--plan-estimated); }
.conf-unknown .dim-line, .conf-unknown .tick { stroke: var(--plan-unknown); }
.conf-unknown .dim-text, .room-area.conf-unknown { fill: var(--plan-unknown); font-weight: 600; }
/* Designed values look like measured ones (#623): the plan marks only what to check, estimated and unknown. */
.el { cursor: pointer; outline: none; }
.el.selected .wall-body, .el.selected .room-fill, .el.selected .fixture-body, .opening.selected .hit { fill: url(#hatch); stroke: var(--plan-selection); }
.el.selected .fixture-inset, .el.picked .fixture-inset { stroke: var(--plan-selection); }
.el:focus-visible .hit, .el:focus-visible .room-fill { stroke: var(--plan-selection); stroke-dasharray: none; }
/* Change Review (#11): what a revision changed, and dashed outlines where it was before. */
.el.changed .wall-body, .el.changed .fixture-body, .el.changed .fixture-inset, .opening.changed .jamb, .opening.changed .leaf, .opening.changed .pane { stroke: var(--plan-changed); }
.el.changed .wall-body { fill: var(--plan-changed); }
.kind-railing.changed .wall-body { fill: none; }
.el.changed .wall-rail { stroke: var(--plan-changed); }
.room.changed .room-fill { stroke: var(--plan-changed); }
/* A draft (#166): what it changed is drawn in chalk, with a faint wash, so the proposal reads apart from Main's
   lines. Crisp, not rough (#394): the wobble turned thin fixture lines into squiggles. */
.el.drafted .wall-body, .el.drafted .fixture-body, .el.drafted .fixture-inset, .opening.drafted .jamb, .opening.drafted .leaf, .opening.drafted .pane,
.opening.drafted .swing, .room.drafted .room-fill { stroke: var(--plan-chalk); stroke-dasharray: none; }
.el.drafted .wall-body, .el.drafted .fixture-body { fill: var(--plan-chalk-wash); }
.el.drafted.overhead .fixture-body { fill: transparent; }
.opening.drafted .hit { fill: var(--plan-chalk-wash); }
/* A countertop stays one shape in a draft and in Change Review (#396): its pieces keep an opaque fill and no
   outline of their own, so the joins stay covered; the top's one outside edge takes the colour. */
.countertop .el.drafted .counter-body, .countertop .el.changed .counter-body { stroke: none; filter: none; }
.countertop .el.drafted .counter-body { fill: color-mix(in srgb, var(--plan-counter), var(--plan-chalk) 22%); }
.countertop.drafted .counter-edge { stroke: var(--plan-chalk); }
.countertop.changed .counter-edge { stroke: var(--plan-changed); }
.scope-outline rect { fill: none; stroke: var(--plan-selection); }
.scope-outline text { fill: var(--plan-selection); font-family: "Barlow Condensed", sans-serif; letter-spacing: 0.1em; }
.ghost { pointer-events: none; }
.plan .unfocused { opacity: 0.32; } /* room focus (#167): the rest of the floor stays visible, dimmed */
.ghost .wall-body, .ghost .fixture-body, .ghost .fixture-inset, .ghost .room-fill { fill: none; stroke: var(--plan-chalk); opacity: 0.8; }
.ghost .hit { display: none; }
.tb-box { fill: var(--plan-ground); stroke: var(--plan-line); }
.tb-title { font-family: "Patrick Hand SC", cursive; fill: var(--plan-line); }
.tb-bar { fill: none; stroke: var(--plan-line); }
.north { fill: var(--plan-line); }
/* Layers (#7): hidden layers are classes on the <svg>; a piece hides if any of its layers is hidden. */
.hide-existing [data-layers~="existing"], .hide-demo [data-layers~="demo"], .hide-new [data-layers~="new"],
.hide-structure [data-layers~="structure"], .hide-cabinets [data-layers~="cabinets"], .hide-counters [data-layers~="counters"],
.hide-appliances [data-layers~="appliances"], .hide-overhead [data-layers~="overhead"], .hide-lengths [data-layers~="lengths"], .hide-widths [data-layers~="widths"],
.hide-labels [data-layers~="labels"], .hide-areas [data-layers~="areas"], .hide-fixture-names [data-layers~="fixture-names"] { display: none; }
/* Labels by zoom (#362): on screen only (floor.js adds `live`); a download draws every label at its size.
   The sizes match DIM_TEXT_SIZE and FIXTURE_NAME_SIZE in app/render.py. */
.plan-svg.live .dim:not(.tool-dim) > .dim-text { font-size: calc(var(--u) * 2px * var(--zk, 1)); }
.plan-svg.live .fixture-label { font-size: calc(var(--u) * 1.3px * var(--zk, 1)); }
.plan-svg.live .cramped,
.plan-svg.live.far [data-layers~="widths"],
.plan-svg.live.far .fixture-label { display: none; }
/* plan:end */

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; }

/* --- Sign-in pages (auth_base.html) ---------------------------------------------------- */
.auth-page main { max-width: 26rem; padding: 2rem 1.25rem; }
.auth-page h1 { font-size: 2rem; margin-bottom: 1.5rem; }
.auth-page label { display: block; margin: 0 0 1rem; font-size: 0.9rem; color: var(--muted); }
.auth-page input[type="text"] {
  display: block; width: 100%; margin-top: 0.35rem; height: 44px; padding: 0 0.75rem; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 1.25rem;
  border: 0; border-radius: 22px; background: var(--accent); color: var(--surface); font: inherit; font-weight: 600; cursor: pointer;
}
.btn:disabled { opacity: 0.6; cursor: default; }
/* Consent screen (#839): Deny then Allow, the main button last (#622), as one row of equal pills. */
.consent-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.consent-actions .btn, .consent-actions .btn-quiet { flex: 1; width: auto; font-size: 1rem; }
.auth-page pre { padding: 0.75rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 1.05rem; line-height: 1.7; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.signed-in { display: flex; align-items: center; gap: 0.75rem; margin: 0; font-size: 0.9rem; }
.link-btn { border: 0; background: none; padding: 0.5rem 0; color: var(--accent); font: inherit; cursor: pointer; }

/* Account page (decision 2026-11-07-account-page-ported-from-spearmint): stacked lists, no tables, so it reads at phone width. */
.account-link { color: var(--muted); text-decoration: none; padding: 0.5rem 0; }
.account-link:hover { color: var(--accent); }
.acc-section { margin: 0 0 1.25rem; padding: 0.75rem 1rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.acc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.25rem; }
.acc-head h2 { margin: 0; font-size: 1.1rem; }
.acc-list { list-style: none; margin: 0; padding: 0; }
.acc-list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.65rem 0; border-bottom: 1px solid var(--line); }
.acc-list > li:last-child { border-bottom: 0; }
.acc-main { flex: 1 1 14rem; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.acc-meta { font-size: 0.8rem; color: var(--muted); overflow-wrap: anywhere; }
.acc-note { margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--muted); }
.acc-name { width: 100%; max-width: 22rem; min-height: 40px; padding: 0 0.6rem; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.acc-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.acc-confirm { flex: 1 1 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--danger); border-radius: 10px; font-size: 0.9rem; }
.acc-confirm p { margin: 0 0 0.5rem; }
.acc-codes { margin: 0.5rem 0; padding: 0.75rem 1rem; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font-size: 1.05rem; line-height: 1.7; }
.btn-sm { min-height: 40px; padding: 0 0.9rem; border: 1px solid var(--accent); border-radius: 8px; background: var(--surface); color: var(--accent); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.btn-sm:disabled { opacity: 0.6; cursor: default; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.btn-sm.danger { border-color: var(--danger); background: var(--danger); color: var(--surface); }
.chip { display: inline-block; margin-left: 0.35rem; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--chip-bg); color: var(--chip-text); font-size: 0.75rem; font-weight: 600; }
.field-error { margin: 0.25rem 0 0; color: var(--danger); font-size: 0.85rem; }
.mono { font-family: ui-monospace, Menlo, monospace; }

/* --- Design board: Area Design Board and Decision (#13). Calm chrome, never blueprint. ------------ */
.design-view .site-header { display: none; }
.design-view main { max-width: none; padding: 0; }
.dv-header {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 0.25rem; min-height: 56px;
  padding: 0 0.75rem 0 0.15rem; background: var(--surface); border-bottom: 1px solid var(--line);
}
.dv-header h1 { margin: 0; font-size: 1.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-btn {
  flex: none; display: inline-flex; align-items: center; gap: 0.3rem; min-height: 44px; padding: 0 0.9rem;
  border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--text);
  font: inherit; font-size: 0.85rem; text-decoration: none; cursor: pointer;
}
.pill-btn svg, .btn-wide svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dv-body { max-width: 72rem; margin: 0 auto; padding: 0.75rem 1rem 2rem; display: flex; flex-direction: column; gap: 0.75rem; }
.dv-note, .dv-error { margin: 0; padding: 0.5rem 0.75rem; border-radius: 10px; font-size: 0.85rem; background: var(--surface); border: 1px solid var(--line); }
.dv-error { border-color: var(--danger); color: var(--danger); }
.hint { margin: 0; font-size: 0.8rem; color: var(--muted); }
.hint.center { text-align: center; }

.dv-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.filters { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filter {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 0.8rem; border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); color: var(--text); font-size: 0.85rem; text-decoration: none;
}
.filter[aria-current="page"] { background: var(--chip-bg); border-color: var(--chip-bg); color: var(--chip-text); font-weight: 600; }

.dv-add > summary { list-style: none; width: max-content; }
.dv-add > summary::-webkit-details-marker { display: none; }
.dv-add[open] > summary { margin-bottom: 0.5rem; }
.dv-form {
  display: flex; flex-direction: column; gap: 0.6rem; max-width: 32rem; padding: 0.75rem 1rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.dv-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--muted); }
.dv-form input[type="text"], .dv-form input[type="url"], .from-link input[type="url"], .dv-form input[type="tel"],
.dv-form input[type="email"], .dv-form input[type="date"], .dv-form select, .dv-form textarea {
  width: 100%; min-height: 44px; padding: 0.4rem 0.6rem; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
.dv-form label.check { flex-direction: row; align-items: center; gap: 0.5rem; min-height: 44px; color: var(--text); }
.dv-form label.check input { width: 20px; height: 20px; margin: 0; }
.dv-form .btn { align-self: flex-start; }
/* A note form's pair (Save and Suggest Updates + Save Note): side by side, same size, wrapping on a phone. */
.dv-form .form-foot { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.dv-form .form-foot .btn-quiet { width: auto; padding: 0 1.25rem; font-size: inherit; }
.dv-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.6rem; }

.dv-group { display: flex; flex-direction: column; gap: 0.5rem; }
.group-title { margin: 0.5rem 0 0; font-size: 0.8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.card-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
.dcard {
  display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; text-decoration: none;
}
.dcard:hover, .dcard:focus-visible { border-color: var(--accent); }
.dcard-head { display: flex; align-items: center; gap: 0.5rem; }
.dcard-head h3 { margin: 0; flex: 1; min-width: 0; font-size: 1rem; }
.dcard-meta { font-size: 0.82rem; color: var(--muted); }
.dcard-foot { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.82rem; }
.thumbs { display: flex; gap: 0.4rem; }

/* Status chips: the word carries the meaning; the style only reinforces it. */
.st {
  flex: none; display: inline-flex; align-items: center; height: 22px; padding: 0 0.5rem; border-radius: 11px;
  font-size: 0.75rem; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--text); white-space: nowrap;
}
.st-locked { background: var(--text); border-color: var(--text); color: var(--surface); }
.st-shortlisted { background: var(--chip-bg); border-color: var(--chip-bg); color: var(--chip-text); }
.st-idea { border-style: dashed; color: var(--muted); }
.st-chosen { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.st-rejected { color: var(--muted); }
.dv-header .st { margin-left: 0.25rem; }

/* Thumbnails: a photo, a paint swatch, or a neutral placeholder (never a made-up colour). */
.thumb { flex: none; display: flex; overflow: hidden; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); object-fit: cover; }
.thumb-sm { width: 56px; height: 56px; }
.thumb-lg { width: 100%; height: 112px; }
.ocard-render dd { display: grid; gap: 0.25rem; }
.ocard-render img { width: 100%; height: auto; max-height: 180px; object-fit: cover; }
.thumb-none { flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-align: center; }
.thumb-none svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.thumb-none span { font-size: 0.65rem; line-height: 1.1; padding: 0 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.thumb-lg.thumb-none span { font-size: 0.75rem; }
.thumb-paint { position: relative; }
.thumb-wrap { position: relative; display: inline-flex; flex: none; }
.thumb-wrap .swatch-chip { position: absolute; right: 4px; bottom: 4px; width: 14px; height: 14px; border-radius: 3px; box-shadow: 0 0 0 1px var(--surface); }
.swatch-chip { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; }
.swatch-chip rect { stroke: var(--line); stroke-width: 1; }
.thumb-paint svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.paint-tag { position: absolute; left: 4px; bottom: 4px; padding: 0 5px; border-radius: 4px; font-size: 0.65rem; background: var(--surface); color: var(--text); }

.dv-meta { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; color: var(--muted); }
/* Options: about two in view on a phone, scrolling sideways; a grid on wider screens. */
.options { display: flex; gap: 0.6rem; overflow-x: auto; margin: 0 -1rem; padding: 0 1rem 0.25rem; scroll-snap-type: x proximity; }
.ocard {
  flex: none; width: 172px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 0.6rem; padding: 0.6rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: 0.82rem; line-height: 1.35;
}
.ocard.is-chosen { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ocard-title h2 { margin: 0 0 0.25rem; font-size: 0.95rem; }
.ocard-status { display: flex; align-items: center; gap: 0.35rem; font-size: 0.7rem; }
.ocard-facts { margin: 0; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.ocard-facts dt { font-size: 0.7rem; color: var(--muted); }
.ocard-facts dd { margin: 0; overflow-wrap: anywhere; }
.ocard-facts .links { display: flex; flex-wrap: wrap; gap: 0 0.6rem; }
.ocard-actions { display: flex; flex-direction: column; gap: 0.35rem; }
.ocard-actions form { margin: 0; }
.ocard-actions > form:has(.btn-choose) { order: -1; } /* Choose first, above Edit (#651) */
.btn-choose, .btn-quiet {
  width: 100%; min-height: 44px; padding: 0 0.75rem; border-radius: 22px; font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
/* Choose is the card's main action (#651): filled, like every sheet's primary button. */
.btn-choose { border: 1px solid var(--accent); background: var(--accent); color: var(--surface); }
.btn-quiet { border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 400; }
.rejected summary { min-height: 44px; display: flex; align-items: center; color: var(--accent); cursor: pointer; font-size: 0.85rem; }
.rejected ul { list-style: none; margin: 0; padding: 0; }
.rejected li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.25rem 0; font-size: 0.85rem; }
.rejected li form { margin: 0; }
.rejected .btn-quiet { width: auto; }
.dv-lock { display: flex; flex-direction: column; gap: 0.4rem; max-width: 32rem; }
.dv-lock form { margin: 0; }
.btn-wide {
  width: 100%; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: 1px solid var(--accent); border-radius: 22px; background: var(--accent); color: var(--surface); font: inherit; font-weight: 600; cursor: pointer;
}
.btn-wide:disabled { background: var(--bg); border-color: var(--line); color: var(--muted); cursor: default; }
.btn-wide.btn-outline { background: var(--surface); color: var(--accent); }

/* Bottom sheet (Add Option): a modal <dialog> anchored to the bottom on phones, a centred card on wider screens. */
.dv-add.as-sheet > :not(summary) { display: none; }
body:has(dialog.bsheet[open]) { overflow: hidden; }
dialog.bsheet {
  position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: none; max-height: 88dvh; padding: 0; border: 0;
  overflow: auto; overscroll-behavior: contain; background: var(--surface); color: var(--text);
  border-radius: 16px 16px 0 0; box-shadow: 0 -4px 18px var(--shadow);
}
dialog.bsheet::backdrop { background: var(--scrim); }
.bsheet-head { position: sticky; top: 0; z-index: 1; padding: 0.5rem 0.5rem 0 1rem; background: var(--surface); touch-action: none; cursor: grab; }
.bsheet-head .grip { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 0.25rem; }
.bsheet-title { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.bsheet-title h2 { margin: 0; font-size: 1.3rem; }
.bsheet .dv-form { max-width: none; padding: 0.25rem 1rem 0; border: 0; border-radius: 0; background: none; }
.bsheet .form-foot { position: sticky; bottom: 0; margin: 0 -1rem; padding: 0.6rem 1rem calc(0.75rem + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.bsheet .form-foot .btn { width: 100%; }
/* A page's form opened as a sheet (#626): its body keeps the page's padding off. */
.page-sheet .bsheet-body > .dv-body { padding: 0 0 0.5rem; max-width: none; }
.page-sheet .bsheet-body .dv-add { margin: 0.75rem 1rem 1rem; }
.dv-more > summary { min-height: 44px; display: flex; align-items: center; color: var(--accent); cursor: pointer; font-size: 0.9rem; }
.dv-more-body { display: flex; flex-direction: column; gap: 0.6rem; }

@media (min-width: 760px) {
  dialog.bsheet { inset: 0; margin: auto; width: 30rem; max-height: 85dvh; border-radius: 12px; box-shadow: 0 4px 18px var(--shadow); }
  /* Sheet layout (#622, #625): on desktop the main button sits at the right of the footer. */
  .bsheet .form-foot { display: flex; justify-content: flex-end; }
  .bsheet .form-foot .btn { width: auto; min-width: 10rem; }
  .bsheet-head { cursor: default; }
  .bsheet-head .grip { display: none; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
  .options { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); overflow: visible; margin: 0; padding: 0; }
  .ocard { width: auto; }
  .thumb-lg { height: 140px; }
}

/* Edit Decision / Edit Option (#56): quiet triggers; their forms open as bottom sheets. */
.link-btn { list-style: none; width: max-content; min-height: 44px; display: inline-flex; align-items: center; color: var(--accent); cursor: pointer; font-size: 0.85rem; }
.link-btn::-webkit-details-marker { display: none; }
.dv-edit-option > summary.btn-quiet { display: flex; align-items: center; justify-content: center; width: 100%; }
/* A <summary> drawn as a button stays a list item unless told otherwise, so its label sat at the top (#864). */
summary.btn-quiet, summary.btn-choose { display: inline-flex; align-items: center; justify-content: center; padding: 0 1.1rem; list-style: none; }
summary.btn-quiet::-webkit-details-marker, summary.btn-choose::-webkit-details-marker { display: none; }
.dv-edit-option[open]:not(.as-sheet) > .dv-form { padding: 0.5rem; }

/* Images and quote files (#54), in an option's Edit sheet. */
.edit-body { display: flex; flex-direction: column; gap: 0.75rem; }
.bsheet .edit-body > .form-foot { margin: 0; }  /* Save Option after the images (#625): the body has no side padding */
.edit-body > .form-foot .btn { font-size: 1rem; }
.dv-media { display: flex; flex-direction: column; gap: 0.5rem; padding: 0 1rem 1rem; }
.media-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.media-list li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.media-list .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.media-list form, .upload { margin: 0; }
.btn-small { width: auto; min-height: 36px; font-size: 0.8rem; }
.upload { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.upload-pick, .dv-form .upload-pick { position: relative; min-height: 44px; display: inline-flex; flex-direction: row; align-items: center; }
.upload-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload.js-upload .upload-send { display: none; }
.upload.is-sending .upload-pick { opacity: 0.6; }

/* Image from a link (#109), under the Images drop zone. */
.from-link { display: flex; align-items: flex-end; gap: 0.5rem; margin: 0; }
.from-link .btn-small { min-height: 44px; }
.from-link .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; }

/* Drop zones (#96): a picker that also takes dropped files; dragging files outlines every target. */
.dropzone { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.5rem; border: 1px dashed var(--line); border-radius: 12px; }
.dropzone-hint { font-size: 0.8rem; color: var(--muted); }
.dropzone-files { font-size: 0.8rem; color: var(--text); overflow-wrap: anywhere; }
.dropzone .field-error { flex-basis: 100%; margin: 0; }
.is-dragging-files .dropzone, .is-dragging-files .ocard[data-drop-images] { outline: 2px dashed var(--accent); outline-offset: 2px; }
.dropzone.is-drop-over, .ocard.is-drop-over { background: var(--chip-bg); }
@media (hover: none) { .dropzone-hint { display: none; } }

/* Desktop sidebar (D3/D4): areas by floor with open counts, Suppliers, the small plan on a decision. */
.dv-side { display: none; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list a { display: flex; align-items: center; gap: 0.5rem; min-height: 40px; padding: 0 0.5rem; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 0.9rem; }
.side-list a[aria-current="page"] { background: var(--chip-bg); color: var(--chip-text); font-weight: 600; }
.side-list .grow { flex: 1; min-width: 0; }
.side-list .meta { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; color: var(--muted); }
.side-count { min-width: 1.5rem; text-align: right; font-size: 0.8rem; color: var(--muted); }
.dv-plan { margin: 1rem 0 0; }
.dv-plan-frame { display: block; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--plan-ground); }
.dv-plan-frame svg { width: 100%; height: 100%; display: block; }

@media (min-width: 1024px) {
  .dv-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); align-items: start; min-height: calc(100dvh - 56px); }
  .dv-layout > .dv-body { width: 100%; }
  .dv-side {
    display: block; position: sticky; top: 56px; max-height: calc(100dvh - 56px); overflow: auto;
    min-height: calc(100dvh - 56px); padding: 0.75rem; border-right: 1px solid var(--line); background: var(--surface);
  }
  .dv-side .group-title:first-child { margin-top: 0; }
}

/* Property overview: areas link to their boards. */
.area-list { list-style: none; padding: 0; margin: 0; }
.area-list li { border-bottom: 1px solid var(--line); }
.area-list a { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; text-decoration: none; color: var(--text); }
.area-list .grow { flex: 1; color: var(--accent); }

/* Trades: Contacts (#72) and Jobs (#73) */
.tr-list { list-style: none; margin: 0.35rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.tr-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.5rem 0.5rem 0.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.tr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; min-height: 44px; justify-content: center; color: var(--text); text-decoration: none; }
.tr-main strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-actions { display: flex; gap: 0.35rem; flex: none; }
.tr-icon { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 22px; color: var(--accent); background: var(--surface); }
.tr-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tr-facts { margin: 0; display: grid; gap: 0.5rem; }
.tr-facts div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.5rem; }
.tr-facts dt { color: var(--muted); font-size: 0.85rem; }
.tr-facts dd { margin: 0; overflow-wrap: anywhere; }
.tr-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-link { display: inline-flex; align-items: center; text-decoration: none; }
.pre { white-space: pre-wrap; }
.tr-title { display: flex; align-items: baseline; gap: 0.4rem; min-width: 0; }
.tr-wait { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--text); }
.tr-wait svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tr-wait.clear { color: var(--muted); }
.tr-plain { list-style: none; margin: 0.35rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.tr-plain li { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; }
.tr-plain li > a { flex: 1; min-width: 0; color: var(--text); text-decoration: none; }
.tr-plain .grow { flex: 1; min-width: 0; }
.tr-point.covered .grow { color: var(--muted); text-decoration: line-through; }
.tr-check { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; cursor: pointer; color: var(--accent); }
.tr-check svg { width: 24px; height: 24px; border: 2px solid var(--line); border-radius: 6px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; box-sizing: border-box; }
.tr-inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; margin-top: 0.5rem; }
.tr-inline label { flex: 1 1 12rem; }
.tr-status { display: flex; align-items: flex-end; gap: 0.5rem; }
.tr-status label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--muted); }
.tr-status select { min-height: 44px; padding: 0 0.6rem; font: inherit; font-size: 1rem; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.tr-sub { margin: 0.75rem 0 0; font-size: 0.85rem; font-weight: 600; }
.tr-log { list-style: none; margin: 0.75rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.tr-log > li { padding: 0.6rem 0.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.tr-log p { margin: 0; }
.log-agent { margin: 0.5rem 0 0; padding-left: 0.75rem; border-left: 2px solid var(--line); }
.log-agent > p { margin: 0 0 0.4rem; }
.tr-buttons > a { width: auto; min-width: 6rem; justify-content: center; text-decoration: none; }

/* Trades: quotes and costs on the job page (#74) */
.q-compare { list-style: none; margin: 0.35rem 0 0; padding: 0 0 0.5rem; display: flex; gap: 0.75rem; overflow-x: auto; scroll-snap-type: x proximity; }
.q-card { flex: 0 0 min(88%, 20rem); scroll-snap-align: start; display: flex; flex-direction: column; gap: 0.35rem; padding: 0.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.q-card.accepted { border-color: var(--accent); border-width: 2px; }
.q-card.declined, .q-card.withdrawn { opacity: 0.7; }
.q-card.late { border-color: var(--danger); }
.q-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.q-card p { margin: 0; overflow-wrap: anywhere; }
.q-card .tr-sub { margin-top: 0.35rem; }
.q-status { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.q-card.accepted .q-status { color: var(--accent); font-weight: 600; }
.q-amount { font-size: 1.35rem; font-weight: 600; }
.late-text { color: var(--danger); }
.q-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: flex-end; margin-top: 0.35rem; }
.q-actions form { margin: 0; }
.tr-files { list-style: none; margin: 0.25rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.tr-files li { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; }
.tr-files a { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--accent); }
.cost-totals { margin: 0.5rem 0 0; display: grid; gap: 0.35rem; padding: 0.6rem 0.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.cost-totals .estimate dt, .cost-totals .estimate dd { color: var(--dim-estimated); }
.cost-totals .estimate dd { font-style: italic; }
.cost-totals div { display: flex; justify-content: space-between; gap: 0.5rem; }
.cost-totals dt { color: var(--muted); }
.cost-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.cost-totals .strong dt, .cost-totals .strong dd { color: var(--text); font-weight: 600; }
.cost-totals .owing dd { color: var(--danger); }
.tr-plain .amt { font-variant-numeric: tabular-nums; }
.tr-row.inv.paid .tr-title strong { color: var(--muted); }
@media (min-width: 900px) {
  .q-compare { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); overflow: visible; }
  .q-card { flex: none; }
}

/* Trades: Next Up (#75) */
.nu { display: flex; flex-direction: column; gap: 1.25rem; }
.nu-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.nu-chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.85rem; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 0.85rem; text-decoration: none; }
.nu-chip[aria-pressed="true"], .nu-chip[aria-current="page"] { background: var(--chip-bg); color: var(--chip-text); border-color: transparent; font-weight: 600; }
button.nu-chip { font: inherit; font-size: 0.85rem; cursor: pointer; }
.nu-chip.ready { background: var(--chip-bg); color: var(--chip-text); border-color: transparent; font-weight: 600; }
.nu-chip.late { border-color: var(--danger); color: var(--danger); font-weight: 600; }
.nu-cols { display: flex; flex-direction: column; gap: 1.25rem; }
.nu-cols section { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.nu-cols section > p { margin: 0; }
.nu-card { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none; }
.nu-head { display: flex; align-items: center; gap: 0.5rem; min-width: 0; flex-wrap: wrap; }
.nu-head strong { flex: 1 1 auto; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.nu-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 0.5rem; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); font-size: 0.75rem; font-weight: 600; color: var(--text); white-space: nowrap; }
.nu-badge.structural { border-color: var(--dim-estimated); color: var(--dim-estimated); }
.nu-badge.late { border-color: var(--danger); color: var(--danger); }
.nu-remind { margin: -0.25rem 0 0; font-size: 0.8rem; color: var(--dim-estimated); }
.nu-quote { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.5rem 0.5rem 0.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.nu-quote.late { border-color: var(--danger); }
.nu-when { font-size: 0.85rem; }
.nu-all { text-decoration: none; margin-right: 0.25rem; }
.nu-all svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 900px) {
  .nu-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 1.5rem; }
}
.dv-note.warn { border-color: var(--dim-estimated); color: var(--dim-estimated); }

/* Jobs chat (#129): the chat beside the Jobs list on desktop, a sheet under it on phones. */
.jc-work { display: flex; flex-direction: column; min-height: 100dvh; }
.jc-main { flex: 1; min-width: 0; }
.jc-work > .chat { position: sticky; bottom: 0; }
.chat-more { align-self: center; }
@media (min-width: 1024px) {
  .jc-work { flex-direction: row; align-items: flex-start; }
  .jc-work > .chat { position: sticky; top: 0; bottom: auto; height: 100dvh; }
}
.proposal { margin-top: 0.5rem; }
.prop-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.prop-card.is-saved { border-color: var(--accent); }
.prop-card > header { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); }
.prop-grp { margin: 0; padding: 0.4rem 0.75rem; font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--line); }
.prop-row { display: flex; gap: 0.65rem; align-items: flex-start; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); }
.prop-row input[type="checkbox"] { flex: none; width: 1.4rem; height: 1.4rem; margin: 0.1rem 0 0; accent-color: var(--accent); }
.prop-text { flex: 1; min-width: 0; }
.prop-text small { display: block; color: var(--muted); font-size: 0.85rem; }
.prop-row.is-off .prop-text { opacity: 0.45; text-decoration: line-through; }
.prop-qi { flex: none; width: 1.4rem; text-align: center; font-weight: 700; color: var(--accent); }
.prop-pick { display: grid; gap: 0.25rem; margin-top: 0.35rem; }
.prop-pick label { display: flex; gap: 0.5rem; align-items: center; min-height: 2.2rem; font-size: 0.9rem; }
.prop-move { flex: none; display: flex; flex-direction: column; gap: 0.2rem; }
.prop-move button { min-width: 2.75rem; min-height: 2rem; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; }
.prop-move button[hidden] { display: block; visibility: hidden; }
/* The Proposals screen (#896) */
.pl { display: flex; flex-direction: column; gap: 0.75rem; padding-bottom: 5rem; }
.pl-cards { display: flex; flex-direction: column; gap: 1rem; }
.pl-title { margin: 0 0 0.4rem; font-size: 1rem; }
.pl-bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.6rem 1rem; background: var(--surface); border-top: 1px solid var(--line); }
.pl-bar[hidden] { display: none; }
.nu-proposals { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; min-height: 3rem; padding: 0 0.9rem; border-radius: 12px; background: var(--chip-bg); color: var(--chip-text); text-decoration: none; }
.prop-link-line { margin: 0.3rem 0 0; }
.prop-already { padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
.prop-already summary { min-height: 2.25rem; display: flex; align-items: center; cursor: pointer; }
.prop-already ul { margin: 0 0 0.4rem; padding-left: 1.1rem; }
.prop-card > .muted { margin: 0; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); }
.prop-source { margin: 0 0 0.35rem; font-size: 0.8rem; color: var(--muted); }
.prop-source strong { color: var(--text); font-weight: 600; }
.badge-warn { display: inline-block; font-size: 0.72rem; border: 1px solid var(--dim-estimated); color: var(--dim-estimated); border-radius: 999px; padding: 0 0.5rem; }
.prop-actions { display: flex; gap: 0.6rem; padding: 0.6rem 0.75rem; }
.prop-actions .btn { flex: 1; gap: 0.35em; } /* .btn is inline-flex, which drops the space before the count */
.prop-written { margin: 0; padding: 0.5rem 0.75rem 0.5rem 1.6rem; }
.prop-foot { margin: 0; padding: 0 0.75rem 0.6rem; }

/* Order of Jobs (#157) */
.or-bar { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.or-bar form { flex: none; }
.or-bar button[disabled] { opacity: 0.45; cursor: default; }
.or-warn { color: var(--dim-estimated); font-size: 0.9rem; }
.or-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.or-row { display: flex; gap: 0.4rem; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; scroll-margin-top: 4rem; }
.or-row.is-flagged { border-color: var(--dim-estimated); }
.or-row.is-done { opacity: 0.6; }
.or-n { flex: none; width: 1.6rem; height: 1.6rem; margin-top: 0.1rem; border-radius: 50%; background: var(--chip-bg); color: var(--chip-text); font-size: 0.8rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.or-card { flex: 1; min-width: 0; min-height: 44px; display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.65rem 0.75rem; color: var(--text); text-decoration: none; }
.or-main { flex: 1; min-width: 0; display: grid; gap: 0.2rem; }
.or-title { display: flex; flex-wrap: wrap; gap: 0.1rem 0.4rem; align-items: baseline; }
.or-when { display: flex; gap: 0.35rem; align-items: flex-start; font-size: 0.9rem; }
.or-when svg { margin-top: 0.2em; }
.or-when svg, .or-go { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.or-go { align-self: center; width: 18px; height: 18px; color: var(--muted); }
.or-row.is-done { border-style: dashed; }
.or-row.is-done .or-card { align-items: center; padding-block: 0.4rem; }
.or-row.is-done .meta { flex: none; }
.jo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.jo-bar .seg a { min-height: 44px; }
.dv-header .jo-new { margin-left: auto; }
.or-move { flex: none; display: flex; flex-direction: column; gap: 0.2rem; padding: 0.5rem 0.5rem 0.5rem 0; }
.or-move button { min-width: 2.75rem; min-height: 2rem; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; }
.or-move button.is-off { visibility: hidden; }
.or-tent { font-size: 0.72rem; border: 1px dashed var(--muted); color: var(--muted); border-radius: 999px; padding: 0 0.45rem; }
.or-flag { color: var(--dim-estimated); font-size: 0.85rem; }

/* A job's summary card (#924) */
.jb-summary { display: grid; gap: 0.6rem; padding: 0.85rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.jb-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; }
.jb-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 0.5rem; border-radius: 10px; border: 1px solid var(--line); font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.jb-facts { display: grid; gap: 0.3rem; margin: 0; font-size: 0.9rem; }
.jb-facts > div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 0.5rem; }
.jb-facts dt { color: var(--muted); }
.jb-facts dd { margin: 0; }
.jb-remind { margin: 0; color: var(--dim-estimated); font-size: 0.85rem; }
.jb-next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; padding-top: 0.6rem; border-top: 1px solid var(--line); font-size: 0.9rem; }
.jb-next .btn { width: auto; min-height: 44px; padding: 0 1.1rem; display: inline-flex; align-items: center; text-decoration: none; }
.dv-header > .pill-btn { margin-left: auto; }

/* A job's section headers with "+ Add" (#949) */
.jb-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.jb-head .group-title { margin: 0; }
.jb-plus { display: inline-flex; align-items: center; gap: 0.3rem; min-height: 44px; padding: 0 0.25rem; color: var(--accent); font-size: 0.9rem; font-weight: 600; text-decoration: none; cursor: pointer; list-style: none; }
.jb-plus::-webkit-details-marker { display: none; }
.jb-plus svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.5; }
.jb-fold[open] > .jb-plus { color: var(--muted); }

/* A job's Quotes with More, and Costs in three lines (#975) */
.q-more > summary { display: inline-flex; align-items: center; gap: 0.3rem; min-height: 44px; color: var(--accent); font-size: 0.9rem; font-weight: 600; cursor: pointer; list-style: none; }
.q-more > summary::-webkit-details-marker { display: none; }
.q-more > summary::after { content: "▾"; font-size: 0.75rem; }
.q-more[open] > summary::after { content: "▴"; }
.q-more-body { display: grid; gap: 0.6rem; }
.q-more-body .q-actions:empty { display: none; }
.q-ask { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-start; }
.q-ask > details[open] { flex-basis: 100%; }
.cost-short { margin-bottom: 0; }

/* A job's Bookings section and its booking sheets (#925) */
.jb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.jb-card { display: flex; align-items: center; gap: 0.75rem; min-height: 44px; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; }
.jb-main { flex: 1; min-width: 0; display: grid; gap: 0.15rem; font-size: 0.9rem; }
.jb-change { flex: none; color: var(--accent); font-size: 0.9rem; }
.jb-flag { color: var(--dim-estimated); font-size: 0.85rem; }
.jb-notes { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-size: 0.9rem; }
.jb-add { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.bk-form .or-time { display: grid; gap: 0.5rem; }
.bk-form .or-time summary { cursor: pointer; color: var(--accent); min-height: 44px; display: flex; align-items: center; }
.bk-form .or-hint { margin: 0; color: var(--muted); font-size: 0.8rem; }
.bk-remove { margin: 0.75rem 0 0; }
.bk-remove .btn-quiet { width: auto; padding: 0 1.25rem; color: var(--danger); }
.page-sheet .bk-remove, .page-sheet .bk-what { margin-left: 1rem; margin-right: 1rem; }

/* Projects (#175) */
.pj-sum { display: flex; flex-wrap: wrap; gap: 0 0.5rem; color: var(--muted); font-size: 0.8rem; }
.pj-sum .late { color: var(--danger); }
.pj-list a { padding: 0.35rem 0; }
.pj-late { min-width: 1.4rem; height: 1.4rem; padding: 0 0.4rem; border-radius: 999px; border: 1px solid var(--danger); color: var(--danger); font-size: 0.75rem; display: inline-flex; align-items: center; justify-content: center; }
.pj-chip { display: inline-flex; align-self: flex-start; align-items: center; height: 20px; padding: 0 0.5rem; border-radius: 10px; background: var(--chip-bg); color: var(--chip-text); font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.pj-chip.general { background: none; border: 1px solid var(--line); color: var(--muted); }
.pj-move { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.pj-move select { flex: 1; min-width: 0; }
.pj-move button { flex: none; white-space: nowrap; }

/* --- Property panel (#176): a drawer on the phone, a left rail on desktop (collapses to icons). ---------------- */
.pn-shell { display: flex; min-width: 0; }
.pn-main { flex: 1; min-width: 0; }
.floor-view .pn-shell { flex: 1; min-height: 0; }
.floor-view .pn-main { display: flex; flex-direction: column; min-height: 0; }
html.pn-locked, html.pn-locked body { overflow: hidden; }
.pnl { background: var(--surface); overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
.pnl:focus { outline: none; }
.pn-head { display: flex; align-items: flex-start; gap: 0.25rem; padding: 0.6rem 0.5rem 0.6rem 1rem; border-bottom: 1px solid var(--line); }
.pn-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pn-props { font-size: 0.75rem; text-decoration: none; }
.pn-title { font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-meta { color: var(--muted); font-size: 0.75rem; }
.pn-h { margin: 0.8rem 1rem 0.2rem; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.pn-list { list-style: none; margin: 0; padding: 0; }
.pn-list a, .pn-proj summary { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; padding: 0.3rem 1rem; color: var(--text); text-decoration: none; cursor: pointer; }
.pn-list a:hover, .pn-proj summary:hover { background: var(--bg); }
.pn-list a[aria-current="page"] { background: var(--chip-bg); color: var(--chip-text); font-weight: 600; }
.pn-list a:focus-visible, .pn-proj summary:focus-visible, .pn-sub a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pn-ico { flex: none; width: 1.6rem; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.pn-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pn-floor { font-size: 0.68rem; font-weight: 600; white-space: nowrap; }
.pn-code { color: var(--muted); font-size: 0.75rem; font-weight: 400; }
.pn-lab { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pn-m { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 400; }
.pn-m .late { color: var(--danger); }
.pn-cnt { flex: none; min-width: 1.4rem; height: 1.4rem; padding: 0 0.4rem; border-radius: 999px; background: var(--chip-bg); color: var(--chip-text); font-size: 0.75rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.pn-cnt.late { background: none; border: 1px solid var(--danger); color: var(--danger); }
.pn-empty { padding: 0.4rem 1rem; color: var(--muted); font-size: 0.9rem; }
.pn-add { color: var(--accent); }
.pn-add .pn-ico { color: var(--accent); }
.pn-proj summary { list-style: none; }
.pn-proj summary::-webkit-details-marker { display: none; }
.pn-proj .pj-sum { margin-top: 0.1rem; }
/* A project's two screens, as rows under it (#231). */
.pn-sub { display: flex; flex-direction: column; padding-bottom: 0.25rem; }
.pn-sub a { display: flex; align-items: center; gap: 0.5rem; min-height: 40px; padding: 0 1rem 0 3.2rem; color: var(--text); text-decoration: none; font-size: 0.9rem; }
.pn-sub a:hover { background: var(--bg); }
.pn-sub .pn-ico { width: 1.25rem; }
.pn-sub .pn-ico svg { width: 16px; height: 16px; }
.pn-sub a[aria-current="page"] .pn-ico { color: inherit; }
.pn-sub a[aria-current="page"] { background: var(--chip-bg); color: var(--chip-text); font-weight: 600; }
.pn-min-only { display: none; }
.pn-collapse { display: none; }
.pn-open { flex: none; }
/* The property landing (a property with no floors) shows the same Projects rows, full width. */
main > .pn-list.pj-list .pn-sub a, .pn-main > .pn-list.pj-list .pn-sub a { padding-left: 2.6rem; }

/* The Next Up button in the plan header: what's ready, in the warning colour when a quote is late. */
.nu-btn { position: relative; }
.nu-count { position: absolute; top: 4px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--surface); font-size: 0.66rem; font-weight: 700; line-height: 17px; text-align: center; }
.nu-count.late { background: var(--danger); }

@media (max-width: 1023px) {
  .pnl {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 30; width: min(21rem, 86vw);
    box-shadow: 4px 0 18px var(--shadow); transform: translateX(-102%); visibility: hidden;
    transition: transform 0.2s ease, visibility 0s linear 0.2s;
  }
  .pn-shell[data-drawer="open"] .pnl { transform: none; visibility: visible; transition: transform 0.2s ease; }
  .pn-scrim { position: fixed; inset: 0; z-index: 29; background: var(--scrim); display: none; }
  .pn-shell[data-drawer="open"] .pn-scrim { display: block; }
}
@media (max-width: 1023px) and (prefers-reduced-motion: reduce) {
  .pnl, .pn-shell[data-drawer="open"] .pnl { transition: none; }
}
@media (min-width: 1024px) {
  .pn-open, .pn-close, .pn-scrim { display: none; }
  .pn-collapse { display: inline-flex; }
  .pn-main .fv-header, .pn-main .dv-header { padding-left: 1rem; }  /* no menu button on desktop */
  .pnl { flex: none; width: 15rem; border-right: 1px solid var(--line); position: sticky; top: 0; height: 100dvh; align-self: flex-start; }
  .floor-view .pnl { position: static; height: auto; align-self: stretch; }
  .pn-shell.rail-min .pnl { width: 3.5rem; }
  .rail-min .pn-name, .rail-min .pn-h, .rail-min .pn-lab, .rail-min .pn-cnt, .rail-min .pn-detail { display: none; }
  .rail-min .pn-min-only { display: list-item; }
  .rail-min .pn-head { justify-content: center; padding: 0.5rem 0; }
  .rail-min .pn-collapse svg { transform: scaleX(-1); }
  .rail-min .pn-list { padding-top: 0.5rem; border-bottom: 1px solid var(--line); }
  .rail-min .pn-list a { justify-content: center; padding: 0.3rem 0; position: relative; }
  .rail-min .pn-ico { width: auto; }
  .rail-min .pn-list a .pn-cnt.late, .rail-min .pn-list a[href$="/next"] .pn-cnt { display: inline-flex; position: absolute; top: 2px; right: 4px; min-width: 16px; height: 16px; padding: 0 3px; font-size: 0.62rem; }
}

/* The Timeline (#77) and Coming Up on Next Up (#171): pins for a quote visit (a dot), a work booking (a bar) and a quote
   due date (a diamond); dashed is tentative, the warning colour needs a look, the danger colour is a late quote. */
.tl { display: flex; flex-direction: column; gap: 1.1rem; }
.tl-pin { display: inline-block; flex: none; box-sizing: border-box; background: var(--accent); }
.tl-pin.quote { width: 8px; height: 8px; border-radius: 4px; }
.tl-pin.work { width: 14px; height: 6px; border-radius: 3px; background: var(--chip-text); }
.tl-pin.due { width: 7px; height: 7px; transform: rotate(45deg); background: var(--muted); }
.tl-pin.tent { background: transparent; border: 1.5px dashed var(--accent); }
.tl-pin.work.tent { border-color: var(--chip-text); }
.tl-pin.look { background: var(--dim-estimated); border-color: var(--dim-estimated); }
.tl-pin.due.look { background: var(--danger); }
.tl-step { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.tl-arrow { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; font-size: 1.1rem; }
.tl-range { min-width: 7.5rem; text-align: center; font-size: 0.9rem; }
.tl-before { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.6rem 0.75rem; border: 1px solid var(--danger); border-radius: 12px; background: var(--surface); }
.tl-before h2 { margin: 0; font-size: 0.9rem; font-weight: 600; color: var(--danger); }
.tl-before a { color: var(--danger); text-decoration: none; font-size: 0.9rem; }
.tl-before a.look { color: var(--dim-estimated); }
.tl-before .tl-link { color: var(--accent); }
.tl-weeks { display: flex; flex-direction: column; gap: 1.1rem; }
.tl-week { display: flex; flex-direction: column; gap: 0.5rem; }
.tl-week h2 { margin: 0; font-size: 0.95rem; font-weight: 600; }
.tl-week h2 .meta { font-weight: 400; }
.tl-days, .tl-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.tl-days { font-size: 0.7rem; color: var(--muted); text-align: center; }
.tl-days .now { color: var(--chip-text); font-weight: 700; }
.tl-card { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.6rem 0.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none; }
.tl-card.look { border-color: var(--dim-estimated); }
.tl-head { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.tl-head strong { font-weight: 600; overflow-wrap: anywhere; }
.tl-strip span { height: 10px; border-radius: 3px; background: var(--bg); border: 1px solid var(--line); box-sizing: border-box; }
.tl-strip .work { background: var(--chip-text); border-color: var(--chip-text); }
.tl-strip .quote, .tl-strip .due { background: var(--accent); border-color: var(--accent); }
.tl-strip .due { background: var(--muted); border-color: var(--muted); }
.tl-strip .tent { background: var(--surface); border: 1.5px dashed var(--chip-text); }
.tl-strip .look { background: var(--dim-estimated); border-color: var(--dim-estimated); }
.tl-key { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; margin: 0; font-size: 0.75rem; color: var(--muted); }
.tl-key > span { display: inline-flex; align-items: center; gap: 0.35rem; }

/* Desktop: a row per job across the weeks. The phone keeps the week cards. */
.tl-gantt { display: none; flex-direction: column; gap: 6px; }
.tl-grow { display: grid; grid-template-columns: 12rem repeat(var(--days), minmax(0, 1fr)); min-height: 50px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; }
.tl-grow > * { grid-row: 1; }
.tl-grow.look { border-color: var(--dim-estimated); }
.tl-ghead { min-height: 0; background: none; border: 0; }
.tl-glabel { grid-column: 1; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0.35rem 0.6rem; min-width: 0; }
.tl-gname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.85rem; }
.tl-glabel .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.75rem; }
.tl-gday { text-align: center; font-size: 0.68rem; line-height: 1.3; color: var(--muted); align-self: end; }
.tl-gday.now { color: var(--chip-text); font-weight: 700; }
.tl-gbg.wkend { background: var(--bg); }
.tl-gbg.now { box-shadow: inset 2px 0 0 var(--accent); }
.tl-gbar { align-self: center; height: 16px; margin: 0 1px; border-radius: 4px; background: var(--chip-text); box-sizing: border-box; }
.tl-gbar.quote { justify-self: center; width: 13px; height: 13px; border-radius: 7px; background: var(--accent); }
.tl-gbar.due { justify-self: center; width: 10px; height: 10px; border-radius: 0; transform: rotate(45deg); background: var(--muted); }
.tl-gbar.tent { background: var(--surface); border: 1.5px dashed var(--chip-text); }
.tl-gbar.quote.tent { border-color: var(--accent); }
.tl-gbar.look { background: var(--dim-estimated); border-color: var(--dim-estimated); }
.tl-gbar.due.look { background: var(--danger); }
@media (min-width: 1100px) {
  .tl .tl-weeks { display: none; }
  .tl .tl-gantt { display: flex; }
}

/* Coming Up: the glance at the top of Next Up. */
.tl-glance { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.75rem; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; max-width: 34rem; }
.tl-glance-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: space-between; }
.tl-glance-head h2 { margin: 0; font-size: 1.25rem; }
.tl-glance .tl-before { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; padding: 0.4rem 0.6rem; }
.tl-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.tl-wd { font-size: 0.7rem; color: var(--muted); text-align: center; }
.tl-day { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 48px; padding: 4px 0 5px; box-sizing: border-box; border: 1px solid transparent; border-radius: 8px; background: var(--surface); color: var(--text); text-decoration: none; font-size: 0.9rem; }
.tl-day.past { background: none; color: var(--muted); }
.tl-day.today { border-color: var(--accent); font-weight: 700; }
.tl-day.sel { background: var(--chip-bg); border-color: var(--chip-text); }
.tl-pins { display: flex; gap: 3px; align-items: center; min-height: 9px; }
.tl-chosen { display: flex; flex-direction: column; gap: 0.4rem; }
.tl-chosen h3 { margin: 0; font-size: 0.9rem; font-weight: 600; }
.tl-glance > .pill-btn { align-self: flex-start; }
.inspector-delete { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--line); font-size: 0.9rem; }
.inspector-delete p { margin: 0 0 0.5rem; }
.inspector-delete .danger-text { color: var(--danger); }
/* Edit mode on the inspector (decision 2026-11-11-edit-from-the-inspector) */
.edit-form { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.5rem; }
.edit-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.ef-field { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; }
.ef-field > span, .ef-field legend { font-size: 0.8rem; color: var(--muted); padding: 0; margin-bottom: 0.3rem; }
.ef-field input[type="text"], .ef-field input:not([type]) { min-height: 40px; padding: 0 0.6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; width: 100%; box-sizing: border-box; }
.ef-field.invalid input:not([type="radio"]) { border-color: var(--danger); }
.ef-field[hidden] { display: none; }
.ef-help { margin: 0.2rem 0 0; font-size: 0.8rem; color: var(--muted); }
.ef-anchor { margin-top: 0.3rem; }
.edit-form .seg { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; }
.edit-form .seg label { position: relative; }
.edit-form .seg input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.edit-form .seg span { min-height: 36px; display: inline-flex; align-items: center; padding: 0 0.7rem; font-size: 0.85rem; cursor: pointer; }
.edit-form .seg-sm span { min-height: 32px; padding: 0 0.55rem; font-size: 0.8rem; }
.edit-form .seg input:checked + span { background: var(--chip-bg); color: var(--chip-text); font-weight: 600; }
.edit-form .seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.tool-readout .readout-warn, .tool-readout .readout-flag { flex-basis: 100%; white-space: normal; text-align: center; font-size: 0.8rem; }
.tool-readout .readout-warn { color: var(--plan-estimated); }
.tool-readout .readout-flag { color: var(--plan-structural); font-weight: 600; }
.inspector:has(.edit-form) { max-height: 85%; padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }
.edit-form > .edit-actions { position: sticky; bottom: 0; margin: 0; padding: 0.6rem 0 0.25rem; background: var(--surface); border-top: 1px solid var(--line); }
.edit-actions .inspector-actions { margin: 0; }
.edit-actions .push-right { margin-left: auto; }
.edit-delete { margin: 0.75rem 0; }
.edit-delete .delete-confirm { margin-top: 0.6rem; }
.delete-refused { margin: 0.75rem 0 0; font-size: 0.85rem; }
.ef-number .ef-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.ef-number .ef-row input { flex: 1 1 5rem; width: auto; min-width: 0; }
.pocket { fill: none; stroke: var(--plan-muted); }
.track { fill: none; stroke: var(--plan-muted); }
.door-ways .way-set { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem; }
.door-ways .way { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 0.2rem; border: 1px solid var(--line); border-radius: 8px; font-size: 0.8rem; text-align: center; cursor: pointer; background: var(--plan-ground); color: var(--plan-line); }
.door-ways .way input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.door-ways .way:has(input:checked) { border-color: var(--plan-selection); box-shadow: 0 0 0 2px var(--plan-selection); }
.door-ways .way:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.door-thumb { width: 100%; max-width: 76px; aspect-ratio: 1; height: auto; }
.door-thumb .thumb-wall { opacity: 0.55; }
.door-thumb .thumb-wall { fill: none; stroke: var(--plan-line); }
.door-ways .way-set[hidden], .door-ways[hidden] { display: none; }
.tool-readout .readout-summary { white-space: normal; text-align: center; }

/* Icon toggles beside a number: its confidence, and which point stays put */
.ef-number .ef-row { flex-wrap: nowrap; }
/* The element's Estimated switch (#691): the Layers sheet's switch, On while a value is a guess. */
.ef-switch { display: flex; align-items: center; justify-content: space-between; min-height: 44px; cursor: pointer; color: var(--dim-estimated); font-weight: 600; }
.ef-switch input { appearance: none; -webkit-appearance: none; order: 2; flex: none; width: 42px; height: 24px; margin: 0; border-radius: 12px; background: var(--line); position: relative; cursor: pointer; transition: background 0.15s; }
.ef-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 9px; background: var(--surface); transition: transform 0.15s; }
.ef-switch input:checked { background: var(--dim-estimated); }
.ef-switch input:checked::after { transform: translateX(18px); }
.ef-switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ef-held .link-btn { display: inline; min-height: 0; padding: 0; font-size: inherit; }
/* What a draft takes out (#623): a dashed outline where it was, in the draft's colour. */
.ghost.removed .wall-body, .ghost.removed .fixture-body, .ghost.removed .room-fill { stroke: var(--plan-changed); fill: none; }
.icon-seg { display: flex; flex: none; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.icon-seg label { position: relative; display: flex; }
.icon-seg input, .anchor-grid input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.icon-seg span, .anchor-grid span { width: 34px; height: 38px; display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; }
.icon-seg svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-seg b { font-size: 1.3rem; font-weight: 600; line-height: 1; }
.glyph { font-family: ui-monospace, Menlo, monospace; font-size: 1.15rem; line-height: 1; }
.icon-seg input:checked + span, .anchor-grid input:checked + span { background: var(--chip-bg); color: var(--chip-text); }
.icon-seg input:focus-visible + span, .anchor-grid input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.anchor-seg span { width: 30px; }
.ef-caption { color: var(--text); }
.ef-pair { display: flex; gap: 0.75rem; align-items: center; }
.ef-pair-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.ef-grid { flex: none; align-items: center; }
.anchor-grid { display: grid; grid-template-columns: repeat(3, 30px); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; transform: rotate(var(--turn, 0deg)); margin: 0.6rem; }
.anchor-grid label { position: relative; display: flex; }
.anchor-grid span { width: 30px; height: 30px; }
.inspector-delete { margin-bottom: 0.5rem; }
.edit-form .inspector-delete { margin-top: 0; border-top: 1px solid var(--line); padding-top: 0.6rem; }
.anchor-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.anchor-icon .anchor-faint { stroke-width: 1.2; opacity: 0.5; }
.anchor-icon .anchor-strong { stroke-width: 2.4; }
.anchor-icon .anchor-tick { stroke-width: 1.5; }
.anchor-icon .anchor-dot { fill: var(--surface); stroke-width: 1.6; }
.icon-seg input:checked + span .anchor-dot, .anchor-grid input:checked + span .anchor-dot { fill: currentColor; }
.anchor-grid { border: 0; gap: 0; }
.anchor-grid span { width: 30px; height: 30px; }
.anchor-grid .anchor-icon { width: 30px; height: 30px; }
.anchor-seg .anchor-icon { width: 30px; height: 30px; transform: rotate(var(--turn, 0deg)); }
.door-types { flex-wrap: nowrap; width: fit-content; max-width: 100%; }
.door-types span { width: 42px; height: 38px; }

.icon-seg .door-type-icon { width: 34px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.door-type-icon .dt-wall { stroke-width: 4; stroke-linecap: butt; opacity: 0.6; }
.door-type-icon .dt-thin { stroke-width: 1.3; }
/* Door clearance clashes (#288): a warning, drawn in yellow dashes */
.opening .door-clash .leaf, .opening .door-clash .swing, .opening .door-clash .pocket, .opening .door-clash .track { stroke: var(--plan-estimated); }
.inspector dd.v-warning { color: var(--dim-estimated); }

/* The move pill (#352): the drag readout as fixed cells over fixed-width numbers, and what's changing by
   class. Labels sit above numbers; numbers right-align with the fraction in a fixed slot of its own, so
   nothing shifts while dragging. */
.tool-readout:has(> .move-pill) { padding: 0; border: none; background: none; display: block; white-space: normal; }
.move-pill {
  background: var(--pill-bg); color: var(--pill-text); border-radius: 14px; box-shadow: 0 8px 24px var(--pill-shadow);
  font-family: system-ui, -apple-system, sans-serif; letter-spacing: 0; font-variant-numeric: tabular-nums;
  overflow: hidden; max-width: min(30rem, calc(100vw - 20px)); text-align: left;
}
.mp-head { display: flex; align-items: stretch; padding: 6px 4px; }
.mp-cell { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 2px 10px; }
.mp-cell .mp-num { font-size: 1.05rem; font-weight: 600; display: flex; justify-content: flex-end; min-width: 5.75rem; white-space: nowrap; }
.mp-subject { flex: 1 1 auto; min-width: 0; }
.mp-name { font-size: 0.95rem; font-weight: 600; color: var(--pill-accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-label { font-size: 0.68rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pill-label); white-space: nowrap; }
.mp-sep { width: 1px; background: var(--pill-line); margin: 4px 2px; flex: none; }
.mp-toggle {
  all: unset; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 4.5rem; min-height: 44px; border-radius: 10px;
}
.mp-toggle:focus-visible { outline: 2px solid var(--pill-accent); outline-offset: -2px; }
.mp-count { font-size: 1.05rem; font-weight: 600; }
.mp-caret::after { content: "▾"; }
.move-pill[data-open="1"] .mp-caret::after { content: "▴"; }
.move-pill[data-open="0"] .mp-list { display: none; }
.mp-list { border-top: 1px solid var(--pill-line); padding: 6px 0 4px; max-height: 40dvh; overflow: auto; }
.mp-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem 5.5rem 4.5rem; column-gap: 8px; align-items: baseline;
  padding: 3px 14px; font-size: 0.82rem;
}
.mp-heads { padding-top: 4px; }
.mp-what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-n { display: flex; justify-content: flex-end; white-space: nowrap; }
.mp-was { color: var(--pill-label); }
.mp-change { color: var(--pill-change); font-weight: 600; }
.mp-group { display: flex; align-items: center; gap: 8px; padding: 8px 14px 2px; font-size: 0.75rem; color: var(--pill-label); }
.mp-tag { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: var(--pill-chip); }
.move-pill .conf-estimated { color: var(--pill-estimated); }
.move-pill .conf-unknown { color: var(--pill-unknown); }
.move-pill .q { display: inline-flex; align-items: baseline; justify-content: flex-end; }
.move-pill .qf { display: inline-block; width: 1.3em; text-align: left; }
.mp-notes { border-top: 1px solid var(--pill-line); padding: 8px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; }
.mp-notes .readout-warn { color: var(--pill-estimated); }
.mp-notes .readout-flag { color: var(--pill-flag); font-weight: 600; }
.mp-notes a { color: var(--pill-accent); align-self: flex-start; }
@media (max-width: 480px) {
  .mp-row { grid-template-columns: minmax(0, 1fr) 5rem 4.25rem; }
  .mp-row > .mp-was, .mp-heads > .mp-label:nth-child(2) { display: none; }
  .mp-cell .mp-num { min-width: 5rem; }
}
.mp-notes .readout-warn, .mp-notes .readout-flag { flex-basis: auto; text-align: left; }

/* Measure (#354): the dashed guide from the ruler's end to the point it measured straight to. */
.tool-layer .measure-guide { stroke: var(--plan-selection); stroke-dasharray: 4 4; }
.mp-notes .readout-note { color: var(--pill-label); font-size: 0.75rem; }
/* In the panel (#621) the move pill fills the readout strip: no shadow, no float. */
.tool-readout .move-pill { box-shadow: none; border-radius: 0; max-width: none; width: 100%; }
/* In the panel the pill's head wraps (#636): what's moving on its own line, the numbers sharing the next, so
   long labels ("To North-East Corner") never run into each other at the side column's width. */
.tool-readout .mp-head { flex-wrap: wrap; row-gap: 2px; }
.tool-readout .mp-subject { flex: 1 1 100%; }
.tool-readout .mp-subject + .mp-sep { display: none; }
.tool-readout .mp-head > .mp-cell:not(.mp-subject) { flex: 1 1 0; min-width: 0; }
.tool-readout .mp-head > .mp-cell:not(.mp-subject) .mp-label { overflow: hidden; text-overflow: ellipsis; }
.tool-readout .mp-head .mp-num { min-width: 0; }
.tool-readout .mp-head > .mp-toggle { flex: none; }

/* The toast (#636): what just happened, in small type at the top of the screen, just under the 56px top bar
   so it covers neither the bar nor the Move tool at the bottom; it fades out. */
.toast {
  position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); z-index: 60;
  transform: translate(-50%, -8px); opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease;
  display: flex; align-items: flex-start; gap: 4px; width: max-content; max-width: min(34rem, calc(100vw - 24px));
  padding: 4px 4px 4px 12px; border-radius: 10px; background: var(--toast-bg); color: var(--toast-text);
  box-shadow: 0 4px 16px var(--pill-shadow); font-size: 0.8rem; line-height: 1.35;
}
.toast[hidden] { display: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-body { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 6px 0; min-width: 0; }
.toast a { color: var(--toast-accent); font-weight: 600; }
.toast .readout-warn { color: var(--toast-warn); }
.toast .readout-flag { color: var(--toast-flag); font-weight: 600; }
.toast .readout-note { opacity: 0.8; }
.toast-close { flex: none; width: 32px; height: 32px; border: 0; background: none; color: inherit; font-size: 1.1rem; cursor: pointer; border-radius: 6px; }
.toast-close:focus-visible { outline: 2px solid var(--toast-accent); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; transform: translate(-50%, 0); } }
/* The Move tool (#368, decision 2026-11-14-the-move-tool): picked elements and the Move sheet. */
.el.picked .wall-body, .el.picked .fixture-body, .opening.picked .hit { fill: url(#hatch); stroke: var(--plan-selection); }
.move-sheet { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 0.45rem; }
.move-sheet .wall-note, .move-sheet .wall-error { flex-basis: auto; }
.move-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.move-head h2 { margin: 0 0.25rem 0 0; font-size: 1.35rem; font-weight: 400; }
.move-picked { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.move-picked li { display: inline-flex; align-items: center; min-height: 28px; padding: 0 0 0 0.6rem; border-radius: 14px; background: var(--chip-bg); color: var(--chip-text); font-size: 0.8rem; font-weight: 600; }
.move-picked button { width: 28px; height: 28px; border: 0; background: none; color: inherit; font: inherit; font-size: 1rem; cursor: pointer; }
.move-fields { display: grid; grid-template-columns: 4.5rem 44px minmax(0, 1fr) 44px; align-items: center; gap: 0.4rem 0.5rem; }
.move-axis { display: flex; flex-direction: column; line-height: 1.15; }
.move-axis b { font-size: 1.05rem; }
.move-axis span { font-size: 0.75rem; color: var(--muted); }
.move-axis.off { color: var(--muted); }
.move-sheet .move-fields input[type="text"] { width: auto; min-width: 0; min-height: 40px; text-align: right; font-size: 1.1rem; }
.move-sheet .move-fields input:disabled { border-style: dashed; color: var(--muted); }
.move-step { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 1.2rem; cursor: pointer; }
.move-step:disabled { color: var(--line); cursor: default; }
.move-why { grid-column: 2 / 5; margin-top: -0.2rem; font-size: 0.75rem; color: var(--muted); }
.move-why:empty { display: none; }
.move-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; font-size: 0.8rem; color: var(--muted); }
.move-step-size { display: inline-flex; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.move-step-size button { min-height: 32px; min-width: 44px; border: 0; border-left: 1px solid var(--line); background: none; color: var(--text); font: inherit; cursor: pointer; }
.move-step-size button:first-child { border-left: 0; }
.move-step-size button[aria-pressed="true"] { background: var(--chip-bg); color: var(--chip-text); font-weight: 600; }
.move-north { margin-left: auto; }
@media (max-width: 420px) { .move-pill .mp-cell .mp-num { min-width: 4.25rem; } .move-north { flex-basis: 100%; margin-left: 0; } }

/* 3D view of a floor (#414, epic #426). Colours come from the plan's tokens; floor3d.js reads them. */
body.floor-3d { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.floor-3d .site-header { display: none; }
.floor-3d main { width: 100%; flex: 1; min-height: 0; max-width: none; padding: 0; display: flex; flex-direction: column; }
.f3-header { flex: none; display: flex; align-items: center; gap: 0.25rem; min-height: 56px; padding: 0 0.5rem 0 0.15rem;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.f3-stage { flex: 1; min-height: 0; position: relative; background: var(--plan-ground); touch-action: none; overflow: hidden; }
.f3-stage canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.f3-tools { position: absolute; top: 0.5rem; right: 0.5rem; left: 0.5rem; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.35rem; pointer-events: none; }
.f3-tools > * { pointer-events: auto; }
.f3-btn { height: 32px; padding: 0 0.75rem; border: 1px solid var(--pill-line); border-radius: 16px; font: inherit; font-size: 0.8rem;
  background: var(--pill-bg); color: var(--pill-text); box-shadow: 0 1px 3px var(--pill-shadow); }
.f3-btn[aria-pressed="true"] { background: var(--pill-accent); border-color: var(--pill-accent); color: var(--pill-bg); }
.f3-note { position: absolute; left: 0.5rem; margin: 0; padding: 0.35rem 0.7rem; border-radius: 14px; font-size: 0.8rem;
  background: var(--pill-bg); color: var(--pill-text); box-shadow: 0 1px 3px var(--pill-shadow); max-width: calc(100% - 1rem); }
.f3-room-actions { display: inline-flex; gap: 0.35rem; }
.f3-room-actions[hidden] { display: none; }
.f3-note { top: 0.5rem; max-width: calc(100% - 16rem); }
.f3-legend { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; margin: 0; padding: 0.4rem 0.6rem;
  list-style: none; font-size: 0.75rem; color: var(--plan-line); pointer-events: none; }
.floor-3d main { position: relative; }
.f3-legend li { display: inline-flex; align-items: center; gap: 0.35rem; }
.f3-swatch { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.f3-swatch.measured { background: var(--plan-line); }
.f3-swatch.estimated { background: var(--plan-estimated); opacity: 0.7; }
.f3-swatch.unknown { border: 1.5px dashed var(--plan-unknown); }
.f3-swatch.structural { border: 2px solid var(--plan-structural); }
/* Render (#579) as a card on the right (#826), where the Sun panel sits; the Sun steps aside while a still is up. */
.f3-render { position: absolute; top: 3.2rem; right: 0.5rem; width: min(19rem, calc(100% - 1rem)); max-height: calc(100% - 6rem); overflow: auto;
  display: flex; flex-direction: column; gap: 0.55rem; padding: 0.6rem 0.75rem; border-radius: 14px; font-size: 0.85rem;
  background: var(--pill-bg); color: var(--pill-text); border: 1px solid var(--pill-line); box-shadow: 0 1px 6px var(--pill-shadow); z-index: 3; }
.f3-render[hidden], .f3-render button[hidden], .f3-render-group[hidden], .f3-render-notes[hidden] { display: none; }
.f3-stage.rendering .f3-sun, .f3-stage.rendering .f3-sun-pill { display: none; }
.f3-render-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.f3-render-head span { font-size: 0.8rem; opacity: 0.8; }
.f3-render-read { margin: 0; font-variant-numeric: tabular-nums; }
.f3-render-group { display: flex; flex-direction: column; gap: 0.3rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.f3-render-label { padding: 0; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.7; }
.f3-render-opts label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem; cursor: pointer; }
.f3-render-opts .hint { flex-basis: 100%; margin: 0 0 0 1.4rem; font-size: 0.75rem; opacity: 0.7; }
.f3-render-notes { margin: 0; padding: 0 0 0 1rem; font-size: 0.78rem; opacity: 0.8; display: flex; flex-direction: column; gap: 0.1rem; }
.f3-render-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.f3-render-actions button { flex: 1 1 auto; }
.f3-render-mode { display: inline-flex; gap: 0.2rem; }
.f3-render-mode button[aria-pressed="true"] { background: var(--accent); color: var(--surface); }
@media (max-width: 420px) { .f3-note { top: 2.9rem; max-width: calc(100% - 10rem); } }
@media (max-width: 480px) { .f3-wide { display: none; } }
/* The inspector over the 3D stage (#429): a bottom sheet on phones, a card at the bottom right on wider screens. */
.inspector.f3-inspector { position: absolute; top: auto; bottom: 0; left: 0; right: 0; max-height: 55%; z-index: 3; }
.f3-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); margin-bottom: 0.5rem; }
/* Wider screens: a floating card. `.inspector.f3-inspector` outranks the plan's desktop rule, which puts its
   inspector in the side column (position: static) and would push this one off the bottom of the stage. */
@media (min-width: 720px) {
  .inspector.f3-inspector { left: auto; right: 0.75rem; bottom: 2.4rem; width: 24rem; max-height: calc(100% - 5rem);
    border: 0; border-radius: 16px; box-shadow: 0 4px 18px var(--shadow); padding: 0.5rem 1rem 1rem; }
}

/* The Shopping List (#436) */
.sh-totals { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0; font-size: 0.95rem; }
.sh-totals strong { font-weight: 600; }
.sh-kind { display: flex; flex-wrap: wrap; gap: 0 1rem; border: 0; margin: 0; padding: 0; min-width: 0; }
.sh-kind legend { padding: 0; font-size: 0.85rem; color: var(--muted); }
.sh-group { display: flex; flex-direction: column; gap: 0.5rem; }
.sh-item { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; scroll-margin-top: 4rem; }
.sh-item.is-returned { opacity: 0.7; }
.sh-links { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; font-size: 0.9rem; }
.sh-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.5rem; }
.sh-step { display: flex; align-items: center; gap: 0.5rem; margin: 0; flex: 0 1 26rem; }
.sh-paid { flex: 1; min-width: 0; margin: 0; }
.sh-paid input { width: 100%; min-height: 40px; padding: 0.3rem 0.6rem; font: inherit; font-size: 1rem; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.sh-edit > summary, .ocard-buy .dv-add > summary { display: inline-flex; align-items: center; justify-content: center; }
.ocard-buy .dv-add > summary { width: 100%; max-width: 100%; box-sizing: border-box; white-space: normal; text-align: center; } /* no overflow on a phone (#651) */
.sh-step .btn { flex: none; white-space: nowrap; }
.sh-edit { flex: 1 1 100%; }
.sh-edit[open] { padding-top: 0.25rem; }
.ocard-buy { display: flex; flex-direction: column; gap: 0.4rem; }
.ocard-onlist { font-size: 0.85rem; }
/* North arrow and sun panel over the 3D stage (#463). */
.f3-north { position: absolute; left: 0.5rem; bottom: 2.4rem; width: 48px; height: 48px; display: grid; place-items: center;
  pointer-events: none; color: var(--plan-line); }
.f3-north svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(var(--north, 0deg)); }
.f3-north circle { fill: var(--plan-ground); stroke: var(--plan-line); stroke-width: 1.5; opacity: 0.85; }
.f3-north path { fill: var(--plan-line); }
.f3-north text { fill: var(--plan-line); font-size: 8px; font-weight: 700; }
@media (max-width: 480px) { .f3-north { bottom: 3.6rem; } }
.f3-sun .seg { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.f3-sun .seg label { position: relative; }
.f3-sun .seg input { position: absolute; opacity: 0; pointer-events: none; }
.f3-sun .seg span { display: inline-block; padding: 0.25rem 0.6rem; border: 1px solid var(--pill-line); border-radius: 12px; font-size: 0.8rem; cursor: pointer; }
.f3-sun .seg input:checked + span { background: var(--pill-accent); border-color: var(--pill-accent); color: var(--pill-bg); }
.f3-sun .seg input:focus-visible + span { outline: 2px solid var(--plan-selection); outline-offset: 2px; }
.f3-north.unset { opacity: 0.45; }
.f3-north.unset svg { transform: none; }
.f3-sun { position: absolute; top: 3.2rem; right: 0.5rem; width: min(20rem, calc(100% - 1rem)); padding: 0.6rem 0.75rem; border-radius: 14px;
  background: var(--pill-bg); color: var(--pill-text); box-shadow: 0 1px 6px var(--pill-shadow); font-size: 0.85rem; z-index: 2; }
.f3-sun[hidden], .f3-sun-missing[hidden], .f3-sun-controls[hidden] { display: none; }
.f3-sun-missing { margin: 0; }
.f3-sun-controls { display: flex; flex-direction: column; gap: 0.5rem; }
.f3-sun-time { display: flex; flex-direction: column; gap: 0.2rem; }
.f3-sun-time input { width: 100%; }
.f3-sun-read { margin: 0; color: var(--muted); }

/* A project's page and its phases (#437) */
.ph { gap: 1rem; }
.ph-card { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.ph-card .nu-head .btn-small { display: inline-flex; align-items: center; padding: 0 0.75rem; text-decoration: none; }
.ph-move { display: inline-flex; }
.ph-move form { margin: 0; }
.ph-links { display: flex; flex-direction: column; border-top: 1px solid var(--line); margin-top: 0.25rem; }
.ph-link { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.ph-link .pn-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.ph-board { margin-top: 0; padding: 0 0.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.ph-board .ph-link { border-bottom: 0; font-weight: 600; }
.ph-draft { display: flex; gap: 0.5rem; align-items: center; margin: 0.25rem 0 0; }
.ph-draft label { flex: 1; min-width: 0; margin: 0; }
.ph-draft input { width: 100%; min-height: 40px; padding: 0.3rem 0.6rem; font: inherit; font-size: 1rem; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.ph-empty { display: flex; flex-direction: column; gap: 0.75rem; align-items: flex-start; padding: 1rem; border: 1px dashed var(--line); border-radius: 12px; }
.db-where { margin: 0; font-size: 0.9rem; }
.db-phases { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.db-phases a { display: flex; align-items: center; gap: 0.75rem; min-height: 48px; padding: 0.4rem 0; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.also-picks { max-height: 16rem; overflow-y: auto; }
.ph > .pill-btn { align-self: flex-start; }
.ph-draft { max-width: 32rem; }
/* Trim Styles (#483). */
.ts-default { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem; margin: 1rem 0; }
.ts-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.ts-card { border: 1px solid var(--line); border-radius: 12px; padding: 0.75rem 1rem; background: var(--surface); }
.ts-card h2 { font-size: 1rem; margin: 0 0 0.25rem; }
.ts-sizes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem 0.75rem; margin: 0.5rem 0; }
.ts-sizes input { width: 100%; }
/* The sun panel's header, its minimised pill and the Roof toggle (#504). */
.f3-sun-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.4rem; }
.f3-sun-pill { position: absolute; top: 3.2rem; right: 0.5rem; z-index: 2; }
.f3-sun-pill[hidden] { display: none; }
.f3-roof { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem; }
.f3-roof .hint { flex-basis: 100%; margin: 0; font-size: 0.75rem; color: var(--muted); }
.f3-roof input:disabled + * { opacity: 0.5; }

/* What and Rooms (#515) and starter decisions (#517) */
.cover { display: flex; flex-direction: column; gap: 0.75rem; }
.cover-rooms { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.cover-rooms legend { padding: 0; margin-bottom: 0.25rem; }
.db-starters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0; }
.db-starters .hint { flex: 1 1 12rem; }
.cover .room-picks { padding-left: 0; }
.cover [hidden] { display: none !important; }
/* The design in the room (#511): what each colour is, and Compare's stepper. Above the legend, clear of north. */
.f3-key { position: absolute; right: 0.5rem; bottom: 2.4rem; width: min(20rem, calc(100% - 4.5rem)); max-height: 40%; overflow: auto;
  padding: 0.5rem 0.7rem; border-radius: 14px; background: var(--pill-bg); color: var(--pill-text); box-shadow: 0 1px 6px var(--pill-shadow);
  font-size: 0.8rem; z-index: 2; }
.f3-key[hidden], .f3-compare[hidden], .f3-key .hint[hidden] { display: none; }
.f3-key ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.f3-key li { display: flex; align-items: center; gap: 0.45rem; }
.f3-key .hint { margin: 0; }
.f3-bright { display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.4rem; }
.f3-bright input { flex: 1; min-width: 0; }
.f3-bright output { min-width: 2.8rem; text-align: right; font-variant-numeric: tabular-nums; }
.f3-bright button[hidden] { display: none; }
.f3-chip { flex: none; width: 14px; height: 14px; border-radius: 3px; box-shadow: 0 0 0 1px var(--pill-line); }
.f3-compare { display: flex; align-items: center; gap: 0.4rem; padding-bottom: 0.4rem; margin-bottom: 0.4rem; border-bottom: 1px solid var(--pill-line); }
.f3-compare-what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.f3-compare-what a { color: inherit; font-size: 0.75rem; }
.f3-compare button { font-size: 1.1rem; min-width: 2.2rem; }
/* Minimise (#843): folded, the key is its header row, plus Compare's stepper while comparing. */
.f3-key-head { display: flex; align-items: center; gap: 0.45rem; }
.f3-key-sum { flex: 1; min-width: 0; color: var(--muted); font-size: 0.75rem; }
.f3-key-head + * { margin-top: 0.35rem; }
.f3-key-body > :first-child { margin-top: 0.35rem; }
.f3-key.folded { width: auto; max-width: calc(100% - 4.5rem); }
.f3-key.folded .f3-key-body { display: none; }
.f3-key.folded .f3-compare { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
@media (max-width: 480px) { .f3-key { bottom: 3.6rem; max-height: 30%; } }
/* Schemes (#845): chips to wear a scheme (kept when minimised), then Edit and Save as Scheme in the body. */
.f3-schemes { align-items: center; padding-bottom: 0.4rem; margin-bottom: 0.4rem; border-bottom: 1px solid var(--pill-line); }
.f3-schemes .nu-chip { min-height: 36px; padding: 0 0.7rem; font-size: 0.78rem; }
.f3-key.folded .f3-schemes { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.f3-scheme-actions { display: flex; flex-wrap: wrap; align-items: center; column-gap: 1rem; padding-bottom: 0.4rem; margin-bottom: 0.4rem; border-bottom: 1px solid var(--pill-line); }
.f3-scheme-link { font-size: 0.78rem; min-height: 32px; padding: 0; }
.f3-scheme-save[open] { flex-basis: 100%; }
.f3-scheme-link[hidden] { display: none; }
.f3-scheme-save > summary { list-style: none; cursor: pointer; }
.f3-scheme-save > summary::-webkit-details-marker { display: none; }
.f3-scheme-save form { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.35rem; }
.f3-scheme-save label { display: flex; flex-direction: column; gap: 0.15rem; }
/* Delete Decision (#527): out of the way under Lock, a second tap to confirm. */
.dv-delete { margin-top: 1.25rem; text-align: center; }
.dv-delete summary { list-style: none; cursor: pointer; color: var(--danger); }
.dv-delete summary::-webkit-details-marker { display: none; }
.dv-delete form { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; text-align: left; }
/* Quick Add on a board card (#528): drop pictures on the card, or + Pictures; a sheet names each one. */
.dcard-box { position: relative; display: flex; flex-direction: column; border-radius: 12px; }
.dcard-box > .dcard { flex: 1; }
.dcard-box.is-drop-over > .dcard { border-color: var(--accent); border-style: dashed; background: var(--bg); }
.dcard-box .dcard-add { position: absolute; right: 0.6rem; bottom: 0.5rem; width: auto; min-height: 36px; padding: 0 0.8rem; font-size: 0.8rem; }
.dcard-box:has(.dcard-add:not([hidden])) .dcard-foot { padding-right: 6rem; }
.qa-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.qa-list li { display: flex; align-items: center; gap: 0.6rem; }
.qa-list label { flex: 1; min-width: 0; }
.qa-thumb { flex: none; width: 56px; height: 56px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
/* 3D Look on the option form (#542): the colour from the picture as a token, the finish picked, a colour by hand. */
.look { border: 1px solid var(--line); border-radius: 10px; padding: 0.5rem 0.75rem 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.look legend { padding: 0 0.25rem; font-size: 0.85rem; }
.look-label { font-size: 0.85rem; }
.look-token { margin: 0; display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; }
.look-token .swatch-chip { width: 18px; height: 18px; }
.look:not(:has(input[name="swatch_pick"][value="hand"]:checked)) .look-pick { display: none; }
/* Its Picture's width and polish (#792), only with that surface. */
.look:not(:has(select[name="swatch_finish"] option[value="picture"]:checked)) .look-picture { display: none; }
.look-accent { display: none; flex-direction: column; gap: 0.5rem; }
.look-accent-always,
.look:has(select[name="swatch_finish"] option[value="subway-tile"]:checked) .look-accent,
.look:has(select[name="swatch_finish"] option[value="floor-tile"]:checked) .look-accent,
.look:has(select[name="swatch_finish"] option[value="brick"]:checked) .look-accent { display: flex; }
.look-accent .acc-mortar,
.look:has(select[name="swatch_finish"] option[value="brick"]:checked) .look-accent .acc-grout { display: none; }
.look:has(select[name="swatch_finish"] option[value="brick"]:checked) .look-accent .acc-mortar { display: inline; }
.look:has(select[name="swatch_finish"] option[value="picture"]:checked) .look-accent { display: none; }
.look-picture { display: flex; flex-direction: column; gap: 0.5rem; }
/* The colour chips (#550, #562): Auto and Custom are pills; the picture's other colours are bare squares on a row of
   their own. Each is a radio; the picked one is ringed. `.dv-form` labels are columns, so these say row. */
.look-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.look-from { gap: 0.15rem 0.2rem; }
/* The Auto hint only while Auto is picked (#651). */
.look:has(input[name="swatch_pick"][value="auto"]:not(:checked)) .look-auto-hint { display: none; }
.look-from-label { flex-basis: 100%; font-size: 0.8rem; color: var(--muted); }
.dv-form .look-opt { position: relative; display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 0.4rem; min-height: 44px; padding: 0 0.85rem 0 0.55rem; border: 1px solid var(--line); border-radius: 22px; font-size: 0.85rem; color: var(--text); cursor: pointer; }
.dv-form .look-opt.look-text { padding: 0 0.85rem; }
.look-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.look-opt .swatch-chip { width: 22px; height: 22px; }
.look-opt .swatch-chip rect { stroke-width: 0.4; }
.dv-form .look-swatch { width: 44px; height: 44px; padding: 0; border-color: transparent; border-radius: 10px; }
.look-swatch .swatch-chip { width: 28px; height: 28px; }
.look-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.look-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.look-pick input[type="color"] { width: 3rem; height: 2rem; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }

/* Paste a Message (#653): on Next Up, and Who Is This From? */
.paste-message { margin: 0.5rem 0; }
.paste-message > .dv-form { margin-top: 0.25rem; }
.paste-who { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.paste-who legend { font-size: 0.85rem; color: var(--muted); padding: 0; margin-bottom: 0.25rem; }

/* From Email on Next Up (#654) */
.nu-email { margin: 0.75rem 0; }
.nu-email-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.nu-email .form-foot { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.nu-email .form-foot form { margin: 0; }

/* Request Quotes by Email (#655) */
.qr-sent { margin: 0.75rem 0; }
.qr-sent li { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.qr-sent .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.qr-sent .meta { display: block; }
.side-list.qr-sent a.btn { min-height: 40px; padding: 0 1rem; color: var(--surface); font-weight: 600; border-radius: 22px; }

/* The compact inspector (#711): the name, kind and trash in one header; numbers as tiles; actions and decisions
   as chips; read-only rows as a tight list. */
.insp-head { display: flex; align-items: center; gap: 2px; margin-right: -0.5rem; }
.insp-head [hidden] { display: none; }
.insp-title { flex: 1; min-width: 0; }
.inspector .insp-head h2 { margin: 0; font-size: 1.4rem; line-height: 1.15; }
.insp-name {
  display: block; width: 100%; min-height: 36px; padding: 0; border: 0; border-bottom: 1px dashed transparent;
  background: none; color: var(--text); font: inherit; letter-spacing: inherit;
}
.insp-name:hover { border-bottom-color: var(--line); }
.insp-name:focus { outline: none; border-bottom: 1px solid var(--accent); }
.insp-head .kind { font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insp-head .danger-text { color: var(--danger); }
.edit-form .insp-del { margin: 0; padding: 0; border: 0; }
.insp-del .delete-confirm { margin: 0; padding: 0.6rem 0.7rem; border: 1px solid var(--danger); border-radius: 10px; font-size: 0.9rem; }
.insp-del .delete-confirm p { margin: 0 0 0.5rem; }
.insp-del .inspector-actions { margin: 0; }
.edit-form.live-form { gap: 0.6rem; margin-top: 0; }

/* Tiles: a short label over the value. A floated legend stays out of the fieldset's border. */
.ef-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 0.5rem; }
.edit-form .ef-tile { display: block; min-width: 0; padding: 0.3rem 0.6rem 0.2rem; border: 1px solid var(--line); border-radius: 10px; cursor: text; }
.edit-form .ef-tile:focus-within { border-color: var(--accent); }
.edit-form .ef-tile.invalid { border-color: var(--danger); }
.ef-tile.ef-wide { grid-column: span 2; }
.ef-tiles .ef-tile[data-field="arch_rise"] { grid-column: span 2; }
.edit-form .ef-tile legend { float: left; width: 100%; margin: 0; padding: 0; font-size: 0.75rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edit-form .ef-tile .ef-row input::placeholder { font-size: 0.9rem; font-weight: 400; }
.ef-tile .ef-row { clear: both; }
.edit-form .ef-tile .ef-row input:not([type]) { min-height: 44px; padding: 0; border: 0; border-radius: 0; background: none; font-size: 1.1rem; font-weight: 600; }
.ef-tile .ef-help { margin: 0 0 0.15rem; font-size: 0.75rem; }
.ef-tile .icon-seg span { height: 36px; }

/* A fixture: its four sizes as a 2 × 2 beside the 9-point anchor, at a size you can tap. */
.edit-form .ef-pair { align-items: stretch; gap: 0.5rem; }
.edit-form .ef-pair-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.edit-form .ef-grid { justify-content: center; }
.edit-form .ef-grid legend { text-align: center; margin: 0 0 0.2rem; }
.edit-form .anchor-grid { grid-template-columns: repeat(3, 42px); margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.edit-form .anchor-grid span, .edit-form .anchor-grid .anchor-icon { width: 42px; height: 42px; }

/* A label and its control on one line: Use, a wall's Type, Trim. */
.edit-form .ef-inline { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) auto; align-items: center; column-gap: 0.5rem; }
.edit-form .ef-inline > legend, .edit-form .ef-inline > span { float: left; margin: 0; }
.ef-inline select { width: 100%; min-height: 44px; padding: 0 0.5rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.ef-inline .ef-link { font-size: 0.8rem; white-space: nowrap; }
.edit-form .ef-inline .seg { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.edit-form .ef-inline .seg span { min-height: 42px; }

/* Door type and head: icons across the sheet, the pick's name beside the label. */
.edit-form legend .ef-caption { margin-left: 0.3rem; color: var(--text); }
.edit-form .door-types { width: 100%; }
.edit-form .door-types label { flex: 1; }
.edit-form .door-types span { width: 100%; height: 42px; }
.edit-form .door-ways .way-set { gap: 0.35rem; }
.edit-form .door-ways .way { padding: 0.15rem; }
.edit-form .door-thumb { max-width: 52px; }

/* Actions and decisions as chips; the read-only rows as a tight list. */
.insp-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.inspector > .insp-chips, #f3-card > .insp-chips { margin-top: 0.6rem; }
.insp-chips .inspector-cover { display: contents; }
.insp-chips .change-error { flex-basis: 100%; font-size: 0.8rem; }
.chip-btn {
  min-height: 40px; display: inline-flex; align-items: center; gap: 4px; padding: 0 0.8rem; border: 1px solid var(--line);
  border-radius: 20px; background: var(--surface); color: var(--accent); font: inherit; font-size: 0.85rem; text-decoration: none; cursor: pointer;
}
.chip-btn svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip-btn.chip-on { background: var(--chip-bg); border-color: var(--chip-bg); color: var(--chip-text); }
.chip-btn:disabled { opacity: 0.5; }
.insp-sect { margin-top: 0.6rem; }
.insp-sect-h { display: block; margin-bottom: 0.3rem; font-size: 0.75rem; color: var(--muted); }
.insp-sect .muted { font-size: 0.85rem; }
.inspector dl.insp-details { margin: 0.6rem 0 0; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0.25rem 0.6rem; font-size: 0.85rem; }
.inspector dl.insp-details dt { font-size: 0.8rem; }
.insp-foot { margin: 0.6rem 0 0; font-size: 0.75rem; }
.edit-form .ef-tile[hidden] { display: none; }
/* The project page's phases (#738): the heading row with Add Phase, and each phase's drafts. */
.ph-title { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.ph-title .group-title { margin: 0; }
.ph-h { margin: 0.5rem 0 0; font-size: 0.8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.ph-card .hint { margin: 0; }
/* A project's whole board (#739): a section per phase. */
.dv-phase { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.dv-phase-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.dv-phase-head h2 { margin: 0; font-size: 1.3rem; }
/* Floors (#741): the order, with the first as the cover. */
.fo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.fo-list li { display: flex; align-items: center; gap: 0.75rem; min-height: 52px; border-bottom: 1px solid var(--line); }
.fo-name { flex: 1; display: flex; align-items: center; gap: 0.6rem; color: var(--text); text-decoration: none; min-height: 44px; }
/* The panel's Floors and Projects headings, each with an edit pencil to its manage screen (#750). */
.pn-hrow { display: flex; align-items: center; justify-content: space-between; padding-right: 0.5rem; }
.pn-hrow .pn-h { flex: 1; }
.pn-edit { color: var(--muted); }
.pn-edit svg { width: 18px; height: 18px; }
.pn-edit[aria-current="page"] { color: var(--accent); }
@media (min-width: 1024px) { .rail-min .pn-hrow { display: none; } }
.fo-name .grow { flex: 1; min-width: 0; }
.fo-list form { margin: 0; }
.fo-archived .fo-name { color: var(--muted); }
.fo-list .btn-small { min-height: 44px; padding: 0 0.9rem; }
/* Manage screens' rows (#759): name and counts stacked; Rename as a pencil. */
.fo-two { display: flex; flex-direction: column; gap: 0.1rem; line-height: 1.25; }
.fo-act { color: var(--muted); }
.fo-act svg { width: 18px; height: 18px; }

/* Schemes on a project's board and a scheme's page (#845; decision 2026-11-23-schemes). */
.sc-bar { margin-bottom: 1rem; }
.sc-bar .nu-chips { align-items: flex-start; }
.sc-new > summary { list-style: none; cursor: pointer; }
.sc-new > summary::-webkit-details-marker { display: none; }
.sc-new[open] { flex-basis: 100%; }
.sc-new[open] > .dv-form { margin-top: 0.5rem; }
.sc-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.sc-row { display: flex; flex-direction: column; gap: 0.25rem; }
.sc-row select { min-height: 44px; }
.sc-form .group-title { margin-top: 0.75rem; }

/* The Costs sheet (#854). Lines and totals in their own spaces: on a wide screen a table with the totals beside it,
   on the phone the totals first, then rows. Estimates use the estimated colour; a line with no number, the unknown. */
.cs { gap: 1rem; }
.cs-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.cs-by { align-items: center; }
.cs-wrap { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.cs-totals { flex: 1 1 18rem; max-width: 24rem; display: flex; flex-direction: column; gap: 0.6rem; padding: 0.9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.cs-lines { flex: 999 1 36rem; min-width: 0; order: -1; }
.cs-figures { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.cs-figures dt { font-size: 0.8rem; color: var(--muted); }
.cs-figures dd { margin: 0; font-size: 1.1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.cs-figures dd.big { font-size: 1.4rem; }
.cs-figures .over dd, .cs-figures .over dt { color: var(--danger); }
.cs-firm { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--bg); }
.cs-f-paid { background: var(--text); }
.cs-f-committed { background: var(--accent); }
.cs-f-priced { background: var(--chip-bg); }
.cs-f-estimated { background: var(--dim-estimated); }
.cs-legend, .cs-other { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.cs-legend li { display: flex; align-items: center; gap: 0.5rem; }
.cs-dot { width: 10px; height: 10px; border-radius: 5px; flex: none; }
.cs-warn { margin: 0; font-size: 0.85rem; color: var(--dim-estimated); }
.cs-other li { display: flex; flex-direction: column; gap: 0.2rem; }
.cs-other-row { display: flex; justify-content: space-between; gap: 0.5rem; }
.cs-meter { display: block; height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.cs-meter span { display: block; height: 100%; background: var(--accent); }
.cs-kind { flex: none; display: inline-block; min-width: 2.4rem; margin-right: 0.5rem; padding: 0.1rem 0; border-radius: 10px; text-align: center; font-size: 0.7rem; font-weight: 600; background: var(--chip-bg); color: var(--chip-text); }
.cs-kind.job { background: var(--bg); color: var(--text); border: 1px solid var(--line); }
.cs-sub { display: block; font-size: 0.7rem; font-weight: 400; color: var(--muted); font-style: normal; }
.cs-proj { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.cs-estimate .cs-proj, .cs-est { color: var(--dim-estimated); }
.cs-estimate .cs-proj { font-style: italic; }
.cs-none .cs-proj { color: var(--dim-unknown); }
.cs-returned { opacity: 0.6; }
/* Wide: the table. */
.cs-table-box { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.cs-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.cs-table th, .cs-table td { padding: 0.5rem 0.65rem; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; vertical-align: top; }
.cs-table th[scope="row"], .cs-table thead th:first-child, .cs-group th { text-align: left; white-space: normal; font-weight: 400; }
.cs-table thead th { font-size: 0.75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.cs-table .cs-group th, .cs-table .cs-group td { background: var(--bg); font-weight: 600; }
.cs-table tfoot th, .cs-table tfoot td { border-bottom: 0; font-weight: 600; }
/* Phone: the totals first, then rows. */
.cs-list { display: none; flex-direction: column; gap: 0.75rem; }
.cs-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cs-card-head { margin: 0; display: flex; justify-content: space-between; padding: 0.55rem 0.75rem; background: var(--bg); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.cs-card-head span:last-child { color: var(--text); font-variant-numeric: tabular-nums; }
.cs-row { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0.5rem 0.75rem; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; }
.cs-row .grow, .cs-legend .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
@media (max-width: 47.99rem) {
  .cs-lines { order: 0; }
  .cs-totals { max-width: none; }
  .cs-table-box { display: none; }
  .cs-list { display: flex; }
}
/* Desktop tool readouts on the plan (#863, decision 2026-11-24-desktop-tool-readouts-on-the-plan). From 1024 px
   the live number rides the cursor, the tool's compact card sits bottom left, New Wall opens beside its end
   point and Move's fields sit by what's picked. hud.js moves the pieces; the phone keeps the panel. */
.plan-hud, .cursor-tag, .move-at { display: none; }
.fv-panel .mp-lead, .fv-panel .mp-close, .fv-panel .mp-desk, .fv-panel .wall-from-toggle { display: none; }
@media (min-width: 1024px) {
  .plan-hud.on {
    display: flex; flex-direction: column; left: 12px; bottom: 12px; z-index: 4; max-width: calc(100% - 96px); max-height: calc(100% - 24px);
    background: var(--pill-bg); color: var(--pill-text); border-radius: 12px; box-shadow: 0 6px 24px var(--pill-shadow);
    overflow: auto; font-family: system-ui, -apple-system, sans-serif; letter-spacing: 0;
  }
  .plan-area.hud-on .title-block { display: none; }
  .plan-hud .tool-readout { background: none; color: var(--pill-text); font-family: inherit; letter-spacing: 0; padding: 8px 12px; justify-content: flex-start; }
  .plan-hud .tool-readout:has(> .move-pill) { padding: 0; }
  .plan-hud .tool-readout .readout-warn { color: var(--pill-estimated); text-align: left; }
  .plan-hud .tool-readout .readout-flag { color: var(--pill-flag); text-align: left; }
  .plan-hud .move-pill { box-shadow: none; border-radius: 0; max-width: none; }
  .plan-hud .mp-head { align-items: center; flex-wrap: nowrap; padding: 4px 2px 4px 4px; }
  .plan-hud .tool-readout .mp-head > .mp-cell:not(.mp-subject) { flex: none; }
  .plan-hud .tool-readout .mp-head .mp-num { min-width: 4.75rem; }
  .plan-hud .tool-readout .mp-subject + .mp-sep { display: block; }
  .plan-hud .mp-notes { max-width: 34rem; }
  .plan-hud .mp-cell { padding: 0 10px; gap: 1px; }
  .plan-hud .mp-cell .mp-num { font-size: 0.95rem; min-width: 4.75rem; }
  .plan-hud .tool-readout .mp-subject { flex: 0 1 auto; max-width: 12rem; }
  .plan-hud .mp-subject > .mp-label { display: none; }
  .plan-hud .mp-subject:has(.mp-name:empty), .plan-hud .mp-subject:has(.mp-name:empty) + .mp-sep,
  .plan-hud .move-pill:has(.mp-lead) .mp-subject, .plan-hud .move-pill:has(.mp-lead) .mp-subject + .mp-sep { display: none; }
  .plan-hud .mp-toggle { min-width: 3.5rem; min-height: 36px; }
  .plan-hud .readout-note { display: none; }
  .plan-hud .mp-notes:not(:has(> :not(.readout-note))) { display: none; }
  .plan-hud > .tool-readout:not([hidden]) + .move-sheet:not([hidden]) { border-top: 1px solid var(--pill-line); }
  .mp-mode { display: flex; gap: 2px; padding: 2px; margin: 0 4px; border-radius: 9px; background: var(--pill-chip); }
  .mp-mode button { min-width: 36px; height: 32px; padding: 0 8px; border: 0; border-radius: 7px; background: none; color: var(--pill-text); font: 500 0.75rem system-ui, -apple-system, sans-serif; cursor: pointer; }
  .mp-mode button[aria-pressed="true"] { background: var(--pill-bg); box-shadow: 0 1px 2px var(--pill-shadow); }
  .mp-close { flex: none; width: 36px; height: 36px; margin-left: 2px; border: 0; border-radius: 8px; background: none; color: var(--pill-label); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
  .mp-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .mp-close:focus-visible, .mp-mode button:focus-visible { outline: 2px solid var(--pill-accent); outline-offset: -2px; }

  /* Move's sheet as one row in the card: what's picked, the step, Move and ×. */
  .plan-hud .move-sheet { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; background: none; color: var(--pill-text); }
  .plan-hud .move-head, .plan-hud .move-steps, .plan-hud .move-sheet .wall-actions { display: contents; }
  .plan-hud .move-head h2, .plan-hud .move-conf, .plan-hud .move-north, .plan-hud .move-steps > span:first-child, .plan-hud [data-move-reset] { display: none; }
  .plan-hud .move-picked, .plan-hud .move-hint { order: 1; }
  .plan-hud .move-head .move-picked { flex-basis: auto; }
  .plan-hud .move-hint { flex-basis: auto; margin: 0; font-size: 0.85rem; color: var(--pill-label); }
  .plan-hud .move-step-size { order: 2; }
  .plan-hud .move-sheet [type="submit"] { order: 3; }
  .plan-hud .move-head .icon-btn { order: 4; margin-left: 0; }
  .plan-hud .move-sheet .wall-error { order: 5; flex-basis: 100%; }

  /* Move's X and Y beside what's picked. */
  .move-at:not([hidden]) {
    display: block; position: absolute; z-index: 5; padding: 6px 8px; border-radius: 10px;
    background: var(--pill-bg); color: var(--pill-text); box-shadow: 0 4px 16px var(--pill-shadow);
    font-family: system-ui, -apple-system, sans-serif; letter-spacing: 0;
  }
  .move-at .move-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; max-width: 16rem; }
  .move-at .move-step, .move-at [data-axis-way] { display: none; }
  .move-at .move-axis b { font-size: 0.75rem; font-weight: 600; color: var(--pill-label); }
  .move-at .move-axis.off b { opacity: 0.5; }
  .move-at input[type="text"] {
    width: 5.5rem; min-height: 34px; padding: 0 8px; border: 1px solid var(--pill-line); border-radius: 7px; background: var(--pill-bg);
    color: var(--pill-text); font: 600 0.95rem system-ui, -apple-system, sans-serif; text-align: right; font-variant-numeric: tabular-nums;
  }
  .move-at input[type="text"]:focus { outline: none; border: 2px solid var(--pill-accent); }
  .move-at input:disabled { border-style: dashed; color: var(--pill-label); }
  .move-at .move-why { flex-basis: 100%; margin: 0; font-size: 0.72rem; color: var(--pill-label); }
  .move-at .move-why:empty { display: none; }

  /* The cursor tag: the live number(s) beside the pointer, never in its way. */
  .cursor-tag:not([hidden]) { display: flex; gap: 4px; position: absolute; z-index: 6; pointer-events: none; font: 600 0.8rem system-ui, -apple-system, sans-serif; letter-spacing: 0; font-variant-numeric: tabular-nums; }
  .ct-part { padding: 2px 7px; border-radius: 6px; background: var(--pill-bg); color: var(--pill-text); box-shadow: 0 2px 8px var(--pill-shadow); white-space: nowrap; }
  .ct-part + .ct-part { color: var(--pill-label); font-weight: 500; }
  .ct-part.conf-estimated { color: var(--pill-estimated); }
  .ct-part.conf-unknown { color: var(--pill-unknown); }

  /* New Wall as a small dialog beside the end point: Length, Measured, From Start / End and the buttons. */
  .wall-sheet.wall-pop {
    position: absolute; z-index: 7; width: 16rem; box-sizing: border-box; padding: 12px; gap: 8px;
    border-radius: 12px; box-shadow: 0 8px 28px var(--pill-shadow); font-family: system-ui, -apple-system, sans-serif; letter-spacing: 0;
  }
  .wall-pop .sheet-head, .wall-pop .wall-note { display: none; }
  .wall-pop > label[for] { flex-basis: 100%; margin-bottom: -4px; font-size: 0.7rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
  .wall-pop > input[type="text"] { flex: 1 1 100%; width: auto; min-width: 0; box-sizing: border-box; font-weight: 600; }
  .wall-pop .wall-from[data-folded="1"] { display: none; }
  .wall-pop .wall-from label input { width: 6.5rem; }
  .wall-from-toggle:not([hidden]) { margin-left: auto; min-height: 32px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 0.85rem; cursor: pointer; }
  .wall-pop .wall-actions { flex-basis: 100%; justify-content: flex-end; margin-left: 0; }
}

/* The Jobs screen's phase row, in a project (#942) */
.jo-bar { flex-wrap: nowrap; }
.jo-bar .seg { flex: none; }
.jo-phase { flex: 1; min-width: 0; display: flex; gap: 0.4rem; }
.jo-phase label { flex: 1; min-width: 0; display: flex; }
.jo-phase select { flex: 1; min-width: 0; min-height: 44px; border-radius: 22px; padding: 0 0.75rem; }
.jo-phase.js-jump .jump-go { display: none; }
.jo-bar .pill-btn.icon-only { flex: none; width: 44px; padding: 0; justify-content: center; }
.jo-group { display: grid; gap: 0.5rem; }
.jo-group .group-title { margin: 0.5rem 0 0; }

/* A warning as a short chip that opens to its full text on a tap (#982): structural ("Needs engineer") and
   BC Building Code guards ("Code check"). It opens in place, so it never overflows a narrow chat. */
.warn-chip { display: block; margin-top: 0.45rem; max-width: 100%; font-size: 0.8rem; }
.warn-chip[hidden] { display: none; }
.warn-chip > summary { display: inline-flex; align-items: baseline; gap: 0.25rem; max-width: 100%; cursor: pointer; list-style: none;
  border: 1px solid var(--dim-estimated); color: var(--dim-estimated); border-radius: 999px; padding: 0.05rem 0.55rem; }
.warn-chip > summary::-webkit-details-marker { display: none; }
.warn-chip > summary:focus-visible { outline: 2px solid var(--dim-estimated); outline-offset: 2px; }
.warn-chip-mark { font-weight: 600; }
.warn-chip-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warn-chip-body { margin-top: 0.35rem; padding: 0.45rem 0.6rem; border: 1px solid var(--dim-estimated); border-radius: 10px; }
