/* =============================================================================
   FMF Glass Railing Configurator — POC styles
   Aesthetic: architectural / engineering-spec. Ink + steel neutrals on paper,
   a single glass-teal accent, IBM Plex Mono for all technical numerics.
   ============================================================================= */

:root {
  --ink: #0c1116; --ink-2: #1b2530; --steel: #3a4654;
  --muted: #5a6675; --muted-2: #8893a0;
  --paper: #f5f7f8; --surface: #ffffff; --surface-2: #fbfcfd;
  --line: #e4e8ec; --line-2: #eef1f4;
  --teal: #0e948c; --teal-d: #0b756f; --teal-l: #14b8a6;
  --teal-wash: #eaf6f4; --glass: #bfe6e3;
  --brass: #b08948;
  --danger: #c2410c; --warn-bg: #fff8f1; --warn-line: #f3d9c0;
  --shadow-s: 0 1px 2px rgba(12,17,22,.06), 0 1px 3px rgba(12,17,22,.04);
  --shadow-m: 0 6px 18px rgba(12,17,22,.07), 0 2px 6px rgba(12,17,22,.05);
  --shadow-l: 0 24px 60px rgba(12,17,22,.16);
  --r: 14px; --r-s: 10px; --r-xs: 8px;
  --display: 'Archivo Expanded', 'Archivo', sans-serif;
  --sans: 'Archivo', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, #ffffff 0%, transparent 60%),
    linear-gradient(180deg, #f7f9fa 0%, var(--paper) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
svg { width: 1em; height: 1em; display: inline-block; vertical-align: middle; flex: none; }
button { font-family: inherit; cursor: pointer; color: inherit; }
input, textarea { font-family: inherit; }

/* ---- app frame ------------------------------------------------------------ */
#app { max-width: 1600px; margin: 0 auto; padding: 0 24px 64px; }

.appbar {
  display: flex; align-items: center; gap: 24px;
  padding: 20px 4px 18px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo-mark { width: 40px; height: 40px; }
.brand-name {
  font-family: var(--display); font-weight: 800; font-size: 18px;
  letter-spacing: .02em; line-height: 1; color: var(--ink);
}
.brand-name span { font-weight: 600; color: var(--teal-d); margin-left: 6px; letter-spacing: .04em; }
.brand-sub {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted-2); margin-top: 4px;
}
.project-field { margin-left: auto; display: flex; flex-direction: column; gap: 3px; }
.project-field label {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted-2); padding-left: 2px;
}
.project-field input {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--r-xs); padding: 8px 12px; font-size: 13.5px; font-weight: 600;
  color: var(--ink); width: 240px; transition: border-color .15s, box-shadow .15s;
}
.project-field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-wash); }
.demo-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--teal); color: #fff; border: 0; border-radius: 999px;
  padding: 8px 15px; font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow-s);
  transition: background .15s, transform .12s, box-shadow .2s;
}
.demo-btn svg { width: 13px; height: 13px; }
.demo-btn:hover { background: var(--teal-d); transform: translateY(-1px); box-shadow: var(--shadow-m); }
.demo-btn.playing { background: var(--ink); }
.demo-btn.playing:hover { background: #000; }

.appbar-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em;
  color: var(--steel); background: var(--surface); border: 1px solid var(--line);
  padding: 7px 12px; border-radius: 999px; box-shadow: var(--shadow-s);
}
.appbar-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal-l); box-shadow: 0 0 0 3px var(--teal-wash); }

/* ---- stepper -------------------------------------------------------------- */
.stepper {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 14px; box-shadow: var(--shadow-s); margin-bottom: 26px;
  position: sticky; top: 12px; z-index: 30;
}
.step {
  display: inline-flex; align-items: center; gap: 9px; background: none; border: 0;
  padding: 7px 10px; border-radius: var(--r-s); transition: background .15s;
}
.step:not(:disabled):hover { background: var(--line-2); }
.step:disabled { cursor: default; opacity: .55; }
.step-num {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  background: var(--line-2); color: var(--muted); border: 1px solid var(--line);
  transition: all .2s;
}
.step-num svg { width: 14px; height: 14px; }
.step-label { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: color .2s; }
.step.active .step-num { background: var(--ink); color: #fff; border-color: var(--ink); }
.step.active .step-label { color: var(--ink); }
.step.done .step-num { background: var(--teal); color: #fff; border-color: var(--teal); }
.step.done .step-label { color: var(--steel); }
.step-line { flex: 1; height: 1px; background: var(--line); min-width: 6px; }

/* ---- screens & entrance --------------------------------------------------- */
.screen { display: block; }
.screen.in > * { animation: rise .55s cubic-bezier(.2,.7,.2,1) both; }
.screen.in > *:nth-child(1) { animation-delay: .02s; }
.screen.in > *:nth-child(2) { animation-delay: .08s; }
.screen.in > *:nth-child(3) { animation-delay: .14s; }
.screen.in > *:nth-child(4) { animation-delay: .20s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.screen-head { margin-bottom: 30px; max-width: 680px; }
.screen-head.compact { margin-bottom: 22px; }
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--teal-d); margin-bottom: 12px;
}
.screen-head h1 {
  font-family: var(--display); font-weight: 800; font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: -.01em; line-height: 1.05; color: var(--ink);
}
.lead { color: var(--muted); font-size: 15px; margin-top: 12px; max-width: 56ch; }

.block { margin-bottom: 30px; }
.block-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--steel); font-weight: 600; margin-bottom: 14px;
}
.tline { width: 22px; height: 2px; background: var(--teal); border-radius: 2px; }

/* ---- buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--r-s); padding: 12px 20px;
  font-size: 14px; font-weight: 600; transition: transform .12s, box-shadow .2s, background .2s, border-color .2s;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: #fff; box-shadow: var(--shadow-m); }
.btn.primary:hover { background: #000; box-shadow: var(--shadow-l); }
.btn.ghost { background: transparent; color: var(--steel); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface); border-color: var(--muted-2); }
.btn.outline { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.btn.outline:hover { background: var(--ink); color: #fff; }
.btn.block { width: 100%; }
.btn.sm { padding: 9px 14px; font-size: 13px; }
.btn.is-disabled { opacity: .4; pointer-events: none; }

.actions {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line);
}

/* ---- screen 1: project ---------------------------------------------------- */
.pick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.pick-card {
  text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 20px 18px; transition: all .18s; box-shadow: var(--shadow-s);
}
.pick-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); border-color: #d2d8de; }
.pick-card.sel { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-wash), var(--shadow-m); }
.pick-ico { color: var(--teal-d); margin-bottom: 14px; }
.pick-ico svg { width: 30px; height: 30px; }
.pick-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.pick-desc { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

.mount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mount-card {
  text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 20px; transition: all .18s; box-shadow: var(--shadow-s);
}
.mount-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); }
.mount-card.sel { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-wash), var(--shadow-m); }
.mount-top { display: flex; align-items: center; gap: 11px; margin-bottom: 8px; color: var(--teal-d); }
.mount-top svg { width: 26px; height: 26px; }
.mount-name { font-weight: 700; font-size: 16px; color: var(--ink); }
.mount-tag { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--teal-d); text-transform: uppercase; margin-bottom: 8px; }
.mount-desc { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* ---- two-column work layout ---------------------------------------------- */
.layout-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.design-col, .config-col { min-width: 0; }

/* ---- summary rail --------------------------------------------------------- */
.summary-rail {
  position: sticky; top: 84px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-m); overflow: hidden;
}
.sr-head {
  display: flex; align-items: center; gap: 9px; padding: 15px 18px;
  background: var(--ink); color: #fff;
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
}
.sr-head svg { width: 16px; height: 16px; color: var(--teal-l); }
#sr-body { padding: 16px 18px 18px; }
.sr-grp { border-bottom: 1px solid var(--line-2); padding-bottom: 12px; margin-bottom: 14px; }
.sr-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 4px 0; }
.sr-row span { color: var(--muted); }
.sr-row b { font-weight: 600; text-align: right; }
.sr-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 12px 6px; text-align: center; }
.stat-n { font-family: var(--mono); font-weight: 600; font-size: 16px; color: var(--ink); }
.stat-l { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); margin-top: 3px; }
.sr-price {
  display: flex; flex-direction: column; gap: 3px; background: var(--teal-wash);
  border: 1px solid #cfeae6; border-radius: var(--r-s); padding: 13px 14px;
}
.sr-price span { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--teal-d); }
.sr-price strong { font-family: var(--mono); font-size: 22px; font-weight: 600; color: var(--ink); }
.sr-price em { font-style: normal; font-size: 12px; color: var(--muted); }
.sr-note { font-size: 11px; color: var(--muted-2); margin-top: 10px; text-align: center; }

/* ---- screen 2: layout ----------------------------------------------------- */
.preset-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.preset-label { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); margin-right: 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 15px; font-size: 13px; font-weight: 600;
  color: var(--steel); transition: all .15s; box-shadow: var(--shadow-s);
}
.chip svg { width: 16px; height: 16px; color: var(--teal-d); }
.chip:hover { border-color: var(--teal); color: var(--ink); transform: translateY(-1px); }

.canvas-wrap {
  position: relative; height: 360px; background:
    linear-gradient(180deg, #fcfdfe, #f7f9fb);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-s);
}
#layoutCanvas { display: block; width: 100%; height: 100%; }
.canvas-tag {
  position: absolute; left: 14px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--muted-2);
  background: rgba(255,255,255,.85); padding: 4px 9px; border-radius: 6px; border: 1px solid var(--line-2);
}
.canvas-tag svg { width: 13px; height: 13px; }

.seg-editor { margin-top: 16px; display: flex; flex-direction: column; gap: 9px; }
.seg-row {
  display: flex; align-items: center; gap: 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 12px;
}
.seg-tag {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .08em;
  color: #fff; background: var(--ink-2); padding: 5px 9px; border-radius: 6px;
}
.seg-input { display: flex; flex-direction: column; gap: 2px; }
.seg-input > span { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.seg-input input {
  width: 96px; border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px;
  font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.seg-input input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-wash); }
.seg-input em { font-style: normal; font-family: var(--mono); font-size: 10.5px; color: var(--teal-d); }
.seg-input.ghosted { opacity: .8; }
.seg-start { font-family: var(--mono); font-size: 13px; color: var(--muted); padding: 7px 0; }
.seg-del { margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 7px; padding: 8px; color: var(--muted); transition: all .15s; display: grid; place-items: center; }
.seg-del svg { width: 16px; height: 16px; }
.seg-del:hover { color: var(--danger); border-color: var(--warn-line); background: var(--warn-bg); }
.seg-del-spacer { margin-left: auto; width: 34px; }
.add-seg { margin-top: 2px; background: var(--surface); border: 1px dashed var(--muted-2); color: var(--steel); justify-content: center; }
.add-seg:hover { border-color: var(--teal); border-style: solid; color: var(--teal-d); }

/* ---- screen 3: configure -------------------------------------------------- */
.seg-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.seg-btn {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s);
  padding: 12px 18px; font-weight: 600; font-size: 14px; color: var(--steel);
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 76px; transition: all .15s; box-shadow: var(--shadow-s);
}
.seg-btn em { font-style: normal; font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); }
.seg-btn:hover { border-color: var(--teal); transform: translateY(-1px); }
.seg-btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg-btn.on em { color: var(--teal-l); }
.opt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.opt-card {
  text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s);
  padding: 14px; display: flex; flex-direction: column; gap: 6px; transition: all .15s; box-shadow: var(--shadow-s);
}
.opt-card:hover { border-color: var(--teal); transform: translateY(-2px); }
.opt-card.on { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-wash); }
.opt-name { font-weight: 600; font-size: 13.5px; }
.opt-rate { font-family: var(--mono); font-size: 12px; color: var(--teal-d); }
.swatch-row { display: flex; gap: 12px; flex-wrap: wrap; }
.swatch {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s);
  padding: 10px 14px 10px 10px; display: flex; align-items: center; gap: 10px; transition: all .15s; box-shadow: var(--shadow-s);
}
.swatch:hover { border-color: var(--teal); transform: translateY(-1px); }
.swatch.on { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-wash); }
.swatch-chip { width: 26px; height: 26px; border-radius: 7px; border: 1px solid rgba(0,0,0,.12); box-shadow: inset 0 1px 2px rgba(255,255,255,.5); }
.swatch-name { font-weight: 600; font-size: 13.5px; }

/* ---- screen 4: BOM -------------------------------------------------------- */
.warns { margin-bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.warn {
  display: flex; align-items: center; gap: 10px; background: var(--warn-bg); border: 1px solid var(--warn-line);
  color: var(--danger); border-radius: var(--r-s); padding: 11px 14px; font-size: 13px; font-weight: 500;
}
.warn svg { width: 17px; height: 17px; flex: none; }

.solve-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 18px 14px; margin-bottom: 22px; box-shadow: var(--shadow-s); }
.solve-head { display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--teal-d); padding: 14px 0 12px; border-bottom: 1px solid var(--line-2); }
.solve-head svg { width: 16px; height: 16px; }
.solve-row { display: grid; grid-template-columns: 70px 64px 1fr auto; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.solve-row:last-child { border-bottom: 0; }
.solve-seg { font-family: var(--mono); font-size: 11px; font-weight: 600; color: #fff; background: var(--ink-2); padding: 4px 8px; border-radius: 5px; text-align: center; }
.solve-len { font-family: var(--mono); font-size: 13px; color: var(--steel); }
.solve-parts { font-family: var(--mono); font-size: 13px; color: var(--ink); font-weight: 500; }
.solve-gap { font-family: var(--mono); font-size: 11.5px; color: var(--muted-2); }

.bom-table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-s); }
.bom-table { width: 100%; border-collapse: collapse; }
.bom-table thead th {
  text-align: left; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted-2); font-weight: 600; padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.bom-table thead th:nth-child(3), .bom-table thead th:nth-child(5) { text-align: right; }
.bom-table thead th:nth-child(4) { text-align: center; }
.bom-table tr.grp td {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--steel);
  background: var(--surface-2); padding: 9px 16px; font-weight: 600; border-bottom: 1px solid var(--line-2);
}
.bom-table tr.grp td { display: table-cell; }
.bom-table tr.grp svg { width: 15px; height: 15px; color: var(--teal-d); margin-right: 7px; }
.bom-table tbody tr:not(.grp) { border-bottom: 1px solid var(--line-2); transition: background .15s; }
.bom-table tbody tr.edited { background: var(--teal-wash); }
.bom-table td { padding: 13px 16px; vertical-align: middle; }
.ci-title { font-weight: 600; font-size: 13.5px; }
.ci-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ci-sku { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.ci-unit, .ci-total { font-family: var(--mono); font-size: 13px; text-align: right; white-space: nowrap; }
.ci-total { font-weight: 600; }
.ci-qty { text-align: center; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.qty button { width: 28px; height: 30px; background: var(--surface-2); border: 0; font-size: 16px; color: var(--steel); transition: background .12s; }
.qty button:hover { background: var(--line-2); color: var(--ink); }
.qty input { width: 46px; height: 30px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font-family: var(--mono); font-size: 13px; font-weight: 500; }
.qty input:focus { outline: none; background: var(--teal-wash); }
.ci-x button { background: none; border: 0; color: var(--muted-2); padding: 6px; border-radius: 6px; transition: all .15s; }
.ci-x svg { width: 16px; height: 16px; }
.ci-x button:hover { color: var(--danger); background: var(--warn-bg); }

.bom-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-top: 18px; flex-wrap: wrap; }
.bom-foot-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.subtotal { margin-left: auto; text-align: right; display: flex; flex-direction: column; gap: 3px; }
.subtotal span { font-size: 12px; color: var(--muted); }
.subtotal strong { font-family: var(--mono); font-size: 26px; font-weight: 600; }
.subtotal strong em { font-style: normal; font-size: 13px; color: var(--muted); }
.subtotal small { font-size: 11px; color: var(--muted-2); }

/* ---- screen 5: preview ---------------------------------------------------- */
.preview-grid { display: grid; grid-template-columns: 1fr 280px; gap: 22px; align-items: start; }
.viewer-wrap { position: relative; height: 480px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-m); }
#viewer { width: 100%; height: 100%; }
.viewer-hint {
  position: absolute; left: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; color: var(--steel); background: rgba(255,255,255,.86);
  padding: 6px 11px; border-radius: 7px; border: 1px solid var(--line-2); backdrop-filter: blur(4px);
}
.viewer-hint svg { width: 14px; height: 14px; color: var(--teal-d); }
.viewer-fallback { height: 100%; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); text-align: center; padding: 30px; }
.viewer-fallback svg { width: 30px; height: 30px; color: var(--danger); }
.spec-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 16px; box-shadow: var(--shadow-s); margin-bottom: 14px; }
.spec-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.spec-row:last-child { border-bottom: 0; }
.spec-row span { color: var(--muted); }
.spec-row b { font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.ink-dot { width: 13px; height: 13px; border-radius: 4px; border: 1px solid rgba(0,0,0,.12); }
.legend { display: flex; gap: 18px; padding: 0 4px 12px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--steel); }
.lg { width: 16px; height: 16px; border-radius: 4px; }
.lg.glass { background: rgba(20,160,150,.32); border: 1px solid var(--teal); }
.lg.metal { border: 1px solid rgba(0,0,0,.15); }
.note { font-size: 12px; color: var(--muted-2); padding: 0 4px; line-height: 1.5; }

/* ---- screen 6: cart ------------------------------------------------------- */
.cart-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.cart-lines { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-s); }
.cart-lines-head { display: flex; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cart-line { display: grid; grid-template-columns: 1fr auto auto; gap: 18px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.cart-line:last-child { border-bottom: 0; }
.cl-name { font-weight: 600; font-size: 14px; }
.cl-sku { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.cl-qty { font-family: var(--mono); font-size: 13px; color: var(--steel); }
.cl-total { font-family: var(--mono); font-size: 14px; font-weight: 600; min-width: 72px; text-align: right; }
.cart-summary { position: sticky; top: 84px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow-m); }
.cs-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; font-size: 14px; }
.cs-row b { font-family: var(--mono); font-weight: 600; }
.cs-row.muted { color: var(--muted); } .cs-row.muted b { color: var(--muted); font-weight: 500; }
.cs-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0; margin: 8px 0 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cs-total span { font-weight: 600; font-size: 14px; }
.cs-total b { font-family: var(--mono); font-size: 22px; font-weight: 600; }
.cs-total em { font-style: normal; font-size: 12px; color: var(--muted); }
.cart-summary .btn { margin-top: 10px; }
.trust { display: flex; align-items: center; gap: 7px; justify-content: center; margin-top: 14px; font-size: 11.5px; color: var(--muted-2); }
.trust svg { width: 13px; height: 13px; }

/* ---- modal ---------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(12,17,22,.42); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 24px; z-index: 100; opacity: 0; transition: opacity .2s;
}
.modal-backdrop.show { opacity: 1; }
.modal {
  background: var(--surface); border-radius: 18px; padding: 32px; max-width: 480px; width: 100%;
  box-shadow: var(--shadow-l); text-align: center; transform: translateY(12px) scale(.98); transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.modal-backdrop.show .modal { transform: none; }
.modal-ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px; background: var(--teal-wash); color: var(--teal-d); }
.modal-ico.ok { background: var(--teal); color: #fff; }
.modal-ico svg { width: 28px; height: 28px; }
.modal h3 { font-family: var(--display); font-weight: 700; font-size: 21px; }
.modal-sub { color: var(--muted); font-size: 14px; margin: 10px 0 20px; }
.pay-list { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); padding: 6px 14px; text-align: left; margin-bottom: 20px; max-height: 180px; overflow: auto; }
.pay-head { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); padding: 10px 0 8px; border-bottom: 1px solid var(--line-2); }
.pay-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 7px 0; font-family: var(--mono); font-size: 12px; border-bottom: 1px solid var(--line-2); }
.pay-row:last-child { border-bottom: 0; }
.pay-id { color: var(--teal-d); }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-actions .btn { flex: 1; }
.modal-fineprint { font-size: 11px; color: var(--muted-2); margin-top: 16px; }
.qform { text-align: left; display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.qform label { display: flex; flex-direction: column; gap: 5px; }
.qform span { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.qform input, .qform textarea { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.qform textarea { min-height: 64px; resize: vertical; }
.qform input:focus, .qform textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-wash); }

/* ---- toast & footer ------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; translate: -50% 80px;
  background: var(--ink); color: #fff; padding: 13px 22px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-l); opacity: 0; transition: opacity .3s, translate .3s; z-index: 120; pointer-events: none;
}
.toast.show { opacity: 1; translate: -50% 0; }
.foot { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted-2); text-align: center; }

/* ---- responsive ----------------------------------------------------------- */
@media (max-width: 960px) {
  .layout-grid, .preview-grid, .cart-grid { grid-template-columns: 1fr; }
  .summary-rail, .cart-summary { position: static; }
  .pick-grid { grid-template-columns: repeat(2, 1fr); }
  .opt-grid { grid-template-columns: repeat(2, 1fr); }
  .mount-grid { grid-template-columns: 1fr; }
  .project-field { display: none; }
  .stepper { overflow-x: auto; }
  .step-label { display: none; }
  .step-line { min-width: 10px; }
}
@media (max-width: 560px) {
  #app { padding: 0 14px 48px; }
  .pick-grid { grid-template-columns: 1fr; }
  .solve-row { grid-template-columns: 60px 1fr; row-gap: 4px; }
  .solve-gap { grid-column: 2; }
  .bom-table .ci-sku { display: none; }
}
