/* PanelPro Web — phone screens. Light, high contrast for sunlight on site; tape-measure
   yellow marks what you act on and the measurements themselves. */
:root {
  /* 2D front view part colours (same as the plugin's preview) */
  --carcass: #ece7db; --back: #cfc7b6; --front: #a7b8ca; --frame: #b98a5b; --base: #5d5a55;
  --top: #7d6a56; --skin: #e4dfd2; --drawer: #e2c494; --shelf: #f4efe3; --hardware: #9aa0a6; --stroke: #3b3833;
  --ink: #1d2a30;
  --ink-2: #3c4a50;
  --muted: #5d6b71;
  --ground: #e8ecee;
  --card: #ffffff;
  --line: #cbd3d6;
  --tape: #f3c623;
  --tape-deep: #d9a900;
  --tape-ink: #231d00;
  --warn-bg: #fff3df;
  --warn: #8a4b00;
  --danger: #b3261e;
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--tape-deep); outline-offset: 2px; }
[hidden] { display: none !important; }
#app { min-height: 100%; }

/* ---------------------------------------------------------------- boot */
.boot { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 32px 28px; background: var(--ink); color: #fff; }
.boot h1 { font-size: 34px; letter-spacing: -0.02em; margin: 20px 0 6px; }
.boot p { margin: 0; color: #c9d4d8; }
.boot .bar { height: 8px; background: rgba(255,255,255,.14); border-radius: 4px; margin: 22px 0 14px; overflow: hidden; }
.boot .bar i { display: block; height: 100%; width: 4%; background: var(--tape); border-radius: 4px; transition: width .2s; }
.boot-note { font-size: 14px; }
.boot-mark { display: flex; gap: 6px; height: 56px; align-items: flex-end; }
.boot-mark span { width: 22px; background: var(--tape); border-radius: 3px; }
.boot-mark span:nth-child(1) { height: 56px; }
.boot-mark span:nth-child(2) { height: 36px; }
.boot-mark span:nth-child(3) { height: 56px; }
.boot.error .bar i { background: #ff8a80; }

/* ---------------------------------------------------------------- top bar */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 4px;
  min-height: 56px; padding: calc(6px + var(--safe-t)) 8px 6px;
  background: var(--ink); color: #fff;
}
.top h1 { flex: 1; min-width: 0; font-size: 19px; margin: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em; }
.top .sub { display: block; font-size: 13px; font-weight: 400; color: #b9c6cb; }
.icon-btn { min-width: 44px; height: 44px; border: 0; background: transparent; color: inherit; border-radius: 10px; font-size: 22px; padding: 0 10px; }
.icon-btn:active { background: rgba(255,255,255,.12); }
.top .text-btn { border: 0; background: transparent; color: #fff; height: 44px; padding: 0 12px; border-radius: 10px; font-size: 15px; }
.top .text-btn:active { background: rgba(255,255,255,.12); }

.page { padding: 14px 14px calc(110px + var(--safe-b)); max-width: 720px; margin: 0 auto; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h2 { color: var(--ink); font-size: 20px; margin: 0 0 6px; }

/* ---------------------------------------------------------------- bottom action */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  padding: 10px 14px calc(10px + var(--safe-b));
  background: linear-gradient(rgba(232,236,238,0), var(--ground) 30%);
  display: flex; gap: 10px; justify-content: center;
}
.dock > * { max-width: 692px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; border-radius: var(--radius);
  border: 1.5px solid var(--line); background: var(--card); font-weight: 600;
}
.btn.primary { flex: 1; background: var(--tape); border-color: var(--tape-deep); color: var(--tape-ink); font-size: 17px; }
.btn.primary:active { background: var(--tape-deep); }
.btn:disabled { opacity: .55; }
.btn.quiet { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 15px; }

/* ---------------------------------------------------------------- lists */
.list { display: flex; flex-direction: column; gap: 10px; }
.row-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; min-height: 64px;
}
.row-card:active { border-color: var(--ink-2); }
.row-card .grow { flex: 1; min-width: 0; }
.row-card .t1, .row-card .t2 { display: block; }
.row-card .t1 { font-weight: 650; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-card .t2 { color: var(--muted); font-size: 14px; }
.row-card .thumb { width: 72px; height: 56px; object-fit: contain; background: #fff; border-radius: 8px; flex: none; }
.code {
  flex: none; min-width: 40px; height: 32px; padding: 0 8px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--tape); font-weight: 700; font-size: 15px;
}
.dims { font-weight: 600; color: var(--ink-2); }
.chev { color: var(--muted); font-size: 22px; }
.section-h { font-size: 15px; font-weight: 650; color: var(--ink-2); margin: 22px 2px 8px; }
.section-h:first-child { margin-top: 4px; }
.meta-line { color: var(--muted); font-size: 14px; margin: 0 2px 12px; }

/* ---------------------------------------------------------------- module picker */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mcard {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px; text-align: left; min-height: 150px;
}
.mcard:active { border-color: var(--ink); }
.mcard .pic { aspect-ratio: 4 / 3; width: 100%; object-fit: contain; background: #fff; border-radius: 8px; }
.mcard .pic.wait { background: repeating-linear-gradient(135deg, #f3f5f6 0 10px, #eceff1 10px 20px); }
.mcard .nm { font-weight: 600; font-size: 15px; margin: 6px 2px 0; line-height: 1.25; }
.mcard .sz { color: var(--muted); font-size: 13px; margin: 2px 2px 0; }

/* ---------------------------------------------------------------- editor */
.view3d { position: sticky; top: calc(56px + var(--safe-t)); z-index: 4; height: 36vh; min-height: 220px; background: #fff; border-bottom: 1px solid var(--line); }
.view3d .view3d-host { position: absolute; inset: 0; }
.view3d .elev { position: absolute; inset: 28px 12px 56px; width: calc(100% - 24px); height: calc(100% - 84px); display: none; }
.view3d.is2d .elev { display: block; }
.view3d.is2d .view3d-host { visibility: hidden; }
.readout { margin: 4px 0 8px; padding: 8px 10px; background: #f2f5f6; border-radius: 10px; font-size: 13.5px; color: var(--ink-2); }
.view3d canvas { display: block; width: 100% !important; height: 100% !important; }
.view-tools { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.view-tools button { height: 40px; min-width: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.92); font-size: 14px; font-weight: 600; }
.view-tools button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.view-hint { position: absolute; left: 10px; top: 8px; font-size: 12px; color: var(--muted); background: rgba(255,255,255,.85); padding: 2px 6px; border-radius: 6px; }
.view-err { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center; color: var(--muted); }

/* the measurements: the one loud thing on the screen */
.measure { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 14px 0 4px; }
.measure button {
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 8px 6px 10px; text-align: center; min-height: 82px;
}
.measure button:active { background: var(--tape); }
.measure .lbl { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.measure .num { display: block; font-size: 30px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.15; }
.measure .unit { font-size: 13px; color: var(--muted); font-weight: 500; }
.measure button.changed { background: #fff9dc; }

.field { display: block; margin: 12px 0; }
.field > span { display: block; font-size: 14px; color: var(--ink-2); font-weight: 600; margin: 0 2px 6px; }
.text-in { width: 100%; height: 48px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; background: var(--card); font-size: 17px; }
.text-in:focus { border-color: var(--ink); outline: none; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  min-height: 42px; padding: 0 14px; border-radius: 21px; border: 1.5px solid var(--line);
  background: var(--card); font-size: 15px; font-weight: 550;
}
.seg button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg button.num-chip { font-weight: 650; }

.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 10px 0; }
.box h3 { margin: 0 0 8px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.box h3 .grow { flex: 1; }
.box h3:only-child { margin: 0; }
.frow { border-top: 1px solid #e3e8ea; padding: 10px 0 4px; }
.frow:first-of-type { border-top: 0; padding-top: 2px; }
.frow-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; color: var(--muted); }
.frow-head .grow { flex: 1; }
.hbtn { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; height: 36px; padding: 0 10px; font-weight: 650; font-size: 14px; }
.xbtn { border: 0; background: transparent; color: var(--muted); height: 36px; width: 36px; border-radius: 10px; font-size: 18px; }
.xbtn:active { background: #eef1f2; }
.xbtn:disabled { opacity: .3; }
.addbtn { display: block; margin: 10px auto 2px; min-width: 150px; background: var(--tape); border-color: var(--tape-deep); color: var(--ink); font-weight: 700; }
.addbtn:active { background: var(--tape-deep); }
.xbtn.del { color: #c62828; }
.xbtn.del:active { background: #fdecea; }
.frow-head .rlbl { font-weight: 650; color: var(--ink-2); }
.szc { display: inline-flex; align-items: center; gap: 4px; }
.hbtn.szv { min-width: 64px; }
.hbtn.szv.is-auto { color: var(--muted); font-weight: 600; }
.autob { display: inline-flex; align-items: center; gap: 3px; height: 32px; padding: 0 8px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.autob svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.autob[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.opt-l { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 8px 0 5px; }
/* the front is the row's category: one joined control on one line */
.seg.seg-joined { flex-wrap: nowrap; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.seg.seg-joined button { flex: 1 1 0; min-width: 0; border: 0; border-radius: 0; padding: 4px 4px; min-height: 40px; font-size: 13.5px;
  line-height: 1.15; white-space: normal; overflow-wrap: anywhere; }
.seg.seg-joined button + button { border-left: 1px solid var(--line); }
/* its details (hinge, inside): lighter chips, set in under it */
.row-details { margin: 8px 0 2px 4px; padding: 0 0 2px 10px; border-left: 3px solid var(--tape); }
.row-details .opt-l:first-child { margin-top: 2px; }
.row-details .seg button.chip { min-height: 30px; padding: 0 10px; font-size: 13px; background: #f4f6f7; border-color: #dfe5e7; }
.row-details .seg button.chip[aria-pressed="true"] { background: #fff; border-color: var(--ink); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.row-details .stepper { margin-top: 6px; }

.warn { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 10px 0; }
.warn p { margin: 0 0 4px; }
.warn p:last-child { margin: 0; }
.err { background: #fde8e6; color: var(--danger); }

/* ---------------------------------------------------------------- full editor (tabs + settings) */
.etabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px; }
.etabs::-webkit-scrollbar { display: none; }
.etabs button { flex: 0 1 auto; height: 40px; padding: 0 14px; border-radius: 20px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: 15px; color: var(--ink-2); }
.etabs button[aria-selected="true"] { background: var(--tape); border-color: var(--tape-deep); color: var(--tape-ink); }
.fields { padding: 4px 12px 8px; }
.grp { font-size: 13px; color: var(--muted); font-weight: 700; margin: 16px 0 2px; padding-top: 10px; border-top: 1px solid #e3e8ea; }
.grp:first-child { margin-top: 4px; border-top: 0; padding-top: 4px; }
.frow-f { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 4px 0; }
.frow-f .flbl { flex: 1; min-width: 0; font-size: 15px; line-height: 1.3; }
.frow-f.stack { display: block; padding: 6px 0; }
.frow-f.stack .flbl { display: block; margin-bottom: 6px; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.valbtn { flex: none; min-width: 92px; height: 42px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--ink); background: #fff; font-weight: 700; font-size: 16px; text-align: right; }
.valbtn:active { background: var(--tape); }
.sel { width: 100%; height: 46px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); padding: 0 10px; font-size: 16px; }
.switch { position: relative; flex: none; width: 52px; height: 32px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: #c5cdd0; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--tape-deep); outline-offset: 2px; }
.chk { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.chk input { width: 20px; height: 20px; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0,0,0,.2); margin-right: 8px; vertical-align: -2px; }
.picks { margin: -2px 0 8px; justify-content: flex-start; }   /* quick picks on the left, under the title */
.picks button { min-height: 34px; padding: 0 12px; font-size: 14px; }
.fbtn { width: 100%; margin: 8px 0; }
.colbox { padding-bottom: 8px; }
.col-head { display: flex; align-items: center; gap: 8px; }
.col-head .grow { flex: 1; }
.sub-seg { margin-top: 6px; }
.sub-seg .seg button { min-height: 36px; font-size: 14px; padding: 0 12px; }
.stepper { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.stepper button { width: 40px; height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-size: 22px; font-weight: 600; line-height: 1; }
.stepper b { min-width: 22px; text-align: center; font-size: 18px; }
.addcol { margin: 6px auto 8px; }

/* ---------------------------------------------------------------- cut list */
.cut-mod { margin: 14px 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cut-mod h3 { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; font-size: 16px; border-bottom: 1px solid var(--line); }
.cut-tab { width: 100%; border-collapse: collapse; font-size: 14px; }
.cut-tab td { padding: 8px 12px; border-top: 1px solid #edf0f1; vertical-align: top; }
.cut-tab tr:first-child td { border-top: 0; }
.cut-tab .q { width: 44px; font-weight: 700; color: var(--ink-2); }
.cut-tab .sz { white-space: nowrap; text-align: right; font-weight: 650; }
.cut-tab .mat { display: block; color: var(--muted); font-size: 12.5px; }
.edge { display: inline-block; font-size: 11.5px; color: var(--muted); margin-left: 4px; }
.eb-tog { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.eb { font: inherit; font-size: 11.5px; font-weight: 650; min-width: 30px; height: 24px; padding: 0 6px; border-radius: 6px;
  border: 1px solid #d5dbde; background: #fff; color: var(--muted); cursor: pointer; }
.eb.on { background: var(--ink, #1d2a30); border-color: var(--ink, #1d2a30); color: #fff; }
.eb.all { margin-left: 4px; }
@media (max-width: 520px) { .eb-tog { gap: 3px; } .eb { min-width: 26px; height: 23px; padding: 0 4px; font-size: 11px; } .eb.all { margin-left: 2px; } }
.eb-tog.set .eb.on { box-shadow: inset 0 -2px 0 #f3c623; }
.cut-mod h3 .eb.mod { margin-left: auto; font-weight: 600; }
@media (hover: hover) { .eb:hover { border-color: var(--ink, #1d2a30); } }
.totals { font-size: 14px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid #edf0f1; }
.totals div:first-child { border-top: 0; }

/* ---------------------------------------------------------------- documents, cutting plan */
.actions-row { display: flex; gap: 10px; margin: 2px 0 12px; }
.actions-row .btn { flex: 1; }
.docview { position: fixed; inset: 0; z-index: 35; background: rgba(20, 28, 32, .55); display: flex; align-items: center; justify-content: center; padding: 3vh 3vw; }
.doc-modal { width: min(1180px, 100%); height: 100%; background: #e9e6e0; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.doc-h { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; background: #fff; border-bottom: 1px solid var(--line); }
.doc-h h1 { flex: 1; margin: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-h .btn { flex: none; }
.doc-x { color: var(--ink); font-size: 18px; }
.docview iframe { flex: 1; width: 100%; border: 0; background: #e9e6e0; }
@media (max-width: 700px) { .docview { padding: 0; } .doc-modal { border-radius: 0; } }
.stats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-bottom: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.stat b { display: block; font-size: 24px; letter-spacing: -0.02em; }
.stat span { color: var(--muted); font-size: 13px; }
.optgrp h3 { margin: 0 0 2px; font-size: 16px; }
.sheets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 8px; }
.sheet { margin: 0; background: #fff; border: 1px solid #e3e8ea; border-radius: 10px; padding: 6px; }
.sheet svg { width: 100%; height: auto; display: block; }
.sheet figcaption { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.muted { color: var(--muted); font-weight: 400; }

/* ---------------------------------------------------------------- composition */
.compose { display: flex; flex-direction: column; height: calc(100vh - 56px - var(--safe-t)); }
.compose .cview { position: relative; top: 0; flex: 1; height: auto; min-height: 0; }
.csvg { position: absolute; inset: 0; width: 100%; height: 100%; display: none; touch-action: none; background: #fff; }
.cview.is2d .csvg { display: block; }
.cview.is2d .view3d-host { visibility: hidden; }
.csvg .floor { stroke: var(--ink-2); }
.csvg .cmod { cursor: grab; }
.csvg .cmod polygon { stroke: var(--stroke); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.csvg .cmod .hit { fill: transparent; }
.csvg .cmod .selbox { fill: none; stroke: none; }
.csvg .cmod.picked .selbox { stroke: var(--ink); stroke-width: 3; fill: rgba(243, 198, 35, .22); vector-effect: non-scaling-stroke; }
.rp-sheet { position: fixed; inset: 0; z-index: 60; background: rgba(15, 22, 25, .45); display: flex; align-items: flex-end; justify-content: center; }
.rp-box { background: var(--ground); width: 100%; max-width: 580px; max-height: 92vh; overflow: auto; padding: 16px 16px calc(16px + var(--safe-b, 0px));
  border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.2);
  --accent: var(--ink); --panel: #fff; --soft: #f4f6f7; --warn: #8a4a00; }
@media (min-width: 700px) { .rp-sheet { align-items: center; } .rp-box { border-radius: 16px; } }
.csvg .cmod.on .selbox { stroke: var(--tape-deep); stroke-width: 3; stroke-dasharray: 8 6; vector-effect: non-scaling-stroke; }
.csvg .chip rect { fill: var(--ink); }
.csvg .chip text { fill: var(--tape); font-weight: 700; text-anchor: middle; font-family: system-ui, sans-serif; }
.csvg .cdims line { stroke: var(--ink-2); }
.csvg .cdims text { fill: var(--ink); text-anchor: middle; font-weight: 650; font-family: system-ui, sans-serif; paint-order: stroke; stroke: #fff; stroke-width: 6px; stroke-linejoin: round; }
.csvg .cdims text.d-all, .csvg .cdims text.d-grp { font-weight: 800; }
.csvg .cdims text.d-gap { fill: var(--muted); font-weight: 500; }
.csvg .cdims line.d-gap { stroke: var(--muted); stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.csvg .cdims text.d-in { fill: var(--ink-2); }
.cpanel { background: var(--ground); border-top: 1px solid var(--line); padding: 10px 14px calc(12px + var(--safe-b)); }
.cpanel .crow { display: flex; align-items: center; gap: 10px; min-height: 46px; }
.cpanel .crow .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpanel .flbl { flex: 1; }
.cpanel .meta-line { margin: 4px 0; }
.cpanel .cturn { flex-wrap: wrap; gap: 6px; padding: 4px 0; }
.cpanel .cturn button { min-height: 38px; font-size: 14px; }
@media (min-width: 960px) {
  .compose { flex-direction: row; }
  .cpanel { width: 380px; border-top: 0; border-left: 1px solid var(--line); padding-top: 18px; }
}

/* ---------------------------------------------------------------- menu sheet */
.menu { position: fixed; inset: 0; z-index: 30; background: rgba(15,22,25,.45); display: flex; align-items: flex-end; }
.menu-sheet { width: 100%; max-width: 720px; margin: 0 auto; background: var(--card); border-radius: 18px 18px 0 0; padding: 8px 8px calc(12px + var(--safe-b)); }
.menu-sheet button { display: block; width: 100%; text-align: left; min-height: 52px; padding: 0 16px; border: 0; background: transparent; border-radius: 12px; font-size: 17px; }
.menu-sheet button:active { background: #eef1f2; }
.menu-sheet .danger { color: var(--danger); }
.menu-sheet .menu-title { padding: 10px 16px 6px; color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------- keypad */
.pad { position: fixed; inset: 0; z-index: 40; background: rgba(15,22,25,.45); display: flex; align-items: flex-end; }
.pad-sheet { width: 100%; max-width: 520px; margin: 0 auto; background: var(--ink); color: #fff; border-radius: 20px 20px 0 0; padding: 12px 12px calc(12px + var(--safe-b)); }
.pad-head { display: flex; align-items: center; justify-content: space-between; font-weight: 650; color: #c9d4d8; padding: 0 4px; }
.pad-x { border: 0; background: transparent; color: #c9d4d8; width: 44px; height: 40px; font-size: 18px; border-radius: 10px; }
.pad-read { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; background: var(--tape); color: var(--tape-ink); border-radius: 12px; padding: 6px 14px; min-height: 64px; margin: 6px 0 4px; }
#padExpr { font-size: 38px; font-weight: 750; letter-spacing: -0.02em; overflow-x: auto; white-space: nowrap; }
.pad-unit { font-size: 15px; font-weight: 600; }
.pad-result { min-height: 22px; text-align: right; font-size: 15px; color: #e7edef; padding: 0 6px; }
.pad-result.bad { color: #ffb4ab; }
.pad-chips { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0 8px; scrollbar-width: none; }
.pad-chips button { flex: none; height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; font-weight: 600; }
.pad-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pad-keys button { height: 56px; border: 0; border-radius: 12px; background: #2d3d44; color: #fff; font-size: 24px; font-weight: 600; }
.pad-keys button:active { background: #44575f; }
.pad-keys button.op { background: #24333a; color: var(--tape); }
.pad-foot { display: flex; gap: 8px; margin-top: 10px; }
.pad-foot button { flex: 1; height: 56px; border-radius: 14px; border: 0; font-size: 18px; font-weight: 700; }
.pad-set { background: var(--tape); color: var(--tape-ink); }
.pad-auto { background: #2d3d44; color: #fff; }

/* ---------------------------------------------------------------- toast */
.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); z-index: 50; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.25); display: flex; gap: 12px; align-items: center; }
.toast button { border: 0; background: var(--tape); color: var(--tape-ink); font-weight: 700; border-radius: 8px; height: 34px; padding: 0 12px; }

/* ---------------------------------------------------------------- larger screens
   Tablet: more room for the 3D view and the cards.
   Desktop (≥ 960 px): lists fill the width in columns; the editor puts the 3D view on the left at
   full height with the settings in a column on the right; the keypad and menus become dialogs. */
.cut-layout, .edit-layout { display: block; }

@media (min-width: 640px) {
  .view3d { height: 46vh; }
  .page { padding-left: 24px; padding-right: 24px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
  .list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
  .row-card { height: 100%; }
  .page.page-wide { max-width: 1000px; }
}

@media (min-width: 960px) {
  .top { padding-left: max(12px, calc((100vw - 1200px) / 2)); padding-right: max(12px, calc((100vw - 1200px) / 2)); }
  .page.page-wide { max-width: 1200px; }
  .page { padding-bottom: 120px; }

  /* bottom actions: a right-aligned bar inside the content width instead of a full-width strip */
  .dock {
    background: none; pointer-events: none; justify-content: flex-end;
    padding-left: max(24px, calc((100vw - 1200px) / 2 + 24px)); padding-right: max(24px, calc((100vw - 1200px) / 2 + 24px));
  }
  .dock .btn { pointer-events: auto; box-shadow: 0 6px 18px rgba(29, 42, 48, .18); }
  .dock .btn.primary { flex: 0 1 auto; min-width: 220px; }

  /* module editor: 3D left, settings right */
  .edit-layout {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(400px, 460px);
    height: calc(100vh - 56px - var(--safe-t));
  }
  .edit-layout .view3d { position: relative; top: 0; height: auto; min-height: 0; border-bottom: 0; border-right: 1px solid var(--line); }
  .edit-side { display: flex; flex-direction: column; min-height: 0; background: var(--ground); }
  .edit-side .page { flex: 1; overflow-y: auto; width: 100%; padding: 18px 22px 24px; }
  .edit-side .dock { position: static; padding: 12px 22px 16px; background: var(--ground); border-top: 1px solid var(--line); pointer-events: auto; }
  .edit-side .dock .btn { box-shadow: none; }
  .edit-side .dock .btn.primary { flex: 1; }
  .view-hint { font-size: 13px; }
  .measure .num { font-size: 32px; }

  /* cut list: modules in columns, totals in a side column that stays in view */
  .cut-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
  .cut-main { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; align-items: start; }
  .cut-main .cut-mod { margin: 0; }
  .cut-side { position: sticky; top: calc(72px + var(--safe-t)); }
  .cut-side .section-h:first-child { margin-top: 0; }

  /* keypad and menus: centred dialogs */
  .pad, .menu { align-items: center; justify-content: center; }
  .pad-sheet { max-width: 400px; border-radius: 20px; padding-bottom: 14px; }
  .menu-sheet { max-width: 380px; border-radius: 16px; padding-bottom: 8px; }
  .toast { bottom: 32px; }
}

@media (min-width: 1400px) {
  .edit-layout { grid-template-columns: minmax(0, 1fr) 500px; }
}

/* mouse: hover feedback (touch screens keep the pressed state only) */
@media (hover: hover) and (pointer: fine) {
  .row-card:hover, .mcard:hover { border-color: var(--ink-2); }
  .measure button:hover { background: #fffbe6; }
  .seg button:hover:not([aria-pressed="true"]) { border-color: var(--ink-2); }
  .btn:hover:not(:disabled) { border-color: var(--ink-2); }
  .btn.primary:hover:not(:disabled) { background: #f5cf45; }
  .icon-btn:hover, .top .text-btn:hover { background: rgba(255,255,255,.1); }
  .view-tools button:hover, .hbtn:hover { border-color: var(--ink-2); }
  .pad-keys button:hover { background: #3a4c54; }
  .menu-sheet button:hover { background: #eef1f2; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* material list */
.mat-thumb { width: 52px; height: 52px; border-radius: 8px; border: 1px solid var(--line, rgba(0,0,0,.15)); flex: none; margin-right: 12px; }
.mat-tex { height: 140px; border-radius: 10px; border: 1px solid var(--line, rgba(0,0,0,.15)); margin: 6px 0; }
.mat-color { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.mat-color input[type=color] { width: 32px; height: 26px; border: 0; padding: 0; background: none; }
.mat-thick { border-top: 1px solid var(--line, rgba(0,0,0,.12)); padding-top: 6px; margin-top: 6px; }
.warn-line { color: var(--danger, #b3261e); font-size: 14px; margin: 4px 0 0; }
.costbox { background: rgba(0,0,0,.035); border-radius: 10px; padding: 8px 12px; margin: 8px 0; font-size: 14px; }
.costbox > div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.costbox > div span { color: var(--muted, #667); }
.costbox > div b { font-weight: 600; text-align: right; }
.costbox .tot { border-top: 1px solid rgba(0,0,0,.1); margin-top: 3px; padding-top: 6px; }
.linkbtn { background: none; border: 0; padding: 6px 0 2px; color: var(--accent, #1d6fb8); font: inherit; font-weight: 600; cursor: pointer; }

/* accounts, plans, companies, gallery (cloud.js) */
.signin { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 14px; padding: 32px 28px; background: var(--ink); color: #fff; }
.signin h1 { font-size: 34px; margin: 8px 0 0; }
.signin p { margin: 0; color: #c9d4d8; max-width: 420px; }
.signin .meta-line { color: #9fb0b6; }
.signin .text-btn { background: none; border: 0; color: #c9d4d8; padding: 8px 0; font-size: 15px; text-decoration: underline; }
.gbtn { flex: 0 0 auto; min-height: 52px; display: inline-flex; align-items: center; gap: 10px; min-width: 260px; justify-content: center; }
.gbtn .g { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: #4285f4; font-weight: 700; }
.space-chip { margin-left: 10px; vertical-align: middle; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.08); color: #fff; border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 600; max-width: 55vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct { display: flex; align-items: center; gap: 14px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; }
.box.plan h3 { margin: 0 0 4px; }
.box.plan.cur { outline: 2px solid var(--tape-deep); }
.pp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pp-row .pp-btn { min-width: 200px; flex: 1; max-width: 300px; }
.badge { display: inline-block; background: var(--tape); color: var(--tape-ink); font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; vertical-align: 1px; }
.gcard { position: relative; padding: 0; }
.gcard .gpick { all: unset; display: flex; flex-direction: column; cursor: pointer; width: 100%; }
.gcard .gmore { position: absolute; top: 6px; right: 6px; border: 0; background: rgba(255,255,255,.85); border-radius: 8px; width: 32px; height: 32px; }
.mat-tabs { display: flex; gap: 6px; margin: 0 0 12px; }
.mat-tabs button { flex: 1; min-height: 40px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; font: inherit; font-weight: 600; color: var(--ink-2); }
.mat-tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.row-card .btn.small { flex: none; }
.invite { margin-bottom: 12px; }
.invite .actions-row { margin: 8px 0 0; }
table.tiers { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tiers th, table.tiers td { padding: 6px; text-align: center; border-bottom: 1px solid var(--line); }
table.tiers th:first-child { text-align: left; }
.dv-plan { display: grid; grid-template-columns: 1.6fr 1fr 1fr 0.8fr auto; gap: 6px; margin: 6px 0; align-items: center; }
.dv-plan .text-in { min-width: 0; padding: 8px; font-size: 14px; }
@media (max-width: 520px) { .dv-plan { grid-template-columns: 1fr 1fr; } }

/* ================================================================ desktop app (body.desk, ≥ 1024 px; desk.js)
   An app frame: dark sidebar, light title bar with the screen's actions, denser controls, menus
   and number boxes that open where you click. Phones never get body.desk. */
.signin .gbtn { flex: 0 0 auto; }
body.desk { font-size: 14px; background: #f3f5f6; }
body.desk .dk { display: grid; grid-template-columns: 236px minmax(0, 1fr); height: 100vh; }

/* sidebar */
.dk-side { background: var(--ink); color: #c7d2d6; display: flex; flex-direction: column; gap: 6px; padding: 14px 10px 12px; overflow-y: auto; min-height: 0; }
.dk-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 10px; color: #fff; font-size: 16px; letter-spacing: -0.01em; }
.dk-mark { display: flex; gap: 3px; align-items: flex-end; height: 18px; }
.dk-mark i { width: 6px; background: var(--tape); border-radius: 1.5px; height: 18px; }
.dk-mark i:nth-child(2) { height: 11px; }
.dk-space { display: grid; grid-template-columns: 1fr auto; text-align: left; width: 100%; padding: 7px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); color: #fff; margin-bottom: 6px; }
.dk-space small { grid-column: 1 / -1; font-size: 11px; color: #8fa1a8; text-transform: uppercase; letter-spacing: .04em; }
.dk-space span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-space em { font-style: normal; color: #8fa1a8; }
.dk-space:hover { background: rgba(255,255,255,.09); }
.dk-navs { display: flex; flex-direction: column; gap: 1px; }
.dk-nav { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: #c7d2d6; text-decoration: none; font-size: 14px; }
.dk-nav svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dk-nav:hover { background: rgba(255,255,255,.06); color: #fff; }
.dk-nav.on { background: rgba(243,198,35,.14); color: #fff; }
.dk-nav.on svg { stroke: var(--tape); }
.dk-nav.sub { padding: 5px 10px 5px 26px; font-size: 13.5px; }
.dk-nav.sub svg { width: 16px; height: 16px; }
.dk-proj { margin: 2px 0 6px; padding: 4px 0 6px; border-top: 1px solid rgba(255,255,255,.08); border-bottom: 1px solid rgba(255,255,255,.08); }
.dk-proj-name { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: #8fa1a8; padding: 4px 10px 3px 26px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; text-decoration: none; color: inherit; }
.dk-user:hover, .dk-user.on { background: rgba(255,255,255,.06); }
.dk-user img, .dk-user i { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.dk-user i { display: grid; place-items: center; background: var(--tape); color: var(--tape-ink); font-style: normal; font-weight: 700; }
.dk-user span { min-width: 0; display: flex; flex-direction: column; }
.dk-user b { color: #fff; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-user small { font-size: 11.5px; color: #8fa1a8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* main column: title bar + scrolling body */
.dk-main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.dk-body { flex: 1; min-height: 0; overflow: auto; position: relative; }
body.desk .top { position: static; background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); min-height: 52px; padding: 7px 16px; gap: 8px; flex: none; }
body.desk .top h1 { font-size: 17px; margin: 0 4px; display: flex; align-items: baseline; gap: 10px; }
body.desk .top .sub { display: inline; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
body.desk .top .icon-btn { min-width: 34px; height: 34px; font-size: 18px; padding: 0 8px; border-radius: 7px; }
body.desk .top .icon-btn:hover, body.desk .top .text-btn:hover { background: #eef1f2; }
body.desk .top .text-btn { color: var(--ink-2); height: 34px; }
body.desk .space-chip { border-color: var(--line); background: #f3f5f6; color: var(--ink); }
.dk-actions { display: flex; gap: 8px; align-items: center; }
body.desk .dk-actions .btn { min-height: 34px; padding: 0 14px; font-size: 14px; border-radius: 8px; box-shadow: none; flex: none; min-width: 0; }
.dk-search { width: 280px; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #f3f5f6; font-size: 14px; }
.dk-search:focus { outline: none; border-color: var(--ink-2); background: #fff; }

/* denser controls */
body.desk .page { max-width: none; padding: 20px 28px 48px; margin: 0; }
body.desk .page:not(.page-wide) { max-width: 760px; }
body.desk .btn { min-height: 36px; border-radius: 8px; font-size: 14px; border-width: 1px; }
body.desk .btn.primary { font-size: 14px; }
body.desk .btn.small { min-height: 32px; font-size: 13.5px; }
body.desk .box { border-radius: 10px; padding: 12px 14px; }
body.desk .row-card { border-radius: 10px; min-height: 54px; padding: 8px 12px; }
body.desk .row-card .t1 { font-size: 15px; }
body.desk .row-card .t2 { font-size: 13px; }
body.desk .list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
body.desk .text-in { height: 36px; border-radius: 8px; font-size: 14px; border-width: 1px; }
body.desk .sel { height: 34px; border-radius: 8px; font-size: 14px; border-width: 1px; }
body.desk .valbtn { min-width: 84px; height: 32px; border-radius: 6px; border: 1px solid #aeb9bd; font-size: 14px; font-weight: 650; }
body.desk .valbtn:hover { border-color: var(--ink); background: #fffbe6; }
body.desk .seg button { min-height: 30px; padding: 0 11px; border-radius: 6px; font-size: 13px; border-width: 1px; }
body.desk .seg.seg-joined { border-radius: 7px; }
body.desk .seg.seg-joined button { border-radius: 0; border-width: 0; padding: 3px 4px; min-height: 32px; }
body.desk .seg.seg-joined button + button { border-left-width: 1px; }
body.desk .hbtn, body.desk .stepper button { height: 30px; border-radius: 6px; border-width: 1px; font-size: 13px; }
body.desk .stepper button { width: 30px; font-size: 17px; }
body.desk .xbtn { height: 30px; width: 30px; font-size: 15px; }
body.desk .frow-f { min-height: 38px; padding: 2px 0; gap: 10px; }
body.desk .frow-f .flbl { font-size: 13.5px; }
body.desk .frow-f.stack .flbl { font-size: 12.5px; margin-bottom: 4px; }
body.desk .grp { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
body.desk .switch { width: 38px; height: 22px; }
body.desk .switch span { border-radius: 11px; }
body.desk .switch span::after { width: 16px; height: 16px; }
body.desk .switch input:checked + span::after { transform: translateX(16px); }
body.desk .etabs { gap: 0; margin: 12px 0 2px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
body.desk .etabs button { height: 34px; padding: 0 10px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; font-size: 13.5px; color: var(--muted); margin-bottom: -1px; }
body.desk .etabs button:hover { color: var(--ink); }
body.desk .etabs button[aria-selected="true"] { background: none; color: var(--ink); border-bottom-color: var(--tape-deep); }
body.desk .measure { gap: 6px; margin: 4px 0 2px; }
body.desk .measure button { min-height: 58px; border-width: 1.5px; border-radius: 10px; padding: 5px 6px 6px; }
body.desk .measure .num { font-size: 22px; }
body.desk .measure .lbl, body.desk .measure .unit { font-size: 12px; }
body.desk .cards { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; }
body.desk .mcard { border-radius: 10px; min-height: 0; }
body.desk .mcard .nm { font-size: 14px; }
body.desk .section-h { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 24px 2px 8px; }
body.desk .warn { border-radius: 8px; font-size: 13.5px; }
body.desk .meta-line { font-size: 13px; }
body.desk .toast { bottom: 24px; }
body.desk .view-tools button { height: 32px; min-width: 32px; padding: 0 10px; border-radius: 7px; font-size: 13px; }

/* projects table */
.dk-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dk-table th { text-align: left; padding: 0; background: #f7f9f9; border-bottom: 1px solid var(--line); }
.dk-table th button { width: 100%; text-align: inherit; border: 0; background: none; padding: 9px 12px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.dk-table th button:hover { color: var(--ink); }
.dk-table td { padding: 8px 12px; border-top: 1px solid #edf0f1; vertical-align: middle; }
.dk-table tbody tr:first-child td { border-top: 0; }
.dk-table tr[data-site] { cursor: pointer; }
.dk-table tr[data-site]:hover td { background: #fafbf6; }
.dk-table tr[data-site]:focus { outline: 2px solid var(--tape-deep); outline-offset: -2px; }
.dk-table td b { display: block; font-size: 14.5px; }
.dk-table td small { display: block; color: var(--muted); font-size: 12.5px; }
.dk-table .n { text-align: right; white-space: nowrap; }
.dk-table th.n button { text-align: right; }
.dk-table .th-pic, .dk-table .td-pic { width: 88px; }
.dk-table .td-pic img { width: 72px; height: 52px; object-fit: contain; display: block; }

/* project workspace: modules | 3D | settings */
body.desk .edit-layout { height: 100%; grid-template-columns: minmax(0, 1fr) 420px; }
body.desk .edit-layout.ws, .ws { display: grid; grid-template-columns: 260px minmax(0, 1fr) 420px; height: 100%; }
.ws:not(.edit-layout) { grid-template-columns: 260px minmax(0, 1fr); }
body.desk .edit-side .page { padding: 14px 18px 20px; }
body.desk .edit-side .dock { padding: 10px 18px 12px; }
body.desk .edit-layout .view3d { border-right: 1px solid var(--line); }
.ws-mods { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: #f8fafa; }
.ws-head { display: flex; align-items: center; gap: 4px; padding: 10px 8px 2px 14px; }
.ws-head b { flex: 1; min-width: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-head .icon-btn { min-width: 30px; height: 30px; font-size: 17px; color: var(--ink-2); border-radius: 6px; }
.ws-head .icon-btn:hover { background: #e9eef0; }
.ws-client { padding: 0 14px 6px; color: var(--muted); font-size: 12.5px; }
.ws-add { margin: 6px 12px 10px; flex: none !important; }
.ws-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.ws-mod { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 1px solid transparent; background: none; border-radius: 8px; padding: 5px 6px; }
.ws-mod:hover { background: #eef2f3; }
.ws-mod.on { background: #fff; border-color: var(--tape-deep); box-shadow: 0 1px 3px rgba(29,42,48,.08); }
.ws-mod img { width: 46px; height: 36px; object-fit: contain; flex: none; background: #fff; border-radius: 4px; }
.ws-mod .code { min-width: 28px; height: 22px; font-size: 12px; border-radius: 5px; padding: 0 5px; }
.ws-mod .grow { flex: 1; min-width: 0; }
.ws-mod .t1 { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-mod .t2 { display: block; font-size: 12px; color: var(--muted); }
.ws-mod.new .code { background: var(--tape); color: var(--tape-ink); }
.ws-empty { display: flex; align-items: center; justify-content: center; }
.ws-empty .btn { margin-top: 12px; flex: none; }
body.desk .compose { height: 100%; }

/* menus that drop down where you click */
.menu.pop { background: transparent; display: block; }
.menu.pop .menu-sheet { position: fixed; width: auto; min-width: 210px; max-width: 320px; margin: 0; border-radius: 10px; padding: 5px; border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(15,22,25,.18); max-height: calc(100vh - 16px); overflow-y: auto; }
.menu.pop .menu-sheet button { min-height: 32px; font-size: 14px; border-radius: 6px; padding: 0 12px; }
.menu.pop .menu-sheet button:hover, .menu.pop .menu-sheet button:focus { background: #eef2f3; outline: none; }
.menu.pop .menu-title { font-size: 12px; padding: 6px 12px 4px; }

/* number box (desktop keypad) */
.dpad-wrap { position: fixed; inset: 0; z-index: 40; }
.dpad { position: fixed; width: 300px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(15,22,25,.2); padding: 10px 12px 12px; }
.dpad label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.dpad-in { display: flex; align-items: center; border: 1.5px solid var(--ink); border-radius: 8px; height: 42px; background: #fffdf2; }
.dpad-in input { flex: 1; min-width: 0; border: 0; background: none; font-size: 20px; font-weight: 700; text-align: right; padding: 0 8px; outline: none; }
.dpad-in span { padding: 0 10px 0 2px; color: var(--muted); font-size: 13px; }
.dpad-res { min-height: 18px; font-size: 13px; color: var(--ink-2); text-align: right; margin: 4px 2px; }
.dpad-res.bad { color: var(--danger); }
.dpad-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 8px; }
.dpad-chips button { height: 26px; padding: 0 9px; border-radius: 13px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; font-weight: 600; }
.dpad-chips button:hover { border-color: var(--ink-2); }
.dpad-foot { display: flex; align-items: center; gap: 6px; }
.dpad-foot small { flex: 1; color: var(--muted); font-size: 11.5px; }
.dpad-foot .btn { flex: none !important; min-height: 30px; }

/* sign-in on a computer: a centred card */
body.desk .signin { align-items: center; text-align: center; }
body.desk .signin p { margin-left: auto; margin-right: auto; }
body.desk .cards > p { grid-column: 1 / -1; }
/* sign-in on a phone: centred, a normal-sized button */
.signin { align-items: center; text-align: center; gap: 16px; padding: 32px 24px calc(32px + var(--safe-b)); }
.signin .boot-mark { margin-bottom: 4px; }
.signin p { margin-left: auto; margin-right: auto; }
.signin .gbtn { width: 100%; max-width: 340px; min-height: 52px; font-size: 16px; }

/* ================================================================ phone: compact (2 Nov 2026)
   Smaller controls so more of the module and its settings fit; the buttons over the 3D view are
   small icons so they don't cover the model. (Desktop rules above use body.desk and stay as they are.) */
body { font-size: 15px; }
.top { min-height: 50px; padding-top: calc(4px + var(--safe-t)); padding-bottom: 4px; }
.top h1 { font-size: 17px; }
.icon-btn { min-width: 40px; height: 40px; font-size: 20px; }
.btn { min-height: 44px; border-radius: 12px; }
.btn.primary { font-size: 16px; }
.btn.small { min-height: 36px; font-size: 14px; }
.dock { padding: 8px 14px calc(8px + var(--safe-b)); }
.page { padding-top: 12px; }
.row-card { min-height: 56px; padding: 8px 10px; }
.row-card .t1 { font-size: 16px; }
.row-card .t2 { font-size: 13px; }
.row-card .thumb { width: 60px; height: 46px; }
.box { padding: 10px 12px; margin: 8px 0; }
.text-in { height: 42px; font-size: 16px; border-radius: 10px; }
.sel { height: 40px; font-size: 15px; border-radius: 10px; }
.measure { gap: 6px; margin: 10px 0 2px; }
.measure button { min-height: 62px; padding: 5px 4px 6px; border-width: 1.5px; border-radius: 12px; }
.measure .num { font-size: 24px; }
.measure .lbl, .measure .unit { font-size: 12px; }
.etabs { gap: 5px; margin: 10px 0 2px; }
.etabs button { height: 32px; padding: 0 11px; font-size: 13.5px; border-width: 1px; border-radius: 16px; }
.seg { gap: 5px; }
.seg button { min-height: 34px; padding: 0 11px; font-size: 14px; border-width: 1px; border-radius: 17px; }
.frow-f { min-height: 42px; gap: 10px; }
.frow-f .flbl { font-size: 14.5px; }
.valbtn { min-width: 78px; height: 36px; font-size: 15px; border-radius: 9px; border-width: 1px; }
.xbtn { width: 32px; height: 32px; font-size: 16px; }
.hbtn { height: 32px; font-size: 13.5px; }
.stepper button { width: 34px; height: 34px; font-size: 19px; }
.switch { width: 44px; height: 26px; }
.switch span { border-radius: 13px; }
.switch span::after { width: 20px; height: 20px; }
.switch input:checked + span::after { transform: translateX(18px); }
.warn { font-size: 13.5px; padding: 8px 10px; }
.section-h { font-size: 14px; }
.mcard { min-height: 0; }
.mcard .nm { font-size: 14px; }
.view3d { height: 40vh; }
.view-hint { font-size: 11.5px; }
.menu-sheet button { min-height: 46px; font-size: 16px; }

/* icon buttons over the 3D view */
.view-tools { gap: 6px; right: 8px; bottom: 8px; }
.view-tools .vt { width: 36px; height: 36px; min-width: 0; padding: 0; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.88); backdrop-filter: blur(4px); }
.view-tools .vt svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.view-tools .vt-txt { font-size: 12.5px; font-weight: 750; letter-spacing: -0.02em; }
.view-tools .vt[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.view-tools .vt[aria-pressed="true"] svg { stroke: #fff; }
body.desk .view-tools .vt { width: 32px; height: 32px; }
body.desk .view-tools .vt svg { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) { .view-tools .vt:hover:not([aria-pressed="true"]) { border-color: var(--ink-2); background: #fff; } }
.view3d { top: calc(48px + var(--safe-t)); }
.compose { height: calc(100vh - 48px - var(--safe-t)); }
body.desk .compose { height: 100%; }

/* composition drawing: lines one screen pixel wide at any zoom, real dashes, labels with a halo */
.csvg .floor { stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.csvg .floor.wall { stroke-dasharray: 10 6; }
.cview.is2d .side-bar { bottom: 10px; }
.csvg .cdims line { stroke-width: 1px; vector-effect: non-scaling-stroke; }
.csvg .cdims line.d-all, .csvg .cdims line.d-grp { stroke-width: 1.3px; }
.csvg .cdims line.d-gap { stroke-dasharray: 5 4; stroke-width: 1px; }
.csvg .cdims text { stroke-width: var(--halo, 4px); }
.csvg .cdims text.d-in { fill: var(--ink); font-weight: 650; }
/* "Dimensions in mm": one note for the drawing instead of a unit on every label */
.dim-note { position: absolute; left: 8px; bottom: 8px; z-index: 2; font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: rgba(255,255,255,.85); padding: 2px 7px; border-radius: 6px; pointer-events: none; display: none; }
.cview.is2d .dim-note { display: block; }
.cview.is2d .p3d-note { display: none !important; }
/* toast: as wide as its text (centring with left:50% would otherwise cap it at half the screen) */
.toast { width: max-content; max-width: calc(100% - 32px); }
.toast span { flex: 1; min-width: 0; }
.toast button { flex: none; white-space: nowrap; }
.app-ver { font-size: 13px; color: var(--muted); }
.app-ver b { color: var(--ink); }
.dk-ver { font-size: 11px; color: #6f8389; padding: 2px 10px 0; }
.dk-ver { text-decoration: none; display: block; }
/* menu icons */
.menu-sheet button { display: flex !important; align-items: center; gap: 14px; }
.menu-sheet .mi { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--ink-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.menu-sheet .danger .mi { stroke: var(--danger); }
.menu-sheet button span { flex: 1; min-width: 0; }
.menu.pop .menu-sheet button { gap: 10px; }
.menu.pop .menu-sheet .mi { width: 18px; height: 18px; }

/* picture-card choices (carcass joint, back inside / outside) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; width: 100%; margin-top: 6px; }
.card { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink); font: inherit; cursor: pointer; }
.card svg { width: 34px; height: 38px; flex: none; }
.card b { display: block; font-size: 13.5px; font-weight: 650; }
.card small { display: block; font-size: 12px; color: var(--muted); line-height: 1.25; margin-top: 2px; }
.card[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); background: #fffbea; }
@media (max-width: 480px) { .cards { grid-template-columns: 1fr; gap: 6px; } .card { padding: 7px 10px; } }
.seg.lmode { margin: 4px 0 6px; }
#nkHost { padding: 10px; --nk-on: var(--ink); --nk-go: var(--tape); --nk-bg: #eef1f2; }
/* composition: one tab per wall + the whole room (projects from SketchUp) */
#ctabs:empty { display: none; }
#ctabs { position: absolute; left: 0; right: 0; top: 0; z-index: 3; pointer-events: none; }
.ctabs { flex-wrap: nowrap; overflow-x: auto; padding: 8px 10px; scrollbar-width: none; pointer-events: auto; }
.ctabs button { box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.ctabs button { white-space: nowrap; flex: none; }
/* split module: "split below" under a row, and the separate-into-modules box */
.splitrow { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; padding-top: 6px; }
.splitrow .chip { font: inherit; font-size: 13px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid #dfe5e7; background: #f4f6f7; color: var(--ink); }
.splitrow.on { border-top: 2px dashed var(--accent, #b4532a); }
.splitrow.on .chip[aria-pressed="true"] { background: var(--accent, #b4532a); border-color: var(--accent, #b4532a); color: #fff; }
.splitrow .sel { flex: 1; min-width: 0; }
.sepbox { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px dashed var(--accent, #b4532a); margin-top: 10px; }
/* materials: PanelPro catalog */
.cat-filters { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.cat-seg { flex-wrap: wrap; gap: 6px; }
.cat-seg button { min-height: 32px; padding: 0 12px; font-size: 13px; }
.cat-seg button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.cat-head { display: flex; align-items: center; justify-content: space-between; margin: 10px 2px 8px; }
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .cat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.cat-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.cat-img { display: block; aspect-ratio: 4 / 3; }
.cat-txt { padding: 8px 10px 4px; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--muted); }
.cat-txt b { color: var(--ink); font-size: 14px; }
.cat-txt small { text-transform: uppercase; letter-spacing: .4px; font-size: 10.5px; }
.cat-card .btn, .cat-have { margin: 6px 10px 10px; }
.cat-have { font-size: 12.5px; color: #2e7d32; font-weight: 600; }
/* material boxes: type a name or Choose… (your list + the PanelPro catalog) */
.matpick { display: flex; gap: 8px; align-items: center; }
.matpick .text-in { flex: 1; min-width: 0; }
.mpick .mpick-sheet { max-height: 85vh; display: flex; flex-direction: column; padding: 10px; }
.mpick-h { display: flex; gap: 8px; align-items: center; padding-bottom: 8px; }
.mpick-h .text-in { flex: 1; }
.mpick-list { overflow-y: auto; flex: 1; }
.mpick-g { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 12px 8px 4px; }
.menu-sheet .mpick-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 8px; font-size: 15px; }
.mpick-row i { width: 44px; height: 44px; border-radius: 8px; flex: none; border: 1px solid var(--line); }
.mpick-row span { display: flex; flex-direction: column; min-width: 0; }
.mpick-row small { color: var(--muted); font-size: 12.5px; }
.mpick-row.on { background: #fff6dc; }
@media (min-width: 720px) { .mpick .mpick-sheet { max-width: 560px; height: 80vh; } }

/* material rows: texture tile (tap = picker) beside the name and the box */
.matrow { display: flex; gap: 12px; align-items: stretch; padding: 8px 0; }
.mattile { position: relative; flex: none; width: 66px; min-height: 66px; border-radius: 10px; border: 0; padding: 0; cursor: pointer;
  background-size: cover !important; background-position: center !important; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.15); }
.mattile::after { content: '▾'; position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink, #1d2a30);
  color: #fff; font-size: 10px; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--card, #fff); }
.mattile.linked::after { content: '🔗'; background: #fff; font-size: 10px; }
.matcol { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.matcol .flbl { margin: 0; }
.matlinked { text-align: left; border: 1px dashed var(--line); border-radius: 10px; background: transparent; padding: 8px 12px; cursor: pointer; color: inherit; font: inherit; }
.matlinked b { display: block; font-weight: 600; }
.matlinked small { display: block; color: var(--muted); }
.mpick-link i { position: relative; }
.mpick-link i em { position: absolute; right: -5px; bottom: -5px; font-style: normal; font-size: 11px; background: #fff; border-radius: 50%; width: 18px; height: 18px; line-height: 18px; text-align: center; box-shadow: 0 0 0 1px var(--line); }
.mpick-h #mpQ { flex: 1 1 auto; width: 100%; min-width: 0; height: 44px; padding: 0 12px; box-sizing: border-box; }
.mpick .mpick-h { display: flex; width: 100%; box-sizing: border-box; }
/* Materials screen: My list · PanelPro catalog · Public gallery as compact tabs (not three long buttons) */
.mat-tabs { display: flex; gap: 22px; margin: 2px 0 14px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.mat-tabs::-webkit-scrollbar { display: none; }
.mat-tabs button { flex: none; min-height: 0; height: 40px; padding: 0 2px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none;
  font: inherit; font-weight: 600; color: var(--muted); margin-bottom: -1px; white-space: nowrap; }
.mat-tabs button:hover { color: var(--ink); }
.mat-tabs button.on { background: none; color: var(--ink); border-color: transparent; border-bottom-color: var(--tape-deep); }
.cat-card { position: relative; }
.cat-card .cat-more { position: absolute; top: 6px; right: 6px; background: rgba(255,255,255,.9); border-radius: 50%; }
.mpick-h .xbtn { flex: none; width: 44px; }
.ownmats { display: flex; flex-direction: column; gap: 4px; }
.ownmat { display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 4px 8px; font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.ownmat i { width: 22px; height: 22px; border-radius: 4px; flex: none; background-size: cover !important; }
.ownmat span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ownmat em { font-style: normal; color: var(--muted); }
.mattools { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 0 6px; } .mattools .btn { flex: 0 0 auto; }

/* ===== editor, tidied (13 Nov 2026): one line of sliding tabs, small switches, tiles, compact cards ===== */
/* 3D view: small tools stacked on the right; the hint fades; sizes as chips (phone) */
.view-tools { flex-direction: column; top: 8px; bottom: auto; gap: 5px; }
.view-tools button { height: 34px; min-width: 34px; width: 34px; padding: 0; border-radius: 9px; font-size: 12px; }
.view-tools button svg { width: 18px; height: 18px; }
.view-hint { transition: opacity .6s; max-width: calc(100% - 64px); }
.view-hint.gone { opacity: 0; pointer-events: none; }
.dimchips { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 6px; z-index: 2; }
.dimchips button { height: 32px; padding: 0 9px; border: 0; border-radius: 8px; background: rgba(29,42,48,.9); color: #fff; font: inherit; font-size: 14px; font-weight: 650; }
.dimchips button small { font-size: 11px; font-weight: 600; opacity: .7; margin-right: 4px; }
.dimchips button.changed { background: var(--tape); color: var(--tape-ink); }
body:not(.desk) .measure { display: none; }
body.desk .dimchips { display: none; }
/* tabs: one line that slides sideways, underline on the chosen one */
.etabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 18px; margin: 4px -14px 8px; padding: 0 14px; border-bottom: 1px solid var(--line);
  background: var(--card); position: sticky; top: 0; z-index: 3; scroll-behavior: smooth;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 24px), transparent); }
.etabs button { flex: none; height: 42px; padding: 0 1px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; font-size: 14.5px; font-weight: 600; color: var(--muted); }
.etabs button[aria-selected="true"] { background: none; color: var(--ink); border-color: transparent; border-bottom-color: var(--tape-deep); }
/* small two/three-way switches (layout mode, column type) */
.seg.seg-sw { display: inline-flex; flex-wrap: nowrap; gap: 0; padding: 3px; border-radius: 10px; background: #e3e7ea; margin: 2px 0 8px; max-width: 100%; }
.seg.seg-sw button { min-height: 32px; height: auto; padding: 4px 12px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font-size: 13.5px; font-weight: 600; flex: 1 1 auto; }
.seg.seg-sw button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.seg.seg-sw.colkind { display: flex; }
/* even grids (hinge, inside) */
.seg.seg-grid { display: grid; gap: 6px; }
.seg.seg-grid.g4 { grid-template-columns: repeat(4, 1fr); }
.seg.seg-grid.g3 { grid-template-columns: repeat(3, 1fr); }
.row-details .seg.seg-grid button.chip { min-height: 34px; padding: 3px 4px; font-size: 12.5px; line-height: 1.15; border-radius: 8px; }
/* front type: tiles with a small drawing */
.seg.seg-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg.seg-tiles button.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 6px 4px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink-2); font-size: 12.5px; font-weight: 600; line-height: 1.15; text-align: center; }
.seg.seg-tiles button.tile[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.fi { display: block; width: 20px; height: 26px; border: 2px solid currentColor; border-radius: 3px; position: relative; opacity: .8; }
.fi-door_pair::after { content: ''; position: absolute; left: 50%; top: -2px; bottom: -2px; border-left: 2px solid currentColor; }
.fi-door::after { content: ''; position: absolute; right: 3px; top: 40%; height: 6px; border-left: 2px solid currentColor; }
.fi-drawer { height: 12px; margin: 7px 0; }
.fi-drawer::after { content: ''; position: absolute; left: 30%; right: 30%; top: 3px; border-top: 2px solid currentColor; }
.fi-false_front { border-style: dashed; }
.fi-none { border-color: transparent; background: currentColor; opacity: .18; }
.fi-same::after { content: '↑'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
/* column / row cards */
.colbox { padding: 0 0 8px; overflow: hidden; }
.col-head { padding: 8px 12px; border-bottom: 1px solid #eceef0; font-size: 14px; }
.colbox > .seg, .colbox > .frow, .colbox > .meta-line, .colbox > .splitrow, .colbox > .addrow { margin-left: 12px; margin-right: 12px; }
.colbox > .seg.seg-sw { margin-top: 8px; width: calc(100% - 24px); }
.frow-head { font-size: 13.5px; }
.opt-l { margin: 8px 0 5px; }
/* materials: one list of rows (tile · name · material · ›) */
.matrow { display: block; padding: 0; border-top: 1px solid #eceef0; }
.matrow:first-of-type, .mattools + .matrow { border-top: 0; }
.matbtn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 2px; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.matbtn .mattile { width: 46px; min-height: 0; height: 46px; border-radius: 9px; }
.matbtn .mattile::after { display: none; }
.matbtn .mattile.linked::after { display: block; content: '🔗'; right: -5px; bottom: -5px; width: 18px; height: 18px; line-height: 18px; background: #fff; }
.matbtn .matcol { gap: 2px; }
.matbtn .flbl { font-size: 14px; font-weight: 650; color: var(--ink); }
.matbtn .matval { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.matbtn .chev { color: #9aa3a8; font-size: 20px; }
.matrow .ownmats { margin: 0 0 8px 58px; }
.mattools { margin: 0 0 4px; }
/* the dock: step counter (new module) + the button */
.dock .steps { align-self: center; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.dock .steps[hidden] { display: none; }
body:not(.desk) .view3d .p3d-note { bottom: 46px !important; }
.colbox > .addrow, .addbtn.addcol { display: inline-flex; width: auto; min-height: 34px; height: 34px; padding: 0 14px; border-radius: 9px; background: var(--card); border: 1px dashed #b9c2c7; color: var(--ink-2); font-weight: 600; font-size: 13.5px; box-shadow: none; margin-top: 8px; }
.addbtn.addcol { margin: 2px 0 8px; }
body.desk .etabs { flex-wrap: nowrap; }
/* settings rows: one size for labels and values */
body:not(.desk) .frow-f { min-height: 44px; gap: 10px; }
body:not(.desk) .frow-f .flbl { font-size: 14px; }
body:not(.desk) .frow-f.stack .flbl { font-size: 13px; }
body:not(.desk) .box.fields select, body:not(.desk) .box.fields .sel { min-height: 40px; height: 40px; font-size: 14px; }
body:not(.desk) .box.fields h3.grp { font-size: 15px; }

/* module picker: accordion (one section open at a time) */
.picker .acc { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin: 0 0 8px; overflow: hidden; }
.picker .acc-h { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 14px; border: 0; background: none; font: inherit; text-align: left; color: var(--ink); cursor: pointer; }
.picker .acc-t { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; }
.picker .acc-n { font-size: 12.5px; font-weight: 650; color: var(--muted); background: #eef1f2; border-radius: 10px; padding: 2px 8px; white-space: nowrap; }
.picker .acc-i { font-style: normal; font-size: 22px; color: #9aa3a8; transition: transform .25s; }
.picker .acc.open .acc-i { transform: rotate(90deg); }
.picker .acc.open .acc-h { border-bottom: 1px solid #eceef0; }
.picker .acc.empty .acc-h { cursor: default; min-height: 46px; }
.picker .acc.empty .acc-t { color: var(--muted); font-weight: 600; }
.picker .acc.empty .acc-n { background: none; font-weight: 500; }
.picker .acc.empty .acc-i { display: none; }
.picker .acc-b { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.picker .acc.open .acc-b { grid-template-rows: 1fr; }
.picker .acc-in { overflow: hidden; min-height: 0; }
.picker .acc .cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; margin: 0; }
.picker .acc .mcard { margin: 0; padding: 6px 6px 8px; border-radius: 10px; min-width: 0; }
.picker .acc .mcard .pic { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; }
.picker .acc .mcard .nm { font-size: 13.5px; line-height: 1.2; }
.picker .acc .mcard .sz { font-size: 12px; }
@media (min-width: 640px) { .picker .acc .cards { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .picker .acc-b, .picker .acc-i { transition: none; } }

/* project list: modules · pieces · sheets · estimate */
.pstats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pst { display: inline-flex; flex-direction: column; min-width: 64px; padding: 5px 9px; border-radius: 9px; background: #f2f4f5; line-height: 1.15; }
.pst small { font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.pst b { font-size: 15px; font-weight: 700; color: var(--ink); }
.pst.money { background: #fff6d6; }
.pst.money b { color: #8a5a00; }
.site-card { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.site-card .dupbtn { flex: none; width: 38px; height: 38px; font-size: 17px; color: var(--muted); border-radius: 10px; }
body.desk .dk-table .pstats { margin: 0; flex-wrap: nowrap; }
body.desk .dk-table .pst { min-width: 70px; }
body.desk .dk-table .dupbtn { height: 32px; padding: 0 10px; font-size: 13px; white-space: nowrap; }
/* project list, tidier: one even row of four boxes on every card, no wrapping */
.pstats { display: grid; grid-template-columns: 1fr 1fr 1fr 1.6fr; gap: 6px; flex-wrap: nowrap; margin-top: 10px; }
.pst { min-width: 0; padding: 6px 8px; border-radius: 8px; }
.pst small { font-size: 9.5px; letter-spacing: .4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pst b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.site-card .t1 { font-size: 16.5px; font-weight: 700; }
.site-card .t2 { font-size: 13px; }
.site-card { padding: 12px 10px 12px 14px; }
.site-card .rowbtns { align-items: center; }
body.desk .dk-table .pstats { display: grid; grid-template-columns: 64px 64px 64px 120px; }
.pstats { grid-template-columns: auto auto auto minmax(0, 1fr); }
.pst { padding: 6px 9px; }
.pst small { letter-spacing: .2px; }
body.desk .dk-table .pstats { grid-template-columns: auto auto auto 120px; }
body.desk .dk-table .td-name b { display: block; font-size: 14.5px; }
body.desk .dk-table .td-name small.cli { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; }
.site-card { flex-wrap: wrap; }
.site-card > .pstats { flex: 0 0 100%; }
body.desk .dk-table th.th-plain { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); text-align: left; }

/* dashboard */
.dash-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.dash-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dash-card h3 { margin: 0; font-size: 15.5px; display: flex; align-items: baseline; gap: 8px; }
.dash-card h3 small { font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.dash-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; flex: 1; }
.dash-card li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dash-card li span { min-width: 0; display: flex; flex-direction: column; }
.dash-card li b { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-card li small { font-size: 12px; color: var(--muted); }
.dash-card .dsw { flex: none; width: 38px; height: 38px; border-radius: 8px; background-size: cover !important; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.dash-card .dpic { flex: none; width: 46px; height: 38px; object-fit: contain; background: #fff; border-radius: 6px; }
.dhw { flex: none; width: 38px; height: 38px; border-radius: 8px; background: #f2f4f5; color: var(--ink-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.dhw svg { width: 22px; height: 22px; }
.dhw img { width: 100%; height: 100%; object-fit: cover; }
.dhw.big { width: 84px; height: 84px; border: 1px dashed #b9c2c7; border-radius: 14px; cursor: pointer; }
.dhw.big svg { width: 36px; height: 36px; }
.dash-card .btn { align-self: flex-start; margin-top: 4px; }
.dash-empty, .dash-wait { margin: 0; font-size: 13px; color: var(--muted); }
.dash-h { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 2px 10px; }
.dash-h h2 { margin: 0; font-size: 17px; }
.dash-h a { font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink-2); }
.dash-recent { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dash-recent .site-card { margin: 0; }
@media (max-width: 860px) { .dash-cards { grid-template-columns: 1fr; } .dash-recent { grid-template-columns: 1fr; } }
.hw-row .hw-price { font-size: 14px; white-space: nowrap; }
.hw-row .hw-price small { color: var(--muted); font-weight: 500; }
.hw-photo { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.hw-photo small { color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* Accessories page: one heading per kind */
.hw-grp { display: flex; align-items: center; gap: 8px; margin: 18px 2px 8px; font-size: 15px; font-weight: 700; color: var(--ink); }
.hw-grp svg { width: 20px; height: 20px; color: var(--ink-2); }
.hw-grp small { font-size: 12px; font-weight: 600; color: var(--muted); background: #e9edef; border-radius: 10px; padding: 1px 8px; }
.hw-row .dhw { width: 44px; height: 44px; border-radius: 10px; }
.hw-row .dhw svg { width: 26px; height: 26px; }
.hw-row .t1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Materials: My list grouped by brand / board type */
.mat-groupbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 2px 6px; }
.mat-groupbar .meta-line { margin: 0; }
.mat-grp { display: flex; align-items: center; gap: 8px; margin: 18px 2px 8px; font-size: 15px; font-weight: 700; color: var(--ink); }
.mat-grp small { font-size: 12px; font-weight: 600; color: var(--muted); background: #e9edef; border-radius: 10px; padding: 1px 8px; }
/* very wide monitors: lists and reports stop at 1440 px, the editor and composition at 2000 px, centred */
body.desk .page.page-wide { max-width: 1440px; margin: 0 auto; }
body.desk .page:not(.page-wide) { margin: 0 auto; }
body.desk .edit-layout, body.desk .compose { max-width: 2000px; margin: 0 auto; width: 100%; }
@media (min-width: 2001px) { body.desk .edit-layout, body.desk .compose { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }

/* 2D view: pick the side, centred at the bottom of the preview */
.side-bar { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 3; display: flex; gap: 2px; padding: 3px;
  background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.side-bar[hidden] { display: none; }
.side-bar button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font: 600 13px/1 inherit; color: var(--ink-2); cursor: pointer; }
.side-bar button[aria-pressed="true"] { background: var(--ink); color: #fff; }
/* phone, 2D: the drawing has its own dimension lines, so no size chips; the side bar sits at the very bottom, under the drawing */
@media (max-width: 860px) { .view3d.is2d .dimchips { display: none; } .view3d.is2d .side-bar { bottom: 8px; } .side-bar button { padding: 6px 10px; } }

/* project list: duplicate / delete as icons, their name shown on hover */
.rowbtns { display: inline-flex; gap: 6px; flex: none; }
.rowbtns .icon-btn { position: relative; width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 9px; background: var(--panel, #fff); color: var(--muted); }
.rowbtns .icon-btn svg.mi { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rowbtns .icon-btn:hover { color: var(--ink); border-color: var(--ink); background: var(--soft, #f0ebe2); }
.rowbtns .delbtn:hover { color: #b3261e; border-color: #b3261e; background: #fdecea; }
.rowbtns .icon-btn { margin: 0 !important; width: 36px !important; height: 36px !important; }
/* the name pops up above the button: a small bubble with a pointer */
.rowbtns .icon-btn[data-tip]::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 9px); left: 50%; padding: 5px 9px; border-radius: 7px;
  background: #24221f; color: #fff; font: 600 12px/1.2 -apple-system, "Segoe UI", Inter, Roboto, sans-serif; white-space: nowrap; pointer-events: none;
  opacity: 0; transform: translate(-50%, 4px) scale(.92); transform-origin: 50% 100%; transition: opacity .12s, transform .14s; z-index: 6; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.rowbtns .icon-btn[data-tip]::before { content: ''; position: absolute; bottom: calc(100% + 3px); left: 50%; border: 6px solid transparent; border-bottom: 0; border-top-color: #24221f;
  transform: translate(-50%, 4px); opacity: 0; transition: opacity .12s, transform .14s; pointer-events: none; z-index: 6; }
.rowbtns .icon-btn[data-tip]:hover::after, .rowbtns .icon-btn[data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0) scale(1); }
.rowbtns .icon-btn[data-tip]:hover::before, .rowbtns .icon-btn[data-tip]:focus-visible::before { opacity: 1; transform: translate(-50%, 0); }
.rowbtns .delbtn[data-tip]::after { background: #b3261e; }
.rowbtns .delbtn[data-tip]::before { border-top-color: #b3261e; }
body.desk .dk-table .rowbtns .icon-btn { height: 34px !important; width: 34px !important; padding: 0; }

/* AI renders (ui/render.js): a panel over the screen; while placing furniture on a photo, a bar at the bottom */
.rd-sheet { position: fixed; inset: 0; z-index: 60; background: rgba(20, 19, 17, .55); display: flex; align-items: stretch; justify-content: center; padding: 18px; }
.rd-sheet .rd-box { background: var(--bg, #f6f4ef); border-radius: 14px; padding: 14px; width: min(1400px, 100%); max-height: 100%; overflow: auto; box-sizing: border-box; }
.rd-sheet.placing { inset: auto 0 0 0; background: transparent; padding: 10px; pointer-events: none; }
.rd-sheet.placing .rd-box { pointer-events: auto; box-shadow: 0 6px 30px rgba(0, 0, 0, .25); }
@media (max-width: 760px) { .rd-sheet { padding: 0; } .rd-sheet .rd-box { border-radius: 0; } }

/* side bar: version + Check for updates under the user */
.dk-upd { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 10px 2px; }
.dk-upd .dk-ver { padding: 0; }
.dk-updbtn { font: inherit; font-size: 11px; font-weight: 600; color: #b9c6c9; background: transparent; border: 1px solid rgba(255,255,255,.18); border-radius: 6px; padding: 3px 8px; cursor: pointer; white-space: nowrap; }
.dk-updbtn:hover { color: #fff; border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.06); }
.dk-updbtn:disabled { opacity: .6; cursor: default; }

/* the app's own "are you sure?" box (instead of the browser's) */
.ask { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(20, 24, 26, 0); backdrop-filter: blur(0); transition: background .16s, backdrop-filter .16s; }
.ask.on { background: rgba(20, 24, 26, .45); backdrop-filter: blur(2px); }
.ask-box { width: min(420px, 100%); background: #fff; border-radius: 16px; padding: 22px 22px 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
  text-align: center; transform: translateY(10px) scale(.97); opacity: 0; transition: transform .16s, opacity .16s; }
.ask.on .ask-box { transform: none; opacity: 1; }
.ask-ico { width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: #fdecea; }
.ask-ico .mi { width: 24px; height: 24px; fill: none; stroke: #b3261e; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ask-box h2 { margin: 0 0 6px; font-size: 17px; line-height: 1.3; color: var(--ink); }
.ask-box p { margin: 0 0 4px; color: var(--muted); font-size: 14px; font-weight: 600; word-break: break-word; }
.ask-btns { display: flex; gap: 10px; margin-top: 18px; }
.ask-btns .btn { flex: 1; justify-content: center; }
.ask-btns .btn.danger { background: #b3261e; border-color: #b3261e; color: #fff; }
.ask-btns .btn.danger:hover { background: #9a1f18; }

/* scroll areas keep room for their scroll bar, so the panel keeps its width when it grows past the screen */
.edit-side .page, .dk-body, .dk-side, .ws-list, .rp-box, .rd-sheet .rd-box { scrollbar-gutter: stable; }

/* editor: the module's name over the sizes; the width keypad's outside / between-the-sides choice */
.ed-name { display: block; width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; font-weight: 700; color: var(--ink);
  border: 1px solid transparent; border-radius: 10px; background: transparent; padding: 6px 10px; margin: 0 0 8px; }
.ed-name:hover { border-color: var(--line); background: #fff; }
.ed-name:focus { outline: none; border-color: var(--ink); background: #fff; }
.pad-modes, .dpad-modes { display: flex; margin: 6px 0 8px; }
.pad-modes button, .dpad-modes button { flex: 1; }

/* a size field: its value and quick picks on one line under the title, on the left */
.vrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.vrow .picks { margin: 0; display: inline-flex; flex-wrap: wrap; gap: 6px; }
.vrow .valbtn { margin: 0; }

/* the top bar lines up with the page under it (title over the content's left edge, buttons over its right edge) */
body.desk .top:has(~ .dk-body > .page.page-wide) { padding-left: max(16px, calc((100% - 1440px) / 2 + 16px)); padding-right: max(16px, calc((100% - 1440px) / 2 + 28px)); }
body.desk .top:has(~ .dk-body > .page:not(.page-wide)) { padding-left: max(16px, calc((100% - 760px) / 2 + 16px)); padding-right: max(16px, calc((100% - 760px) / 2 + 28px)); }
body.desk .top:has(~ .dk-body > .edit-layout), body.desk .top:has(~ .dk-body .compose) { padding-left: max(16px, calc((100% - 2000px) / 2 + 16px)); padding-right: max(16px, calc((100% - 2000px) / 2 + 16px)); }

/* undo / redo buttons over the views: dimmed when there is nothing to step to */
.view-tools .vt:disabled { opacity: .35; cursor: default; }

/* the icons sit in the middle of their squares */
.view-tools .vt { display: inline-flex !important; align-items: center; justify-content: center; padding: 0 !important; box-sizing: border-box; flex: none; line-height: 1; }
.view-tools .vt svg { display: block; flex: none; margin: 0; }
.view-tools .vt .vt-txt { display: block; width: 100%; text-align: center; }

/* the name of a view button slides out to the left from behind it (no browser bubble) */
@media (hover: hover) and (pointer: fine) {
  .view-tools .vt { position: relative; }
  /* plain dark text, no box: it slides out of the button and settles 10 px to its left; the part still
     "inside" the button is clipped, going out and coming back, so it never shows past the button */
  /* the name: its box sits 10 px left of the button and clips the text, which slides in from the box's
     right edge and back out to it (so it never shows past the button) */
  .view-tools .vt .vt-tip { position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); overflow: hidden; pointer-events: none;
    padding: 4px 0 4px 6px; visibility: hidden; transition: visibility 0s linear .26s; }
  .view-tools .vt .vt-tip i { display: block; font: 700 12.5px/1 -apple-system, "Segoe UI", Inter, Roboto, sans-serif; font-style: normal; color: var(--ink); white-space: nowrap;
    transform: translateX(calc(100% + 8px)); transition: transform .26s cubic-bezier(.2,.8,.2,1); text-shadow: 0 0 4px #fff, 0 0 8px #fff; }
  .view-tools .vt:hover .vt-tip, .view-tools .vt:focus-visible .vt-tip { visibility: visible; transition-delay: 0s; }
  .view-tools .vt:hover .vt-tip i, .view-tools .vt:focus-visible .vt-tip i { transform: none; }
}

/* render gallery */
.gal-r { margin: 18px 0 8px; }
.gal-r h3 { font-size: 15px; margin: 0 0 8px; }
.gal-r h3 small { font-weight: 500; color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.gal-pic { padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.gal-pic:hover { border-color: var(--ink); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.gal-pic .th { display: block; aspect-ratio: 4 / 3; background: #e6e2da center / cover no-repeat; }
.gal-pic .th.bad { background: #f3e1df; }
.gal-pic small { display: block; padding: 6px 9px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gal-view { position: fixed; inset: 0; z-index: 70; background: rgba(20, 19, 17, .7); display: flex; align-items: center; justify-content: center; padding: 18px; }
.gal-in { position: relative; background: #1e1d1b; border-radius: 14px; padding: 12px; max-width: min(1500px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 10px; box-sizing: border-box; }
.gal-big { display: flex; align-items: center; justify-content: center; min-height: 240px; color: #cfc8bb; }
.gal-big img { max-width: 100%; max-height: calc(100vh - 140px); display: block; border-radius: 8px; }
.gal-bar { display: flex; align-items: center; gap: 8px; color: #fff; flex-wrap: wrap; }
.gal-bar .grow { flex: 1; }
.gal-x { position: absolute; top: -10px; right: -10px; }
.gal-bar .btn { width: auto; flex: none; margin: 0; }
.gal-bar .btn:not(.primary) { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); }
.gal-bar .btn:not(.primary):hover { background: rgba(255,255,255,.12); }

/* dashboard welcome banner */
.hero { position: relative; overflow: hidden; display: flex; align-items: center; gap: 24px; margin: 0 0 18px; padding: 28px 30px; border-radius: 20px;
  color: #fff; background: radial-gradient(circle at 88% 20%, rgba(242, 201, 76, .35), transparent 42%), linear-gradient(120deg, #1d2a30 0%, #23363d 55%, #2f4a4f 100%);
  box-shadow: 0 14px 34px rgba(29, 42, 48, .22); }
.hero::before { content: ''; position: absolute; inset: 0; opacity: .07; pointer-events: none;
  background: repeating-linear-gradient(100deg, #fff 0 1px, transparent 1px 9px), repeating-linear-gradient(97deg, transparent 0 22px, #fff 22px 23px, transparent 23px 47px); }
.hero-txt { position: relative; flex: 1; min-width: 0; }
.hero-k { margin: 0 0 4px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #f2c94c; }
.hero h2 { margin: 0; font-size: clamp(26px, 3.4vw, 38px); line-height: 1.1; letter-spacing: -.02em; color: #fff; }
.hero h2 span { background: linear-gradient(90deg, #f2c94c, #ffe7a0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-line { margin: 8px 0 0; font-size: 15.5px; color: rgba(255,255,255,.82); }
.hero-stats { margin: 6px 0 0; font-size: 13px; color: rgba(255,255,255,.62); }
.hero-stats b { color: #fff; }
.hero-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hero .btn.hero-go { width: auto; background: #f2c94c; color: #1d2a30; border: 0; font-weight: 800; font-size: 15px; padding: 12px 20px; border-radius: 12px;
  box-shadow: 0 8px 20px rgba(242, 201, 76, .35); transition: transform .15s, box-shadow .15s; }
.hero .btn.hero-go:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(242, 201, 76, .45); }
.hero .btn.hero-go span { display: inline-block; transition: transform .15s; }
.hero .btn.hero-go:hover span { transform: translateX(4px); }
.hero .btn.hero-alt { width: auto; background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.3); font-weight: 650; padding: 12px 16px; border-radius: 12px; }
.hero .btn.hero-alt:hover { background: rgba(255,255,255,.16); }
.hero-art { position: relative; flex: none; width: 250px; height: auto; color: rgba(255,255,255,.85); order: 2; animation: heroin .7s cubic-bezier(.2,.8,.2,1); }
.hero-art g:first-child rect:nth-child(2) { transform-origin: 24px 44px; animation: herodoor 4s ease-in-out 1s infinite; }
@keyframes herodoor { 0%, 60%, 100% { transform: scaleX(1); } 70%, 88% { transform: scaleX(.25); } }
@keyframes heroin { from { opacity: 0; transform: translateY(14px); } }
@media (max-width: 760px) { .hero { padding: 22px 20px; } .hero-art { display: none; } }
/* the account avatar instead of ⋯ */
.avatar-btn { flex: none; width: 38px; height: 38px; padding: 0; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--line), 0 2px 8px rgba(0,0,0,.12);
  background: #1d2a30; color: #fff; cursor: pointer; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; transition: box-shadow .15s, transform .15s; }
.avatar-btn:hover { box-shadow: 0 0 0 2px #f2c94c, 0 4px 12px rgba(0,0,0,.18); transform: scale(1.04); }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-btn i { font-style: normal; font-weight: 800; font-size: 16px; }
.avatar-btn svg { width: 22px; height: 22px; }
/* tab strip with previous / next: the strip scrolls between the two arrows */
.etabs-w { display: flex; align-items: stretch; gap: 2px; margin: 4px -14px 8px; border-bottom: 1px solid var(--line); }
.etabs-w .etabs { flex: 1; min-width: 0; margin: 0; border-bottom: 0; scroll-behavior: smooth; padding: 0 6px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); }
.et-nav { flex: none; width: 30px; border: 0; background: none; color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; border-radius: 8px; padding: 0 0 3px; }
.et-nav:hover:not(:disabled) { background: var(--soft, rgba(0,0,0,.05)); }
.et-nav:disabled { color: var(--line); cursor: default; }
body.desk .etabs-w { margin: 4px 0 8px; }
.etabs-w { position: sticky; top: 0; z-index: 3; background: var(--card); }
.etabs-w .etabs { position: static; background: none; }

/* New site / Rename site dialog */
.site-box { position: relative; width: min(460px, 100%); text-align: left; }
.site-box h2 { margin: 0 0 10px; }
.site-box .field { margin: 10px 0 0; }
.site-box .ask-btns { margin-top: 18px; }
.site-ico { width: 40px; height: 40px; border-radius: 12px; background: #fff4cc; color: #8a6400; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.site-ico { font-size: 26px; font-weight: 800; line-height: 1; }
.site-x { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.site-x:hover { background: #f0f1f2; color: var(--ink); }
/* project cards on a phone: the estimate gets its own full-width row so the amount is never cut */
@media (max-width: 560px) {
  .site-card .pstats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-card .pst.money { grid-column: 1 / -1; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 10px; }
  .site-card .pst.money b { overflow: visible; text-overflow: clip; font-size: 16px; }
}

/* project tools as icon tiles: one line each, never wrapping */
.tool-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.tool-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 0; padding: 12px 6px 10px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); font: inherit; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.tool-tile:hover { border-color: var(--ink); box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.tool-tile:active { transform: scale(.97); }
.tool-tile .mi { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tool-tile span { max-width: 100%; font-size: 12.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 560px) {
  .tool-tiles { grid-template-columns: 1fr 1fr; }
  .tool-tile { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 12px 14px; }
  .tool-tile span { font-size: 14px; }
}
/* render gallery: share button on each picture and in the big view */
.gal-pic { position: relative; }
.gal-share { position: absolute; top: 8px; right: 8px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92);
  color: #24221f; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.18); cursor: pointer; }
.gal-share .mi { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.gal-bar .btn .mi { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; margin-right: 5px; }

/* Share 3D view dialog */
.share-box { position: relative; width: min(500px, 100%); text-align: left; }
.share-box h2 { margin: 0; }
.sh-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sh-sub { margin: 2px 0 8px; color: var(--muted); font-weight: 600; }
.sh-note { margin: 0 0 14px; font-size: 13.5px; color: var(--ink-2, #444); }
.sh-toggle { display: flex; align-items: center; gap: 10px; font-weight: 650; margin-bottom: 10px; cursor: pointer; }
.sh-toggle input { width: 20px; height: 20px; accent-color: #1d2a30; }
.sh-link { display: flex; gap: 8px; }
.sh-link input { flex: 1; min-width: 0; font-size: 13px; }
.sh-link .btn { width: auto; margin: 0; flex: none; }
.sh-link.off input { text-decoration: line-through; opacity: .55; }
.sh-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.sh-acts .btn { width: auto; margin: 0; flex: 1 1 auto; text-align: center; text-decoration: none; }
.sh-sec { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.sh-sec summary { cursor: pointer; font-weight: 700; }
.sh-sec summary small { color: var(--muted); font-weight: 600; margin-left: 4px; }
.sh-vers { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; max-height: 200px; overflow: auto; }
.sh-vers a { display: flex; gap: 10px; align-items: baseline; padding: 6px 8px; border-radius: 8px; color: inherit; text-decoration: none; }
.sh-vers a:hover { background: #f2f4f5; }
.sh-vers span { color: var(--muted); font-size: 13px; }
.sh-vers em { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 700; color: #8a6400; }
.sh-brand { margin-top: 8px; }
.sh-logo { display: flex; align-items: center; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.sh-logo img { max-height: 44px; max-width: 160px; border: 1px solid var(--line); border-radius: 6px; padding: 3px; background: #fff; }
.sh-logo span { color: var(--muted); font-size: 13px; }
.sh-logo .btn, .sh-brand > .btn { width: auto; margin: 0; }
/* phone: the view buttons wrap into a second (third…) column instead of running out of the preview */
body:not(.desk) .view-tools { flex-flow: column wrap-reverse; align-content: flex-start; max-height: calc(100% - 16px); }
body:not(.desk) .view-tools .vt .vt-tip { display: none; }
body:not(.desk) .view-hint { max-width: calc(100% - 110px); }

.vt-tip { display: none; }
@media (hover: hover) { .view-tools .vt .vt-tip { display: block; } }
body:not(.desk) .view-tools .vt .vt-tip { display: none; }
.vt .vt-t { font: inherit; }
