/* Home Design Studio: the design system every page shares.
   Feature pages add their own file in this folder and load it in {% block head %}.
   See /dev/kit for every component in use. */

:root {
  --paper: #f5f2ec;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --sunken: #efebe3;
  --ink: #1f1c18;
  --ink-2: #4d4840;
  --ink-3: #847d72;
  --ink-4: #aaa397;
  --line: #e2dcd0;
  --line-2: #cdc5b6;
  --accent: #a8532c;
  --accent-ink: #853d1c;
  --accent-soft: #f5e6dc;
  --ok: #3d7d5a;
  --ok-soft: #e2f0e7;
  --warn: #a8650a;
  --warn-soft: #fbf0d9;
  --bad: #b3392b;
  --bad-soft: #f9e4e0;
  --info: #2f6690;
  --info-soft: #e1edf5;
  --plum: #6d4a7c;
  --plum-soft: #efe6f3;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-1: 0 1px 2px rgba(31, 28, 24, .05);
  --shadow-2: 0 1px 2px rgba(31, 28, 24, .06), 0 6px 20px rgba(31, 28, 24, .07);
  --shadow-3: 0 12px 40px rgba(31, 28, 24, .18);
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --side-w: 236px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 14px/1.5 var(--font-ui); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.2; }
h1 { font: 500 28px/1.15 var(--font-display); letter-spacing: -.01em; }
h2 { font: 500 20px/1.2 var(--font-display); }
h3 { font-size: 14px; letter-spacing: .01em; }
h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
p { margin: 0 0 .7em; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .small { font-size: 12.5px; }
code, .mono { font: 12.5px var(--font-mono); }
code { background: var(--sunken); padding: 1px 5px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
img, svg { max-width: 100%; }
::selection { background: var(--accent-soft); }

.muted { color: var(--ink-3); }
.soft { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.grow { flex: 1 1 auto; min-width: 0; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -- icons ---------------------------------------------------------------------------- */
.icon {
  width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -3.5px;
}
.icon-sm { width: 15px; height: 15px; vertical-align: -2.5px; }
.icon-lg { width: 24px; height: 24px; }
.icon-fill { fill: currentColor; }

/* -- layout --------------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #ebe6dc;
  border-right: 1px solid var(--line); padding: 18px 12px 14px; display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: #f3ede2;
  display: grid; place-items: center; flex: none;
}
.brand-name { font: 500 15.5px/1.1 var(--font-display); }
.brand-sub { font-size: 11px; color: var(--ink-3); letter-spacing: .04em; }
.side-home {
  margin: 0 4px 10px; padding: 9px 10px; background: rgba(255, 255, 255, .6); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.side-home select { width: 100%; border: 0; background: transparent; font: 600 13px var(--font-ui); color: var(--ink); padding: 0; }
.side-home .small { color: var(--ink-3); }
.side h4 { padding: 14px 10px 5px; font-size: 10.5px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: 13.5px; min-height: 31px;
}
.nav-item:hover { background: rgba(255, 255, 255, .55); text-decoration: none; color: var(--ink); }
.nav-item.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }
.nav-item.on .icon { color: var(--accent); }
.nav-item .count { margin-left: auto; font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.nav-sub { padding-left: 37px; min-height: 27px; font-size: 13px; }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); flex: none; margin-left: auto; }
.nav-dot.chosen { background: var(--ok); }
.nav-dot.bad { background: var(--bad); }
.side-foot { margin-top: auto; padding: 12px 10px 0; font-size: 11.5px; color: var(--ink-3); }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav .side-home { margin-top: 12px; }
.side-rooms > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; padding-right: 8px; border-radius: var(--radius-sm); }
.side-rooms > summary::-webkit-details-marker { display: none; }
.side-rooms > summary h4 { flex: 1; display: flex; align-items: center; gap: 6px; }
.side-rooms > summary .count { font-size: 10.5px; color: var(--ink-4); letter-spacing: 0; font-weight: 600; }
.side-rooms > summary:hover h4 { color: var(--ink); }
.side-rooms > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.side-rooms .side-fold { color: var(--ink-4); margin-top: 9px; transition: transform .12s; }
.side-rooms:not([open]) .side-fold { transform: rotate(-90deg); }
.side-rooms[open] { display: flex; flex-direction: column; gap: 2px; }
.side-floor { padding: 7px 10px 2px; font-size: 11px; color: var(--ink-3); font-weight: 600; }
.nav-room { min-height: 29px; padding-top: 4px; padding-bottom: 4px; font-size: 13px; }
.nav-add { color: var(--ink-3); }
.nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 2000; background: var(--ink); color: #f7f3ec; padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 600; }
.skip-link:focus { top: 12px; text-decoration: none; }
.main:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  padding: 22px 32px 0; display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap;
}
.top-title { min-width: 0; flex: 1 1 320px; }
.trail { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; min-height: 24px; }
.trail-nav { display: inline-flex; gap: 2px; flex: none; }
.trail-btn { width: 24px; height: 24px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: var(--surface, #fff); color: var(--ink-2, inherit); border-radius: 6px; cursor: pointer; padding: 0; }
.trail-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--ink-3); }
.trail-btn:disabled { opacity: .35; cursor: default; }
.crumbs { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-width: 0; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current="page"] { color: var(--ink-2); }
.crumb-sep { color: var(--ink-4); }
.top-meta { color: var(--ink-3); margin-top: 6px; font-size: 13px; display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-bottom: 2px; }
.content { padding: 22px 32px 56px; flex: 1; }
.content.flush { padding: 0; }
.narrow { max-width: 860px; }
.readable { max-width: 68ch; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 28px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-sm { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row.top-align { align-items: flex-start; }
.between { justify-content: space-between; }
.cols { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cols-2 { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.cols-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.split { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.split.wide { grid-template-columns: minmax(0, 1fr) 400px; }
@media (max-width: 1180px) { .split, .split.wide { grid-template-columns: minmax(0, 1fr); } .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); } }

.section-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; flex-wrap: wrap; }
.section-head h2 { flex: none; }
.section-head .muted { font-size: 13px; }
.section-head .spacer { flex: 1; }

/* -- tabs ----------------------------------------------------------------------------- */
.tabs { display: flex; gap: 2px; padding: 16px 32px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex; align-items: center; gap: 7px; padding: 8px 12px 10px; color: var(--ink-3); font-size: 13.5px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; border-radius: 6px 6px 0 0;
}
.tab:hover { color: var(--ink); text-decoration: none; background: rgba(255, 255, 255, .5); }
.tab.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.tab.on .icon { color: var(--accent); }
.tab .count { font-size: 11.5px; background: var(--sunken); border-radius: 99px; padding: 0 6px; color: var(--ink-2); font-weight: 600; }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; }

.tab[aria-current="page"] { cursor: default; }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* -- filters and sorting for a list: ui.filter_search / filter_select / filter_check / sort_select, ui.filter_summary,
      ui.no_matches, ui.pager, ui.sort_th (server-sorted columns) and table[data-sortable] (sorted in the page) ---------- */
.filterbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1);
}
.filterbar .seg { flex: none; }
.fb-search { position: relative; flex: 1 1 240px; min-width: 180px; display: block; }
.fb-search > .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.fb-search .input { padding-left: 32px; }
.fb-search .input::-webkit-search-cancel-button { cursor: pointer; }
.filterbar .fb-select, .fb-select.input { width: auto; max-width: 185px; height: 34px; padding-right: 24px; text-overflow: ellipsis; }
.fb-select.is-set, .fb-check.is-set { border-color: var(--accent); background-color: var(--accent-soft); color: var(--accent-ink); }
.fb-check { height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); white-space: nowrap; }
.fb-check:hover { border-color: var(--ink-4); }
.fb-sort { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.fb-sort-label { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.fb-break { flex-basis: 100%; height: 0; }
.filter-summary { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 13px; color: var(--ink-3); min-height: 26px; margin: 12px 0 14px; }
.filter-summary .fs-count strong { color: var(--ink); font-weight: 600; }
.filter-summary .fs-extra { margin-left: auto; }
.chip-filter { background: var(--accent-soft); color: var(--accent-ink); gap: 4px; padding-right: 5px; height: 24px; font-size: 12px; }
.chip-filter .icon { width: 12px; height: 12px; opacity: .7; }
.chip-filter:hover { text-decoration: none; background: #efd6c6; }
.chip-filter:hover .icon { opacity: 1; }
.fs-clear { font-size: 12.5px; font-weight: 600; }
[data-filter-results] { transition: opacity .12s; }
[data-filter-results].is-loading { opacity: .55; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 18px; }
.th-sort a, table[data-sortable] th[data-sort] { color: inherit; cursor: pointer; user-select: none; }
.th-sort a { display: inline-flex; align-items: center; gap: 3px; }
.th-sort a:hover, table[data-sortable] th[data-sort]:hover { color: var(--ink); text-decoration: none; }
.th-sort.is-sorted, table[data-sortable] th[aria-sort="ascending"], table[data-sortable] th[aria-sort="descending"] { color: var(--ink); }
.th-sort .icon { width: 12px; height: 12px; }
table[data-sortable] th[data-sort]::after { content: ""; display: inline-block; width: 10px; margin-left: 3px; font-size: 10px; }
table[data-sortable] th[aria-sort="ascending"]::after { content: "▲"; }
table[data-sortable] th[aria-sort="descending"]::after { content: "▼"; }
table[data-sortable] th[data-sort]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* -- buttons -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  font: 500 13.5px var(--font-ui); cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-4); text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn:focus-visible, .input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #f7f3ec; }
.btn-primary:hover { background: #38332c; border-color: #38332c; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(31, 28, 24, .06); border-color: transparent; color: var(--ink); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12.5px; gap: 5px; }
.btn-lg { height: 42px; padding: 0 18px; font-size: 15px; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 28px; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.seg { display: inline-flex; background: var(--sunken); border-radius: var(--radius-sm); padding: 2px; gap: 2px; }
.seg a, .seg button, .seg label {
  padding: 4px 10px; border-radius: 4px; font: 500 12.5px var(--font-ui); color: var(--ink-2); border: 0; background: none; cursor: pointer;
}
.seg a:hover, .seg button:hover { text-decoration: none; color: var(--ink); }
.seg .on, .seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); font-weight: 600; }

/* -- forms ---------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; }
.field .hint { font-size: 12px; color: var(--ink-3); }
.input, select.input, textarea.input {
  height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface);
  font: 13.5px var(--font-ui); color: var(--ink); width: 100%; min-width: 0;
}
textarea.input { height: auto; padding: 8px 10px; line-height: 1.45; resize: vertical; min-height: 70px; }
.input:hover { border-color: var(--ink-4); }
.input-sm { height: 28px; font-size: 12.5px; padding: 0 7px; }
.input.num { font-variant-numeric: tabular-nums; }
.input[type="color"] { padding: 2px; width: 44px; }
.form-grid { display: grid; gap: 12px 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.check { display: inline-flex; gap: 7px; align-items: center; font-size: 13.5px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.inline-select {
  border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--radius-sm); height: 34px; padding: 0 28px 0 10px;
  font: 500 13.5px var(--font-ui); color: var(--ink); max-width: 260px;
}

/* -- surfaces ------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card-pad { padding: 16px 18px; }
.card-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.card-head h3 { flex: 1; min-width: 0; }
.card-body { padding: 14px 16px; }
.card-foot { padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
a.card { color: inherit; display: block; transition: box-shadow .15s, transform .15s, border-color .15s; }
a.card:hover { text-decoration: none; box-shadow: var(--shadow-2); border-color: var(--line-2); transform: translateY(-1px); }
.panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.well { background: var(--sunken); border-radius: var(--radius-sm); padding: 10px 12px; }

.callout { display: flex; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--info-soft); color: #214b6b; font-size: 13.5px; align-items: flex-start; }
.callout .icon { margin-top: 1px; }
.callout.ok { background: var(--ok-soft); color: #28573e; }
.callout.warn { background: var(--warn-soft); color: #7a4a07; }
.callout.bad { background: var(--bad-soft); color: #86291e; }
.callout ul { margin: 4px 0 0; padding-left: 18px; }

.empty { text-align: center; padding: 44px 24px; color: var(--ink-3); border: 1px dashed var(--line-2); border-radius: var(--radius); background: rgba(255, 255, 255, .4); }
.empty h3 { font: 500 18px var(--font-display); color: var(--ink); margin-bottom: 6px; }
.empty .row { justify-content: center; margin-top: 14px; }

/* -- chips ---------------------------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px;
  font-weight: 600; background: var(--sunken); color: var(--ink-2); white-space: nowrap; letter-spacing: .01em;
}
.chip .icon { width: 12px; height: 12px; vertical-align: 0; }
.chip-ok, .chip-chosen, .chip-done, .chip-kept, .chip-love { background: var(--ok-soft); color: #28573e; }
.chip-warn, .chip-shortlisted, .chip-queued, .chip-maybe, .chip-manual { background: var(--warn-soft); color: #7a4a07; }
.chip-bad, .chip-rejected, .chip-failed, .chip-invalid, .chip-no { background: var(--bad-soft); color: #86291e; }
.chip-info, .chip-generated, .chip-running, .chip-new { background: var(--info-soft); color: #214b6b; }
.chip-claude, .chip-claude-code { background: var(--plum-soft); color: #553762; }
.chip-accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip-line { background: transparent; border: 1px solid var(--line-2); }
a.chip:hover { text-decoration: none; filter: brightness(.96); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--ink-4); }
.dot-ok { background: var(--ok); } .dot-warn { background: #d99a1c; } .dot-bad { background: var(--bad); } .dot-info { background: var(--info); }

/* -- tables --------------------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 600;
  padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap;
}
.table td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tr.is-hot td { background: var(--accent-soft); }
.table .right { text-align: right; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table-compact td, .table-compact th { padding: 5px 10px; font-size: 13px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 5px 16px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }

/* -- drawings ------------------------------------------------------------------------- */
.drawing-frame { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
.drawing-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); min-height: 44px; }
.drawing-bar h3 { flex: 1; min-width: 0; font-size: 13.5px; }
.drawing-bar .muted { font-size: 12px; font-weight: 400; }
.drawing-body { padding: 10px; background: #fff; position: relative; }
.drawing-body svg.drawing { display: block; width: 100%; height: auto; max-height: 78vh; margin: 0 auto; }
.drawing-body.tall svg.drawing { max-height: 86vh; }
.drawing-body img.view-picture { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 780; object-fit: contain; background: #f4f1ec; border-radius: 4px; cursor: zoom-in; }
.drawing-note { font-size: 12px; color: var(--ink-3); padding: 0 14px 10px; }
svg.drawing .item { cursor: pointer; }
svg.drawing .item.is-hot .surf, svg.drawing .item.is-hot .ln, svg.drawing .item.is-hot polygon, svg.drawing .item.is-hot rect {
  stroke: var(--accent) !important; stroke-opacity: 1 !important;
}
svg.drawing .item.is-hot > .surf, svg.drawing .item.is-hot > rect.surf { stroke-width: 1px; }
svg.drawing .item.is-pinned .surf { stroke: var(--accent) !important; }
svg.drawing.measuring { cursor: crosshair; }
svg.drawing.measuring .item { cursor: crosshair; }
.measure-line { stroke: var(--info); stroke-width: 1.5; vector-effect: non-scaling-stroke; fill: none; }
.measure-dot { fill: var(--info); }
.measure-label { fill: var(--info); font-weight: 700; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; text-anchor: middle; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); align-items: center; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 2px dashed #d9822b; vertical-align: middle; margin-right: 5px; }
.legend i.solid { border-top-style: solid; }
.thumb { background: #fff; border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; padding: 10px; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; }
.thumb svg { width: 100%; height: 100%; }
.thumb { position: relative; }
.thumb-render { position: absolute; right: 8px; bottom: 8px; width: 42%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; border: 2px solid #fff; box-shadow: var(--shadow-1); }

/* -- swatches ------------------------------------------------------------------------- */
.swatch-box { display: inline-block; border-radius: 6px; overflow: hidden; border: 1px solid rgba(31, 28, 24, .16); line-height: 0; flex: none; }
.swatch-box svg, .swatch-box .swatch-photo { display: block; }
.swatch-photo { max-width: 100%; }
.swatch-round { border-radius: 50%; }
.material { display: flex; gap: 10px; align-items: center; min-width: 0; }
.material-name { font-weight: 600; font-size: 13px; line-height: 1.25; }
.material-sub { font-size: 12px; color: var(--ink-3); }
.palette-strip { display: flex; height: 34px; border-radius: 6px; overflow: hidden; border: 1px solid rgba(31, 28, 24, .14); }
.palette-strip > * { flex: 1; line-height: 0; }
.palette-strip svg { width: 100%; height: 100%; display: block; }

/* -- notes ---------------------------------------------------------------------------- */
.note { border-left: 3px solid var(--line-2); padding: 8px 12px; background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.note-head { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-3); margin-bottom: 3px; flex-wrap: wrap; }
.note-body { font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-recommendation { border-left-color: var(--ok); }
.note-question { border-left-color: #d99a1c; }
.note-decision { border-left-color: var(--accent); }
.note-insight { border-left-color: var(--info); }
.note.resolved { opacity: .6; }

/* -- lists of findings ---------------------------------------------------------------- */
.finding { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.finding:last-child { border-bottom: 0; }
.finding-mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; }
.finding-mark .icon { width: 13px; height: 13px; }
.finding.ok .finding-mark { background: var(--ok-soft); color: var(--ok); }
.finding.warn .finding-mark { background: var(--warn-soft); color: var(--warn); }
.finding.bad .finding-mark { background: var(--bad-soft); color: var(--bad); }
.finding.info .finding-mark { background: var(--info-soft); color: var(--info); }
.finding-title { font-weight: 600; font-size: 13.5px; }
.finding-text { font-size: 13px; color: var(--ink-2); }

/* -- stats ---------------------------------------------------------------------------- */
.stat { padding: 14px 16px; }
.stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 600; }
.stat-value { font: 500 28px/1.15 var(--font-display); margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.meter { height: 6px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.steps { display: flex; gap: 4px; }
.steps i { flex: 1; height: 4px; border-radius: 99px; background: var(--line); }
.steps i.done { background: var(--ok); }
.steps i.now { background: var(--accent); }

/* -- overlays ------------------------------------------------------------------------- */
dialog { border: 0; border-radius: 14px; padding: 0; box-shadow: var(--shadow-3); max-width: min(92vw, 720px); width: 560px; color: var(--ink); }
dialog::backdrop { background: rgba(31, 28, 24, .42); }
dialog.wide { width: 900px; max-width: 94vw; }
dialog.zoom { width: fit-content; max-width: 94vw; max-height: 94vh; background: #1f1c18; overflow: visible; }
dialog.zoom img { display: block; margin: 0 auto; max-width: 94vw; max-height: 86vh; border-radius: 14px 14px 0 0; }
dialog.zoom .zoom-cap { margin: 0; padding: 8px 14px; color: #f4f1ec; font-size: 13px; }
dialog.zoom .zoom-cap:empty { display: none; }
dialog.zoom .zoom-x { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border: 0; border-radius: 99px; background: rgba(31, 28, 24, .7); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
[data-zoom] { cursor: zoom-in; }
.zoom-btn { position: absolute; right: 5px; bottom: 5px; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 6px; background: rgba(31, 28, 24, .68); color: #fff; padding: 0; }
.zoom-btn:hover { background: rgba(31, 28, 24, .9); }
.dialog-head { padding: 16px 20px 12px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { flex: 1; }
.dialog-body { padding: 16px 20px; max-height: 70vh; overflow-y: auto; }
.dialog-foot { padding: 12px 20px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 14px 14px; }

#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; max-width: 420px; }
#toasts[popover] { inset: auto 20px 20px auto; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; }
#toasts[popover]:not(:popover-open) { display: none; }
.toast {
  background: var(--ink); color: #f6f1e8; padding: 10px 14px; border-radius: 9px; box-shadow: var(--shadow-3); font-size: 13.5px;
  animation: toast-in .18s ease-out;
}
.toast.bad { background: #8d2c20; }
.toast.ok { background: #2f6247; }
.toast ul { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; opacity: .9; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.banner { background: var(--ink); color: #f6f1e8; padding: 8px 32px; font-size: 13.5px; display: flex; gap: 12px; align-items: center; }
.banner a { color: #f3c9ad; font-weight: 600; }

.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 50; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-2); min-width: 190px; padding: 5px; display: flex; flex-direction: column;
}
.menu-list.left { right: auto; left: 0; }
.menu-list a, .menu-list button {
  display: flex; gap: 8px; align-items: center; padding: 6px 9px; border-radius: 5px; color: var(--ink); font: 13.5px var(--font-ui);
  background: none; border: 0; text-align: left; cursor: pointer; width: 100%;
}
.menu-list a:hover, .menu-list button:hover { background: var(--sunken); text-decoration: none; }
.menu-list hr { margin: 4px 0; width: 100%; }

details.fold > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; padding: 6px 0; color: var(--ink-2); list-style: none; display: flex; gap: 6px; align-items: center; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "›"; display: inline-block; transition: transform .12s; font-size: 16px; line-height: 1; color: var(--ink-3); }
details.fold[open] > summary::before { transform: rotate(90deg); }

.htmx-request.btn, .htmx-request .btn-busy { opacity: .6; pointer-events: none; }
.htmx-indicator { opacity: 0; transition: opacity .15s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* -- print ---------------------------------------------------------------------------- */
@media print {
  .side, .tabs, .top-actions, .no-print, #toasts, .banner { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .content, .top { padding: 0; }
  .card, .drawing-frame { box-shadow: none; }
}

.swatch-fill { line-height: 0; }
.swatch-fill svg { width: 100%; height: 84px; display: block; }

/* Labels, dimensions and page marks never take the pointer: a click lands on the item underneath. */
svg.drawing text, svg.drawing .assumed-mark, svg.drawing .marks *, svg.drawing .dim * { pointer-events: none; }

/* -- renders on a room's overview, and the references strip on the home page ---------------- */
.room-renders { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 26px; }
.room-renders a { position: relative; display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #f4f1ec; }
.room-renders img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.room-renders span { position: absolute; top: 8px; right: 8px; background: rgba(31, 28, 24, .75); color: #fff; border-radius: 99px; width: 24px; height: 24px; display: grid; place-items: center; }
.ref-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.ref-strip a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; color: inherit; }
.ref-strip a:hover { text-decoration: none; border-color: var(--ink-4); }
.ref-strip .icon { width: 20px; height: 20px; color: var(--accent); flex: none; }
.ref-strip b { display: block; font-size: 15px; }
.ref-strip small { color: var(--ink-3); }

/* On the server (CRAWLER=false) nothing that would start a crawl or open the crawler's window is offered. */
body[data-crawler="off"] .no-phone, body[data-crawler="off"] .crawler-only { display: none !important; }

/* -- phone -------------------------------------------------------------------------------------------------------
   An iPhone held upright (390 to 440 px wide), or any phone on its side. The sidebar becomes a menu that slides in from
   the left (More, in the bar along the bottom, or the sidebar's own close button), the bar along the bottom holds the
   places B goes most, and controls grow to a thumb's size. Type in a text box is 16 px or more, so iOS does not zoom
   the page when one is focused. A feature's own file narrows its layout under @media (max-width: 760px). */
.side-top { display: flex; align-items: flex-start; gap: 6px; }
.side-top .brand { flex: 1; min-width: 0; }
.side-close, .phonebar, .side-scrim, .fb-toggle { display: none; }
video { max-width: 100%; }
.cards { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.cols { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.field-inline { flex-direction: row; align-items: center; gap: 6px; }
.room-cards { grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); }
.room-card-name { font-size: 15px; }
/* Words for a mouse and words for a finger ("Hover an item" / "Tap an item"). */
.touch-only { display: none; }
@media (hover: none) and (pointer: coarse) { .touch-only { display: revert; } .mouse-only { display: none; } }

@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) {
  :root { --phonebar-h: 56px; --gutter: 16px; }
  .shell { display: block; min-height: 100dvh; }
  .main { min-height: 100dvh; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }

  /* the menu */
  .side {
    position: fixed; z-index: 960; inset: 0 auto 0 0; height: 100dvh; width: min(86vw, 340px);
    padding: calc(12px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
    transform: translateX(-104%); visibility: hidden; transition: transform .24s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .24s;
    box-shadow: var(--shadow-3); overscroll-behavior: contain; border-right: 0;
  }
  body.nav-open .side { transform: none; visibility: visible; transition: transform .24s cubic-bezier(.2, .8, .2, 1); }
  .side-close { display: inline-flex; flex: none; }
  .side-scrim {
    display: block; position: fixed; inset: 0; z-index: 955; background: rgba(31, 28, 24, .38);
    opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  body.nav-open .side-scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .nav-item, .nav-room { min-height: 44px; font-size: 15px; padding: 8px 12px; }
  .nav-sub { padding-left: 39px; }
  .side h4 { font-size: 11px; }
  .side-rooms > summary { min-height: 40px; }
  .side-home select { font-size: 16px; min-height: 32px; }
  .side-foot { padding-bottom: 4px; }

  /* the bar along the bottom */
  .phonebar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; z-index: 800; left: 0; right: 0; bottom: 0;
    height: calc(var(--phonebar-h) + env(safe-area-inset-bottom)); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: rgba(245, 242, 236, .94); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
    border-top: 1px solid var(--line);
  }
  .pb-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0;
    color: var(--ink-3); font: 600 10.5px/1.1 var(--font-ui); letter-spacing: .01em; background: none; border: 0; padding: 4px 0 0;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .pb-item .icon { width: 24px; height: 24px; }
  .pb-item:hover { text-decoration: none; color: var(--ink); }
  .pb-item.on { color: var(--accent-ink); }
  .pb-item.on .icon { color: var(--accent); }

  /* the page head, tabs and content */
  .top { padding: calc(12px + env(safe-area-inset-top)) var(--gutter) 0; gap: 10px; align-items: stretch; }
  .top-title { flex: 1 1 100%; }
  h1 { font-size: 24px; overflow-wrap: anywhere; }
  .trail { gap: 8px; }
  .trail-btn { width: 32px; height: 32px; }
  .crumbs { font-size: 13px; }
  .top-actions { flex: 1 1 100%; gap: 8px; min-width: 0; }
  .top-actions > .field { flex: 1 1 100%; }
  .top-actions > .field .inline-select { width: 0; flex: 1 1 auto; max-width: none; }
  /* a room's Arrangement and Theme side by side, each label above its list */
  .top-actions > .field-inline { flex: 1 1 calc(50% - 4px); flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; }
  .top-actions > .field-inline .label { font-size: 11.5px; color: var(--ink-3); }
  .top-actions > .field-inline .inline-select { width: 100%; flex: none; }
  .inline-select { max-width: 100%; min-width: 0; }
  .tabs {
    padding: 8px var(--gutter) 0; scroll-padding: 0 var(--gutter);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
  .tab { padding: 10px 11px 12px; font-size: 14px; }
  .content { padding: 16px var(--gutter) calc(var(--phonebar-h) + env(safe-area-inset-bottom) + 28px); overflow-wrap: break-word; }
  .content.flush { padding: 0 0 calc(var(--phonebar-h) + env(safe-area-inset-bottom)); }
  .banner { padding: 8px var(--gutter); flex-wrap: wrap; }
  .section-head { gap: 6px 12px; }

  /* controls a thumb can hit; type that does not make iOS zoom */
  .btn { height: 40px; padding: 0 14px; font-size: 14.5px; }
  .btn-sm { height: 34px; padding: 0 11px; font-size: 13.5px; }
  .btn-lg { height: 46px; }
  .btn-icon { width: 40px; padding: 0; }
  .btn-icon.btn-sm { width: 34px; }
  .seg a, .seg button, .seg label { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 12px; font-size: 14px; white-space: nowrap; }
  .input, select.input, textarea.input, .inline-select, .fb-select.input, .filterbar .fb-select { font-size: 16px; }
  .input, select.input, .inline-select { height: 42px; }
  .input-sm { height: 36px; }
  .filterbar .fb-select, .fb-select.input, .fb-check { height: 40px; }
  .filterbar .fb-select { max-width: none; flex: 1 1 140px; }
  .fb-search { flex-basis: 100%; min-width: 0; }
  /* the rest of a long filter bar folds behind "Filters" (studio.js) */
  .fb-toggle { display: inline-flex; flex: none; }
  .filterbar.has-toggle { gap: 8px; }
  .filterbar.has-toggle .fb-search { flex: 1 1 0; }
  .filterbar.has-toggle:not(.is-open) > :not(.fb-search):not(.fb-toggle) { display: none; }
  .filterbar.has-toggle.is-open .fb-search { flex: 1 1 calc(100% - 140px); }
  /* What opens the crawler's window (Browse and pick, logins) opens it on the Mac, not on the phone: not offered here. */
  .no-phone { display: none !important; }
  .fb-sort { margin-left: 0; }
  .check { font-size: 15px; min-height: 32px; }
  .check input { width: 20px; height: 20px; }
  .menu-list { max-width: calc(100vw - 2 * var(--gutter)); }
  .menu-list a, .menu-list button { padding: 10px 12px; font-size: 15px; }
  details.fold > summary { min-height: 40px; }
  .zoom-btn { width: 32px; height: 32px; }

  /* layouts that do not fit a phone's width */
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cards { gap: 12px; }
  .kv { grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 4px 12px; }
  .kv dd { min-width: 0; overflow-wrap: anywhere; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  /* A table keeps readable columns and scrolls sideways inside its box, rather than squeezing every word onto a line. */
  .table-wrap > .table { min-width: 600px; }
  /* a shadow on the side that has more to scroll to (shadows stay put, the covers travel with the table) */
  .table-wrap {
    background:
      linear-gradient(to right, var(--surface) 40%, rgba(255, 255, 255, 0)) left / 36px 100% no-repeat local,
      linear-gradient(to left, var(--surface) 40%, rgba(255, 255, 255, 0)) right / 36px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(31, 28, 24, .16), transparent) left / 12px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(31, 28, 24, .16), transparent) right / 12px 100% no-repeat scroll,
      var(--surface);
  }
  /* the home's rooms: two to a row, the plan with its latest render, the name and size */
  .room-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .room-cards .thumb { padding: 6px; }
  .room-cards .card-body { padding: 9px 10px 11px; gap: 3px; }
  .room-cards .room-card-name { font-size: 14px; }
  .room-cards .row-sm.between { flex-wrap: wrap; gap: 4px; }
  .room-cards .steps, .room-cards .card-body > .small.soft, .room-cards .card-body > .row-sm:last-child { display: none; }
  .room-cards .thumb-render { width: 58%; right: 5px; bottom: 5px; border-width: 1.5px; border-radius: 5px; }
  .room-renders { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ref-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ref-strip a { padding: 10px 12px; gap: 8px; }
  pre { overflow-x: auto; max-width: 100%; }
  .card-head, .card-body { padding-left: 14px; padding-right: 14px; }
  /* a card's heading keeps its width; the buttons beside it go to the next line */
  .card-head { flex-wrap: wrap; row-gap: 6px; }
  .card-head h3 { min-width: min(55%, 12em); }
  .card-pad { padding: 14px; }
  .drawing-bar { flex-wrap: wrap; padding: 6px 8px 6px 12px; }
  .drawing-body { padding: 6px; }
  .stat-value { font-size: 24px; }
  .empty { padding: 32px 18px; }

  /* dialogs rise from the bottom as a sheet; the large photo fills the screen */
  dialog, dialog.wide {
    width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 16px 16px 0 0;
    max-height: calc(100dvh - env(safe-area-inset-top) - 16px);
  }
  .dialog-head { padding: 14px var(--gutter) 10px; }
  .dialog-body { padding: 14px var(--gutter); max-height: calc(100dvh - env(safe-area-inset-top) - 150px); overscroll-behavior: contain; }
  .dialog-foot { padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); border-radius: 0; flex-wrap: wrap; }
  dialog.zoom { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; display: none; }
  dialog.zoom[open] { display: flex; flex-direction: column; justify-content: center; }
  dialog.zoom img { max-width: 100vw; max-height: calc(100dvh - 90px); border-radius: 0; }
  dialog.zoom .zoom-x { top: calc(10px + env(safe-area-inset-top)); right: 10px; width: 40px; height: 40px; }

  /* small messages sit above the bar along the bottom */
  #toasts { left: 12px; right: 12px; bottom: calc(var(--phonebar-h) + env(safe-area-inset-bottom) + 10px); max-width: none; }
  #toasts[popover] { inset: auto 12px calc(var(--phonebar-h) + env(safe-area-inset-bottom) + 10px) 12px; }
}

/* A touch screen has no hover: no lifted cards left behind by a tap. */
@media (hover: none) {
  a.card:hover { transform: none; box-shadow: var(--shadow-1); }
  .btn:not(.on):not(.btn-ghost):not(.btn-primary):not(.btn-accent):hover { background: var(--surface); border-color: var(--line-2); }
  .btn-primary:hover { background: var(--ink); border-color: var(--ink); }
  .btn-accent:hover { background: var(--accent); border-color: var(--accent); }
  .btn-ghost:not(.on):hover { background: transparent; }
}

/* A phone on its side: little height, so the bar along the bottom is slimmer and a room's pickers share one row. */
@media (pointer: coarse) and (max-height: 520px) {
  :root { --phonebar-h: 44px; }
  .pb-item { flex-direction: row; gap: 7px; font-size: 12.5px; padding-top: 0; }
  .pb-item .icon { width: 20px; height: 20px; }
  .top-actions { flex-wrap: nowrap; align-items: flex-end; }
  .top-actions > .field-inline { flex: 1 1 30%; }
}

/* A view that fills a phone's screen (the walk-through, a panorama, a 3D view): the page script adds
   body.phone-immersive while it does; the bar along the bottom steps aside and the page behind does not scroll. */
body.phone-immersive { overflow: hidden; overscroll-behavior: none; }
body.phone-immersive .phonebar, body.phone-immersive #toasts:empty { display: none; }
/* On a touch screen a quick second tap on a control is a second tap, not a zoom. */
@media (pointer: coarse) {
  a, button, .btn, summary, label, select, input, [role="button"] { touch-action: manipulation; }
}
