/* 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;
  --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.10);
  --plan-estimated: #ffc35a;
  --plan-unknown: #ffb3aa;
  --plan-selection: #7fe3ff;
  --plan-selection-fill: rgba(127, 227, 255, 0.15);
  --plan-chalk: #fffdf2;
}

@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;
    --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;
  }
}

@font-face { font-family: "Architects Daughter"; font-weight: 400; font-display: swap; src: url("fonts/ArchitectsDaughter-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 400; font-display: swap; src: url("fonts/BarlowCondensed-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("fonts/BarlowCondensed-600.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; }

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: "Architects Daughter", 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); }

/* --- 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); }
@media (max-width: 420px) {
  .fv-header .icon-btn { width: 38px; }
  .rev-select { max-width: 6.5rem; }
}
.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; }

/* Overlays on the blueprint: they use the plan tokens, not the chrome. */
.plan-overlay { position: absolute; color: var(--plan-line); font-family: "Barlow Condensed", sans-serif; 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: 600 8px "Barlow Condensed", sans-serif; 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: "Architects Daughter", 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: 40px; height: 40px; 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; }
.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: a bottom sheet on phones, a floating card on wider screens. Calm chrome, never blueprint. */
.inspector, .sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 60%; 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 .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); }
.structural-card { margin-top: 0.75rem; padding: 0.5rem 0.7rem; border: 1px solid var(--dim-estimated); border-radius: 10px; font-size: 0.85rem; }
.structural-card strong { color: var(--dim-estimated); }

/* 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); }

@media (min-width: 760px) {
  .inspector, .sheet { left: auto; right: 64px; top: 12px; bottom: auto; width: 22rem; max-height: calc(100% - 24px); border-radius: 12px; box-shadow: 0 4px 18px var(--shadow); }
  .inspector .grip, .sheet .grip { display: none; }
}

/* --- 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); }
.wall-body { fill: var(--plan-line); stroke: var(--plan-line); stroke-linejoin: miter; }
.status-demo .wall-body { fill: none; stroke: var(--plan-muted); }
.status-new .wall-body { fill: var(--plan-ground); stroke: var(--plan-line); }
.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); }
.label { font-family: "Barlow Condensed", sans-serif; font-weight: 600; fill: var(--plan-line); text-anchor: middle; }
.room-area { font-weight: 400; fill: var(--plan-muted); }
.dim-text { font-family: "Barlow Condensed", sans-serif; 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; }
.conf-designed .dim-line, .conf-designed .tick { stroke: var(--plan-chalk); filter: url(#chalk); }
.conf-designed .dim-text { fill: var(--plan-chalk); font-family: "Architects Daughter", cursive; }
.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:focus-visible .hit, .el:focus-visible .room-fill { stroke: var(--plan-selection); stroke-dasharray: none; }
.tb-box { fill: var(--plan-ground); stroke: var(--plan-line); }
.tb-title { font-family: "Architects Daughter", 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-fixtures [data-layers~="fixtures"], .hide-dims [data-layers~="dims"], .hide-labels [data-layers~="labels"] { 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; }
.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-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: 36px; padding: 0 0.75rem;
  border: 1px solid var(--line); border-radius: 18px; 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"], .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; }
.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; }
.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-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; }
.btn-choose, .btn-quiet {
  width: 100%; min-height: 40px; padding: 0 0.75rem; border-radius: 20px; font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.btn-choose { border: 1px solid var(--accent); background: var(--surface); color: var(--accent); }
.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%; }
.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); }
  .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; }
}

/* 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); }
