:root {
  --bg: #0c0e11; --panel: #14171c; --panel-2: #1a1e24; --line: #262b33; --line-2: #333944;
  --text: #ebe8e2; --muted: #98a0aa; --faint: #6b727c;
  --accent: #f2b84b; --accent-ink: #1d1503; --good: #7ed491; --warn: #f2b84b; --bad: #ff8a70; --info: #5cc8ff;
  --r: 14px; --sans: 'Manrope', system-ui, sans-serif; --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1380px; margin: 0 auto; padding: 0 24px; }
a { color: inherit; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: rgba(12, 14, 17, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; font-size: 17px; }
.mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; }
.brand-sub { color: var(--muted); font-weight: 500; }
.top-nav { display: flex; gap: 22px; }
.top-nav a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.top-nav a:hover { color: var(--text); }

.hero { padding-top: 56px; padding-bottom: 28px; }
.hero h1 { font-size: clamp(34px, 5vw, 60px); line-height: 1.02; font-weight: 800; max-width: 16ch; margin: 10px 0 16px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: var(--accent); margin: 0; font-weight: 700; }
.lede { color: var(--muted); max-width: 70ch; margin: 0; font-size: 16px; }

/* plan cards */
.plan-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin: 18px 0; }
.plan-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; color: var(--text); cursor: pointer; font: inherit; transition: border-color .15s, transform .15s; }
.plan-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.plan-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.plan-card b { display: block; font-size: 16px; }
.plan-card .area { font-family: var(--mono); color: var(--accent); font-size: 13px; margin: 4px 0 6px; display: block; }
.plan-card span.d { color: var(--muted); font-size: 13px; line-height: 1.4; display: block; }
.plan-card .tag { position: absolute; top: 15px; right: 16px; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }

/* upload card and the review panel */
.plan-card.upload { border-style: dashed; border-color: var(--accent); background: rgba(242, 184, 75, .06); }
.plan-card.upload b { color: var(--accent); }
.importer { background: var(--panel); border: 1px solid var(--accent); border-radius: var(--r); padding: 16px 18px; margin: 0 0 18px; }
.imp-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.imp-head h3 { font-size: 20px; }
.imp-head p { margin: 4px 0 0; font-size: 14px; }
.imp-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; margin-top: 14px; }
.imp-stage { position: relative; background: #fff; border-radius: 10px; overflow: hidden; align-self: start; }
.imp-stage img { display: block; width: 100%; height: auto; }
.imp-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.imp-stage text { font-family: var(--sans); }
.imp-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.imp-help { margin: 0; font-size: 13px; }
.imp-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.imp-row input { width: 90px; }
.imp-side input, .imp-side select { font: 500 13px var(--sans); background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 8px; }
.imp-rooms td, .imp-rooms th { padding: 7px 9px; white-space: normal; }
.imp-rooms input[name=name] { width: 100%; min-width: 120px; }
.imp-rooms td.num { font-size: 12px; }
.imp-count { margin: 0; font-size: 13px; }
.imp-rooms tr.floor-row td { color: var(--accent); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; background: var(--panel-2); }
.paper img { width: 100%; height: auto; display: block; max-height: 640px; object-fit: contain; }
@media (max-width: 900px) { .imp-body { grid-template-columns: 1fr; } }

/* segmented buttons */
.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.seg button { font: 600 14px var(--sans); color: var(--text); background: transparent; border: 1px solid var(--line-2); border-radius: 999px; padding: 9px 16px; cursor: pointer; }
.seg button:hover { border-color: var(--muted); }
.seg button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg.small button { padding: 6px 12px; font-size: 13px; }
.mode { margin: 4px 0 18px; }
.tabs { margin: 28px 0 22px; }

.source { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; }
.source summary, .checks summary { cursor: pointer; font-weight: 700; }
.paper { margin: 14px auto 4px; background: #fff; border-radius: 10px; max-width: 900px; padding: 10px; }
.paper svg { width: 100%; height: auto; display: block; max-height: 560px; }

/* catalogue */
.catalog { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 26px; }
.cat-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cat-head p { margin: 0; max-width: 62ch; font-size: 14px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.prod { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: start; }
.prod svg, .prod .thumb { width: 64px; height: 64px; background: #e7e5e0; border-radius: 8px; display: block; }
.prod b { font-size: 14px; }
.prod .t { color: var(--muted); font-size: 12px; }
.prod .s { font-family: var(--mono); font-size: 11px; color: var(--faint); display: block; margin: 2px 0 6px; }
.prod .d { font-size: 12px; color: var(--muted); line-height: 1.35; }
.prod .row { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
.prod a { font-size: 12px; color: var(--muted); }

.btn { font: 600 13px var(--sans); background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 9px; padding: 8px 13px; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-2); }
.btn.ghost:hover { border-color: var(--muted); }
.btn:disabled { opacity: .4; cursor: default; }

.meta { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 8px; }
#headline { font-size: clamp(28px, 3.6vw, 44px); font-weight: 800; margin-bottom: 10px; }

/* summary cards */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); margin: 22px 0 22px; overflow: hidden; }
.card { padding: 16px 18px; border-right: 1px solid var(--line); }
.card:last-child { border-right: 0; }
.card .k { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.card .v { font-weight: 800; font-size: 17px; margin: 6px 0 4px; line-height: 1.25; }
.card .s { color: var(--muted); font-size: 13px; line-height: 1.4; }
.card .v.good { color: var(--good); } .card .v.bad { color: var(--bad); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.chips button { font: 600 14px var(--sans); color: var(--text); background: var(--panel); border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 15px; cursor: pointer; }
.chips button:hover { border-color: var(--muted); }
.chips button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chips.arr button.on { background: transparent; color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.chips .badge { font-family: var(--mono); font-size: 10px; font-weight: 500; background: rgba(126, 212, 145, .16); color: var(--good); border-radius: 5px; padding: 2px 6px; margin-left: 8px; letter-spacing: .06em; }
.chips .warnb { background: rgba(255, 138, 112, .15); color: var(--bad); }
.room-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 6px 0 12px; font-size: 14px; }
select { font: 500 13px var(--sans); background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 9px; padding: 7px 10px; }

/* the two panes */
.panes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.pane { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.pane-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pane-head h3 { font-size: 15px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.chk { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); cursor: pointer; }
.chk input { accent-color: var(--accent); }
.plan-wrap { background: #121418; flex: 1; min-height: 420px; display: flex; }
.plan-wrap svg { width: 100%; height: 100%; min-height: 420px; max-height: 640px; display: block; touch-action: none; user-select: none; }
.plan-wrap .piece { cursor: grab; }
.plan-wrap .piece.dim { opacity: .28; cursor: pointer; }
.plan-wrap .floor { cursor: pointer; }
.plan-wrap text { font-family: var(--sans); pointer-events: none; font-weight: 600; }
.help { color: var(--muted); font-size: 13px; padding: 10px 14px; margin: 0; border-top: 1px solid var(--line); }
.view3d { position: relative; flex: 1; min-height: 520px; background: #d5d8dc; }
.view3d canvas { display: block; }
.labels3d { position: absolute; inset: 0; pointer-events: none; }
.lbl { font: 600 11px var(--sans); color: #fff; background: rgba(20, 23, 28, .78); padding: 3px 7px; border-radius: 6px; white-space: nowrap; }
.lbl.room { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.v-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 2; }
.tog { font: 600 12px var(--sans); background: rgba(20, 23, 28, .78); color: #fff; border: 1px solid transparent; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.tog.on { background: var(--accent); color: var(--accent-ink); }
.v-hint { position: absolute; left: 10px; bottom: 10px; background: rgba(20, 23, 28, .78); color: #dfe3e8; padding: 5px 9px; border-radius: 7px; z-index: 2; font-size: 11px; }
.busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(12, 14, 17, .55); z-index: 3; color: #fff; font-weight: 600; }

/* verdict */
.verdict { margin: 34px 0 10px; max-width: 1100px; }
.verdict .eyebrow { color: var(--muted); font-family: var(--mono); font-weight: 500; }
.v-title { font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; margin: 8px 0 8px; }
.procon { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 16px; }
.procon h4 { font-size: 15px; margin-bottom: 6px; }
.procon h4.pro { color: var(--good); } .procon h4.con { color: var(--bad); }
.procon ul { margin: 0; padding-left: 18px; }
.procon li { margin: 6px 0; }
.procon li.problem { color: var(--bad); font-weight: 600; }

.sec { font-size: 24px; font-weight: 800; margin: 34px 0 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
table.cmp { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp th, .cmp td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cmp tr:last-child td { border-bottom: 0; }
.cmp th { font-weight: 700; color: var(--text); }
.cmp th.on { color: var(--accent); }
.cmp td:first-child { color: var(--muted); }
.cmp td.good { color: var(--good); font-family: var(--mono); } .cmp td.warn { color: var(--warn); font-family: var(--mono); } .cmp td.bad { color: var(--bad); font-family: var(--mono); }
.cmp td.num { font-family: var(--mono); }
.cmp tr.sel td { background: rgba(242, 184, 75, .08); }
.pieces tr { cursor: pointer; }
.st { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 2px 7px; border-radius: 5px; }
.st.ok { background: rgba(126, 212, 145, .14); color: var(--good); } .st.tight { background: rgba(242, 184, 75, .15); color: var(--warn); } .st.problem { background: rgba(255, 138, 112, .15); color: var(--bad); }
.checks { margin: 20px 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; }
.checks .table-wrap { margin-top: 12px; border: 0; }
.foot { padding: 40px 24px 60px; font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #22262d; border: 1px solid var(--line-2); color: var(--text); padding: 11px 16px; border-radius: 10px; z-index: 50; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); max-width: 90vw; }

@media (max-width: 1100px) {
  .panes { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .card:nth-child(2) { border-right: 0; }
  .card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .top-nav { display: none; }
  .cards { grid-template-columns: 1fr; }
  .card { border-right: 0; border-bottom: 1px solid var(--line); }
  .procon { grid-template-columns: 1fr; }
  .view3d { min-height: 380px; }
}
