/* LiDARO: frosted glass over birch and lake, spruce for action, maple red used sparingly (the lidaro bob, DRAFT, delete).
   Numbers are tabular so columns of dimensions line up like a drawing's schedule. */
:root {
  --bg: #f1efe9; --paper: #faf8f3; --card: rgba(255,255,255,.74); --ink: #15201e; --muted: #5b6865; --line: rgba(21,32,30,.11); --line-2: rgba(21,32,30,.2);
  --spruce: #1d5a4b; --spruce-2: #2b7a66; --lake: #2f6f8f; --maple: #d9382b; --amber: #b5761a;
  --navy: var(--spruce); --blue: var(--lake); --violet: var(--spruce-2);
  --pale: #e6efec; --good: #2a7d5b; --warn: #a96b12; --bad: #c4372b; --canvas: #131b1a; --radius: 20px;
  --grad: linear-gradient(135deg, #2f8570, #1b5144);
  --glass: rgba(255,255,255,.64); --glass-strong: rgba(255,255,255,.82); --glass-edge: rgba(255,255,255,.7);
  --glass-shadow: 0 1px 0 rgba(255,255,255,.75) inset, 0 8px 28px rgba(21,48,42,.11), 0 1px 2px rgba(21,48,42,.08);
  --dglass: rgba(19,27,26,.58);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: var(--font);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; color: var(--ink); font: 15px/1.45 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; letter-spacing: -.003em;
  background: radial-gradient(900px 520px at 8% -8%, #dbe9ee 0, transparent 60%), radial-gradient(800px 560px at 100% 105%, #d8e8e0 0, transparent 58%), var(--bg); background-attachment: fixed; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--lake); }
.hidden { display: none !important; }
svg { width: 22px; height: 22px; flex: none; }
h2, h3, h4 { margin: 0 0 8px; letter-spacing: -.015em; font-weight: 650; }

#app { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
#screen { position: relative; flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.page { flex: 1; min-height: 0; position: relative; }
.scroll { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px 110px; }
.wrap { max-width: 1040px; margin: 0 auto; }
.narrow { max-width: 620px; margin: 0 auto; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.eyebrow { font-size: 11px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 14px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.gap { height: 12px; }

/* ---------- glass surfaces */
.glass, .card, .sheet, .menu, .modal, .btabs, .btool, .vbar, .hintbar, .tools, .pill, .circ, .cbar, .xfoot, .search, .pcard, .banner, .phase, .zoomc button, .chip, .prevbar, .phead, .lib-head {
  -webkit-backdrop-filter: blur(22px) saturate(1.7); backdrop-filter: blur(22px) saturate(1.7);
}
.card, .pcard, .phase, .banner { background: var(--card); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow); }
.card { border-radius: var(--radius); }
.card.pad { padding: 16px; }

/* ---------- buttons, inputs */
.btn { border: 1px solid transparent; background: var(--spruce); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; justify-content: center; box-shadow: 0 1px 0 rgba(255,255,255,.22) inset, 0 4px 12px rgba(29,90,75,.22); transition: transform .08s, filter .15s; }
.btn:active { transform: scale(.97); }
.btn.grad { background: var(--grad); }
.btn.ghost { background: var(--glass-strong); color: var(--spruce); border-color: var(--line-2); box-shadow: none; }
.btn.danger { background: var(--bad); box-shadow: 0 4px 12px rgba(196,55,43,.25); }
.btn.sm { padding: 6px 13px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.btn svg { width: 18px; height: 18px; }
.pill { border: 1px solid var(--line-2); background: var(--glass-strong); border-radius: 999px; padding: 8px 15px; font-size: 13.5px; font-weight: 550; display: inline-flex; align-items: center; gap: 7px; box-shadow: var(--glass-shadow); }
.pill.grad { background: var(--grad); color: #fff; border-color: transparent; font-weight: 600; }
.pill.dark { background: rgba(21,32,30,.86); color: #fff; border-color: transparent; }
.pill svg { width: 18px; height: 18px; }
.circ { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--glass-strong); display: grid; place-items: center; color: var(--ink); padding: 0; position: relative; box-shadow: var(--glass-shadow); }
.circ.on { background: var(--spruce); border-color: var(--spruce); color: #fff; }
.circ .dot { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; border-radius: 99px; background: var(--maple); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 3px; font-weight: 700; }
.circ-l { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.55); }
.circ-l.on { color: #fff; }
.icon-btn { background: none; border: none; padding: 8px; border-radius: 999px; color: var(--ink); display: grid; place-items: center; position: relative; }
.icon-btn:active { background: rgba(21,32,30,.08); }
.input, .field input, .field select, .field textarea, select.sel { padding: 11px 14px; border: 1px solid var(--line-2); border-radius: 14px; background: rgba(255,255,255,.8); width: 100%; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus, .lf input:focus { outline: 3px solid rgba(47,111,143,.22); border-color: var(--lake); }
.field { display: flex; flex-direction: column; gap: 5px; margin: 10px 0; }
.field > label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.field.inline { flex-direction: row; gap: 8px; align-items: center; flex-wrap: wrap; }
.field.inline input, .field.inline select { width: auto; flex: 1; min-width: 90px; }
select.sel { width: auto; }
.seg { display: inline-flex; background: rgba(21,32,30,.075); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; padding: 7px 15px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(21,32,30,.18); }
.seg.small button { padding: 4px 10px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 2px; font-size: 14px; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: none; }
input[type=checkbox].tg, .tg { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 99px; background: rgba(21,32,30,.2); position: relative; transition: .18s; flex: none; cursor: pointer; margin: 0; }
.tg::after { content: ""; position: absolute; left: 2px; top: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); transition: .18s; }
.tg:checked { background: var(--spruce-2); }
.tg:checked::after { left: 20px; }
input[type=range] { accent-color: var(--spruce-2); }

/* ---------- badges: status is always spelled out (measured, assumed, suggested, draft) */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 650; background: rgba(21,32,30,.07); color: var(--muted); white-space: nowrap; letter-spacing: .01em; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.good { background: rgba(42,125,91,.13); color: var(--good); } .badge.fair, .badge.warn { background: rgba(181,118,26,.15); color: var(--warn); } .badge.poor, .badge.bad { background: rgba(217,56,43,.13); color: var(--bad); }
.badge.dev, .badge.info { background: rgba(29,90,75,.09); color: var(--spruce); } .badge.vio { background: rgba(47,111,143,.14); color: var(--lake); }
.draftstamp { display: inline-block; border: 1.5px solid var(--maple); color: var(--maple); font-weight: 800; letter-spacing: .14em; font-size: 10.5px; padding: 2px 8px; border-radius: 4px; transform: rotate(-2deg); }

/* ---------- tables (title-block style: hairlines, small-caps headers) */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.tbl th { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; font-weight: 650; background: rgba(21,32,30,.03); }
.tbl .n { text-align: right; }
.tbl tr.tot td { font-weight: 700; background: rgba(21,32,30,.03); }
.note { background: rgba(47,111,143,.09); border: 1px solid rgba(47,111,143,.18); border-radius: 14px; padding: 10px 13px; font-size: 13.5px; margin: 10px 0; }
.note.warn { background: rgba(181,118,26,.11); border-color: rgba(181,118,26,.28); } .note.bad { background: rgba(217,56,43,.1); border-color: rgba(217,56,43,.28); } .note.good { background: rgba(42,125,91,.1); border-color: rgba(42,125,91,.25); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { padding: 12px 14px; } .kpi .v { font-size: 22px; font-weight: 650; letter-spacing: -.02em; } .kpi .k { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 650; margin-top: 2px; }
.sec-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 8px; }
.sec-title h3 { font-size: 12px; margin: 0; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 650; }
.metric { padding: 12px 14px; border-bottom: 1px solid var(--line); } .metric .top { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 14px; }
.mbar { height: 5px; background: rgba(21,32,30,.08); border-radius: 99px; margin: 6px 0; overflow: hidden; } .mbar i { display: block; height: 100%; }
.metric .help { font-size: 12.5px; color: var(--muted); }
.ring { width: 96px; height: 96px; } .score { display: flex; gap: 16px; align-items: center; padding: 16px; }
.err-good { color: var(--good); font-weight: 700; } .err-fair { color: var(--warn); font-weight: 700; } .err-bad { color: var(--bad); font-weight: 700; }

/* ---------- title block + workflow strip (details page) */
.titleblock { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; background: rgba(255,255,255,.5); font-size: 13px; }
.titleblock > div { padding: 9px 13px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); min-width: 0; }
.titleblock > div:nth-child(2n) { border-right: none; }
.titleblock > div:nth-last-child(-n+2) { border-bottom: none; }
.titleblock small { display: block; font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 650; margin-bottom: 1px; }
.titleblock b { font-weight: 600; overflow-wrap: anywhere; }
.flow { display: flex; align-items: flex-start; margin: 14px 0 4px; }
.flow .s { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); position: relative; text-align: center; background: none; border: none; padding: 0; }
.flow .s::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--line-2); z-index: 0; }
.flow .s:first-child::before { display: none; }
.flow .s i { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--line-2); display: grid; place-items: center; z-index: 1; font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); }
.flow .s i svg { width: 15px; height: 15px; }
.flow .s.done { color: var(--ink); } .flow .s.done::before { background: var(--spruce-2); } .flow .s.done i { background: var(--spruce-2); border-color: var(--spruce-2); color: #fff; }
.flow .s.now i { border-color: var(--spruce-2); color: var(--spruce-2); box-shadow: 0 0 0 4px rgba(43,122,102,.16); } .flow .s.now { color: var(--ink); }

/* ---------- auth */
.auth { height: 100%; display: grid; place-items: center; padding: 22px 16px; overflow-y: auto;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='640' viewBox='0 0 640 640' fill='none' stroke='%231d5a4b' stroke-opacity='.10' stroke-width='1.3'%3E%3Cpath d='M-20 80C90 40 160 120 280 84S470 30 560 80 660 70 660 70'/%3E%3Cpath d='M-20 130C100 92 170 168 290 132S470 82 560 128 660 118 660 118'/%3E%3Cpath d='M-20 180C110 142 180 214 300 180S470 134 560 176 660 166 660 166'/%3E%3Cpath d='M-20 230C120 196 190 262 310 230S480 188 570 226 660 216 660 216'/%3E%3Cpath d='M-20 420C70 380 150 450 270 418S450 366 560 414 660 404 660 404'/%3E%3Cpath d='M-20 470C80 432 160 498 280 466S460 418 570 462 660 452 660 452'/%3E%3Cpath d='M-20 520C90 484 170 544 290 514S470 470 580 510 660 500 660 500'/%3E%3Cpath d='M-20 570C100 536 180 590 300 562S480 522 590 558 660 548 660 548'/%3E%3C/svg%3E") center/640px repeat; }
.auth-card { width: 100%; max-width: 420px; padding: 28px 24px 22px; background: var(--glass-strong); border-radius: 30px; }
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; font-weight: 700; font-size: 22px; letter-spacing: -.02em; color: var(--ink); }
.auth-logo small { display: block; font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-top: -1px; }
.logo { width: 42px; height: 42px; flex: none; display: block; }
.logo svg { width: 42px; height: 42px; }
.auth h2 { font-size: 24px; }
.auth .sub { color: var(--muted); margin: 0 0 12px; }
.err { color: var(--bad); font-size: 13.5px; min-height: 20px; margin-top: 6px; }
.feat { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 4px; font-size: 12.5px; color: var(--muted); }
.feat span { display: flex; gap: 6px; align-items: center; } .feat svg { width: 16px; height: 16px; color: var(--spruce-2); }

/* ---------- library */
.lib-head { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + var(--safe-t)) 14px 8px; flex: none; position: relative; }
.who { display: flex; align-items: center; gap: 10px; border: none; background: none; font-size: 22px; font-weight: 700; letter-spacing: -.02em; padding: 4px; }
.who svg { width: 18px; height: 18px; color: var(--muted); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; flex: none; box-shadow: 0 1px 0 rgba(255,255,255,.3) inset; }
.banner { border-radius: 24px; padding: 16px 18px; margin: 6px 0 14px; }
.banner b { font-size: 17px; letter-spacing: -.015em; } .banner p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.bar { height: 8px; background: rgba(21,32,30,.1); border-radius: 99px; overflow: hidden; margin-top: 10px; } .bar i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.search-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; border: 1px solid var(--glass-edge); border-radius: 999px; padding: 8px 15px; background: rgba(255,255,255,.7); box-shadow: var(--glass-shadow); }
.search svg { color: var(--muted); width: 18px; height: 18px; }
.search input { border: none; outline: none; flex: 1; background: none; min-width: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chip { border: 1px solid var(--glass-edge); background: rgba(255,255,255,.66); border-radius: 99px; padding: 6px 14px; font-size: 13px; font-weight: 550; white-space: nowrap; box-shadow: var(--glass-shadow); }
.chip.on { background: var(--spruce); color: #fff; border-color: var(--spruce); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; }
.pgrid.list { grid-template-columns: 1fr; }
.pcard { border-radius: 24px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; position: relative; transition: transform .12s; }
.pcard:active { transform: scale(.985); }
.pgrid.list .pcard { flex-direction: row; align-items: center; }
.pthumb { aspect-ratio: 4/3; background: #e9e7df center/cover no-repeat; position: relative; display: grid; place-items: center; color: var(--muted); margin: 6px; border-radius: 18px; }
.pgrid.list .pthumb { width: 120px; flex: none; }
.pthumb .tag { position: absolute; left: 8px; top: 8px; }
.pthumb .ver { position: absolute; right: 8px; bottom: 8px; background: var(--dglass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; font-size: 11px; padding: 2px 9px; border-radius: 99px; font-weight: 600; }
.pmeta { padding: 4px 14px 13px; display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.pmeta .nm { font-weight: 650; font-size: 14.5px; letter-spacing: -.01em; display: flex; align-items: center; gap: 4px; }
.pmeta .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.pmeta .sub { font-size: 12px; color: var(--muted); }
.fab { position: absolute; right: 18px; bottom: calc(92px + var(--safe-b)); width: 58px; height: 58px; border-radius: 50%; border: 1px solid rgba(255,255,255,.4); background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 10px 26px rgba(29,90,75,.38); z-index: 30; }
.fab svg { width: 26px; height: 26px; }
.empty { text-align: center; padding: 44px 16px; color: var(--muted); }
.empty h3 { color: var(--ink); }
.btabs { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-b)); width: min(440px, calc(100% - 28px)); display: flex; background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 28px; padding: 6px; box-shadow: var(--glass-shadow); z-index: 20; }
.btabs button { flex: 1; border: none; background: none; padding: 8px 2px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 10.5px; font-weight: 650; border-radius: 22px; }
.btabs button.on { color: var(--spruce); background: rgba(29,90,75,.11); }

/* ---------- page header (non viewer) */
.phead { display: flex; align-items: center; gap: 6px; padding: calc(8px + var(--safe-t)) 10px 8px; background: rgba(255,255,255,.5); border-bottom: 1px solid var(--line); flex: none; position: relative; z-index: 5; }
.phead .ttl { flex: 1; text-align: center; font-weight: 650; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phead .sp { width: 42px; }

/* ---------- project details */
.dprev { border-radius: 26px; overflow: hidden; background: var(--canvas) center/contain no-repeat; aspect-ratio: 16/10; position: relative; border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow); display: grid; place-items: center; color: var(--muted); }
.dtitle { display: flex; align-items: center; gap: 8px; font-size: 26px; font-weight: 700; letter-spacing: -.025em; margin: 16px 0 4px; }
.dlist { background: var(--card); border: 1px solid var(--glass-edge); border-radius: 22px; box-shadow: var(--glass-shadow); overflow: hidden; margin-top: 12px; }
.dlist button.item, .dlist a.item { width: 100%; display: flex; align-items: center; gap: 14px; padding: 13px 16px; border: none; background: none; border-bottom: 1px solid var(--line); text-align: left; font-size: 15px; font-weight: 550; color: var(--ink); text-decoration: none; }
.dlist button.item:last-child { border-bottom: none; }
.dlist button.item > svg:first-child { color: var(--spruce-2); }
.dlist small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }

/* ---------- viewer: the canvas runs edge to edge; controls float on glass above it */
.vwr { position: absolute; inset: 0; display: flex; flex-direction: column; }
.stage { background: var(--paper); }
.vbar { position: absolute; top: calc(8px + var(--safe-t)); left: 10px; right: 10px; padding: 5px 8px; display: flex; align-items: center; gap: 4px; background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 999px; box-shadow: var(--glass-shadow); z-index: 8; }
.vbar .sp { flex: 1; }
.vtop { position: absolute; top: calc(68px + var(--safe-t)); left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: flex-start; z-index: 6; pointer-events: none; }
.vtop > * { pointer-events: auto; }
.vrail { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.vrail .circ { background: var(--dglass); border-color: rgba(255,255,255,.18); color: #fff; }
.vrail .circ.on { background: var(--spruce-2); border-color: transparent; }
.btool { position: absolute; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 28px; display: flex; overflow-x: auto; padding: 6px; z-index: 8; gap: 2px; scrollbar-width: none; box-shadow: var(--glass-shadow); }
.btool::-webkit-scrollbar { display: none; }
.btool button { flex: none; min-width: 66px; border: none; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; padding: 6px 8px; color: var(--ink); border-radius: 20px; }
.btool button svg { width: 22px; height: 22px; }
.btool button.on { background: rgba(29,90,75,.12); color: var(--spruce); }
.btool .vsep { width: 1px; background: var(--line-2); margin: 10px 4px; flex: none; }
.hud { position: absolute; left: 10px; bottom: calc(96px + var(--safe-b)); max-width: calc(100% - 80px); z-index: 7; pointer-events: none; }
#screen[data-mode=plan] .hud { bottom: calc(150px + var(--safe-b)); }
.hud .pillh { background: var(--dglass); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6); color: #fff; padding: 9px 14px; border-radius: 18px; font-size: 13px; line-height: 1.4; pointer-events: auto; border: 1px solid rgba(255,255,255,.14); }
.hud b { color: #9fe0cf; }
.sheet { position: absolute; left: 8px; right: 8px; bottom: calc(8px + var(--safe-b)); background: var(--glass-strong); border: 1px solid var(--glass-edge); border-radius: 30px; padding: 20px 18px 16px; z-index: 12; box-shadow: 0 -4px 40px rgba(21,48,42,.2), 0 1px 0 rgba(255,255,255,.8) inset; max-height: 70%; overflow: auto; }
.sheet::before { content: ""; position: absolute; top: 7px; left: 50%; width: 38px; height: 4.5px; border-radius: 9px; background: rgba(21,32,30,.2); transform: translateX(-50%); }
.sheet.tall { max-height: 90%; }
.sheet h4 { font-size: 16px; margin: 2px 0 10px; }
.sheet .x { position: absolute; right: 14px; top: 14px; border: none; background: rgba(21,32,30,.08); width: 28px; height: 28px; border-radius: 50%; font-size: 18px; line-height: 1; color: var(--muted); }
.sheet .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 10px; }
.sheet .head b { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.vtabs { display: flex; gap: 6px; margin-bottom: 8px; }
.vtabs button { flex: 1; border: none; background: rgba(21,32,30,.06); border-radius: 16px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; }
.vtabs button.on { background: rgba(29,90,75,.13); color: var(--spruce); }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0; }
.preset { border: 2px solid transparent; background: none; border-radius: 16px; padding: 0 0 4px; font-size: 12.5px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.preset i { display: block; width: 100%; aspect-ratio: 1.45; border-radius: 13px; }
.preset.on { border-color: var(--spruce-2); background: rgba(43,122,102,.1); }
.rng { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; font-weight: 550; }
.rng span { width: 86px; } .rng input[type=range] { flex: 1; } .rng output { width: 40px; text-align: right; color: var(--muted); }
.floors .flr { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); font-weight: 600; }
.floors .flr.sub { padding-left: 26px; font-size: 14px; font-weight: 500; }
.floors .flr .eye { border: none; background: none; padding: 0; color: var(--spruce-2); }
.floors .flr .eye.off { color: var(--muted); }
.notelist .nrow { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.notelist .nrow small { color: var(--muted); display: block; }
.vplan { position: absolute; left: 0; right: 0; top: calc(112px + var(--safe-t)); bottom: calc(96px + var(--safe-b)); background: transparent; }
#screen[data-mode=plan] .vplan { bottom: calc(150px + var(--safe-b)); }
.vtop2 { position: absolute; top: calc(68px + var(--safe-t)); left: 10px; right: 10px; z-index: 6; pointer-events: none; display: flex; flex-direction: column; gap: 8px; }
.vtop2 > * { pointer-events: auto; }
.hintbar { background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 550; display: flex; align-items: center; gap: 10px; box-shadow: var(--glass-shadow); }
.hintbar i { width: 8px; height: 8px; border-radius: 50%; background: var(--spruce-2); display: inline-block; flex: none; box-shadow: 0 0 0 3px rgba(43,122,102,.2); }
.sugg-bar { background: rgba(255,244,228,.9); border: 1px solid rgba(181,118,26,.4); color: #7a4a08; border-radius: 22px; padding: 8px 12px; display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; flex-wrap: wrap; box-shadow: var(--glass-shadow); }
.tools { position: absolute; left: 10px; right: 10px; bottom: calc(86px + var(--safe-b)); background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 999px; padding: 4px; display: flex; gap: 2px; z-index: 8; box-shadow: var(--glass-shadow); }
.tools button { flex: 1; border: none; background: none; border-radius: 999px; padding: 9px 6px; display: flex; gap: 6px; align-items: center; justify-content: center; font-size: 13px; font-weight: 550; }
.tools button.on { background: #fff; box-shadow: 0 1px 3px rgba(21,32,30,.18); font-weight: 650; }
.tools button svg { width: 18px; height: 18px; }
.lf { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); gap: 3px; font-weight: 600; letter-spacing: .03em; }
.lf input { width: 96px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 12px; background: rgba(255,255,255,.8); }

/* ---------- export screen */
.xgroup { margin-top: 20px; } .xgroup h4 { font-size: 11px; font-weight: 650; margin: 0 0 6px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.xrow { display: flex; align-items: center; gap: 14px; padding: 10px 8px; border-radius: 18px; cursor: pointer; width: 100%; border: 1px solid transparent; background: none; text-align: left; }
.xrow.sel { background: rgba(29,90,75,.1); border-color: rgba(29,90,75,.25); }
.xrow.dis { opacity: .5; cursor: default; }
.xico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 11.5px; letter-spacing: .02em; flex: none; box-shadow: 0 1px 0 rgba(255,255,255,.3) inset; }
.xrow b { font-weight: 600; font-size: 15.5px; display: block; } .xrow small { color: var(--muted); font-size: 12.5px; }
.xfoot { position: absolute; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); padding: 8px; background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 999px; box-shadow: var(--glass-shadow); display: flex; gap: 8px; z-index: 20; }
.xfoot .btn { flex: 1; padding: 13px; }
.promo { background: rgba(255,255,255,.7); border: 1px solid var(--glass-edge); border-left: 4px solid var(--maple); border-radius: 18px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; box-shadow: var(--glass-shadow); }

/* ---------- build screen: stages hang on a dimension line */
.build { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .build { grid-template-columns: 1.4fr 1fr; } }
.stage-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 14px; color: var(--muted); position: relative; }
.stage-row:not(:last-child)::after { content: ""; position: absolute; left: 10.25px; top: 31px; bottom: -8px; width: 1.5px; background: var(--line-2); }
.stage-row.done::after { background: var(--spruce-2); }
.stage-row.done { color: var(--ink); } .stage-row.now { color: var(--spruce); font-weight: 650; }
.stage-row .dotc { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; display: grid; place-items: center; flex: none; z-index: 1; }
.stage-row.done .dotc { background: var(--spruce-2); border-color: var(--spruce-2); color: #fff; } .stage-row.done .dotc svg { width: 13px; height: 13px; }
.stage-row.now .dotc { border-color: var(--spruce-2); border-top-color: transparent; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.draft { position: relative; background: var(--canvas); border-radius: 26px; overflow: hidden; aspect-ratio: 4/3; box-shadow: var(--glass-shadow); }
.draft img, .draft svg.over { position: absolute; inset: 0; width: 100%; height: 100%; }
.draft img { object-fit: contain; opacity: .9; }
.draft .cap { position: absolute; left: 12px; top: 10px; color: #fff; font-size: 12px; font-weight: 600; background: var(--dglass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: 4px 11px; border-radius: 99px; z-index: 2; }
.draft3d { position: relative; background: var(--canvas); border-radius: 26px; overflow: hidden; aspect-ratio: 4/3; box-shadow: var(--glass-shadow); }

/* ---------- corrections workspace */
.corr { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.corr .panes { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; grid-template-rows: 1fr; }
.corr .cpane.off { display: none; }
.corr .ptabs { flex: none; display: flex; justify-content: center; padding: 8px; border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .corr .panes { grid-template-columns: 1fr 1fr; } .corr .cpane.off { display: block; } .corr .ptabs { display: none; } }
.zoomc { position: absolute; right: 10px; bottom: 10px; z-index: 3; display: flex; flex-direction: column; gap: 6px; }
.zoomc button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--glass-edge); background: var(--glass-strong); font-size: 20px; font-weight: 600; display: grid; place-items: center; padding: 0; box-shadow: var(--glass-shadow); }
.prevbar { position: absolute; left: 10px; right: 10px; top: 46px; z-index: 4; background: rgba(255,244,228,.92); border: 1px solid rgba(181,118,26,.4); border-radius: 18px; padding: 8px 12px; font-size: 13px; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.cform { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.cform .full { grid-column: 1 / -1; }
.step { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; padding: 3px 0; }
.step i { flex: none; width: 22px; height: 22px; border-radius: 50%; background: rgba(29,90,75,.12); color: var(--spruce); font-style: normal; font-weight: 700; display: grid; place-items: center; font-size: 12px; }
.step.done i { background: var(--spruce-2); color: #fff; }
.pastrow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cpane { position: relative; min-height: 0; overflow: hidden; background: #e8e5dc; border-right: 1px solid var(--line); }
.cpane .ph { position: absolute; left: 10px; top: 10px; z-index: 3; font-size: 12px; font-weight: 600; background: var(--glass-strong); border: 1px solid var(--glass-edge); padding: 4px 11px; border-radius: 99px; }
.cimg { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
.cimg .inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.cimg img { display: block; max-width: none; user-select: none; -webkit-user-drag: none; }
.cchip { position: absolute; transform: translate(-50%,-50%); background: rgba(47,111,143,.94); color: #fff; font-size: 12px; font-weight: 650; padding: 2px 9px; border-radius: 99px; border: 2px solid #fff; cursor: pointer; white-space: nowrap; box-shadow: 0 1px 5px rgba(0,0,0,.4); }
.cchip.sel { background: var(--maple); z-index: 2; } .cchip.used { background: var(--spruce-2); }
.cbar { flex: none; background: var(--glass-strong); border-top: 1px solid var(--glass-edge); padding: 12px 14px calc(12px + var(--safe-b)); max-height: 44%; overflow: auto; }
.citem { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.citem .arrow { color: var(--muted); }

/* ---------- versions */
.vcard { padding: 16px; margin-bottom: 12px; border-radius: 24px; }
.vcard h4 { font-size: 16px; margin: 6px 0 4px; }
.vstats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin: 6px 0; }
.mini { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; width: 100%; aspect-ratio: 4/3; }

/* ---------- phases */
.phase { padding: 18px; margin-bottom: 14px; border-radius: 26px; position: relative; }
.phase.now { border: 1px solid rgba(43,122,102,.5); box-shadow: 0 0 0 4px rgba(43,122,102,.1), var(--glass-shadow); }
.phase h3 { font-size: 20px; margin: 8px 0 4px; }
.phase ul { list-style: none; padding: 0; margin: 10px 0 0; }
.phase li { display: flex; gap: 10px; padding: 7px 0; font-size: 14px; align-items: flex-start; border-top: 1px solid var(--line); }
.phase li .st { flex: none; width: 96px; }

/* ---------- overlay / toast / menu */
.overlay { position: fixed; inset: 0; background: rgba(14,28,25,.42); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--glass-strong); border: 1px solid var(--glass-edge); border-radius: 30px; padding: 22px; width: 100%; max-width: 460px; max-height: 92dvh; overflow: auto; box-shadow: 0 24px 70px rgba(10,30,26,.35); }
.modal.wide { max-width: 880px; }
.modal h3 { margin-top: 0; font-size: 19px; }
.drop { border: 1.5px dashed rgba(29,90,75,.4); border-radius: 22px; padding: 24px 12px; text-align: center; color: var(--muted); background: rgba(29,90,75,.04); }
.drop.over { background: rgba(43,122,102,.12); border-color: var(--spruce-2); }
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); background: var(--dglass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); color: #fff; padding: 10px 18px; border-radius: 999px; z-index: 200; max-width: 90%; font-size: 14px; border: 1px solid rgba(255,255,255,.14); }
.menu { position: absolute; right: 10px; top: calc(62px + var(--safe-t)); background: var(--glass-strong); border: 1px solid var(--glass-edge); border-radius: 22px; box-shadow: 0 18px 50px rgba(10,30,26,.28); z-index: 60; min-width: 230px; overflow: hidden; padding: 4px; }
.menu button { display: flex; width: 100%; gap: 11px; align-items: center; padding: 11px 13px; border: none; background: none; text-align: left; font-size: 14px; font-weight: 550; border-radius: 16px; }
.menu button svg { width: 19px; height: 19px; color: var(--spruce-2); }
.menu button:hover { background: rgba(29,90,75,.08); } .menu button.red, .menu button.red svg { color: var(--bad); } .menu hr { border: none; border-top: 1px solid var(--line); margin: 4px 8px; }
.progress { height: 8px; background: rgba(21,32,30,.1); border-radius: 99px; overflow: hidden; } .progress i { display: block; height: 100%; background: var(--grad); transition: width .3s; border-radius: 99px; }
details.how { margin-top: 14px; } details.how summary { cursor: pointer; font-weight: 650; }

/* ---------- plan and 3D overlays */
.plan-svg { display: block; width: 100%; height: 100%; }
.plan-svg text { stroke-linejoin: round; }
/* CAD lettering: the condensed sans of a drawing set, with ISOCP (AutoCAD's dimension face) for figures where installed */
.plan-svg .cadtxt { font-family: "Arial Narrow", "Helvetica Neue Condensed", "Swis721 Cn BT", "Roboto Condensed", "Bahnschrift SemiCondensed", "Arial", sans-serif; font-stretch: condensed; }
.plan-svg .dimtxt { font-family: "ISOCP", "ISOCPEUR", "GENISO", "Arial Narrow", "Roboto Condensed", "Arial", sans-serif; font-stretch: condensed; letter-spacing: .02em; }
.plan-svg .room { cursor: pointer; }
.lbl3d { position: absolute; left: 0; top: 0; pointer-events: none; transform: translate(-50%,-50%); font-size: 12px; font-weight: 650; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 0 2px rgba(0,0,0,.9); white-space: nowrap; text-align: center; line-height: 1.2; }
.lbl3d small { display: block; font-weight: 600; opacity: .85; font-size: 11px; }
.lbl3d.meas { background: #ffb020; color: #1f2933; text-shadow: none; padding: 3px 9px; border-radius: 99px; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.lbl3d.pin { background: var(--spruce-2); color: #fff; text-shadow: none; padding: 3px 10px; border-radius: 99px; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.lbl3d.tag { background: #fff; color: #111; text-shadow: none; border: 1.5px solid #111; border-radius: 99px; padding: 1px 6px; font-size: 11px; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.lbl3d.tag.window { border-color: #1b78d0; color: #1b78d0; border-radius: 6px; }
.lbl3d.tag.door { border-color: #b5651d; color: #7a4210; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 6px 0; }
.pthumb .tag { background: rgba(255,255,255,.9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
/* short windows: give the drawing the room */
@media (max-height: 640px) {
  .hintbar { display: none; }
  .vplan { top: calc(104px + var(--safe-t)); }
  .vtop2 { top: calc(64px + var(--safe-t)); }
  .tools { bottom: calc(80px + var(--safe-b)); } #screen[data-mode=plan] .vplan { bottom: calc(132px + var(--safe-b)); }
  .btool button { padding: 4px 8px; } .btool button svg { width: 20px; height: 20px; }
}
@media (max-height: 640px) { .vrail { gap: 8px; } .vrail .circ-l { font-size: 0; gap: 0; } .vrail .circ { width: 38px; height: 38px; } }

/* 3D floor plan mode: labels read dark on the light paper */
.light .lbl3d { color: #15201e; text-shadow: 0 0 3px #faf8f3, 0 0 3px #faf8f3, 0 0 2px #faf8f3; }
.light .lbl3d.tag, .light .lbl3d.meas, .light .lbl3d.pin { text-shadow: none; }
.mini-tg { width: 34px; height: 20px; border-radius: 99px; background: rgba(21,32,30,.22); position: relative; flex: none; transition: .18s; }
.mini-tg::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: .18s; }
.mini-tg.on { background: var(--spruce-2); } .mini-tg.on::after { left: 16px; }
.vleft { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* ---------- issue screen */
.issue-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin: 4px 0 14px; }
.issue-head h2 { font-size: 26px; margin: 2px 0 2px; letter-spacing: -.025em; }
.issue-grid { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
@media (min-width: 900px) { .issue-grid { grid-template-columns: 1.15fr 1fr; } }
.sheetlist { margin: 6px 0 4px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: rgba(255,255,255,.5); }
.srow { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 12px; border-bottom: 1px solid var(--line); }
.srow:last-child { border-bottom: none; }
.srow .st { flex: 1; font-weight: 550; cursor: pointer; }
.srow:not(.on) .st { color: var(--muted); font-weight: 450; }
.srow .sn { width: 42px; font-size: 12.5px; color: var(--spruce); font-weight: 650; }
.chk { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-2); background: #fff; display: grid; place-items: center; padding: 0; color: #fff; flex: none; }
.chk svg { width: 14px; height: 14px; }
.srow.on .chk { background: var(--spruce-2); border-color: var(--spruce-2); }
.opts { margin: 10px 0 0; border-top: 1px solid var(--line); padding-top: 8px; }
.opts summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.opts .row { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.opts .row:last-child { border-bottom: none; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 520px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) and (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,.62); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow); text-decoration: none; color: var(--ink); min-width: 0; transition: transform .08s; }
.tile:active { transform: scale(.97); }
.tile .ext { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--spruce); }
.tile b { font-weight: 600; font-size: 14px; } .tile small { color: var(--muted); font-size: 11.5px; line-height: 1.25; }
.tile.off { opacity: .45; }
.btn.disabled, .btn.wait { opacity: .6; pointer-events: none; }
.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.spin.dark { border-color: rgba(21,32,30,.2); border-top-color: var(--spruce-2); margin-right: 8px; vertical-align: -3px; }
.pv { position: relative; margin: 10px 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; min-height: 240px; overflow: hidden; }
.pv img { display: block; width: 100%; height: auto; transition: opacity .2s; }
.pvwait { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.logobox { width: 120px; height: 72px; border: 1px dashed var(--line-2); border-radius: 14px; display: grid; place-items: center; background: #fff; overflow: hidden; font-size: 12px; }
.logobox img { max-width: 100%; max-height: 100%; }
.vrail.dl .circ-l { color: #15201e; text-shadow: none; }

/* ---------- on-plan chips and action bar */
.chiplayer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.dchip, .dchip-in { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; white-space: nowrap; font: 600 12px "Arial Narrow", "Roboto Condensed", Arial, sans-serif; letter-spacing: .02em; border-radius: 7px; padding: 2px 7px; }
.dchip { background: #fff; border: 1px solid rgba(47,111,143,.75); color: #15201e; cursor: text; box-shadow: 0 1px 4px rgba(21,48,42,.18); }
.dchip:hover { background: #eef6fa; }
.dchip.main { background: #2f6f8f; border-color: #2f6f8f; color: #fff; }
.dchip.ro { cursor: default; border-style: dashed; }
.dchip-in { width: 86px; border: 2px solid #2f6f8f; background: #fff; text-align: center; outline: none; }
.selbar { position: absolute; transform: translate(-50%, -100%); pointer-events: auto; display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.selbar button { width: 32px; height: 32px; border-radius: 50%; border: none; background: none; display: grid; place-items: center; padding: 0; color: var(--ink); }
.selbar button:hover { background: rgba(29,90,75,.1); } .selbar button.red { color: var(--bad); } .selbar svg { width: 18px; height: 18px; }

/* ---------- the live 3D inset next to the floor plan */
.inset { position: absolute; top: calc(172px + var(--safe-t)); right: 10px; width: min(42%, 440px); aspect-ratio: 4 / 3; z-index: 7; border-radius: 22px; overflow: hidden; background: #f1efe9; border: 1px solid var(--glass-edge); box-shadow: 0 16px 44px rgba(21,48,42,.28); }
.inset.big { width: min(68%, 780px); }
.inset-c { position: absolute; inset: 0; }
.inset-h { position: absolute; left: 6px; right: 6px; top: 6px; display: flex; align-items: center; gap: 2px; padding: 3px 4px; border-radius: 999px; background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid var(--glass-edge); cursor: grab; z-index: 2; }
.inset-h .seg { background: transparent; padding: 0; } .inset-h .seg button { padding: 4px 8px; font-size: 11.5px; }
.inset-h .icon-btn { padding: 4px; } .inset-h svg { width: 16px; height: 16px; }
@media (max-height: 640px) { .inset { top: calc(116px + var(--safe-t)); } }
@media (max-width: 700px) { .inset, .inset.big { left: 10px; width: auto; aspect-ratio: auto; height: 34%; top: calc(124px + var(--safe-t)); } }
.vleft .seg { background: var(--glass-strong); box-shadow: var(--glass-shadow); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border: 1px solid var(--glass-edge); }
/* a faint drafting grid behind the plan, like a CAD screen */
#screen[data-mode=plan] .stage { background-image: linear-gradient(rgba(21,48,42,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(21,48,42,.05) 1px, transparent 1px); background-size: 28px 28px; }
#selSheet { max-height: 44%; }

/* ---------- palette tiles: sized by their content, not by the width of the window */
.presets { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
.preset i { aspect-ratio: auto; height: 58px; }
.preset i svg { width: 28px; height: 28px; }
.presets .preset { max-width: 130px; }
.side .sheet#selSheet, .sheet#selSheet { }

/* ---------- desktop editor: left tool rail, centre canvas, docked right panel */
.railwrap { display: contents; }
.side, .vtitle, .vswitch, .vzoom { display: none; }
.dcol { min-width: 0; }
@media (min-width: 1000px) {
  .wrap.narrow.dwide { max-width: 1120px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 34px; align-items: start; }
  .scroll { padding-left: 28px; padding-right: 28px; }

  #screen[data-mode] { display: grid; grid-template-columns: 82px minmax(0, 1fr) 360px; grid-template-rows: 58px minmax(0, 1fr); }
  #screen[data-mode="3d"] { grid-template-columns: 82px minmax(0, 1fr); }
  #screen[data-mode] > .vbar { grid-column: 1 / -1; grid-row: 1; position: relative; top: auto; left: auto; right: auto; border-radius: 0; border: none; border-bottom: 1px solid var(--line); box-shadow: none; padding: 7px 16px; background: rgba(255,255,255,.78); }
  .vtitle { display: flex; flex-direction: column; line-height: 1.15; margin-left: 8px; min-width: 0; max-width: 28vw; }
  .vtitle b { font-size: 15px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .vtitle small { color: var(--muted); font-size: 11.5px; }
  .vswitch { display: inline-flex; position: absolute; left: 50%; transform: translateX(-50%); }
  #screen[data-mode] > .page { grid-column: 2; grid-row: 2; }

  #screen[data-mode] > .railwrap { display: flex; flex-direction: column; grid-column: 1; grid-row: 2; gap: 12px; padding: 12px 8px; background: rgba(255,255,255,.62); border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: thin; }
  .railwrap .tools { position: static; flex-direction: column; border-radius: 18px; padding: 4px; margin: 0; box-shadow: none; background: rgba(21,32,30,.055); border: none; }
  .railwrap .tools.hidden { display: none !important; }
  .railwrap .tools button { flex-direction: column; gap: 3px; padding: 9px 2px; font-size: 11px; border-radius: 14px; }
  .railwrap .btool { position: static; flex-direction: column; border-radius: 0; padding: 0; box-shadow: none; background: transparent; border: none; overflow: visible; gap: 2px; }
  .railwrap .btool button { min-width: 0; width: 100%; padding: 8px 2px; }
  .railwrap .btool .vsep { width: auto; height: 1px; margin: 5px 8px; }

  #screen[data-mode] > .side { display: flex; flex-direction: column; grid-column: 3; grid-row: 2; border-left: 1px solid var(--line); background: rgba(255,255,255,.62); overflow-y: auto; padding: 0 16px 16px; }
  #screen[data-mode="3d"] > .side { display: none; }
  .side-3d .inset { margin-top: 14px; }
  .side-props:empty::before { content: "Select a door, window, wall, room or piece of furniture on the plan to edit its properties here. Press V to select, W for a partition, D for a door, N for a window."; display: block; color: var(--muted); font-size: 13px; line-height: 1.5; padding: 18px 2px; }
  .inset.docked { position: relative; top: auto; right: auto; left: auto; width: 100%; max-width: none; aspect-ratio: 4 / 3; box-shadow: none; border-radius: 16px; border: 1px solid var(--line-2); }
  .inset.docked.big { aspect-ratio: 1 / 1; }
  .side .sheet { position: static; width: auto; max-height: none; border-radius: 0; box-shadow: none; padding: 14px 2px 6px; background: transparent; border: none; margin: 8px 0 0; overflow: visible; }
  .side .sheet::before { display: none; }
  .side .sheet .x { top: 10px; right: 0; }
  .side .sheet h4 { font-size: 17px; }

  /* every other sheet becomes a tidy popover beside the rail rather than a bottom sheet across the window */
  #screen[data-mode] > .sheet { left: 94px; right: auto; bottom: 16px; width: 400px; max-height: calc(100% - 90px); border-radius: 20px; }
  #screen[data-mode] > .sheet::before { display: none; }
  #screen[data-mode] > .sheet.tall { max-height: calc(100% - 80px); }

  #screen[data-mode] .vtop, #screen[data-mode] .vtop2 { top: 12px; }
  #screen[data-mode] .hintbar { display: none; }
  #screen[data-mode] .vplan, #screen[data-mode=plan] .vplan { top: 62px; bottom: 14px; }
  #screen[data-mode] .hud, #screen[data-mode=plan] .hud { bottom: 18px; }
  #screen[data-mode] .vbar .pill.grad { margin-right: 2px; }
  .vzoom { display: flex; position: absolute; right: 14px; bottom: 16px; z-index: 7; flex-direction: column; gap: 6px; }
  #screen[data-mode="3d"] .vzoom { display: none; }
  .vzoom button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--glass-edge); background: var(--glass-strong); box-shadow: var(--glass-shadow); font-size: 18px; display: grid; place-items: center; padding: 0; }
  .vzoom button svg { width: 18px; height: 18px; }
  .toast { bottom: 24px; }
  .modal { max-width: 520px; } .modal.wide { max-width: 980px; }
  .btabs { width: 460px; }
}
@media (min-width: 1000px) { .side .sheet#selSheet { max-height: none; } }
@media (min-width: 1000px) { .side .field.inline { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; } .side .field.inline select, .side .field.inline .lf:first-child:has(select) { grid-column: 1 / -1; } .side .lf input, .side .lf select, .side .field.inline input { width: 100%; } .side .tbl { font-size: 13px; } }
@media (min-width: 1000px) { .dwide .kpis { grid-template-columns: repeat(3, 1fr); } }

/* ---- drafting: symbol palette, design phases */
.symgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin: 8px 0; max-height: 236px; overflow: auto; padding: 2px; }
.sym { border: 1px solid var(--line-2); background: rgba(255,255,255,.72); border-radius: 14px; padding: 9px 4px 7px; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--ink); text-align: center; line-height: 1.15; }
.sym:hover { border-color: var(--spruce-2); background: rgba(43,122,102,.09); }
.sym svg { color: var(--ink); }
.eyebrow.sp { margin: 12px 0 4px; }
.phasebadge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 650; }
.phasebadge.new { background: #2b2b2b; color: #fff; } .phasebadge.demo { background: rgba(179,38,30,.13); color: #b3261e; }
.layertbl { width: 100%; font-size: 12.5px; border-collapse: collapse; margin: 4px 0 8px; } .layertbl td { padding: 3px 6px; border-bottom: 1px solid var(--line); } .layertbl td.n { text-align: right; color: var(--muted); white-space: nowrap; }
.pill.on-design { background: var(--grad); color: #fff; border-color: transparent; }
.chips .chip.toggle.on { background: var(--spruce); color: #fff; }

@media (max-width: 520px) { .vtop2 .pill .pl { display: none; } .vtop2 .pill { padding: 9px 12px; } }

/* ---- Light (phone) mode hides the full drafting and BIM tools */
:root[data-appmode="light"] .full-only { display: none !important; }
.issue-bim { margin-top: 16px; }

/* ---- BIM Studio (LiDARO Studio engine): Revit's layout */
#screen[data-studio] { display: grid; grid-template-rows: 54px auto 1fr 28px; height: 100%; background: var(--bg, #f3f1ec); }
.st-top { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--line); background: var(--glass-strong); }
.st-title { display: flex; flex-direction: column; line-height: 1.1; } .st-title small { color: var(--muted); font-size: 11.5px; }
.st-top .circ { width: 36px; height: 36px; }
.st-ribbon { border-bottom: 1px solid var(--line); background: #fff; }
.st-tabs { display: flex; gap: 2px; padding: 4px 10px 0; overflow-x: auto; }
.st-tabs button { border: none; background: none; padding: 6px 12px; font-weight: 600; font-size: 13px; color: var(--muted); border-radius: 8px 8px 0 0; }
.st-tabs button.on { background: #eef3f1; color: var(--spruce); }
.st-tools { display: flex; gap: 4px; padding: 6px 10px; background: #eef3f1; overflow-x: auto; }
.st-tool { border: 1px solid transparent; background: none; border-radius: 10px; padding: 4px 8px; min-width: 64px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.st-tool svg { width: 20px; height: 20px; } .st-tool:hover { background: #fff; } .st-tool.on { background: #fff; border-color: var(--spruce-2); }
.st-body { display: grid; grid-template-columns: 210px 1fr 320px; min-height: 0; }
.st-left, .st-right { overflow: auto; background: #fff; padding: 8px 10px; }
.st-left { border-right: 1px solid var(--line); } .st-right { border-left: 1px solid var(--line); }
.st-g { margin: 10px 0 4px; } .st-vi { display: block; width: 100%; text-align: left; border: none; background: none; padding: 5px 8px; border-radius: 8px; font-size: 13px; }
.st-vi:hover { background: #f1f4f2; } .st-vi.on { background: #e3eeea; font-weight: 650; color: var(--spruce); }
.st-counts { font-size: 11.5px; margin-top: 12px; line-height: 1.45; }
.st-stage { position: relative; overflow: hidden; background: #fbfaf7; touch-action: none; cursor: crosshair; }
.st-img { position: absolute; image-rendering: auto; user-select: none; pointer-events: none; }
.st-marks { position: absolute; inset: 0; pointer-events: none; }
.st-wait { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--muted); gap: 6px; }
.st-sched { position: absolute; inset: 0; overflow: auto; background: #fff; padding: 16px; }
.st-tablewrap { overflow: auto; max-height: 70vh; } .st-tablewrap th { position: sticky; top: 0; background: #f4f6f5; text-align: left; font-size: 12px; }
.st-ph { display: flex; align-items: center; gap: 8px; margin: 2px 0 6px; } .st-doc { font-size: 12px; line-height: 1.45; max-height: 140px; overflow: auto; }
.st-form { display: grid; gap: 6px; } .st-f input, .st-f select { width: 100%; } .st-f { font-size: 11px; }
.st-props { display: grid; gap: 6px; } .st-kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px; font-size: 12px; } .st-kv span { color: var(--muted); } .st-kv code { white-space: pre-wrap; word-break: break-all; font-size: 11.5px; }
.st-json { width: 100%; font-family: monospace; font-size: 12px; }
.st-status { display: flex; gap: 14px; align-items: center; padding: 4px 12px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); background: #fff; overflow: hidden; white-space: nowrap; }
.st-xy { margin-left: auto; font-variant-numeric: tabular-nums; }
.st-clist { max-height: 60vh; overflow: auto; display: grid; gap: 4px; }
.st-ci { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 10px; display: grid; gap: 2px; } .st-ci small { color: var(--muted); font-size: 11.5px; }
@media (max-width: 999px) { .st-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } .st-left { display: none; } .st-right { max-height: 40vh; } }

#screen[data-studio-light] { grid-template-rows: 54px 0 1fr 28px; } #screen[data-studio-light] .st-left { display: none; } #screen[data-studio-light] .st-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } #screen[data-studio-light] .st-right { max-height: 34vh; border-left: none; border-top: 1px solid var(--line); }
#screen[data-studio-light] .st-top .sel { max-width: 46vw; }

.st-img { max-width: none !important; max-height: none !important; }
#screen[data-studio-light] .st-title small { display: none; } #screen[data-studio-light] .st-top .pill { padding: 8px 10px; font-size: 0; gap: 0; } #screen[data-studio-light] .st-top .pill svg { width: 18px; height: 18px; }

.st-logo svg { width: 30px; height: 30px; display: block; } .st-phi { display: inline-flex; color: var(--spruce); } .st-ci b { display: inline-flex; gap: 6px; align-items: center; } .st-tool svg { color: var(--spruce); }

/* the LiDARO wordmark: a maple-red dot on the i */
.wm { white-space: nowrap; } .wm-i { position: relative; display: inline-block; }
.wm-i::after { content: ''; position: absolute; left: 50%; top: .2em; width: .2em; height: .2em; margin-left: -.1em; border-radius: 50%; background: var(--maple, #de382b); }

/* office standard summary */
.std-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.std-chip { background: rgba(29, 90, 75, .06); border: 1px solid var(--line, #e2e0d8); border-radius: 10px; padding: 6px 8px; display: flex; gap: 6px; align-items: baseline; font-size: 12px; color: var(--muted); }
.std-chip b { color: var(--spruce); font-size: 15px; font-variant-numeric: tabular-nums; }
textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

/* markup review */
.mk-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 12px; margin-top: 12px; align-items: start; }
@media (max-width: 900px) { .mk-grid { grid-template-columns: 1fr; } }
.mk-sheet { position: relative; background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--line, #e2e0d8); }
.mk-sheet img { display: block; width: 100%; height: auto; }
.mk-sheet svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mk rect { fill: none; stroke-width: 3; }
.mk circle { stroke: #fff; stroke-width: 2; }
.mk text { fill: #fff; font: 700 15px system-ui, sans-serif; text-anchor: middle; dominant-baseline: central; }
.mk { cursor: pointer; }
.mk.on rect { stroke: var(--spruce, #1d5a4b); } .mk.on circle { fill: var(--spruce, #1d5a4b); }
.mk.off rect { stroke: #9aa39f; stroke-dasharray: 6 4; } .mk.off circle { fill: #9aa39f; }
.mk.info rect { stroke: #c8c3b4; stroke-dasharray: 2 4; } .mk.info circle { fill: #c8c3b4; }
.mk-row { display: flex; gap: 8px; align-items: flex-start; padding: 8px 4px; border-top: 1px solid var(--line, #e2e0d8); cursor: pointer; border-radius: 8px; transition: background .3s; }
.mk-row.flash { background: rgba(29, 90, 75, .12); }
.mk-row input[type=checkbox] { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--spruce, #1d5a4b); }
.mk-n { min-width: 22px; height: 22px; border-radius: 11px; background: var(--spruce, #1d5a4b); color: #fff; font: 700 12px system-ui; display: grid; place-items: center; }
.mk-row.muted .mk-n { background: #c8c3b4; }
.mk-textrow { padding: 0 4px 8px 56px; }
.mk-text { width: 100%; text-transform: uppercase; }

/* sign-in: Google button, divider, authenticator set-up, recovery codes */
.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 600; }
.gbtn:hover { background: #f8f9fa; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 12px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line, #e2e0d8); }
.qrbox { display: grid; place-items: center; background: #fff; border-radius: 12px; padding: 10px; margin: 8px 0; }
.qrbox svg { width: 190px; height: 190px; }
.codein { font-size: 22px; letter-spacing: 4px; text-align: center; font-variant-numeric: tabular-nums; }
.reccodes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; background: rgba(29, 90, 75, .06); border-radius: 10px; padding: 10px; font-size: 15px; text-align: center; }
.people-row { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line, #e2e0d8); flex-wrap: wrap; }
.people-row .pwho { flex: 1; min-width: 180px; font-size: 14px; }
