:root {
  --paper: #f4efe7;
  --paper-2: #ece5d9;
  --card: #fffdf9;
  --ink: #1f2a24;
  --ink-2: #3a453e;
  --muted: #7a7469;
  --line: #e2d9ca;
  --line-2: #d4c8b4;
  --forest: #2f4a3a;
  --forest-2: #3e5f4b;
  --brass: #c98b4a;
  --brass-soft: #f3e2cd;
  --clay: #b5583a;
  --ok: #3d7a4f;
  --warn: #b7791f;
  --bad: #b23b3b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 42, 36, .06), 0 8px 24px -12px rgba(31, 42, 36, .18);
  --shadow-lg: 0 24px 60px -20px rgba(31, 42, 36, .35);
  --display: "Fraunces", Georgia, serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; background-image: radial-gradient(circle at 12% -10%, #fbf6ee 0, transparent 45%), radial-gradient(circle at 110% 10%, #efe6d8 0, transparent 40%); background-attachment: fixed; }
a { color: var(--forest); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.hidden { display: none !important; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 700; color: var(--brass); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 18px; padding: 12px clamp(16px, 3vw, 36px); background: rgba(244, 239, 231, .86); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); display: grid; place-items: center; }
.brand .name { font-family: var(--display); font-size: 20px; font-weight: 600; }
.brand .name em { font-style: italic; color: var(--brass); font-weight: 400; }
.crumbs { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; min-width: 0; overflow: hidden; white-space: nowrap; }
.crumbs a { color: var(--ink-2); text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.crumbs a:hover { color: var(--forest); text-decoration: underline; }
.topbar .spacer { flex: 1; }
.page { padding: clamp(18px, 3vw, 36px); max-width: 1500px; margin: 0 auto; }

/* ---------- buttons & inputs ---------- */
.btn { --bg: var(--card); --fg: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); color: var(--fg); font: 600 14px var(--body); cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .08s, background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { --bg: var(--forest); --fg: #fff; border-color: var(--forest); }
.btn.primary:hover { --bg: var(--forest-2); }
.btn.brass { --bg: var(--brass); --fg: #fff; border-color: var(--brass); }
.btn.ghost { --bg: transparent; border-color: transparent; }
.btn.ghost:hover { --bg: var(--paper-2); }
.btn.danger { --fg: var(--bad); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

label.field { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
label.field > span { display: block; margin-bottom: 5px; }
input[type=text], input[type=password], input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font: 14px var(--body); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(47, 74, 58, .14); }
input[type=range] { width: 100%; accent-color: var(--forest); }
input[type=checkbox] { accent-color: var(--forest); width: 16px; height: 16px; }
.check { display: inline-flex; gap: 7px; align-items: center; font-size: 13.5px; cursor: pointer; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--paper-2); border-radius: 11px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 13px; border-radius: 8px; font: 600 13px var(--body); color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: var(--paper-2); color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.brass { background: var(--brass-soft); color: #8a5520; }
.chip.green { background: #e2eee4; color: var(--ok); }
.chip.red { background: #f6e0dc; color: var(--bad); }
.chip.amber { background: #f6ead3; color: var(--warn); }
.swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); display: inline-block; }
.price { font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { position: relative; overflow: hidden; background: var(--ink); color: #f4efe7; padding: 48px; display: flex; flex-direction: column; justify-content: flex-end; }
.login-art::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(circle at 70% 30%, rgba(201,139,74,.35), transparent 50%),
  repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 80px),
  repeating-linear-gradient(0deg, rgba(255,255,255,.04) 0 1px, transparent 1px 80px); }
.login-art .room-svg { position: absolute; inset: 8% 6% 30% 6%; opacity: .9; }
.login-art h1 { position: relative; font-size: clamp(34px, 4.4vw, 58px); font-weight: 400; max-width: 12ch; }
.login-art h1 em { color: var(--brass); }
.login-art p { position: relative; color: #c9c3b6; max-width: 44ch; }
.login-form { display: grid; place-items: center; padding: 40px 24px; }
.login-form form { width: min(360px, 100%); }
@media (max-width: 820px) { .login-wrap { grid-template-columns: 1fr; } .login-art { min-height: 260px; padding: 28px; } .login-art .room-svg { display: none; } }

/* ---------- house grid ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.house { overflow: hidden; cursor: pointer; transition: transform .2s, box-shadow .2s; text-decoration: none; color: inherit; display: block; }
.house:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.house .covers { aspect-ratio: 16/10; display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; background: var(--paper-2); }
.house .covers img { width: 100%; height: 100%; object-fit: cover; display: block; }
.house .covers img:first-child { grid-row: span 2; }
.house .covers.n1 { grid-template-columns: 1fr; }
.house .covers .ph { grid-column: 1 / -1; grid-row: 1 / -1; display: grid; place-items: center; color: var(--line-2); }
.house .meta { padding: 14px 16px 16px; }
.house .stats { display: flex; gap: 14px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.new-tile { display: grid; place-items: center; min-height: 240px; border: 2px dashed var(--line-2); border-radius: var(--radius); color: var(--muted); cursor: pointer; background: transparent; font: 600 15px var(--body); transition: border-color .15s, color .15s, background .15s; }
.new-tile:hover { border-color: var(--forest); color: var(--forest); background: rgba(255,255,255,.4); }

.room-card { overflow: hidden; text-decoration: none; color: inherit; display: block; transition: transform .2s, box-shadow .2s; }
.room-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.room-card .ph { aspect-ratio: 4/3; background: var(--paper-2) center/cover; position: relative; }
.room-card .ph .status { position: absolute; left: 10px; top: 10px; }
.room-card .meta { padding: 12px 14px 14px; }

.dropzone { border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 34px 20px; text-align: center; cursor: pointer; transition: all .15s; background: rgba(255,255,255,.5); }
.dropzone.over, .dropzone:hover { border-color: var(--forest); background: #fff; }
.dropzone .big { font-family: var(--display); font-size: 20px; }

/* ---------- room page ---------- */
.room-layout { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 22px; align-items: start; }
@media (max-width: 1100px) { .room-layout { grid-template-columns: 1fr; } }
.stage-wrap { position: sticky; top: 76px; }
@media (max-width: 1100px) { .stage-wrap { position: static; } }
.stage { position: relative; border-radius: var(--radius); overflow: hidden; background: #111; box-shadow: var(--shadow); user-select: none; -webkit-user-select: none; touch-action: none; }
.stage img.base { display: block; width: 100%; height: auto; max-height: calc(100vh - 200px); object-fit: contain; }
.stage .boxes { position: absolute; inset: 0; }
.box { position: absolute; border: 2px solid rgba(255,255,255,.85); border-radius: 6px; box-shadow: 0 0 0 1px rgba(0,0,0,.25); cursor: pointer; transition: background .15s, border-color .15s; }
.box:hover, .box.on { background: rgba(201,139,74,.14); border-color: var(--brass); box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 0 0 4px rgba(201,139,74,.25); }
.box .tag { position: absolute; left: -2px; top: -2px; transform: translateY(-100%); background: var(--ink); color: #fff; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px 6px 6px 0; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s; }
.box:hover .tag, .box.on .tag, .stage.labels .box .tag { opacity: 1; }
.box .num { position: absolute; right: -9px; top: -9px; width: 20px; height: 20px; border-radius: 50%; background: var(--brass); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.stage.dim .box:not(.on) { opacity: .35; }
.draw-rect { position: absolute; border: 2px dashed var(--brass); background: rgba(201,139,74,.18); pointer-events: none; }
.stage.drawing { cursor: crosshair; }
.stage .overlay-msg { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(20,26,22,.55); color: #fff; text-align: center; padding: 20px; }
.stage-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.scan { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.scan::after { content: ""; position: absolute; left: 0; right: 0; height: 30%; background: linear-gradient(180deg, transparent, rgba(201,139,74,.35), transparent); animation: scan 2.2s ease-in-out infinite; }
@keyframes scan { 0% { top: -30%; } 100% { top: 100%; } }

.panel { min-height: 300px; }
.panel-tabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.panel-tabs button { border: 0; background: none; padding: 8px 12px; border-radius: 8px; font: 600 13.5px var(--body); color: var(--muted); cursor: pointer; white-space: nowrap; }
.panel-tabs button.on { background: var(--paper-2); color: var(--ink); }
.panel-tabs .count { font-size: 11px; background: var(--line); border-radius: 99px; padding: 0 6px; margin-left: 4px; }
.panel-body { padding: 16px; }

.item-row { display: flex; gap: 12px; align-items: center; padding: 9px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.item-row:hover { background: var(--paper); }
.item-row.on { background: var(--brass-soft); border-color: #ecd2b2; }
.item-row img, .thumb { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--paper-2); flex: none; }
.item-row .n { font-weight: 600; line-height: 1.25; }
.item-row .p { text-align: right; white-space: nowrap; }

.detail-head { display: flex; gap: 14px; }
.detail-head img { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; background: var(--paper-2); flex: none; cursor: zoom-in; }
.attrs { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13px; }
.attrs dt { color: var(--muted); }
.attrs dd { margin: 0; }
.section { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }

.listing { display: flex; gap: 11px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.listing + .listing { margin-top: 8px; }
.listing img { width: 64px; height: 64px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid var(--line); flex: none; }
.listing .t { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.listing .s { font-size: 12.5px; color: var(--muted); }
.listing .acts { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.listing .pr { font-family: var(--display); font-size: 17px; font-weight: 600; white-space: nowrap; }
.estimate { display: flex; gap: 14px; align-items: baseline; padding: 14px; border-radius: 12px; background: var(--ink); color: #f4efe7; }
.estimate .big { font-family: var(--display); font-size: 28px; }

.alt-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
.alt { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.alt .top { display: flex; gap: 10px; }
.alt .img { width: 74px; height: 74px; border-radius: 9px; background: var(--paper) center/contain no-repeat; flex: none; border: 1px solid var(--line); display: grid; place-items: center; color: var(--line-2); font-size: 11px; text-align: center; }

.colors { display: flex; gap: 7px; flex-wrap: wrap; }
.colors button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; }
.colors button:hover { box-shadow: 0 0 0 2px var(--forest); }

/* ---------- renders ---------- */
.render-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.render-tile { position: relative; border-radius: 11px; overflow: hidden; cursor: pointer; background: var(--paper-2); aspect-ratio: 4/3; }
.render-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.render-tile:hover img { transform: scale(1.04); }
.render-tile .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; font-size: 11.5px; font-weight: 600; line-height: 1.25; }
.render-tile .kind { position: absolute; top: 6px; left: 6px; }
.base-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.base-strip button { flex: none; width: 82px; height: 60px; border-radius: 8px; border: 2px solid transparent; padding: 0; overflow: hidden; cursor: pointer; background: var(--paper-2); position: relative; }
.base-strip button img { width: 100%; height: 100%; object-fit: cover; }
.base-strip button.on { border-color: var(--brass); }
.base-strip button span { position: absolute; bottom: 0; left: 0; right: 0; font-size: 10px; background: rgba(0,0,0,.6); color: #fff; }

/* before/after */
.compare { position: relative; overflow: hidden; border-radius: var(--radius); background: #111; user-select: none; }
.compare img { display: block; width: 100%; max-height: 74vh; object-fit: contain; }
.compare .after { position: absolute; inset: 0; }
.compare .after img { width: 100%; height: 100%; object-fit: contain; }
.compare .handle { position: absolute; top: 0; bottom: 0; width: 3px; background: #fff; box-shadow: 0 0 8px rgba(0,0,0,.4); pointer-events: none; }
.compare .handle::after { content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; font-weight: 700; box-shadow: var(--shadow); }
.compare .lbl { position: absolute; top: 12px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: rgba(0,0,0,.6); color: #fff; }
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }

/* 360 */
.spinner360 { position: relative; aspect-ratio: 1; max-width: 560px; margin: 0 auto; border-radius: var(--radius); background-color: #eceae6; background-repeat: no-repeat; background-size: 200% 200%; cursor: grab; touch-action: none; }
.spinner360:active { cursor: grabbing; }
.spinner360 .hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 4px 12px; border-radius: 99px; pointer-events: none; }
.dots360 { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.dots360 button { padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line-2); background: #fff; font-size: 12px; cursor: pointer; }
.dots360 button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* studio */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
@media (max-width: 1000px) { .studio { grid-template-columns: 1fr; } }
.studio-canvas-wrap { background: #111; border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; touch-action: none; }
.studio-canvas-wrap canvas { max-width: 100%; max-height: 72vh; display: block; }
.layer-list .layer { display: flex; gap: 8px; align-items: center; padding: 6px; border-radius: 8px; cursor: pointer; }
.layer-list .layer.on { background: var(--brass-soft); }
.layer-list .layer canvas, .layer-list .layer img { width: 40px; height: 40px; object-fit: contain; background: repeating-conic-gradient(#ddd 0 25%, #fff 0 50%) 0 0/10px 10px; border-radius: 6px; }

/* modal */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(20, 26, 22, .55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 18px; animation: fade .15s; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 36px); overflow: auto; background: var(--card); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .18s; }
.modal.wide { width: min(1180px, 100%); }
.modal.xwide { width: min(1400px, 100%); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 2; }
.modal-b { padding: 20px; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--card); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* toasts */
#toasts { position: fixed; z-index: 200; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; max-width: min(440px, calc(100vw - 36px)); }
.toast { background: var(--ink); color: #f4efe7; padding: 11px 15px; border-radius: 11px; box-shadow: var(--shadow-lg); font-size: 14px; animation: pop .2s; white-space: pre-wrap; word-break: break-word; }
.toast.err { background: #5b1f1f; }
.toast.ok { background: var(--forest); }

/* busy */
.busy { display: flex; gap: 12px; align-items: center; padding: 16px; border-radius: 12px; background: var(--paper); color: var(--ink-2); font-size: 14px; }
.busy .dotpulse { display: flex; gap: 4px; }
.busy .dotpulse i { width: 7px; height: 7px; border-radius: 50%; background: var(--brass); animation: pulse 1s infinite ease-in-out; }
.busy .dotpulse i:nth-child(2) { animation-delay: .15s; } .busy .dotpulse i:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
.err-box { padding: 12px 14px; border-radius: 10px; background: #f8e5e1; color: #7a2a1f; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.note-box { padding: 12px 14px; border-radius: 10px; background: var(--brass-soft); color: #6e4519; font-size: 13.5px; }

/* settings */
.settings-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 1000px) { .settings-grid { grid-template-columns: 1fr; } }
.keyrow { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.keyrow + .keyrow { margin-top: 10px; }
.keyrow .prio { width: 34px; height: 34px; border-radius: 9px; background: var(--paper-2); display: grid; place-items: center; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }

/* quote / tables */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tfoot td { font-weight: 700; border-bottom: 0; }
.tbl input { height: 30px; padding: 0 8px; }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.total-card { padding: 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.total-card .v { font-family: var(--display); font-size: 28px; font-weight: 600; }

@media print {
  .topbar, .no-print, #toasts { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
  .page { padding: 0; max-width: none; }
  .quote-room { break-inside: avoid; }
}

.brand .name { white-space: nowrap; }
@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 10px 12px; }
  .topbar .crumbs, .hide-sm { display: none; }
  .brand .name { font-size: 18px; }
  .page { padding: 16px 12px; }
  .modal-b { padding: 14px; }
  .modal-f { flex-wrap: wrap; }
}
