:root {
  --brand: #0f766e;
  --brand-2: #14b8a6;
  --brand-soft: #ccfbf1;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f5;
  --border: #e2e5e9;
  --text: #15191e;
  --muted: #5f6873;
  --danger: #dc2626;
  --warn-bg: #fff7ed;
  --warn-text: #9a3412;
  --ok-bg: #dcfce7;
  --ok-text: #166534;
  --pin: #ea580c;
  --canvas-bg: #eef1f4;
  --hall-floor: #dfe3e8;
  --toast-bg: #15191e;
  --toast-text: #ffffff;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 4px 16px rgb(0 0 0 / 0.06);
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #2dd4bf;
    --brand-2: #14b8a6;
    --brand-soft: #134e4a;
    --bg: #0f1215;
    --surface: #171b20;
    --surface-2: #1f242a;
    --border: #2c333b;
    --text: #e7eaee;
    --muted: #9aa4af;
    --danger: #f87171;
    --warn-bg: #3a2312;
    --warn-text: #fdba74;
    --ok-bg: #14321f;
    --ok-text: #86efac;
    --pin: #f97316;
    --canvas-bg: #1a1f25;
    --hall-floor: #2a3139;
    --toast-bg: #e7eaee;
    --toast-text: #15191e;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 0.6rem; }
h3 { font-size: 0.8rem; margin: 1rem 0 0.4rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
kbd { font: 0.75rem ui-monospace, monospace; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--surface-2); }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer; text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #042f2e; } }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 0.85rem; }
.btn.block { width: 100%; }
.danger-text { color: var(--danger) !important; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text);
  font-size: 1.15rem; cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:disabled { opacity: 0.35; cursor: default; background: transparent; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }

.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; font-weight: 550; flex: 1; min-width: 0; }
.form label.inline { flex-direction: row; align-items: center; gap: 8px; flex: 0 0 auto; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 450; }
.form .row { display: flex; gap: 10px; flex-wrap: wrap; }
.form .row > label { min-width: 110px; }
textarea { resize: vertical; min-height: 64px; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-height: 38px; width: 100%;
}
input[type="color"] { padding: 2px; width: 44px; height: 34px; min-height: 0; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--brand); }
input:disabled { background: var(--surface-2); color: var(--muted); }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px 12px; margin: 0; min-width: 0; }
legend { font-size: 0.8rem; font-weight: 600; padding: 0 4px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.actions.left { justify-content: flex-start; }
.form-error { color: var(--danger); margin: 0; min-height: 1.2em; font-size: 0.9rem; }

/* ---------- app shell ---------- */
.topbar {
  display: flex; align-items: center; gap: 20px; padding: 0 20px; height: 58px;
  background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-size: 1.15rem; }
.brand b, .auth-brand b { color: var(--brand); }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 550; }
.topbar nav a:hover { background: var(--surface-2); color: var(--text); }
.topbar nav a.active { color: var(--brand); background: var(--brand-soft); }
.topbar .account { margin-left: auto; max-width: 280px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.page { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; border: 2px dashed var(--border); border-radius: var(--radius); }
.badge { font-size: 0.72rem; font-weight: 600; background: var(--brand-soft); color: var(--brand); padding: 1px 7px; border-radius: 99px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list.compact li { padding: 6px 0; }
.loading-page { display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; min-height: 70vh; color: var(--muted); }

/* plans */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.plan-card { padding: 0; display: flex; flex-direction: column; margin: 0; }
.plan-card .card-main { display: flex; gap: 14px; padding: 16px; color: var(--text); text-decoration: none; flex: 1; }
.plan-card .card-main:hover h3 { color: var(--brand); }
.plan-card h3 { margin: 0 0 2px; font-size: 1.02rem; text-transform: none; letter-spacing: 0; color: var(--text); }
.plan-card p { margin: 0; }
.plan-card .meta { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.card-actions { display: flex; gap: 4px; padding: 6px 10px; border-top: 1px solid var(--border); }
.mini-booth { flex: 0 0 64px; height: 64px; display: flex; align-items: center; justify-content: center; }
.mini-booth span {
  display: block; background: var(--floor); border-radius: 3px; border: 2px solid var(--text); border-bottom-style: dashed;
  width: calc(60px * min(1, var(--w) / var(--d))); height: calc(60px * min(1, var(--d) / var(--w)));
}

/* tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table.compact { font-size: 0.82rem; }
.table.compact td, .table.compact th { padding: 5px 4px; }
.table tr.group td { font-weight: 650; padding-top: 10px; border-bottom: 0; color: var(--muted); font-size: 0.78rem; }
.row-actions { white-space: nowrap; text-align: right; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgb(0 0 0 / 0.15); flex: 0 0 auto; vertical-align: middle; }

/* auth */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.auth-brand h1 { font-size: 1.7rem; font-weight: 600; }
.auth .switch { text-align: center; margin: 16px 0 0; font-size: 0.9rem; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / 0.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgb(0 0 0 / 0.3); }
.modal.wide { max-width: 760px; }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 0; }
.modal header h2 { margin: 0; }
.modal-body { padding: 12px 18px 18px; }
.types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.type-option { flex-direction: column !important; align-items: center; gap: 4px !important; padding: 10px 4px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; text-align: center; color: var(--muted); }
.type-option input { position: absolute; opacity: 0; pointer-events: none; }
.type-option span { display: flex; flex-direction: column; color: var(--text); }
.type-option small { color: var(--muted); font-weight: 400; }
.type-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.type-option:has(input:focus-visible) { outline: 2px solid var(--brand-2); }
.copy-row { display: flex; gap: 8px; margin: 10px 0; }
.export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.export-opt { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.export-opt:hover { border-color: var(--brand); background: var(--surface-2); }
.export-opt span { font-size: 0.82rem; color: var(--muted); }
/* the way back from AutoCAD, under the export choices */
.cad-return { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 12px 14px;
  border: 1px dashed var(--border); border-radius: 10px; }
.cad-return > div { display: flex; flex-direction: column; gap: 2px; }
.cad-list { margin: 4px 0 12px; padding-left: 18px; max-height: 220px; overflow-y: auto; font-size: 0.9rem; }
.cad-list li { margin: 2px 0; }
.cad-list .check { display: inline-flex; gap: 6px; align-items: center; }
.cad-list:has(.check) { list-style: none; padding-left: 0; }
.export-group { margin: 14px 0 8px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.export-group:first-child { margin-top: 0; }
@media (max-width: 600px) { .cad-return { flex-direction: column; align-items: stretch; } }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--toast-bg); color: var(--toast-text); padding: 10px 16px; border-radius: 10px; font-weight: 550;
  transition: 0.2s; z-index: 60; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--danger); color: #fff; }

/* ---------- editor ---------- */
.editor, .viewer {
  display: grid; height: 100vh; height: 100dvh;
  grid-template-columns: 250px 1fr 300px; grid-template-rows: 56px 1fr;
  grid-template-areas: "bar bar bar" "cat stage props";
}
.viewer { grid-template-columns: 1fr 280px; grid-template-areas: "bar bar" "stage props"; }
.editor-bar {
  grid-area: bar; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: var(--surface); border-bottom: 1px solid var(--border); min-width: 0;
}
.plan-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-btn { border: 0; background: transparent; color: var(--text); font: inherit; cursor: pointer; padding: 6px 8px; border-radius: 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-btn:hover { background: var(--surface-2); }
.title-btn .edit-hint { color: var(--muted); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 5px 14px; border-radius: 7px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.tools { display: flex; align-items: center; gap: 4px; }
.snap { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--muted); margin-left: 6px; white-space: nowrap; }
.snap select { min-height: 32px; padding: 4px 6px; width: auto; }
.save-state { font-size: 0.8rem; color: var(--muted); min-width: 64px; text-align: right; }
.save-state.pending { color: var(--muted); font-style: italic; }
.save-state.error { color: var(--danger); font-weight: 600; }

.side { background: var(--surface); overflow-y: auto; min-height: 0; }
.catalog-side { grid-area: cat; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.props-side { grid-area: props; border-left: 1px solid var(--border); }
.text-tool { margin-bottom: 8px; justify-content: flex-start; }
.text-tool b { font-family: Georgia, serif; font-size: 1.1rem; color: var(--brand); }
.side-head { padding: 10px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.cat-list { padding: 0 8px 8px; flex: 1; }
.cat-list h3 { margin: 12px 6px 4px; }
.cat-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--text); font: inherit; text-align: left; cursor: grab;
}
.cat-item:hover { background: var(--surface-2); border-color: var(--border); }
.cat-item .cat-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cat-item b { font-weight: 550; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-item small { color: var(--muted); font-size: 0.75rem; }
.cat-item .plus { color: var(--brand); font-weight: 700; font-size: 1.1rem; opacity: 0; }
.cat-item:hover .plus { opacity: 1; }
.side-foot { padding: 10px 14px; margin: 0; border-top: 1px solid var(--border); }

.stage { grid-area: stage; position: relative; overflow: hidden; min-width: 0; min-height: 0; background: var(--canvas-bg); }
.stage canvas { display: block; }
.labels-layer { position: absolute; inset: 0; pointer-events: none; }
.stage-hint { position: absolute; left: 12px; bottom: 10px; z-index: 2; font-size: 0.75rem; color: var(--muted); background: color-mix(in srgb, var(--surface) 80%, transparent); padding: 4px 8px; border-radius: 6px; pointer-events: none; }
.item-label {
  /* sits above its anchor point with a short stem, so it never hides small items (network points…).
     No background: dark text with a thin white outline reads on any colour. */
  --tag-bg: transparent;
  --stem: rgb(17 17 17 / 0.55);
  position: relative; margin-top: -30px; padding: 1px 5px; border-radius: 4px;
  font-size: 11px; font-weight: 700; color: #111; background: var(--tag-bg);
  text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff;
}
.item-label span { display: block; white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.item-label::after {
  content: ""; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 12px; margin-left: -0.75px;
  background: var(--stem);
}
.item-label.selected { --tag-bg: var(--brand-2); --stem: var(--brand-2); color: #fff; text-shadow: none; box-shadow: 0 1px 2px rgb(0 0 0 / 0.2); }
.item-label.bad { --tag-bg: #ef4444; --stem: #ef4444; color: #fff; text-shadow: none; box-shadow: 0 1px 2px rgb(0 0 0 / 0.2); }
.side-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); white-space: nowrap; }
.side-label.closed { opacity: 0.8; }
.dim-label { font-size: 12px; font-weight: 700; color: var(--text); background: var(--surface); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border); }

.tabs { display: flex; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 12px 6px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.tab-body { padding: 12px 14px 24px; }
.tab-body h3:first-child { margin-top: 4px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 10px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-weight: 550; }
.keys { padding-left: 16px; margin: 0; color: var(--muted); line-height: 1.9; }
.props { gap: 10px; }
.props .row > label { min-width: 70px; }
.prop-title { display: flex; gap: 10px; align-items: center; }
.prop-title .swatch { width: 28px; height: 28px; }
.rot-row { align-items: flex-end; }
.font-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.font-row select { width: auto; flex: 1; min-width: 110px; }
.font-row input[type="number"] { width: 72px; }
.toggle { position: relative; display: inline-flex !important; flex-direction: row !important; align-items: center; justify-content: center;
  min-width: 34px; height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: 7px; cursor: pointer; font-weight: 500 !important; flex: 0 0 auto !important; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.toggle:has(input:focus-visible) { outline: 2px solid var(--brand-2); }
.small-seg { display: inline-flex; gap: 4px; background: none; padding: 0; }
.unlock-row { margin: 0 0 8px; }
.face-row { display: flex; align-items: center; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.face-row span { margin-right: 4px; }
.face-row .btn.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.transp-row { align-items: center; flex-wrap: nowrap !important; }
.transp-row input[type="range"] { flex: 1; min-height: 0; padding: 0; border: 0; accent-color: var(--brand); }
.transp-row output { min-width: 44px; text-align: right; font-weight: 600; font-size: 0.85rem; }
.rot-row .btn { flex: 0 0 auto; }
.warn { background: var(--warn-bg); color: var(--warn-text); padding: 8px 10px; border-radius: 8px; margin: 0; font-size: 0.85rem; font-weight: 550; }
.warn-box { background: var(--warn-bg); color: var(--warn-text); padding: 10px 12px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 12px; }
.warn-box ul { margin: 6px 0 0; padding-left: 18px; }
.warn-box a { color: inherit; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.totals div { background: var(--surface-2); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; }
.totals small { color: var(--muted); font-size: 0.72rem; }
.totals b { font-size: 1rem; }

/* ---------- presentation / walk-through ---------- */
.stage.presenting { position: fixed; inset: 0; z-index: 60; }
.stage.presenting .stage-hint, .stage.presenting .compare-bar, .stage.presenting .pin-banner { display: none !important; }
/* presentation: no names, pins or dots; only the measuring lines when asked for (and without their delete button) */
.stage.presenting .labels-layer > :not(.dimline-label), .stage.presenting .dim-del { display: none !important; }
body.presenting-open { overflow: hidden; }
.present-bar { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 5; display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap; justify-content: center; width: max-content; max-width: calc(100% - 24px); padding: 8px 10px; border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow); border: 1px solid var(--border); }
.present-bar[hidden] { display: none; }
.present-bar .btn.on, .present-bar .seg .on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.walk-pad { display: grid; grid-template-columns: repeat(3, 34px); grid-template-rows: repeat(2, 30px); gap: 3px; }
.walk-pad [data-k=f] { grid-column: 2; grid-row: 1; }
.walk-pad [data-k=l] { grid-column: 1; grid-row: 2; }
.walk-pad [data-k=b] { grid-column: 2; grid-row: 2; }
.walk-pad [data-k=r] { grid-column: 3; grid-row: 2; }
.walk-pad .btn { min-height: 0; padding: 0; touch-action: none; }
@media (hover: hover) and (pointer: fine) { .walk-hint { display: inline; } }
@media (max-width: 900px) { .walk-hint { display: none; } }

/* ---------- version history ---------- */
.versions { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.version { display: flex; gap: 8px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; }
.version.active { border-color: #f59e0b; box-shadow: 0 0 0 1px #f59e0b; }
.v-icon { flex: 0 0 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 0.8rem; }
.v-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 0.86rem; }
.v-main b { overflow-wrap: anywhere; }
.v-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.v-diff ul { list-style: none; margin: 6px 0 0; padding: 0; font-size: 0.8rem; }
.v-diff li { padding: 2px 0; }
.v-diff li[data-uid] { cursor: pointer; }
.c-added { color: #16a34a; font-weight: 600; }
.c-changed { color: #d97706; font-weight: 600; }
.c-removed { color: #dc2626; font-weight: 600; }
.compare-bar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap; justify-content: center; max-width: calc(100% - 20px); padding: 8px 12px; border-radius: 10px; background: var(--surface);
  box-shadow: var(--shadow); border: 1px solid #f59e0b; font-size: 0.85rem; }
.compare-bar[hidden] { display: none; }

/* ---------- templates ---------- */
.starts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; max-height: min(440px, 52vh); overflow: auto; padding: 2px; }
.start-card { display: flex; flex-direction: column; gap: 2px; padding: 8px; border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 0.82rem; }
.start-card input { position: absolute; opacity: 0; pointer-events: none; }
.start-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.start-card:has(input:focus-visible) { outline: 2px solid var(--brand-2); }
.start-card small { color: var(--muted); font-weight: 400; }
/* a template's picture; its small plan drawing only shows when there is no picture */
.start-photo { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; margin-bottom: 4px; background: #0b1120; }
.start-photo + .mini-plan { display: none; }
.start-card { transition: border-color 0.15s ease, transform 0.15s ease; }
.start-card:hover { border-color: var(--brand); transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .start-card { transition: none; } .start-card:hover { transform: none; } }
.mini-plan { width: 100%; height: 70px; margin-bottom: 4px; }
.section-title { font-size: 1.05rem; margin: 28px 0 10px; }

/* ---------- blocks ---------- */
.block-swatch { display: grid; place-items: center; font-size: 13px; color: var(--brand); background: var(--brand-soft) !important; }
.block-item { position: relative; cursor: pointer; }
.block-del { width: 26px; height: 26px; min-height: 0; font-size: 12px; opacity: 0; margin-left: auto; }
.block-item:hover .block-del, .block-item:focus-within .block-del { opacity: 1; }
@media (hover: none) { .block-del { opacity: 1; } }

/* ---------- custom pieces, standing on decks ---------- */
.stand-row, .arc-presets, .opening-add { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.stand-row span, .opening-add span { margin-right: 4px; }
.stand-row .btn.on, .arc-presets .btn.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.arc-presets { margin: 6px 0; }
.openings { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.opening-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 4px; align-items: end; }
.opening-row label { font-size: 0.72rem; }
.opening-row input { min-height: 30px; padding: 2px 6px; }

/* ---------- hall plan ---------- */
.hall-box { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; }
.hall-box p { margin: 0; }
.hall-box label { display: flex; align-items: center; gap: 8px; }
.hall-box label input[type=number] { width: 90px; }
.hall-box label input[type=range] { flex: 1; }
.hall-actions { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.cal-tools { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.cal-view { max-height: 55vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.cal-inner { position: relative; cursor: crosshair; }
.cal-inner img, .cal-inner svg { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; }
.cal-dist { margin-top: 8px; align-items: center; }

/* ---------- printed graphics ---------- */
.gfx-row { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.gfx-row:last-of-type { border-bottom: 0; }
.gfx-face { flex: 0 0 64px; font-size: 0.8rem; font-weight: 600; padding-top: 4px; }
.gfx-thumb { width: 52px; height: 52px; object-fit: contain; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); flex: 0 0 auto; }
.gfx-thumb.missing { background: #fca5a5; }
.gfx-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; }
.gfx-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gfx-opts { display: flex; flex-direction: column; gap: 4px; }
.gfx-opts select, .gfx-opts input { min-height: 28px; padding: 2px 6px; font-size: 0.8rem; min-width: 0; width: 100%; }
.drop-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 18px; text-align: center; transition: background .15s; }
.drop-zone p { margin: 4px 0; }
.drop-zone.over { border-color: var(--brand-2); background: color-mix(in srgb, var(--brand-2) 10%, transparent); }
.drop-zone.busy { opacity: 0.6; pointer-events: none; }
.gfx-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.gfx-card { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); cursor: pointer; font: inherit; font-size: 0.78rem; color: var(--text); text-align: left; }
.gfx-card:hover { border-color: var(--brand-2); }
.gfx-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--surface-2); border-radius: 4px; }
.gfx-card span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- View menu (layers, names, see-through, distances) ---------- */
.menu-wrap { position: relative; }
#view-btn.on { border-color: var(--brand); color: var(--brand); }
.view-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: 270px; padding: 10px 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.view-menu[hidden] { display: none; }
.view-menu h4 { margin: 0 0 2px; font-size: 0.85rem; }
.view-menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; width: 100%; }
.view-menu label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.view-menu select { margin-left: auto; width: auto; min-height: 28px; padding: 2px 6px; }
.layer-list { display: flex; flex-direction: column; gap: 4px; }
.layer-list .layer-empty { opacity: 0.55; }
.layer-list .muted { margin-left: auto; }
.layer-presets { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- precision: distances, dimension lines, measuring, selection box ---------- */
.gap-label, .dimline-label { pointer-events: none; font: 700 11px/1.2 system-ui, sans-serif; padding: 1px 5px; border-radius: 4px; white-space: nowrap; }
.gap-label { color: #fff; background: #0d9488; }
.dimline-label { color: #fff; background: #db2777; display: flex; align-items: center; gap: 3px; }
.dimline-label.live { pointer-events: none; }
.dim-del { pointer-events: auto; border: 0; background: rgb(255 255 255 / 0.25); color: #fff; width: 15px; height: 15px; border-radius: 3px; padding: 0;
  font: 700 12px/15px system-ui, sans-serif; cursor: pointer; display: none; }
.dim-del { display: inline-block; }
.snap-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #db2777; background: #fff; pointer-events: none; }
.snap-dot { position: relative; }
.snap-dot span { position: absolute; left: 12px; top: -18px; white-space: nowrap; font: 600 11px/1.3 system-ui, sans-serif;
  color: #fff; background: rgb(17 24 39 / 0.8); padding: 1px 5px; border-radius: 4px; }
.snap-dot.on { background: #db2777; box-shadow: 0 0 0 3px rgb(219 39 119 / 0.25); }
.select-box { position: absolute; z-index: 3; border: 1.5px dashed var(--brand-2); background: color-mix(in srgb, var(--brand-2) 12%, transparent); pointer-events: none; }
.editor .plan-title { min-width: 120px; }
@media (max-width: 1599px) { #measure .lbl { display: none; } }
#measure.on { border-color: #db2777; color: #db2777; background: color-mix(in srgb, #db2777 10%, transparent); }
.stage-hint.on { color: var(--text); border: 1px solid #db2777; }
.gap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.gap-to { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.push-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.push-row span { margin-right: 4px; }
.align-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.multi h3 { margin: 4px 0 0; }

/* ---------- customer review: status, approval, comments ---------- */
.status-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; border: 0;
  font: inherit; font-size: 0.8rem; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
button.status-chip { cursor: pointer; }
.status-chip[hidden] { display: none; }
.status-chip.approved { background: var(--ok-bg); color: var(--ok-text); }
.status-chip.changed, .status-chip.changes_requested { background: var(--warn-bg); color: var(--warn-text); }
.approval { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.tabs .count:not(:empty) { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--pin); color: #fff; font-size: 0.72rem; line-height: 18px; }
.review { padding: 10px 12px; border-radius: 8px; background: var(--surface-2); font-size: 0.85rem; margin-bottom: 12px; }
.review.approved { background: var(--ok-bg); color: var(--ok-text); }
.review.changed { background: var(--warn-bg); color: var(--warn-text); }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-size: 0.82rem; color: var(--brand); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.tag { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 5px; border-radius: 4px; background: var(--brand-soft); color: var(--brand); }
.comments-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.threads { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.thread { border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: var(--surface); }
.thread.active { border-color: var(--pin); box-shadow: 0 0 0 1px var(--pin); }
.thread.resolved { opacity: 0.6; }
.thread .reply { margin: 8px 0 0 14px; padding-left: 10px; border-left: 2px solid var(--border); }
.thread-actions { display: flex; gap: 12px; margin-top: 8px; align-items: center; }
.post-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.85rem; }
.post-body { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.9rem; }
.event { font-size: 0.85rem; color: var(--ok-text); background: var(--ok-bg); border-radius: 8px; padding: 8px 10px; }
.pin-num { width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--pin); color: #fff; font: inherit; font-size: 0.75rem; font-weight: 700; cursor: pointer; padding: 0; }
.pin-num.no-spot { background: var(--muted); cursor: default; }
.thread.resolved .pin-num { background: var(--muted); }
/* pin on the booth: a numbered drop whose tip is on the commented point (CSS2DRenderer owns .pin's transform) */
.pin { pointer-events: auto; position: relative; margin-top: -18px; width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; }
.pin-drop { position: absolute; inset: 1px; border: 2px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--pin); box-shadow: 0 1px 3px rgb(0 0 0 / 0.35); }
.pin-n { position: relative; color: #fff; font: 700 12px/28px system-ui, sans-serif; }
.pin.resolved .pin-drop { background: #8b939c; }
.pin.active .pin-drop { box-shadow: 0 0 0 4px color-mix(in srgb, var(--pin) 45%, transparent); }
.pin.active { z-index: 1; }
.pin-banner { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  max-width: calc(100% - 20px); padding: 8px 12px; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--pin); font-size: 0.88rem; font-weight: 600; }
.pin-banner[hidden] { display: none; }

/* team-only notes: dashed, never on the share link */
.thread.internal { border-style: dashed; background: var(--surface-2); }
.reply.internal { border-left-style: dashed; }
.tag.private { background: var(--surface); color: var(--muted); border: 1px solid var(--border); text-transform: none; letter-spacing: 0; }
.pin-num.internal { background: #6b7280; width: auto; min-width: 22px; padding: 0 5px; border-radius: 11px; }
.pin.internal .pin-drop { background: #6b7280; border-style: dashed; }
.pin.internal { width: 32px; }
.pin.internal .pin-n { font-size: 11px; }

/* ---------- the bell ---------- */
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 4px; min-width: 0; }
.bell-wrap { position: relative; }
.bell { position: relative; color: var(--muted); }
.bell.has-new { color: var(--text); }
.bell-count { position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--pin); color: #fff; font-size: 0.68rem; font-weight: 700; line-height: 17px; text-align: center; }
.bell-count[hidden] { display: none; }
.bell-panel { position: fixed; z-index: 20;
  max-height: min(480px, 70vh); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.bell-panel header { padding: 10px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.bell-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px 10px 24px; border-bottom: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-size: 0.86rem; position: relative; }
.bell-item:last-child { border-bottom: 0; }
.bell-item:hover { background: var(--surface-2); }
.bell-item.unread::before { content: ""; position: absolute; left: 10px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--pin); }
.bell-item.is-approval .bell-line b { color: var(--ok-text); }
.bell-body { color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bell-empty { padding: 14px; margin: 0; }

/* ---------- small screens (phones, small tablets) ----------
   Editor and customer link work like an app: a compact two-row bar, the booth filling the screen,
   and a bottom panel with tabs (on phones the catalog is its "Add" tab) that folds down. */
.phone-only, .sheet-handle, .bar-break, .acct-initial, .cat-sum { display: none; }
@media (max-width: 900px) {
  .phone-only { display: block; }
  .editor, .viewer {
    height: 100vh; height: 100dvh; overflow: hidden;
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "bar" "stage" "props";
  }
  .editor-bar { flex-wrap: wrap; height: auto; padding: 6px 8px; padding-top: max(6px, env(safe-area-inset-top));
    padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); gap: 6px; }
  .editor-bar .btn { padding: 0 10px; min-height: 36px; }
  .editor-bar .bar-lbl { display: none; }
  .bar-break { display: block; flex-basis: 100%; height: 0; order: 7; }
  /* row 1: back, name, review chip, bell, Share, Export — row 2: Plan/3D, undo/redo, View, Measure, Present, save state */
  .editor-bar > .icon-btn:first-child, .viewer .editor-bar > img { order: 1; }
  .plan-title, .editor .plan-title { order: 2; flex: 1 1 0; min-width: 50px; }
  .plan-title #plan-meta, .plan-title .edit-hint { display: none; }
  .title-btn { padding: 6px 4px; }
  #review-state { order: 3; }
  .editor-bar .bell-wrap { order: 4; }
  #share { order: 5; }
  #export { order: 6; }
  .editor-bar .seg { order: 8; }
  .editor-bar .seg button { padding: 5px 11px; }
  .tools { order: 9; gap: 2px; }
  .tools .icon-btn { width: 34px; }
  .tools .snap, #booth-size { display: none; }
  #present { order: 10; }
  .save-state { order: 11; min-width: 0; margin-left: auto; font-size: 0.75rem; }
  .viewer .plan-title { flex-basis: calc(100% - 44px); }
  .approval { order: 12; margin-left: auto; }
  .stage-hint { display: none; }
  .stage-hint.on { display: block; right: 12px; }
  /* the bottom panel */
  .props-side { position: relative; border: 0; border-top: 1px solid var(--border); height: 40vh; height: 40dvh;
    display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom); border-radius: 14px 14px 0 0; box-shadow: 0 -6px 20px rgb(0 0 0 / 0.08); }
  .viewer .props-side { height: 40vh; height: 40dvh; }
  .props-side.folded { height: auto; overflow: hidden; }
  .props-side.folded > :not(.tabs):not(.sheet-handle) { display: none !important; }
  .sheet-handle { display: block; flex: 0 0 auto; width: 100%; height: 16px; border: 0; padding: 0; cursor: pointer;
    background: var(--surface); position: sticky; top: 0; z-index: 2; }
  .sheet-handle::before { content: ""; display: block; width: 38px; height: 4px; border-radius: 2px; margin: 6px auto; background: var(--border); }
  .props-side .tabs { top: 16px; flex: 0 0 auto; }
  .tabs button { padding: 9px 4px 10px; font-size: 0.88rem; }
  .props-side .tab-body { flex: 1 0 auto; }
  .props-side .facts dd { overflow-wrap: anywhere; }
  .props-side .catalog-side { border: 0; flex: 1 0 auto; }
  .props-side .catalog-side[hidden] { display: none; }
  .props-side .side-head { position: static; display: flex; gap: 8px; align-items: center; }
  .props-side .side-head .text-tool { margin: 0; width: auto; flex: 0 0 auto; }
  .cat-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 6px; padding-bottom: 12px; }
  .cat-list h3 { grid-column: 1 / -1; }
  .cat-item { padding: 8px 6px; }
  .props-side .side-foot { display: none; }
  /* the View menu opens as a sheet from the bottom */
  .view-menu { position: fixed; top: auto; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto;
    max-height: 70vh; max-height: 70dvh; overflow-y: auto; padding: 14px 16px; border-radius: 14px; }
  .view-menu label.check { min-height: 36px; }
  /* list screens */
  .topbar { gap: 6px; padding: 0 10px; }
  .topbar .brand span { display: none; }
  .topbar nav a { padding: 8px 9px; }
  .topbar .account { max-width: none; padding: 0; width: 36px; justify-content: center; }
  .acct-name { display: none; }
  .acct-initial { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
    background: var(--brand-soft); color: var(--brand); font-weight: 700; }
  .page { padding: 18px 14px 48px; }
  .page-head { flex-wrap: wrap; }
  .page-head h1 { font-size: 1.35rem; }
  .types { grid-template-columns: repeat(2, 1fr); }
  .export-grid { grid-template-columns: 1fr; }
  .modal { max-height: calc(100dvh - 32px); }
  /* catalog page: one line per item with a summary instead of a wide table */
  .cat-table thead, .cat-table td:nth-child(n+3):nth-child(-n+7) { display: none; }
  .cat-table .cat-sum { display: block; color: var(--muted); margin-top: 2px; }
  .cat-table td:first-child { width: 28px; padding-right: 0; }
  .card { padding: 14px 12px; }
  /* presentation bar: tighter, so it takes two rows instead of three */
  /* narrow phones: "Saved" only shows while saving or when it failed */
  @media (max-width: 420px) { .save-state:not(.pending):not(.error) { display: none; } }
  .present-bar { gap: 6px; padding: 6px 8px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .present-bar .btn:not(.walk-pad .btn) { padding: 0 9px; min-height: 34px; font-size: 0.88rem; }
  .present-bar .seg button { padding: 5px 9px; }
  .present-bar .pmenu { position: static; }  /* menus centre on the bar, so they stay on screen */
  @media (max-width: 420px) {
    .present-bar { gap: 5px; padding: 6px; }
    .present-bar .pico { display: none; }
    .present-bar .btn:not(.walk-pad .btn) { padding: 0 8px; }
  }
  /* two rows: views, Turn and Exit on top; Look, Build, Walk and Save below */
  .present-bar:has(> .seg) > * { order: 2; }
  .present-bar:has(> .seg) > .seg, .present-bar > [data-act=turn], .present-bar:has(> .seg) > [data-act=exit] { order: 0; }
  .present-bar:has(> .seg)::after { content: ""; flex-basis: 100%; height: 0; order: 1; }
  .cat-table .row-actions .btn { display: flex; margin-left: auto; }
}
/* touch screens: 16px text in fields so iPhones don't zoom in when you tap one */
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), select, textarea { font-size: 16px !important; }
}

/* quote settings (Team) */
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.quote-logo { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.quote-logo-box { width: 150px; height: 76px; display: grid; place-items: center; border: 1.5px dashed var(--border); border-radius: 8px; background: #fff; padding: 6px; }
.quote-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- print (Export → Print / PDF) ---------- */
#print-root { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; color: #111; font-size: 10pt; }
  #app, #toast, .modal-backdrop { display: none !important; }
  #print-root { display: block; }
  #print-root header { display: flex; justify-content: space-between; border-bottom: 2px solid #0f766e; padding-bottom: 6px; margin-bottom: 8px; }
  #print-root h1 { font-size: 18pt; }
  #print-root h2 { font-size: 12pt; margin: 14px 0 4px; color: #0f766e; break-after: avoid; }
  #print-root header p { margin: 2px 0 0; color: #555; }
  #print-root .right { text-align: right; }
  #print-root .facts { display: block; margin: 0 0 8px; }
  #print-root .muted { color: #666; }
  #print-root .views { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; break-inside: avoid; }
  #print-root figure { margin: 0; border: 1px solid #ddd; padding: 6px; }
  #print-root figure svg, #print-root figure img { width: 100%; height: auto; max-height: 120mm; object-fit: contain; display: block; }
  #print-root figcaption { font-size: 8pt; color: #666; margin-top: 4px; }
  #print-root table { width: 100%; border-collapse: collapse; font-size: 9pt; }
  #print-root th { text-align: left; border-bottom: 1px solid #999; padding: 3px 4px; }
  #print-root td { border-bottom: 1px solid #e5e5e5; padding: 3px 4px; }
  #print-root tr { break-inside: avoid; }
  #print-root tr.total td { font-weight: 700; border-top: 2px solid #111; }
  #print-root footer { margin-top: 16px; font-size: 8pt; color: #888; }
  /* the quote (Export → Quote): the company's own document */
  #print-root .quote { font-size: 10pt; color: #1a1a1a; }
  #print-root .quote-head { align-items: flex-start; border-bottom: 0; padding-bottom: 0; margin-bottom: 14px; }
  #print-root .quote-from { display: flex; gap: 14px; align-items: flex-start; line-height: 1.45; }
  #print-root .quote-logo-img { max-width: 44mm; max-height: 22mm; object-fit: contain; }
  #print-root .quote-ref { text-align: right; }
  #print-root .quote-word { display: block; font-size: 24pt; font-weight: 800; letter-spacing: -0.02em; color: #0f766e; line-height: 1; margin-bottom: 6px; }
  #print-root .quote-ref table { width: auto; margin-left: auto; font-size: 9pt; }
  #print-root .quote-ref td { border: 0; padding: 1px 0 1px 12px; text-align: right; }
  #print-root .quote-ref td:first-child { color: #666; }
  #print-root .quote-for { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 12px; padding: 10px 12px; margin-bottom: 10px;
    background: #f3f6f6; border-left: 3px solid #0f766e; break-inside: avoid; }
  #print-root .quote-label { display: block; font-size: 7.5pt; letter-spacing: 0.08em; text-transform: uppercase; color: #666; margin-bottom: 2px; }
  #print-root .quote-picture { border: 0; padding: 0; margin: 0 0 10px; break-inside: avoid; }
  #print-root .quote-picture img { width: 100%; max-height: 96mm; object-fit: contain; border-radius: 2mm; }
  #print-root .quote-lines th:nth-child(n + 2), #print-root .quote-lines td:nth-child(n + 2) { text-align: right; white-space: nowrap; }
  #print-root .quote-lines th { font-size: 8pt; letter-spacing: 0.06em; text-transform: uppercase; color: #666; border-bottom: 1.5px solid #0f766e; }
  #print-root .quote-group td { font-weight: 700; background: #f3f6f6; border-bottom: 0; padding-top: 5px; padding-bottom: 5px; }
  #print-root .quote-totals { width: 46%; margin: 10px 0 0 auto; break-inside: avoid; }
  #print-root .quote-totals td:last-child { text-align: right; white-space: nowrap; }
  #print-root .quote-totals tr.total td { font-size: 12pt; border-top: 2px solid #0f766e; border-bottom: 0; color: #0f766e; }
  #print-root .quote-terms { margin-top: 14px; break-inside: avoid; }
  #print-root .quote-terms p { margin: 2px 0 0; line-height: 1.5; }
  #print-root .quote-sign { display: grid; grid-template-columns: 1.4fr 0.8fr 1.4fr; gap: 18px; margin-top: 22px; break-inside: avoid; }
  #print-root .quote-sign div { border-top: 1px solid #999; padding-top: 4px; min-height: 16mm; }
  #print-root .quote-foot { margin-top: 14px; padding-top: 6px; border-top: 1px solid #ddd; text-align: center; }
}

/* presentation: round colour / finish swatches for the clicked item */
.swatch-panel {
  position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); z-index: 3;
  width: min(610px, calc(100% - 32px)); padding: 12px 14px; border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.18); display: grid; gap: 10px;
}
.swatch-panel[hidden] { display: none; }
.swatch-head { display: flex; align-items: baseline; gap: 8px; }
.swatch-head .btn { margin-left: auto; }
.swatch-head .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 32px; height: 32px; border-radius: 50%; padding: 0; cursor: pointer; flex: none;
  border: 2px solid var(--surface); box-shadow: 0 0 0 1px rgb(0 0 0 / 0.18), 0 1px 3px rgb(0 0 0 / 0.2);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.swatch:hover { transform: scale(1.12); }
.swatch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.swatch.on { box-shadow: 0 0 0 2px var(--brand), 0 1px 3px rgb(0 0 0 / 0.2); transform: scale(1.08); }
.swatch-custom { display: grid; place-items: center; background: conic-gradient(#ef4444, #facc15, #22c55e, #3b82f6, #a855f7, #ef4444);
  color: #fff; font-weight: 700; text-shadow: 0 0 3px rgb(0 0 0 / 0.6); position: relative; overflow: hidden; }
.swatch-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.swatch-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.swatch-suggest input { flex: 1 1 140px; min-width: 0; }
@media (max-width: 600px) { .swatch { width: 28px; height: 28px; } .swatch-row { gap: 6px; } }

/* presentation: photo render progress */
.photo-panel {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 5;
  width: min(420px, calc(100% - 32px)); padding: 12px 14px; border-radius: 14px; display: grid; gap: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); box-shadow: 0 8px 30px rgb(0 0 0 / 0.18);
}
.photo-panel[hidden] { display: none; }
.photo-progress { height: 6px; border-radius: 3px; background: var(--border, #e5e7eb); overflow: hidden; }
.photo-progress span { display: block; height: 100%; background: var(--brand); transition: width 0.3s ease; }
.photo-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* the booth building itself: no names, dots or measures until it's done */
.stage.building .labels-layer { visibility: hidden; }
/* customer link intro: the title card */
.build-intro { position: absolute; inset: 0; z-index: 4; pointer-events: none; display: grid; place-items: center;
  /* a soft scrim so the title reads on any booth colour (WCAG contrast), fading out with the card */
  background: radial-gradient(ellipse 60% 40% at 50% 50%, rgb(15 23 42 / 0.38), transparent 75%);
  animation: intro-scrim 4.8s ease forwards; }
@keyframes intro-scrim { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.build-intro .intro-card { text-align: center; color: #fff; text-shadow: 0 2px 18px rgb(0 0 0 / 0.45); animation: intro-card 4.8s ease forwards; }
.build-intro .intro-card small { display: block; font-size: 0.85rem; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.85; }
.build-intro .intro-card b { display: block; font-size: clamp(1.6rem, 4vw, 2.8rem); line-height: 1.15; margin: 6px 0; }
.build-intro .intro-card span { font-size: 1rem; opacity: 0.9; }
.build-intro .skip { position: absolute; right: 18px; bottom: 18px; pointer-events: auto; }
@keyframes intro-card { 0% { opacity: 0; transform: translateY(14px); } 15%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .build-intro .intro-card { animation: none; opacity: 0; } }

/* presentation bar menus (Look, Save) */
.pmenu { position: relative; }
.pmenu-panel {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 6;
  width: 270px; max-width: calc(100vw - 32px); padding: 8px; border-radius: 12px; display: grid; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 10px 30px rgb(0 0 0 / 0.18);
}
.pmenu-panel[hidden] { display: none; }
.pmenu-panel > .seg { justify-self: stretch; display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 4px; }
.pmenu-item {
  display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; text-align: left;
  padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; font: inherit;
}
.pmenu-item:hover, .pmenu-item:focus-visible { background: var(--brand-soft); outline: none; }
.pmenu-item b { grid-column: 1; grid-row: 1; font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.pmenu-item small { grid-column: 1; grid-row: 2; color: var(--muted); font-size: 0.75rem; line-height: 1.3; white-space: normal; }
.pmenu-item.pswitch .switch { grid-column: 2; grid-row: 1 / span 2; width: 34px; height: 20px; border-radius: 10px; background: var(--border);
  position: relative; transition: background 0.15s ease; }
.pmenu-item.pswitch .switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.25); transition: transform 0.15s ease; }
.pmenu-item.pswitch.on .switch { background: var(--brand); }
.pmenu-item.pswitch.on .switch::after { transform: translateX(14px); }
@media (prefers-reduced-motion: reduce) { .pmenu-item.pswitch .switch, .pmenu-item.pswitch .switch::after { transition: none; } }

/* ---------- public home page ---------- */
.auth-back { display: inline-block; margin-bottom: 8px; color: var(--muted); text-decoration: none; }
.auth-back:hover { color: var(--brand); }
.landing {
  --land-bg: #0b1120; --land-text: #eef2f7; --land-muted: #a3adbb; --land-accent: #2dd4bf; --land-ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  position: relative; min-height: 100vh; color: var(--land-text); background: var(--land-bg); overflow-x: clip;
}
/* the stand: full screen behind everything, never in the way of the scroll or the clicks */
.land-stage-wrap { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 0.9s ease 0.15s; }
.landing.ready .land-stage-wrap { opacity: 1; }
.land-stage { position: absolute; inset: 0; pointer-events: none; }
/* the demo booth: only its dimension lines show labels */
.land-stage .labels-layer > :not(.dimline-label) { display: none !important; }
/* darker where the text sits and round the edges, so the words always read */
.land-scrim { position: absolute; inset: 0; z-index: 3;
  background: linear-gradient(90deg, rgb(11 17 32 / 0.88) 0%, rgb(11 17 32 / 0.55) 28%, rgb(11 17 32 / 0) 58%),
    radial-gradient(120% 90% at 60% 45%, rgb(11 17 32 / 0) 55%, rgb(5 8 16 / 0.7) 100%); }
/* a fine film grain over the picture */
.land-grain { position: absolute; inset: 0; z-index: 4; opacity: 0.09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"); }

/* the loader: the logo and a thin line, until the first picture is drawn */
.land-loader { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: var(--land-bg); transition: opacity 0.6s ease, visibility 0s linear 0.6s; }
.landing.ready .land-loader { opacity: 0; visibility: hidden; pointer-events: none; }
.land-loader img { border-radius: 10px; animation: land-pulse 1.6s ease-in-out infinite; }
.land-loader-line { width: 132px; height: 2px; border-radius: 2px; background: rgb(255 255 255 / 0.12); overflow: hidden; }
.land-loader-line i { display: block; width: 40%; height: 100%; background: var(--land-accent); border-radius: 2px; animation: land-load 1.1s var(--land-ease) infinite; }
@keyframes land-load { from { transform: translateX(-110%); } to { transform: translateX(260%); } }
@keyframes land-pulse { 50% { opacity: 0.55; } }

.land-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 56px) 26px; background: linear-gradient(rgb(11 17 32 / 0.9), rgb(11 17 32 / 0)); }
.land-nav .brand { display: flex; align-items: center; gap: 10px; color: var(--land-text); text-decoration: none; font-size: 1.1rem; font-weight: 600; }
.land-nav .brand b { color: var(--land-accent); }
.btn.land-primary { display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border-radius: 999px; font-weight: 700;
  background: var(--land-accent); border-color: var(--land-accent); color: #04211d;
  transition: transform 0.25s var(--land-ease), box-shadow 0.25s ease, background-color 0.2s ease; }
.btn.land-primary.small { padding: 9px 18px; }
.btn.land-primary:hover { background: #5eead4; border-color: #5eead4; transform: translateY(-1px); box-shadow: 0 10px 30px rgb(45 212 191 / 0.28); }
.btn.land-primary:active { transform: translateY(0); }
.land-arrow { width: 18px; height: 18px; transition: transform 0.25s var(--land-ease); }
.btn.land-primary:hover .land-arrow { transform: translateX(4px); }
.btn.land-ghost { padding: 13px 22px; border-radius: 999px; background: rgb(255 255 255 / 0.04); border-color: rgb(255 255 255 / 0.28); color: var(--land-text);
  backdrop-filter: blur(6px); transition: border-color 0.2s ease, background-color 0.2s ease; }
.btn.land-ghost:hover { border-color: var(--land-text); background: rgb(255 255 255 / 0.1); }

/* where you are in the story (right edge) */
.land-rail { position: fixed; right: clamp(14px, 2.2vw, 34px); top: 50%; z-index: 9; transform: translateY(-50%); margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 14px; align-items: flex-end; opacity: 0; transition: opacity 0.6s ease 0.6s; }
.landing.ready .land-rail { opacity: 1; }
.land-rail li { display: flex; align-items: center; gap: 10px; color: var(--land-muted); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }
.land-rail li span { opacity: 0; transform: translateX(6px); transition: opacity 0.3s ease, transform 0.3s var(--land-ease); }
.land-rail li i { width: 14px; height: 2px; border-radius: 2px; background: rgb(255 255 255 / 0.3); transition: width 0.3s var(--land-ease), background-color 0.3s ease; }
.land-rail li.on span { opacity: 1; transform: none; color: var(--land-text); }
.land-rail li.on i { width: 30px; background: var(--land-accent); }

.land-main { position: relative; z-index: 1; padding: 0 clamp(18px, 6vw, 96px); }
.land-hero, .land-step { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  max-width: min(46rem, 52vw); }
.land-hero { justify-content: flex-end; padding-bottom: clamp(48px, 11vh, 120px); }
.land-eyebrow { color: var(--land-accent); font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.78rem; margin: 0 0 20px; }
.land-hero h1 { font-size: clamp(2.5rem, 6vw, 6.2rem); font-weight: 800; line-height: 0.98; letter-spacing: -0.035em; margin: 0 0 26px; }
.land-lead { font-size: clamp(1.05rem, 1.5vw, 1.3rem); color: var(--land-muted); max-width: 36ch; line-height: 1.5; margin: 0 0 30px; }
.land-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.land-scroll { display: flex; align-items: center; gap: 12px; margin: 44px 0 0; color: var(--land-muted); font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; }
.land-scroll i { position: relative; width: 1px; height: 40px; background: rgb(255 255 255 / 0.2); overflow: hidden; }
.land-scroll i::after { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 40%; background: var(--land-accent); animation: land-drip 1.9s var(--land-ease) infinite; }
@keyframes land-drip { from { transform: translateY(-110%); } to { transform: translateY(260%); } }

/* headings rise into place line by line; the rest fades up after them */
@media (min-width: 861px) { .land-hero .land-line, .land-step .land-line { white-space: nowrap; width: max-content; padding-right: 0.08em; } }
.land-line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.land-line > span { display: block; transform: translateY(108%); transition: transform 0.95s var(--land-ease); transition-delay: calc(var(--i, 0) * 0.09s + 0.05s); }
.in .land-line > span { transform: none; }
.land-eyebrow, .land-lead, .land-cta, .land-scroll, .land-num, .land-text, .land-counts, .land-chip {
  opacity: 0; transform: translateY(14px); transition: opacity 0.7s ease 0.3s, transform 0.8s var(--land-ease) 0.3s; }
.in > .land-eyebrow, .in > .land-lead, .in > .land-cta, .in > .land-scroll, .in > .land-num, .in > .land-text, .in > .land-counts, .in > .land-chip,
.land-final.in .land-cta { opacity: 1; transform: none; }
.in > .land-cta, .in > .land-counts, .in > .land-chip { transition-delay: 0.45s; }
.in > .land-scroll { transition-delay: 0.7s; }

.land-step { transition: opacity 0.5s ease; }
.land-step:not(.on) { opacity: 0.25; }
.land-ghost-num { position: absolute; left: -0.06em; top: 50%; z-index: -1; transform: translateY(-62%); font-size: clamp(9rem, 24vw, 22rem); font-weight: 800;
  line-height: 1; letter-spacing: -0.05em; color: transparent; -webkit-text-stroke: 1px rgb(255 255 255 / 0.09); user-select: none; pointer-events: none; }
.land-num { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; color: var(--land-accent); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.16em; font-size: 0.8rem; }
.land-num span { color: var(--land-muted); text-transform: uppercase; }
.land-num span::before { content: ""; display: inline-block; width: 28px; height: 1px; margin-right: 14px; vertical-align: middle; background: rgb(255 255 255 / 0.3); }
.land-step h2 { font-size: clamp(2.2rem, 5vw, 4.6rem); font-weight: 800; line-height: 1; letter-spacing: -0.03em; margin: 0 0 22px; }
.land-text { color: var(--land-muted); font-size: clamp(1.02rem, 1.3vw, 1.2rem); line-height: 1.6; max-width: 40ch; margin: 0; }
.land-counts { display: flex; flex-wrap: wrap; gap: 28px; list-style: none; margin: 30px 0 0; padding: 0; color: var(--land-muted); font-size: 0.82rem; letter-spacing: 0.04em; }
.land-counts b { display: block; color: var(--land-text); font-size: 2.2rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.land-chip { display: inline-flex; align-self: flex-start; align-items: center; gap: 10px; margin: 30px 0 0; padding: 10px 16px 10px 12px; border-radius: 999px;
  background: rgb(45 212 191 / 0.12); border: 1px solid rgb(45 212 191 / 0.4); color: #99f6e4; font-weight: 600; font-size: 0.92rem; backdrop-filter: blur(6px); }
.land-ico { width: 28px; height: 28px; color: var(--land-accent); }
.land-ico.small { width: 18px; height: 18px; }

/* after the story: the page closes over the picture */
.land-after { position: relative; z-index: 1; background: linear-gradient(rgb(11 17 32 / 0) 0, rgb(11 17 32 / 0.9) 140px, var(--land-bg) 340px); padding-top: 160px; }
.land-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; max-width: 1240px; margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 48px); }
.land-features article { padding: 30px 26px 34px; border-top: 1px solid rgb(255 255 255 / 0.12); transition: background-color 0.3s ease; }
.land-features article:hover { background: rgb(255 255 255 / 0.035); }
.land-features h3 { margin: 18px 0 8px; font-size: 1.15rem; color: var(--land-text); text-transform: none; letter-spacing: -0.01em; font-weight: 700; }
.land-features p { margin: 0; color: var(--land-muted); line-height: 1.6; }
.land-final { text-align: center; padding: 140px 16px 120px; }
.land-final h2 { font-size: clamp(2.2rem, 5.5vw, 4.8rem); font-weight: 800; line-height: 1; letter-spacing: -0.03em; margin: 0 0 34px; }
.land-final .land-cta { justify-content: center; }
.land-foot { padding: 26px; text-align: center; color: var(--land-muted); font-size: 0.85rem; border-top: 1px solid rgb(255 255 255 / 0.08); }
.landing a:focus-visible, .landing .btn:focus-visible { outline: 2px solid var(--land-accent); outline-offset: 3px; }

@media (max-width: 860px) {
  /* phones: the stand in the upper part of the screen, the words at the bottom */
  .land-scrim { background: linear-gradient(0deg, rgb(11 17 32 / 0.95) 0%, rgb(11 17 32 / 0.7) 34%, rgb(11 17 32 / 0) 62%); }
  .land-hero, .land-step { max-width: none; justify-content: flex-end; padding-bottom: clamp(36px, 8vh, 72px); }
  .land-ghost-num { top: auto; bottom: 34%; transform: none; }
  .land-rail { display: none; }
  .land-features { grid-template-columns: 1fr; }
  .land-counts { gap: 20px; }
  .land-scroll { margin-top: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .land-line > span, .land-eyebrow, .land-lead, .land-cta, .land-scroll, .land-num, .land-text, .land-counts, .land-chip { transform: none; opacity: 1; transition: none; }
  .land-step, .land-stage-wrap, .land-loader, .land-rail, .land-rail li span, .land-rail li i, .btn.land-primary, .land-arrow { transition: none; }
  .land-loader img, .land-loader-line i, .land-scroll i::after { animation: none; }
}
