/* Light paper, navy text and cobalt actions, with green for a match, amber for a mismatch and red for something
   that still needs an answer: the palette of the guided visit preview the office chose. Every colour is paired
   with a label or an icon. */
:root {
  --ink: #182a36; --muted: #52616c; --line: #d7deea; --panel: #ffffff; --page: #f5f6f2;
  --brand: #174ea6; --brand-ink: #ffffff; --accent: #784605; --soft: #e9f2ff; --warn-bg: #fff2df;
  --error: #a3271f; --error-bg: #fdecea; --done: #215744; --good-bg: #eaf5ee; --chip: #f7f9fc;
  --na: #46525c; --na-bg: #e9edf1; --field: #eaf2ff; --field-line: #5f7fb5;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #ecf2fb; --muted: #b9c7d9; --line: #46576d; --panel: #1d2737; --page: #151c29;
    --brand: #a5ccff; --brand-ink: #122947; --accent: #ffd397; --soft: #243a58; --warn-bg: #4a351d;
    --error: #ffb3ab; --error-bg: #4a2320; --done: #b6e7d0; --good-bg: #234336; --chip: #222e41;
    --na: #c9d3df; --na-bg: #334155; --field: #0f1723; --field-line: #7f9fd6; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 18px/1.45 system-ui, -apple-system, 'Segoe UI', sans-serif;
  padding-bottom: env(safe-area-inset-bottom); }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 1rem 0 .5rem; }
h3 { font-size: 1.02rem; margin: 0; }
p { margin: .3rem 0 .6rem; }
button, .button, input, select, textarea { font: inherit; color: inherit; }
button, .button { min-height: 48px; padding: .45rem .9rem; border: 1px solid var(--line); border-radius: .6rem;
  background: var(--panel); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; touch-action: manipulation; }
button.primary, .button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
button.danger { border-color: var(--error); color: var(--error); }
button.link { border: 0; background: none; min-height: 36px; padding: .2rem .3rem; }
button:disabled { opacity: .45; }
/* Every box to type in has its own background and a firm edge, so it never reads as part of the card. */
input, select, textarea { width: 100%; min-height: 44px; padding: .45rem .55rem; border: 2px solid var(--field-line);
  border-radius: .45rem; background: var(--field); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, select:focus, textarea:focus { background: var(--panel); }
textarea { resize: vertical; }
label { display: block; font-weight: 600; font-size: .95rem; }
label.inline { display: inline-flex; gap: .5rem; align-items: center; }
label.inline select { width: auto; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .8rem;
  padding: calc(.5rem + env(safe-area-inset-top)) 1rem .5rem; background: var(--brand); color: var(--brand-ink); }
.top .title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.top .title span { font-size: .85rem; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .back { background: transparent; color: var(--brand-ink); border-color: var(--brand-ink); }
.saved { font-size: .85rem; opacity: .9; }
.banner { padding: .6rem 1rem; background: var(--warn-bg); border-bottom: 1px solid var(--line); }
.banner.error { color: var(--error); font-weight: 600; }
.banner.storage { border-left: .4rem solid var(--accent); }
.view { max-width: 60rem; margin: 0 auto; padding: 1rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: .7rem; padding: 1rem; margin: 0 0 1rem; }
.panel.quiet { background: transparent; border-style: dashed; color: var(--muted); }
.panel.holds { border-left: .35rem solid var(--accent); background: var(--warn-bg); color: var(--accent); }
.panel.notice { border-left: .35rem solid var(--brand); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: .6rem 0; }
.hint { color: var(--muted); font-size: .92rem; }
.cases, .kept-files { list-style: none; padding: 0; margin: 0; }
.cases li, .kept-files li { display: flex; gap: .8rem; align-items: center; justify-content: space-between; padding: .7rem 0;
  border-top: 1px solid var(--line); flex-wrap: wrap; }
.cases li:first-child, .kept-files li:first-child { border-top: 0; }
.cases .meta, .kept-files .meta { color: var(--muted); font-size: .9rem; }
.tabs { position: sticky; top: calc(3.6rem + env(safe-area-inset-top)); z-index: 4; display: flex; gap: .35rem;
  overflow-x: auto; padding: .4rem 0 .6rem; background: var(--page); }
.tabs button { flex: 1 0 auto; border-radius: 2rem; }
.tabs button[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.tabs span:not(:empty) { margin-left: .35rem; font-weight: 500; }
.holds summary { font-weight: 700; cursor: pointer; }
.progress { font-weight: 650; }
.group { margin: 0 0 1rem; }
.group > summary { font-weight: 700; font-size: 1.1rem; padding: .6rem 0; cursor: pointer; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: .7rem; padding: .8rem 1rem; margin: 0 0 .7rem; }
.item.done { border-left: .35rem solid var(--done); }
.item header { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.badge { font-size: .78rem; font-weight: 700; padding: .1rem .5rem; border-radius: 1rem; background: var(--soft); white-space: nowrap; }
.badge.check { background: var(--warn-bg); color: var(--accent); }
.why, .facts { color: var(--muted); font-size: .9rem; margin: .2rem 0; }
.facts { padding-left: 1.1rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.chips button { background: var(--chip); border-color: var(--line); border-radius: 2rem; font-weight: 600; }
.chips button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.item-photos { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .4rem; }
.thumb { width: 72px; height: 72px; border-radius: .4rem; object-fit: cover; background: var(--soft); border: 1px solid var(--line); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .8rem; }
.photo { background: var(--panel); border: 1px solid var(--line); border-radius: .7rem; padding: .5rem; font-size: .88rem; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .4rem; background: var(--soft); display: block; }
.photo .name { font-weight: 650; overflow-wrap: anywhere; }
.photo .meta { color: var(--muted); overflow-wrap: anywhere; }
.photo select { margin: .3rem 0; min-height: 40px; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 .5rem; }
.segmented { display: inline-flex; }
.segmented button { border-radius: 0; margin-left: -1px; }
.segmented button:first-child { border-radius: .5rem 0 0 .5rem; }
.segmented button:last-child { border-radius: 0 .5rem .5rem 0; }
.segmented button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.surface-frame { overflow: auto; max-height: 75vh; border: 1px solid var(--line); border-radius: .5rem; background: #fff;
  -webkit-overflow-scrolling: touch; }
.surface { position: relative; width: 100%; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.surface img { display: block; width: 100%; height: auto; pointer-events: none; }
.surface svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.surface svg polyline { fill: none; stroke: #c4150c; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round;
  vector-effect: non-scaling-stroke; }
.wall, .deficiency { border: 1px solid var(--line); border-radius: .7rem; padding: .7rem 1rem; margin: 0 0 .7rem; background: var(--panel); min-width: 0; }
.wall legend, .deficiency legend { font-weight: 700; padding: 0 .3rem; }
.row { display: flex; flex-wrap: wrap; gap: .5rem .8rem; margin-bottom: .4rem; }
.row > label { flex: 1 1 9rem; min-width: 0; }
.row > label.grow { flex: 3 1 14rem; }
.deficiency details { margin-top: .5rem; }
.deficiency summary { cursor: pointer; font-weight: 650; padding: .3rem 0; }
.summary li, .problems li { margin: .25rem 0; }
.problems { color: var(--error); font-weight: 600; }
#send-history { padding-left: 1.2rem; }
@media (max-width: 40rem) { body { font-size: 16px; } .view { padding: .6rem; } }
/* Records beside what was found on site. */
.beside { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .9rem; margin: .5rem 0; padding: .55rem .75rem;
  border: 1px solid var(--line); border-radius: .55rem; background: var(--chip); }
.beside .k { display: block; font-size: .76rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.beside b { font-weight: 650; overflow-wrap: anywhere; }
.beside ul { margin: .25rem 0 0; padding-left: 1rem; color: var(--muted); font-size: .88rem; }
.beside li.differs { color: var(--accent); font-weight: 650; }
.beside .seen { border-left: 1px solid var(--line); padding-left: .9rem; }
.beside.agrees .seen b { color: var(--done); }
.beside.differs .seen b { color: var(--accent); }
@media (max-width: 30rem) { .beside { grid-template-columns: 1fr; }
  .beside .seen { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: .35rem; } }
/* The sketch: county walls, drawn lines, closed areas and their labels. The labels keep their size when zoomed. */
.surface { touch-action: none; }
.surface svg polyline.county { stroke: #1f5fa8; stroke-width: 3; stroke-dasharray: 7 5; }
.surface svg polyline.county.confirmed { stroke: #2f6b3d; stroke-dasharray: none; }
.surface svg polyline.county.corrected, .surface svg polyline.county.not_observed { stroke: #b8641c; stroke-dasharray: 2 5; }
.surface svg polyline.drawn-line { stroke: #c4150c; stroke-width: 3; }
.surface svg polyline.pending { stroke-dasharray: 6 4; }
.surface svg polygon.face { stroke: none; vector-effect: non-scaling-stroke; }
.surface svg .face.living { fill: rgba(47, 107, 61, .12); }
.surface svg .face.garage { fill: rgba(90, 90, 90, .16); }
.surface svg .face.porch, .surface svg .face.screened_enclosure { fill: rgba(184, 100, 28, .14); }
.surface svg .face.other { fill: rgba(31, 95, 168, .12); }
.surface svg .face.unmeasured { fill: none; }
.marks { position: absolute; inset: 0; pointer-events: none; }
.mark { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; min-height: 30px; padding: .1rem .4rem;
  font-size: .8rem; font-weight: 700; line-height: 1.1; white-space: nowrap; border-radius: .4rem; background: #fff;
  color: #172d30; border: 1px solid #9fb3ad; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.mark.county { border-color: #1f5fa8; color: #1f5fa8; }
.mark.county.confirmed { border-color: #2f6b3d; color: #fff; background: #2f6b3d; }
.mark.county.corrected, .mark.county.not_observed { border-color: #b8641c; color: #b8641c; }
.mark.length { border-color: #c4150c; color: #c4150c; }
.mark.length.editing { background: #c4150c; color: #fff; }
.mark.live { pointer-events: none; transform: translate(12px, -130%); }
.mark.area { font-weight: 650; background: rgba(255, 255, 255, .92); }
.mark.area.unmeasured { font-weight: 500; color: #5b6b68; border-style: dashed; }
#area-summary ul { padding-left: 1.1rem; margin: .2rem 0; }
#area-summary .total { font-weight: 700; }
#area-summary .agrees { color: var(--done); font-weight: 700; }
#area-summary .differs { color: var(--accent); font-weight: 700; }
#line-editor input { width: 7rem; }
dialog.camera { width: min(60rem, 96vw); max-height: 96vh; padding: 1rem; border: 0; border-radius: .8rem;
  background: var(--panel); color: var(--ink); }
dialog.camera::backdrop { background: rgba(0, 0, 0, .6); }
dialog.camera h2 { margin-top: 0; }
dialog.camera video, dialog.camera img { display: block; width: 100%; max-height: 65vh; background: #000;
  border-radius: .5rem; object-fit: contain; }
dialog.camera [hidden] { display: none; }

#shape-palette { margin: .5rem 0; border: 1px solid var(--line); border-radius: .5rem; }
#shape-palette input { width: 6rem; }
.surface svg polyline.observation { stroke: #664290; stroke-width: 2.5; stroke-dasharray: 6 3; }
.mark.observation { color: #513276; background: white; pointer-events: none; }
.surface.placing-observation .mark { pointer-events: none; }

/* ---------- The redesign: fewer fields, tap targets, floating palettes ---------- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.5rem; height: 1.5rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
h2.lead { margin-top: 0; }
.panel.compact { padding: .7rem 1rem; }
.panel.compact h2 { margin-top: 0; }

/* Checklist */
.progress-row { display: flex; align-items: center; gap: 1rem; margin: 0 0 .8rem; }
.progress-row .progress { margin: 0; white-space: nowrap; }
.meter { flex: 1; height: .6rem; border-radius: 1rem; background: var(--na-bg); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--done); border-radius: 1rem; }
.item { border-left: .4rem solid var(--line); margin-bottom: 1.2rem; padding: 1rem 1.1rem; }
.item.done { border-left-color: var(--done); }
.item.differs { border-left-color: var(--accent); }
.item.na { border-left-color: var(--na); }
.item.needs { border-left-color: var(--error); }
.item header { align-items: center; }
.badge.todo { background: var(--soft); color: var(--brand); }
.badge.ok { background: var(--good-bg); color: var(--done); }
.badge.diff { background: var(--warn-bg); color: var(--accent); }
.badge.skip { background: var(--na-bg); color: var(--na); }
.badge.fix { background: var(--error-bg); color: var(--error); }
.onfile { display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: baseline; margin: .35rem 0 .1rem; }
.onfile .k { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.onfile b { font-size: 1.1rem; overflow-wrap: anywhere; }
.onfile .other { color: var(--muted); font-size: .9rem; }
.onfile .other.differs { color: var(--accent); font-weight: 650; }
/* The three answers. Each keeps its own colour and icon, pressed or not, so they never read as one row of choices. */
.tri { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: .6rem 0 .2rem; }
.tri.one { grid-template-columns: minmax(0, 14rem); }
.tri button { min-height: 56px; gap: .45rem; font-size: 1.05rem; border-width: 2px; }
.tri .match { border-color: var(--done); color: var(--done); }
.tri .mismatch { border-color: var(--accent); color: var(--accent); }
.tri .na, .tri .other { border-color: var(--na); color: var(--na); }
.tri .match[aria-pressed="true"] { background: var(--done); color: var(--panel); }
.tri .mismatch[aria-pressed="true"] { background: var(--accent); color: var(--panel); }
.tri .na[aria-pressed="true"], .tri .other[aria-pressed="true"] { background: var(--na); color: var(--panel); }
/* The record says there is none: N/A is offered, not chosen. A dashed ring marks it until the appraiser taps it. */
.tri .na.suggested { border-style: dashed; border-width: 3px; background: color-mix(in srgb, var(--na) 12%, transparent); }
/* What was found: a boxed, labelled answer, set apart from the three answers above it. */
.answer { margin: .6rem 0 .2rem; padding: .6rem .75rem .7rem; border: 1px solid var(--line); border-radius: .6rem;
  background: var(--chip); }
.answer > .k { display: block; font-size: .82rem; font-weight: 700; color: var(--muted); margin-bottom: .4rem; }
.answer.invalid { border-color: var(--error); background: var(--error-bg); }
.choices { display: flex; flex-wrap: wrap; gap: .45rem; }
.choices button { border-radius: .45rem; background: var(--panel); border: 2px solid var(--line); min-width: 5.5rem; }
.choices button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.required { display: flex; gap: .35rem; align-items: center; margin: .4rem 0 0; color: var(--error); font-weight: 650;
  font-size: .95rem; }
.required::before { content: "!"; display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem;
  border-radius: 50%; background: var(--error); color: var(--panel); font-size: .85rem; flex: none; }
.speak { display: flex; gap: .5rem; align-items: flex-start; }
.speak > textarea, .speak > input { flex: 1; min-width: 0; }
button.mic { flex: none; width: 52px; min-height: 52px; padding: 0; border-radius: 50%; border: 2px solid var(--brand);
  color: var(--brand); background: var(--panel); }
button.mic[aria-pressed="true"] { background: var(--error); border-color: var(--error); color: var(--panel); }
.mic-help { color: var(--muted); font-size: .9rem; margin: .3rem 0 0; }
.item-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .6rem; }
button.tool { gap: .4rem; min-height: 44px; padding: .3rem .75rem; font-weight: 600; color: var(--muted); }
.problems button.link { color: var(--brand); text-decoration: underline; min-height: 44px; }
#send-anyway { color: var(--brand); text-decoration: underline; min-height: 44px; }
.badge.fix { border: 1px solid var(--error); }
.onfile.none .other { font-style: italic; }
.why.prefilled { color: var(--na); font-weight: 600; }
/* Counts and follow-up questions answered by tapping: the question on its own line, its choices under it, and a line
   and some space between one question and the next (Brad, November 28: "too crowded … more separation", on the
   Surface in portrait). */
.count-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: .45rem; margin: 0; padding: .75rem 0; }
.count-row + .count-row { border-top: 1px solid var(--line); }
.count-row:not(.count-row + .count-row) { padding-top: .35rem; }
.count-row > .k { font-size: .95rem; font-weight: 700; color: var(--ink); }
.count-row .choices { gap: .55rem; }
.count-row .choices button { min-width: 3.4rem; }
.choices button.on-file { border-style: dashed; border-color: var(--brand); }
.choices.amenities { margin-bottom: .5rem; }
.follow-up { margin: .5rem 0; padding: .5rem .7rem; border-left: .3rem solid var(--brand); background: var(--panel); border-radius: .4rem; }
.answer .speak { margin-top: .6rem; }

/* Palettes: a row of icon buttons to tap, on the page or floating over the camera or the grid. */
.palette { display: flex; flex-wrap: wrap; gap: .5rem; }
.palette button { flex-direction: column; gap: .15rem; min-width: 5.2rem; min-height: 68px; padding: .4rem .5rem;
  font-size: .86rem; font-weight: 650; line-height: 1.1; background: var(--panel); }
.palette button .icon { width: 1.9rem; height: 1.9rem; }
.palette button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.palette.floating { position: absolute; z-index: 3; padding: .4rem; border-radius: .9rem;
  background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .22); }
/* The sketch tools are one bar above the grid (Brad, November 28: the column that floated on the grid ran off the
   Surface's screen). The bar wraps onto a second row on a narrow screen instead of running off it. */
.sketch-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .4rem;
  margin: 0 0 .4rem; padding: .3rem; border-radius: .9rem; background: var(--panel); border: 1px solid var(--line);
  /* It stays in view just under the tabs while the page scrolls (the tabs: 48px buttons and 1rem of padding). */
  position: sticky; z-index: 3; top: calc(3.6rem + 48px + 1rem + env(safe-area-inset-top)); }
.palette.tools { flex-wrap: wrap; gap: .25rem; align-items: center; }
.palette.tools button { min-width: 3.9rem; min-height: 54px; font-size: .78rem; padding: .25rem .35rem; border-color: transparent; }
.palette.tools .gap { width: .5rem; border-left: 1px solid var(--line); align-self: stretch; }
/* Tools or Rooms: two palettes that take turns in the same place at the top of the sketch. */
.views { display: inline-flex; align-self: center; border: 2px solid var(--brand); border-radius: .7rem; overflow: hidden; }
.views button { min-height: 48px; min-width: 5.2rem; border: 0; border-radius: 0; background: var(--panel); font-weight: 700; }
.views button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
#tool-palette[hidden] { display: none; }
.stamps .clear-free { margin-left: auto; }
.stamps .clear-free[hidden] { display: none; }
/* Free sketch: the outline alone, with the appraiser's drawing and room names. */
body[data-sketch-view="free"] .surface .marks > :not(.room-label) { display: none; }
body[data-sketch-view="free"] .surface svg .face { fill: none; }
body[data-sketch-view="free"] #wall-progress { display: none; }
/* Rooms: drag one onto the outline, or tap it and then the spot. */
.stamps { flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: stretch; gap: .35rem; padding-top: .4rem;
  border-top: 1px solid var(--line); }
.stamps button { flex-direction: column; gap: 0; line-height: 1.1; touch-action: none; }
.stamps button small { font-size: .68rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.stamps button[aria-pressed="true"] small { color: inherit; }
.room-ghost { position: fixed; z-index: 10; transform: translate(-50%, -50%); pointer-events: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.stamps[hidden] { display: none; }
.stamps .k { flex: 1 0 100%; font-size: .85rem; font-weight: 700; color: var(--muted); margin-right: .2rem; }
.stamps button { min-width: 3rem; min-height: 44px; padding: .2rem .45rem; font-weight: 750; letter-spacing: .02em; }
.stamps button[aria-pressed="true"] { background: #1d2b28; border-color: #1d2b28; color: #fff; }
/* The floors are a row above the grid, so they never cover a wall's length. */
.floor-chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 .5rem; }
.floor-chips:empty { display: none; }
.floor-chips button { background: var(--panel); }
.floor-chips button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* Photos */
.photo .room { width: 100%; justify-content: flex-start; gap: .45rem; margin: .4rem 0 .2rem; }
.photo .room.unset { border-color: var(--accent); color: var(--accent); }
.photo .palette { margin: .3rem 0; }
.photo .palette button { min-width: 4.2rem; min-height: 58px; font-size: .78rem; }
.photo .for { color: var(--muted); }
.camera-stage { position: relative; }
.camera-review { position: absolute; left: 0; right: 0; bottom: 1rem; display: flex; justify-content: center; gap: 4rem; }
dialog.camera .camera-review[hidden] { display: none; }
button.round { width: 84px; height: 84px; min-height: 84px; padding: 0; border-radius: 50%; border: 3px solid #fff;
  color: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .45); }
button.round .icon { width: 2.6rem; height: 2.6rem; stroke-width: 3; }
button.round.keep { background: #1f7a4d; }
button.round.retake { background: #b3261e; }
/* Room icons in three groups, each with the number of photos already taken of it. */
.palette .group-name { flex: 0 0 100%; margin-top: .25rem; font-size: .78rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; }
.palette .group-name:first-child { margin-top: 0; }
.palette.rooms button { position: relative; }
.palette .count { position: absolute; top: -.4rem; right: -.4rem; display: inline-grid; place-items: center; min-width: 1.5rem;
  height: 1.5rem; padding: 0 .3rem; border-radius: 1rem; background: var(--done); color: var(--panel); font-size: .82rem;
  font-weight: 700; line-height: 1; }
.palette button[aria-pressed="true"] .count { background: var(--panel); color: var(--brand); }
/* The floor question, asked only for a room inside a home with more than one floor. */
.floor-ask { flex: 0 0 100%; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .6rem .7rem;
  border: 2px solid var(--brand); border-radius: .7rem; background: var(--soft); }
.floor-ask .k { flex: 0 0 100%; font-weight: 700; }
.palette .floor-ask button { flex-direction: row; gap: .45rem; min-width: 6.5rem; min-height: 56px; font-size: 1.05rem; }
.palette .floor-ask .count { position: static; }
/* "Other room" asks what the room is: a few names, then a box to type one. */
.name-ask .name-other { flex: 0 0 100%; display: flex; gap: .5rem; align-items: center; }
.name-ask .name-other input { flex: 1 1 auto; min-height: 48px; font-size: 1.05rem; }
.palette .name-ask .name-other button { min-width: 5rem; min-height: 48px; }
/* Use keeps its blue: the palette's own button colours would hide its white word. */
.palette .name-ask button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
/* A photo's optional note, under the picture. */
.photo-note { margin: .3rem 0; }
.photo-note textarea { width: 100%; }
.floors-line { display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: center; margin: .6rem 0 0; color: var(--muted);
  font-size: .92rem; }
.floors-line .choices { flex: 0 0 100%; }
.floors-line button.link { min-height: 44px; color: var(--brand); text-decoration: underline; }
/* New construction: the comparable photos still required, said under the palette and on the Summary tab. */
.comp-required { display: flex; gap: .45rem; align-items: center; margin: .6rem 0 0; padding: .45rem .7rem; border-radius: .6rem;
  background: var(--error-bg); color: var(--error); font-weight: 650; }
.comp-required.met { background: var(--good-bg); color: var(--done); }
.comp-required .icon { flex: 0 0 auto; }
/* What is not on file, said plainly and not as a problem. */
.comp-required.note { background: var(--chip); color: var(--muted); font-weight: 400; }
/* Summary: the property's facts with their sources, and the proposed comparables best match first. */
.facts-list { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: .25rem .9rem; margin: .3rem 0 .8rem; }
.facts-list dt { color: var(--muted); font-size: .92rem; font-weight: 650; }
.facts-list dd { margin: 0; overflow-wrap: anywhere; }
.facts-list .source, .comp .source { display: block; color: var(--muted); font-size: .82rem; }
.comps { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .7rem; }
.comp { border: 1px solid var(--line); border-radius: .7rem; padding: .7rem .9rem; background: var(--chip); }
.comp.taken { border-left: .35rem solid var(--done); }
.comp p { margin: .2rem 0; }
.comp-head { display: flex; gap: .6rem; align-items: flex-start; }
.comp-head b { display: block; font-size: 1.08rem; }
.comp-head .address { display: block; color: var(--muted); font-size: .85rem; }
.comp .rank { flex: 0 0 auto; display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--brand); color: var(--brand-ink); font-weight: 750; }
.comp-like { font-style: italic; }
.comp-head .other-builder { margin-left: auto; }
.comp .actions { align-items: center; margin-bottom: 0; }
.comp .actions button { gap: .4rem; }
.taken-mark { display: inline-flex; gap: .3rem; align-items: center; color: var(--done); font-weight: 650; }
@media (max-width: 34rem) { .facts-list { grid-template-columns: 1fr; } .facts-list dd { margin-bottom: .3rem; } }
/* A photo whose room is being chosen takes the full row, so the icons are not squeezed into its card. */
.photo.picking { grid-column: 1 / -1; }
.photo.picking img { max-width: 16rem; }
/* The camera: the picture, one chip for what it shows, and round buttons on the picture itself. */
.room-chip { position: absolute; z-index: 3; top: .5rem; left: .5rem; max-width: calc(100% - 1rem); gap: .4rem;
  min-height: 48px; border-radius: 2rem; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.room-chip.unset { border-color: var(--accent); color: var(--accent); }
.palette.rooms.sheet { position: absolute; z-index: 4; top: 3.9rem; left: .5rem; right: .5rem; max-height: calc(100% - 4.4rem);
  overflow: auto; padding: .6rem; border-radius: .9rem; background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .4); }
.palette.rooms.sheet button { min-width: 4.8rem; min-height: 60px; font-size: .8rem; }
.camera-live { position: absolute; left: 0; right: 0; bottom: 1rem; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 1.5rem; padding: 0 1rem; pointer-events: none; }
.camera-live button { pointer-events: auto; }
dialog.camera .camera-live[hidden] { display: none; }
#camera-file { grid-column: 1; justify-self: end; }
#camera-switch { grid-column: 3; justify-self: start; }
button.round.shutter { grid-column: 2; width: 88px; height: 88px; min-height: 88px; background: var(--brand); color: var(--brand-ink); }
button.round.side { flex-direction: column; gap: 0; width: 66px; height: 66px; min-height: 66px; border-width: 2px;
  background: rgba(20, 28, 38, .72); font-size: .68rem; font-weight: 650; }
button.round.side .icon { width: 1.7rem; height: 1.7rem; stroke-width: 2; }

/* Sketch: one canvas, its tools floating on it, and a box that opens where a wall is tapped. */
.canvas-wrap { position: relative; margin: 0 0 .8rem; scroll-margin-top: calc(3.6rem + 48px + 1rem + env(safe-area-inset-top)); }
/* The margin keeps the floating tools off the grid, so no wall is hidden under them. */
/* The grid fills what the screen has left below the header, the tabs and the bar. */
.canvas-wrap .surface-frame { max-height: max(20rem, calc(100dvh - var(--bar-h, 4.5rem) - 9.3rem)); min-height: 20rem; }
.pop { position: absolute; z-index: 4; width: min(23rem, calc(100% - 1rem)); max-height: calc(100% - 1rem); overflow: auto;
  padding: .8rem .9rem; border-radius: .9rem; background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .3); }
.pop h3 { margin: 0 2.6rem .5rem 0; font-size: 1.1rem; }
.pop .close { position: absolute; top: .4rem; right: .4rem; width: 44px; min-height: 44px; padding: 0; border: 0; background: none; }
.pop label { margin-top: .9rem; }
/* Two answers side by side. A third, the county wall's Not measured, takes its own row so no label is squeezed. */
.pop .tri { grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }
.pop .tri button:nth-child(3):last-child { grid-column: 1 / -1; }
.pop .tri button { min-height: 52px; font-size: 1rem; }
.pop .choices button { min-width: 4.5rem; min-height: 44px; }
.pop .k { display: block; font-size: .82rem; font-weight: 700; color: var(--muted); margin: .7rem 0 .3rem; }
.pop input.feet { font-size: 1.4rem; font-weight: 650; text-align: center; min-height: 56px; }
.pop .actions { justify-content: space-between; margin-bottom: 0; }
/* Done stays in reach however long the box is. */
.pop > .actions:last-child { position: sticky; bottom: -.8rem; margin: .7rem -.9rem -.8rem; padding: .6rem .9rem .8rem;
  background: var(--panel); border-top: 1px solid var(--line); }
.pop details.more { margin-top: .8rem; border-top: 1px solid var(--line); }
.pop details.more > summary { display: flex; justify-content: space-between; gap: .6rem; align-items: center; min-height: 44px;
  cursor: pointer; font-weight: 650; }
.pop details.more > summary .now { font-weight: 400; color: var(--muted); }
.wall-progress { margin: 0 0 .5rem; font-weight: 650; color: var(--muted); }
.wall-progress.done { color: var(--done); }
.surface svg polyline.plan { stroke: #7a4fb3; stroke-width: 3; stroke-dasharray: 7 5; }
.surface svg polyline.plan.confirmed { stroke: #2f6b3d; stroke-dasharray: none; }
.surface svg polyline.plan.corrected { stroke: #b8641c; stroke-dasharray: 2 5; }
.surface svg polyline.selected { stroke: #174ea6; stroke-width: 5; }
.mark.plan { border-color: #7a4fb3; color: #5b3a8a; }
.mark.plan.confirmed { border-color: #2f6b3d; color: #fff; background: #2f6b3d; }
.mark.plan.corrected { border-color: #b8641c; color: #b8641c; }
.mark { min-height: 34px; font-size: .9rem; }
.mark.observation { pointer-events: auto; }
.surface.placing-observation .mark.observation { pointer-events: none; }
/* Shapes: each kind in its own colour, on the outline, the label and its chip. */
.surface { --shape: #6b3fa0; }
.shape-room { --shape: #6b3fa0; }
.shape-open { --shape: #b4500f; }
.shape-screened { --shape: #0b7285; }
.shape-garage { --shape: #46525c; }
.shape-horizontal, .shape-vertical { --shape: #a3195b; }
.surface svg polyline.observation { stroke: var(--shape); }
.surface svg polyline.observation.picked { stroke-width: 4; stroke-dasharray: none; }
.surface svg polyline.observation.pending { stroke-dasharray: 3 3; }
.mark.observation { color: var(--shape); border-color: var(--shape); border-width: 2px; }
/* The selected shape's label lets a press through, so the shape can be dragged by its middle. */
.mark.observation.picked { background: var(--shape); color: #fff; pointer-events: none; }
.mark.side { pointer-events: none; color: #fff; background: var(--shape); border-color: var(--shape); min-height: 26px; }
.mark.side.across { transform: translate(-50%, -135%); }
.mark.side.down { transform: translate(-112%, -50%); }
.pop .choices.shapes button { border-color: var(--shape); border-left-width: .6rem; }
.pop .choices.shapes button[aria-pressed="true"] { background: var(--shape); border-color: var(--shape); color: #fff; }
/* A handle is a fingertip wide. The dot in its middle is what shows. */
.handle { position: absolute; width: 38px; height: 38px; transform: translate(-50%, -50%); pointer-events: auto;
  touch-action: none; cursor: grab; display: grid; place-items: center; }
.handle::after { content: ""; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid #174ea6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
/* Where drawing starts, and where a drawn wall is still open. */
.start-dot { position: absolute; width: 16px; height: 16px; transform: translate(-50%, -50%); border-radius: 50%;
  border: 3px solid #174ea6; background: rgba(255, 255, 255, .85); pointer-events: none; z-index: 2; }
.start-dot.down { background: #174ea6; box-shadow: 0 0 0 4px rgba(23, 78, 166, .25); }
.end-dot { position: absolute; width: 12px; height: 12px; transform: translate(-50%, -50%); border-radius: 50%;
  background: #c4150c; border: 2px solid #fff; box-shadow: 0 0 0 1px #c4150c; pointer-events: none; }
/* Areas: one colour for each kind, on the fill and on its label. */
.surface svg .face.living { fill: rgba(33, 122, 62, .18); }
.surface svg .face.garage { fill: rgba(70, 82, 92, .26); }
.surface svg .face.porch { fill: rgba(196, 98, 16, .22); }
.surface svg .face.screened_enclosure { fill: rgba(11, 114, 133, .22); }
.surface svg .face.other { fill: rgba(107, 63, 160, .18); }
.surface svg .face.unmeasured { fill: none; }
.mark.area.living { border-color: #217a3e; color: #17552b; }
.mark.area.garage { border-color: #46525c; color: #343d45; }
.mark.area.porch { border-color: #c46210; color: #8a4409; }
.mark.area.screened_enclosure { border-color: #0b7285; color: #085564; }
.mark.area.other { border-color: #6b3fa0; color: #4f2e78; }
.mark.area.unmeasured { border-color: #9fb3ad; color: #5b6b68; }
/* The floors: a second palette, at the right end of the bar. */
.palette.tools.floors button { border-color: var(--line); font-size: .82rem; }
#add-prefill { margin: 0 0 .6rem; }
@media (max-width: 40rem) {
  .palette.tools .gap { display: none; }
  .camera-review { gap: 2.5rem; }
  .camera-live { gap: .8rem; }
  .tri button { font-size: .95rem; }
}

#undo.armed { color: var(--error); background: var(--error-bg); border-color: var(--error); }
.mark.length.measured { font-weight: 700; border-color: var(--done); color: var(--done); }

/* Room labels written inside an outline (candidate 3): plain bold words, like the paper sketch. */
.mark.room-label { font-weight: 750; letter-spacing: .02em; color: #1d2b28; background: rgba(255, 255, 255, .94);
  border: 2px solid #1d2b28; min-height: 40px; min-width: 44px; font-size: 1rem; }
.mark.room-label.picked { background: #1d2b28; color: #fff; }
.mark.side.tap { pointer-events: auto; min-height: 36px; min-width: 44px; font-size: .95rem; }
.pop .full-name { color: #3b4a47; margin: .2rem 0 .4rem; }
body[data-sketch-tool="line"] .mark.side.tap, body[data-sketch-tool="free"] .mark.side.tap,
body[data-sketch-tool="paper"] .mark.side.tap { pointer-events: none; }

.place-ask { margin: .7rem 0 0; }
.place-ask input { margin-top: .3rem; }

/* ---------- The camera on a tablet held sideways (the office, November 29) ---------- */
/* The camera fills the screen and its round buttons are a column at the right edge, under the right thumb, beside the
   picture and never over it. Upright, they stay along the bottom of the picture. */
@media (orientation: landscape) {
  dialog.camera { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0;
    padding: calc(.5rem + env(safe-area-inset-top)) calc(.6rem + env(safe-area-inset-right)) .5rem calc(.8rem + env(safe-area-inset-left)); }
  dialog.camera h2 { font-size: 1.05rem; margin: 0 0 .3rem; }
  .camera-stage { display: grid; grid-template-columns: minmax(0, 1fr) 6.5rem; grid-template-rows: minmax(0, 1fr); gap: .6rem;
    height: calc(100dvh - 8.2rem - env(safe-area-inset-top)); }
  dialog.camera video, dialog.camera img { grid-column: 1; grid-row: 1; height: 100%; min-height: 0; max-height: none; }
  .camera-live, .camera-review { position: static; grid-column: 2; grid-row: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 1.6rem; padding: 0; pointer-events: auto; }
  dialog.camera .camera-live[hidden], dialog.camera .camera-review[hidden] { display: none; }
  #camera-switch { order: 1; }
  button.round.shutter { order: 2; }
  #camera-file { order: 3; }
  .palette.rooms.sheet { right: 7.1rem; }
  dialog.camera > .actions { margin: .3rem 0 0; }
}

/* ---------- Phones: an iPhone 13 or later, held in one hand (the office, November 29) ---------- */
/* The header is one line, the tabs are a bar along the bottom edge under the thumb, every control is at least 44 points
   and no text is smaller than about 13 points. The notch, the rounded corners and the home bar are kept clear. A phone
   on its side gets the same layout, since its screen is too short for the tablet's. */
@media (max-width: 40rem), (max-height: 32rem) {
  .top { gap: .5rem; padding: calc(.35rem + env(safe-area-inset-top)) calc(.7rem + env(safe-area-inset-right)) .35rem
    calc(.7rem + env(safe-area-inset-left)); }
  .top .title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.02rem; }
  .top .title span { font-size: .84rem; }
  .top .back { min-height: 44px; padding: .25rem .7rem; }
  .saved { flex: 0 1 6.6rem; font-size: .82rem; line-height: 1.15; text-align: right; overflow: hidden; max-height: 2.4em; }
  .banner { padding: .5rem calc(.8rem + env(safe-area-inset-right)) .5rem calc(.8rem + env(safe-area-inset-left)); font-size: .94rem; }
  .view { padding-left: calc(.6rem + env(safe-area-inset-left)); padding-right: calc(.6rem + env(safe-area-inset-right)); }
  #case { padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }
  /* What the app brings into view on the Send tab clears the header and the tab bar. */
  #tab-send [id] { scroll-margin-top: calc(var(--top-h, 3.6rem) + .5rem); scroll-margin-bottom: calc(5rem + env(safe-area-inset-bottom)); }
  /* What went wrong stays in view under the header while the page scrolls. */
  #error-banner { position: sticky; top: var(--top-h, 3.6rem); z-index: 4; }
  .tabs { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 6; gap: .15rem; overflow: hidden;
    padding: .3rem calc(.3rem + env(safe-area-inset-right)) calc(.3rem + env(safe-area-inset-bottom)) calc(.3rem + env(safe-area-inset-left));
    background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -2px 10px rgba(0, 0, 0, .1); }
  .tabs { gap: .1rem; }
  .tabs button { flex: 1 1 auto; min-width: 2.9rem; min-height: 52px; padding: .15rem .1rem; flex-direction: column; gap: 0;
    font-size: .8125rem; line-height: 1.15; border-radius: .6rem; border-color: transparent; white-space: nowrap; }
  .tabs span:not(:empty) { margin-left: 0; font-size: .8125rem; font-weight: 600; }
  .holds summary { padding: .75rem 0; }
  button.link { min-height: 44px; }
  .badge, .onfile .k, .answer > .k, .count-row > .k, .beside .k, .palette.rooms .group-name,
  .palette.rooms.sheet button, .photo .palette button, .facts-list .source, .comp .source { font-size: .84rem; }
  .palette.rooms button { min-width: 4.9rem; }
  /* Shared with the Sketch tab, whose own layout is the sketch package's: with the tabs at the bottom, the sketch bar
     sticks just under the header instead of under tabs that are no longer at the top. */
  .sketch-bar { top: var(--top-h, 3.6rem); }
  .canvas-wrap { scroll-margin-top: var(--top-h, 3.6rem); }
  .actions > button, .actions > .button { min-height: 50px; }
}
/* A phone on its side: the tab bar is one row, so more of the short screen is left for the work. */
@media (max-height: 32rem) {
  .tabs button { flex-direction: row; min-height: 44px; }
  .tabs span:not(:empty) { margin-left: .3rem; }
  #case { padding-bottom: calc(3.8rem + env(safe-area-inset-bottom)); }
}

/* An iPhone's banners are one short line each, with a way to close or open them (review 2 of PR #270). */
.banner.compact { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .4rem; font-size: .9rem; line-height: 1.3;
  padding-top: .35rem; padding-bottom: .35rem; }
.banner.compact .line { flex: 1 1 0; min-width: 0; }
.banner.compact button.link { min-height: 44px; padding: 0 .35rem; color: var(--brand); text-decoration: underline; }
.banner.compact button.close { width: 44px; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; }
.banner.compact .steps { flex: 0 0 100%; margin: 0 0 .3rem; }
.banner.compact > button:not(.link):not(.close) { min-height: 44px; padding: .2rem .7rem; }
.banner.compact #pending-line { flex: 1 1 0; min-width: 0; }
/* A phone on its side: each short banner is one line, and the storage line gives way to the line about a visit file. */
@media (max-height: 32rem) {
  .banner.compact .line, .banner.compact #pending-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #pending-banner:not([hidden]) ~ #storage-banner.compact { display: none !important; }
}
