/* Quick Quoter v2 — one stylesheet, Alta mineral light.
   Phone/tablet (<1100px) is the served mobile layout; desktop (>=1100px) rearranges the same
   components into rail | content | BOM. Craft passes informed by unslop (Damir Sokolovsky, CC BY 4.0). */

@font-face { font-family: Figtree; font-style: normal; font-weight: 400 800; font-display: swap; src: url("fonts/figtree-latin.woff2") format("woff2"); }
@font-face { font-family: Archivo; font-style: normal; font-weight: 500 800; font-display: swap; src: url("fonts/archivo-latin.woff2") format("woff2"); }

:root {
  color-scheme: light;
  /* neutrals */
  --bg: #eef2f5; --surface: #fff; --surface-2: #f6f8fa; --sunken: #e7edf1;
  --ink: #16354a; --ink-2: #3d5664; --muted: #566a75; --faint: #8796a0; /* faint = decorative separators only */
  --line: rgba(22, 53, 74, .12); --line-2: rgba(22, 53, 74, .2);
  /* accent (Alta blue; On-Prem swaps to teal) */
  --blue: #006ed7; --blue-ink: #0059ae; --blue-tint: #e6f0fb;
  --teal: #0b7480; --teal-ink: #075f69; --teal-tint: #e0f1f2;
  --accent: var(--blue); --accent-ink: var(--blue-ink); --accent-tint: var(--blue-tint);
  --warn-ink: #8a4b06; --warn-bg: #fdf3dc;
  /* shape */
  --r-1: 6px; --r-2: 10px; --r-3: 14px;
  --shadow: 0 1px 2px rgba(22, 53, 74, .06), 0 1px 0 rgba(22, 53, 74, .03);
  --lift: 0 8px 24px -12px rgba(22, 53, 74, .28);
  /* type */
  --sans: Figtree, "Segoe UI", system-ui, sans-serif;
  --display: Archivo, Figtree, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --header-h: 56px;
  --bar-space: 88px;
}
body[data-scope="onprem"] { --accent: var(--teal); --accent-ink: var(--teal-ink); --accent-tint: var(--teal-tint); }
body[data-scope="pelco"] { --accent: #3d5664; --accent-ink: #26404d; --accent-tint: #e7edf1; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 400 15px/1.45 var(--sans); min-height: 100dvh; padding-bottom: var(--bar-space); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -.01em; }
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.tnum, .from, .price, .line-total, .rprice, .pp, .mprice, .ap, .bom-total, .totals { font-variant-numeric: tabular-nums; }

/* ---------- Header ---------- */
.top { position: sticky; top: 0; z-index: 10; height: var(--header-h); display: flex; align-items: center; gap: 6px; padding: 0 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px) saturate(1.2); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font: 600 16px/1 var(--display); padding: 6px 4px; }
.brand img { width: 24px; height: 24px; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 15px; color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.crumbs a { text-decoration: none; color: var(--ink-2); }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { color: var(--faint); }
.crumbs:not(:empty)::before { content: ""; width: 1px; height: 18px; background: var(--line-2); margin: 0 6px 0 2px; }
.back, .icon-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; background: transparent; border-radius: var(--r-2); cursor: pointer; color: var(--ink); }
.back:hover, .icon-btn:hover { background: var(--sunken); }
.back svg, .icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 1099px) {
  body:has(.crumbs:not(:empty)) .brand-name { display: none; }
}

/* ---------- Layout ---------- */
.shell { display: block; }
.rail, .bom-panel { display: none; }
main { max-width: 600px; margin: 0 auto; padding: 16px 14px 12px; outline: none; }
.screen-title { font-size: 22px; line-height: 1.2; margin: 4px 2px 14px; }

/* ---------- Generic card ---------- */
.card { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink); cursor: pointer; overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease; }
.card:hover { border-color: var(--line-2); box-shadow: var(--lift); }
.card:active { transform: scale(.985); }
.card .label { font-size: 16px; font-weight: 600; line-height: 1.2; }
.card .meta { font-size: 13px; color: var(--muted); }

/* Home */
.platforms { display: grid; grid-template-rows: 1fr 1fr auto auto; gap: 12px; min-height: calc(100dvh - var(--header-h) - var(--bar-space) - 36px); }
.platform { min-height: 180px; padding: 20px; justify-content: space-between; }
.platform .glyph { width: 40px; height: 40px; color: var(--blue); }
.platform.onprem .glyph { color: var(--teal); }
.platform .glyph svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.platform .label { font: 600 28px/1.1 var(--display); margin-top: auto; }
.platform .meta { font-size: 14px; margin-top: 4px; }
.platform::after { content: ""; position: absolute; left: 0; top: 20px; bottom: 20px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue); opacity: 0; transition: opacity .15s; }
.platform.onprem::after { background: var(--teal); }
.platform:hover::after { opacity: 1; }
.slim { flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; min-height: 56px; padding: 12px 16px; border-radius: var(--r-2); }
.slim svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.slim .label { font-size: 15px; font-weight: 500; }
.slim .meta { margin-left: auto; }

/* Camera types */
.types { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type { aspect-ratio: 1 / 1; padding: 12px 14px; }
.type img { position: absolute; inset: 12px 12px 44px; width: calc(100% - 24px); height: calc(100% - 56px); object-fit: contain; mix-blend-mode: multiply; }
.type .count { position: absolute; top: 10px; right: 12px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.type .label { position: relative; }
.type.wide { grid-column: 1 / -1; aspect-ratio: auto; min-height: 84px; flex-direction: row; align-items: center; gap: 14px; padding: 12px 16px; }
.type.wide img { position: static; width: 88px; height: 56px; }
.type.wide > svg { width: 32px; height: 32px; fill: none; stroke: var(--accent); stroke-width: 1.6; }
.type.wide .count { position: static; order: 3; margin-left: auto; }
.type.wide .label { order: 2; }
.type[aria-disabled="true"] { opacity: .5; cursor: default; }

/* Search */
.search { margin-top: 14px; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); box-shadow: var(--shadow); }
.search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; }
.search input::placeholder { color: var(--muted); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }

/* Plain product rows (search, servers) */
.chips { display: flex; gap: 6px; overflow-x: auto; margin: 0 -14px 4px; padding: 2px 14px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip-row-label { font-size: 13px; font-weight: 500; color: var(--muted); margin: 6px 2px; }
.chip { flex: none; min-height: 38px; padding: 0 14px; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-2); font-size: 14px; font-weight: 500; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.products { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.product { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 12px 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); }
.product .name { font-weight: 600; }
.product .desc { grid-column: 1; font-size: 13px; color: var(--muted); }
.product .sku { font: 12px/1.3 var(--mono); color: var(--muted); }
.product .price { font-weight: 600; }
.product .side { grid-row: 1 / span 3; grid-column: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.add { min-width: 56px; height: 40px; padding: 0 14px; border: 0; border-radius: var(--r-2); background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
.add.in { background: var(--accent-tint); color: var(--accent-ink); }
.empty, .status { text-align: center; color: var(--muted); padding: 32px 10px; }

/* ---------- Refine bar ---------- */
.refine { position: sticky; top: var(--header-h); z-index: 5; display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  margin: -4px -14px 12px; padding: 8px 14px; background: var(--bg); border-bottom: 1px solid var(--line); }
.refine::-webkit-scrollbar { display: none; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--sunken); border-radius: var(--r-2); flex-wrap: nowrap; }
.seg button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(22, 53, 74, .14); }
.seg button.na { color: var(--muted); font-weight: 400; }
.seg button.na[aria-pressed="false"] { text-decoration: line-through; text-decoration-color: var(--line-2); }
.seg.wrap { flex-wrap: wrap; }
.refine .seg button { padding: 0 10px; }
.pick { position: relative; display: inline-flex; flex: none; }
.pick select { appearance: none; -webkit-appearance: none; min-height: 42px; padding: 0 30px 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-2); cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235a6e79' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 11px center / 10px;
  font-size: 14px; font-weight: 500; color: var(--ink); }
.pick.on select { border-color: var(--accent); color: var(--accent-ink); background-color: var(--accent-tint); }
.chip-btn { flex: none; min-height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.chip-btn.on { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-tint); }

/* ---------- Series cards ---------- */
.series-list { display: grid; gap: 8px; }
.series-card { scroll-margin-top: calc(var(--header-h) + 72px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow); overflow: clip; transition: border-color .15s, box-shadow .15s; }
.series-card:hover { border-color: var(--line-2); }
.series-card.open { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: var(--lift); }
.series-head { width: 100%; display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; padding: 10px 14px 10px 10px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.series-head img, .series-head .noimg { width: 72px; height: 72px; object-fit: contain; border-radius: var(--r-2); background: var(--surface-2); mix-blend-mode: multiply; }
.series-head .noimg { display: grid; place-items: center; font: 600 13px var(--mono); color: var(--muted); mix-blend-mode: normal; }
.series-main { display: grid; gap: 4px; min-width: 0; }
.series-title { font-size: 17px; font-weight: 600; line-height: 1.2; }
.facts { display: flex; flex-wrap: wrap; column-gap: 0; row-gap: 2px; font-size: 13px; color: var(--ink-2); }
.fact:not(:last-child)::after { content: "·"; margin: 0 6px; color: var(--faint); } /* trailing dot: a wrapped line never starts with one */
.fact.key { color: var(--accent-ink); font-weight: 600; }
.series-side { display: flex; gap: 8px; align-items: baseline; margin-top: 2px; }
.from { font-weight: 600; font-size: 14px; white-space: nowrap; }
.variants { font-size: 13px; color: var(--muted); white-space: nowrap; }
.smaller { margin-top: 4px; }
.smaller summary { cursor: pointer; color: var(--ink-2); font-weight: 500; font-size: 14px; padding: 10px 2px; }
.smaller .series-card { margin-top: 8px; }

/* ---------- Configurator ---------- */
.config { border-top: 1px solid var(--line); padding: 14px; display: grid; gap: 14px; background: var(--surface); }
.cfg-grid { display: grid; gap: 14px; }
.cfg-opts { display: grid; gap: 12px; align-content: start; }
.opt-row { display: grid; gap: 6px; }
.opt-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.opt-row .seg { flex-wrap: wrap; justify-self: start; }
.mount { display: grid; gap: 8px; align-content: start; }
.mtiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mtile { position: relative; display: grid; grid-template-rows: 88px auto auto; justify-items: center; gap: 2px; padding: 8px 8px 10px;
  border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface); cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.mtile:hover { border-color: var(--ink-2); }
.mtile:active { transform: scale(.98); }
.mtile img { width: 100%; height: 88px; object-fit: contain; }
.mtile .mglyph { width: 72px; height: 88px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mtile .mlabel { font-weight: 600; font-size: 14px; }
.mtile .mprice { font-size: 13px; color: var(--muted); }
.mtile.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mtile.on .mglyph { stroke: var(--accent); }
.mtile.on::after { content: ""; position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.linkish { justify-self: start; border: 0; background: none; color: var(--ink-2); font-size: 14px; padding: 4px 2px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.linkish.on { color: var(--accent-ink); text-decoration: none; font-weight: 600; }
.mdetail { display: grid; gap: 10px; }
.parts { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; }
.part { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 14px; }
.part:first-child { border-top: 0; }
.part .pl { display: block; font-weight: 500; }
.part .ps { display: block; font: 12px/1.4 var(--mono); color: var(--muted); }
.part .pp { font-weight: 600; white-space: nowrap; }
.part.missing .pp { color: var(--warn-ink); font-size: 13px; font-weight: 500; }
.part.choice .seg { margin: 6px 0 4px; }
.seg.mini button { min-height: 32px; font-size: 13px; padding: 0 12px; }
.pill { font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: var(--r-1); white-space: nowrap; margin-top: 1px; }
.pill.order { background: var(--accent-tint); color: var(--accent-ink); }
.pill.incl { background: var(--sunken); color: var(--ink-2); }
.addons { display: grid; gap: 6px; }
.addon-row { display: flex; flex-wrap: wrap; gap: 6px; }
.addon { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 12px; border: 1px dashed var(--line-2); border-radius: var(--r-2); background: var(--surface); text-align: left; cursor: pointer; }
.addon:hover { border-color: var(--ink-2); }
.addon .al { font-weight: 500; font-size: 14px; }
.addon .ap { font-size: 12px; color: var(--muted); }
.addon[aria-pressed="true"] { border-style: solid; border-color: var(--accent); background: var(--accent-tint); }
.addon[aria-pressed="true"] .al { color: var(--accent-ink); font-weight: 600; }
.addon:disabled { opacity: .55; cursor: not-allowed; }
.msrc { font-size: 13px; color: var(--muted); }
.msrc a { color: var(--blue-ink); font-weight: 500; }
.mount-none { margin: 0; font-size: 14px; color: var(--muted); }
.specs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.specs li { font-size: 13px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-1); padding: 4px 8px; }
.warn { margin: 0; font-size: 14px; color: var(--warn-ink); background: var(--warn-bg); border-radius: var(--r-2); padding: 9px 12px; }
.resolved { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding-top: 12px; border-top: 1px solid var(--line); }
.rsku { font: 500 13px var(--mono); }
.rname { font-size: 13px; color: var(--muted); }
.inbom { font-size: 13px; font-weight: 600; color: var(--accent-ink); margin-top: 2px; }
.rprice { font-weight: 600; text-align: right; }
.rprice span { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
/* The add bar sticks above the BOM bar while a long configurator scrolls past. */
.cta { position: sticky; bottom: calc(var(--bar-space) - 8px); z-index: 2; display: flex; gap: 10px; align-items: center;
  margin: 0 -14px -14px; padding: 10px 14px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.cta .btn.addcfg { height: 48px; font-size: 16px; flex: 1; background: var(--accent); border-color: var(--accent); }

/* ---------- Qty + buttons ---------- */
.qty { display: flex; align-items: center; gap: 4px; }
.qty button { width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface); font-size: 18px; line-height: 1; cursor: pointer; }
.qty button:hover { background: var(--sunken); }
.qty output { min-width: 30px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.btn { flex: 1; height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface); font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--surface-2); }
.btn.primary { flex: 1.6; background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- BOM: phone bar + sheet ---------- */
.bombar { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 8;
  width: min(572px, calc(100% - 28px)); height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 18px;
  border: 0; border-radius: var(--r-3); background: var(--ink); color: #fff; cursor: pointer; box-shadow: 0 10px 28px -12px rgba(22, 53, 74, .7); }
.bom-count { min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.bom-label { font-weight: 500; }
.bom-total { margin-left: auto; font-weight: 600; }
.bombar.bump { animation: bump .22s ease-out; }
@keyframes bump { 50% { transform: translateX(-50%) scale(1.03); } }
.sheet { width: min(600px, 100%); max-height: 86dvh; margin: auto auto 0; padding: 0; border: 0; border-radius: 18px 18px 0 0; background: var(--surface); color: var(--ink); display: none; flex-direction: column; }
.sheet[open] { display: flex; }
.sheet::backdrop { background: rgba(22, 53, 74, .4); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 10px 20px; border-bottom: 1px solid var(--line); }
.sheet-head h2, .bp-head h2 { font-size: 18px; }
.bom-lines { list-style: none; margin: 0; padding: 0 16px; overflow: auto; flex: 1; }
.bom-lines li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.bom-lines .name { font-size: 14px; line-height: 1.35; }
.bom-lines .sku { font: 12px var(--mono); color: var(--muted); margin-top: 2px; }
.bom-lines .each { font-size: 13px; color: var(--muted); }
.bom-lines .line-total { font-weight: 600; text-align: right; align-self: start; }
.bom-lines .bl-main { min-width: 0; }
.bom-lines .bom-empty { display: grid; gap: 2px; justify-items: center; border: 0; padding: 32px 0; color: var(--muted); grid-template-columns: 1fr; }
.bom-lines .bom-empty span:first-child { color: var(--ink-2); font-weight: 500; }
.sheet-foot, .bp-foot { display: grid; gap: 12px; padding: 14px 20px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.totals { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; color: var(--ink-2); }
.totals span:last-child { font-size: 20px; font-weight: 600; color: var(--ink); }
.sheet-actions { display: flex; gap: 8px; }
.sheet-actions .btn { white-space: nowrap; }
.sheet-actions .btn.ghost { flex: 0 1 auto; min-width: 72px; }
.sheet-actions .btn.primary { flex: 1 1 auto; }
.toast { position: fixed; left: 50%; bottom: 84px; z-index: 9; transform: translate(-50%, 8px); white-space: nowrap; padding: 8px 14px; border-radius: var(--r-2);
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
  .mtiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  main { max-width: 760px; }
  .types { grid-template-columns: repeat(3, 1fr); }
  .platforms { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; min-height: 0; }
  .platform { min-height: 260px; }
  .slim { grid-column: 2; }
}

/* ---------- Desktop: rail | content | BOM ---------- */
@media (min-width: 1100px) {
  :root { --bar-space: 0px; }
  body { padding-bottom: 0; }
  .top { padding: 0 24px; }
  .back { display: none !important; }
  .bombar, .sheet { display: none !important; }
  .toast { bottom: 24px; }
  .shell { display: grid; grid-template-columns: 230px minmax(0, 1fr) 400px; gap: 28px; max-width: 1760px; margin: 0 auto; padding: 0 24px; align-items: start; }
  main { max-width: none; margin: 0; padding: 20px 0 48px; }
  .screen-title { font-size: 26px; margin: 4px 0 18px; }

  .rail { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--header-h) + 20px); max-height: calc(100dvh - var(--header-h) - 40px); overflow: auto; padding: 20px 0; }
  .rail-platform { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; background: var(--sunken); border-radius: var(--r-2); margin-bottom: 18px; }
  .rail-platform a { text-align: center; padding: 8px 0; border-radius: 7px; text-decoration: none; font-weight: 500; color: var(--ink-2); font-size: 14px; }
  .rail-platform a:hover { color: var(--ink); }
  .rail-platform a.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(22, 53, 74, .14); }
  .rail-title { font-size: 13px; font-weight: 500; color: var(--muted); padding: 0 10px 6px; }
  .rail-link { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: var(--r-1); text-decoration: none; color: var(--ink-2); font-size: 15px; }
  .rail-link:hover { background: var(--sunken); color: var(--ink); }
  .rail-link.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
  .rail-n { font-size: 13px; color: var(--muted); font-weight: 400; }
  .rail-search { margin-top: 18px; }
  .rail-search .search { margin: 0; height: 40px; box-shadow: none; }
  .rail-search .search input { font-size: 14px; }

  .bom-panel { display: flex; flex-direction: column; position: sticky; top: calc(var(--header-h) + 20px); max-height: calc(100dvh - var(--header-h) - 40px);
    margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow); overflow: hidden; }
  .bp-head { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
  .bp-count { font-size: 13px; color: var(--muted); }
  .bom-panel .bom-lines { padding: 0 20px; }
  .bom-panel .qty button { width: 32px; height: 32px; font-size: 16px; }
  .bp-foot { padding: 14px 20px 18px; }
  .bom-panel .sheet-actions .btn { height: 40px; font-size: 14px; padding: 0 10px; }

  .refine { top: var(--header-h); margin: -20px 0 16px; padding: 12px 0; }
  .platforms { grid-template-columns: 1fr 1fr; min-height: 0; max-width: 820px; }
  .platform { min-height: 300px; padding: 28px; }
  .platform .label { font-size: 34px; }
  .types { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .search:not(.rail-search .search) { max-width: 560px; }
  main > section > .search { display: none; }
  .platforms .slim { grid-column: auto; }

  .series-list { gap: 10px; }
  .series-head { grid-template-columns: 88px 1fr; padding: 12px 18px 12px 12px; }
  .series-head img, .series-head .noimg { width: 88px; height: 88px; }
  .config { padding: 18px 20px 20px; }
  .cfg-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 28px; }
  .cta { position: static; margin: 0; padding: 4px 0 0; background: none; backdrop-filter: none; border: 0; justify-content: flex-end; }
  .cta .btn.addcfg { flex: 0 1 280px; }
  .mtiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1600px) {
  .mtiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cfg-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ===================== v20: unified quoter additions ===================== */
.top .region { margin-left: auto; }
.top .region select { min-height: 36px; font-size: 14px; }
.kbd { font: 500 12px/1 var(--mono); color: var(--muted); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 3px 6px; }
@media (hover: none) { .kbd { display: none; } }
.sec-title { font-size: 15px; font-weight: 600; color: var(--ink-2); margin: 22px 2px 10px; font-family: var(--sans); }
.booksline { margin: -8px 2px 12px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.booksline .sep { color: var(--faint); }
.flag { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: var(--r-1); background: var(--sunken); color: var(--ink-2); vertical-align: 2px; white-space: nowrap; }
.flag.warnflag { background: var(--warn-bg); color: var(--warn-ink); }
.cats { display: grid; grid-template-columns: 1fr; gap: 8px; }
.cats .slim { min-height: 52px; }
.cats .slim svg { stroke: var(--accent); }
.platforms .pelco svg { stroke: var(--ink-2); }
.series-head .noimg svg { width: 36px; height: 36px; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* product list: bar + rows */
.plist-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 8px; }
.pfilter { flex: 1 1 200px; min-height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface); font-size: 15px; }
.pcount { margin-left: auto; font-size: 13px; color: var(--muted); }
.phead { display: none; }
.product { grid-template-columns: 1fr auto; }
.product .pmain { grid-column: 1; min-width: 0; }
.product .sku { grid-column: 1; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.product .ds { font: 500 12px var(--sans); color: var(--blue-ink); }
.product .price { grid-column: 2; grid-row: 1; text-align: right; }
.product .qin { display: none; }
.product .add { grid-column: 2; grid-row: 2 / span 2; align-self: end; }
.more { display: flex; justify-content: center; margin: 14px 0 4px; }
.more .btn { flex: 0 1 auto; }

/* BOM: quick add, groups, kits, controls */
.qadd { padding: 10px 16px 0; display: grid; gap: 6px; }
.qadd textarea { width: 100%; resize: none; min-height: 40px; max-height: 120px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface-2); font: 14px/1.4 var(--sans); }
.qadd textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.qa-status { margin: 0; font-size: 13px; color: var(--ink-2); }
.qa-status.ok { color: var(--teal-ink); }
.qa-status.err { color: var(--warn-ink); }
.qa-status a { color: var(--blue-ink); font-weight: 600; }
.bom-lines li.bgroup { display: flex; justify-content: space-between; padding: 12px 0 6px; border-bottom: 1px solid var(--line-2); font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.bom-lines li.bwarn { display: block; margin: 10px 0 0; padding: 8px 10px; border: 0; border-radius: var(--r-2); background: var(--warn-bg); color: var(--warn-ink); font-size: 13px; }
.bl-ctl { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.bom-lines .qty button { width: 34px; height: 34px; font-size: 16px; }
.bqty { width: 54px; height: 34px; text-align: center; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface); font-weight: 600; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.bqty::-webkit-inner-spin-button, .qin::-webkit-inner-spin-button { -webkit-appearance: none; }
.rm { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: var(--r-2); background: transparent; color: var(--muted); cursor: pointer; }
.rm:hover { background: var(--warn-bg); color: var(--warn-ink); }
.rm svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.bom-lines li.kit .name { font-weight: 600; }
.kit-parts { grid-column: 1 / -1; list-style: none; margin: 6px 0 0; padding: 6px 0 0 10px; border-left: 2px solid var(--accent-tint); display: grid; gap: 3px; }
.kit-parts li { display: grid !important; grid-template-columns: 40px 1fr auto; gap: 6px; padding: 0 !important; border: 0 !important; font-size: 12.5px; color: var(--ink-2); }
.kit-parts .kp-q { color: var(--muted); }
.kit-parts .kp-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kit-parts .sku { display: inline; }
.totals { display: grid; gap: 2px; }
.totals-row { display: flex; justify-content: space-between; align-items: baseline; }
.totals-row span:last-child { font-size: 20px; font-weight: 600; color: var(--ink); }
.totals .disclaimer { font-size: 12px; color: var(--muted); }
.sheet-head .clear { margin-left: auto; margin-right: 4px; }
.bp-head .clear { margin-left: 10px; font-size: 13px; }
.bp-head { align-items: center; }
.bp-head .bp-count { margin-left: auto; }
.export-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.export-row .opt-label { margin-right: 2px; }
.btn.sm { flex: 0 1 auto; height: 34px; padding: 0 10px; font-size: 13px; font-weight: 500; }
.toast.act { pointer-events: auto; display: flex; gap: 12px; align-items: center; }
.toast-undo { border: 0; background: transparent; color: #9fd0ff; font-weight: 700; cursor: pointer; padding: 2px 4px; }

/* paste preview */
.pdlg { width: min(860px, calc(100% - 24px)); max-height: 86dvh; padding: 0; border: 0; border-radius: var(--r-3); background: var(--surface); color: var(--ink); display: none; flex-direction: column; }
.pdlg[open] { display: flex; }
.pdlg::backdrop { background: rgba(22, 53, 74, .4); }
.pd-body { overflow: auto; padding: 12px 20px; display: grid; gap: 10px; }
.ptable { width: 100%; border-collapse: collapse; font-size: 14px; }
.ptable th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
.ptable td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ptable .mono { font: 12.5px var(--mono); }
.ptable .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ptable .note { font: 11px var(--sans); color: var(--muted); }
.ptable tr.unknown td { color: var(--warn-ink); background: var(--warn-bg); }
.pd-sum { margin: 0; font-weight: 600; }

@media (min-width: 640px) {
  .cats { grid-template-columns: repeat(2, 1fr); }
  .platforms { grid-template-rows: 1fr auto auto; }
  .platforms .slim { grid-column: auto; }
}

/* Desktop: dense table rows (In-Dev density) beside the persistent BOM (Production's always-visible total). */
@media (min-width: 1100px) {
  .cats { grid-template-columns: repeat(3, 1fr); }
  .platforms { grid-template-rows: auto auto; }
  .phead { display: grid; grid-template-columns: minmax(0, 1fr) 210px 110px 64px 76px; gap: 12px; padding: 0 14px 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
  .phead span:nth-child(3) { text-align: right; }
  .products { gap: 0; margin-top: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; }
  .product { grid-template-columns: minmax(0, 1fr) 210px 110px 64px 76px; gap: 12px; align-items: center; padding: 8px 14px; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
  .product:first-child { border-top: 0; }
  .product:hover { background: var(--surface-2); }
  .product .pmain, .product .sku, .product .price, .product .qin, .product .add { grid-row: 1; grid-column: auto; }
  .product .name { font-size: 14px; }
  .product .desc { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .product .sku { font-size: 12px; flex-direction: column; gap: 0; }
  .product .price { text-align: right; }
  .product .qin { display: block; width: 64px; height: 36px; text-align: center; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface); font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
  .product .add { align-self: center; height: 36px; min-width: 76px; }
  .products .empty { border: 0; }
  .bom-panel .bom-lines li { grid-template-columns: 1fr auto; }
  .bl-ctl { margin-top: 4px; }
  .qadd { padding: 12px 20px 0; }
  .bom-panel .qadd textarea { font-size: 13.5px; }
  .bp-foot .btn.primary { height: 42px; }
}
@media (min-width: 1600px) { .cats { grid-template-columns: repeat(4, 1fr); } }

/* v20 fixes */
.cats .slim, .platforms .slim { grid-column: auto; }
.bom-lines .kit-parts li { display: grid !important; grid-template-columns: 34px minmax(0, 1fr) auto !important; gap: 6px; padding: 0 !important; border: 0 !important; align-items: baseline; }
.kit-parts .kp-n .sku { margin-right: 4px; }
@media (min-width: 1100px) {
  .rail .rail-title { margin-top: 16px; }
  .rail-search { margin-top: 0; margin-bottom: 4px; }
}
/* review fixes */
.kit-parts li.kp-missing { color: var(--warn-ink); }
.kit-parts li.kp-missing .kp-p { font-size: 12px; font-weight: 600; }
/* Discontinued (retired) parts and lines: visible, struck from pricing, never exported. */
.kit-parts li.kp-retired { color: var(--warn-ink); }
.kit-parts li.kp-retired .kp-d { text-decoration: line-through; }
.kit-parts li.kp-retired .kp-p { font-size: 12px; font-weight: 600; }
.bom-lines li.retired .name { color: var(--warn-ink); }
.bom-lines li.retired .name .flag { margin-left: 6px; }
.bom-lines li.retired .line-total { color: var(--warn-ink); }
.ptable-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ptable .warnnote { color: var(--warn-ink); font-weight: 600; }
@media (max-width: 1099px) {
  .bom-lines .qty button, .rm, .bqty { width: 40px; height: 40px; }
  .bqty { width: 58px; }
  .sheet-head .clear { min-height: 40px; padding: 0 10px; }
  .ptable { font-size: 13px; }
  .ptable th:nth-child(3), .ptable td:nth-child(3) { display: none; }
}

/* ===================== v22: review fixes ===================== */
main:focus-visible { outline: none; } /* programmatic focus after navigation is for screen readers, not a visible box */
.region { align-items: center; gap: 8px; }
.region-l { font-size: 13px; color: var(--muted); }
@media (max-width: 479px) { .region-l { display: none; } }

/* Filter bar: one scrolling row on phones instead of wrapping to two */
@media (max-width: 639px) {
  .refine { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .refine > * { flex: none; }
}
.clearf { border-style: dashed; color: var(--ink-2); }

/* Configurator */
.opt-hint { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.camonly { justify-self: start; min-height: 40px; }
.cqty { width: 64px; height: 40px; }
.cta .qty button { flex: none; }
.mtile .mprice { font-variant-numeric: tabular-nums; }
.mtile.on .mprice { color: var(--accent-ink); font-weight: 600; }

/* Quick add suggestions */
.qa-sug { list-style: none; margin: 0; padding: 4px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface); box-shadow: var(--lift); display: grid; gap: 1px; }
.qa-sug li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; padding: 7px 8px; border-radius: var(--r-1); cursor: pointer; }
.qa-sug li:hover, .qa-sug li[aria-selected="true"] { background: var(--accent-tint); }
.qa-sug .qs-sku { font: 500 12.5px/1.4 var(--mono); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa-sug .qs-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.qa-sug .qs-name { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa-sug .qs-more { display: block; cursor: default; font-size: 12px; color: var(--muted); }
.qa-sug .qs-more:hover { background: none; }

/* BOM */
.bom-lines li.bom-empty, .bom-panel .bom-lines li.bom-empty { grid-template-columns: 1fr; text-align: center; }
.bom-lines .kit-parts li { align-items: start; }
.kit-parts .kp-n { white-space: normal; overflow: visible; display: grid; gap: 0; }
.kit-parts .kp-n .sku { display: block; margin: 0; overflow-wrap: anywhere; }
.kit-parts .kp-d { color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.sheet-foot .btn.primary { flex: none; }

/* Toast sits under the header so it never covers the Add row or the BOM actions */
.toast { top: calc(var(--header-h) + 10px); bottom: auto; transform: translate(-50%, -8px); max-width: min(560px, calc(100vw - 24px)); white-space: normal; text-align: center; box-shadow: var(--lift); }
.toast.show { transform: translate(-50%, 0); }
.toast.act { text-align: left; }

/* Product rows keep name, description and SKU readable at any width */
.product .name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.product .desc:empty { display: none; }

@media (max-width: 1099px) {
  /* 44px tap targets in the configurator and BOM sheet */
  .opt-row .seg button { min-height: 44px; padding: 0 14px; }
  .seg.mini button { min-height: 40px; }
  .refine .seg button { min-height: 40px; }
  .camonly { min-height: 44px; }
  .cqty { height: 44px; }
  .cta .qty button { width: 44px; height: 44px; }
  .sheet-foot .btn.sm { height: 44px; padding: 0 12px; }
  .sheet-foot .export-row .opt-label { display: none; }
  .sheet-foot .export-row .btn { flex: 1 1 auto; }
  .series-card { scroll-margin-bottom: var(--bar-space); }
}

@media (min-width: 1100px) {
  .toast { bottom: auto; }
  /* Add row stays reachable while a long mount list scrolls */
  .cta { position: sticky; bottom: 0; z-index: 2; margin: 0 -20px -20px; padding: 12px 20px; background: var(--surface); border-top: 1px solid var(--line); justify-content: flex-end; }
  .platform { min-height: 220px; }
  .rail { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; padding-right: 6px; }
  /* Dense rows: Product (name / description / SKU) | MSRP | Qty | Add */
  .phead, .product { grid-template-columns: minmax(0, 1fr) 104px 64px 76px; }
  .phead span:nth-child(3) { text-align: left; }
  .phead span:nth-child(2) { text-align: right; }
  .product { row-gap: 1px; padding: 9px 14px; }
  .product .pmain { grid-column: 1; grid-row: 1; }
  .product .sku { grid-column: 1; grid-row: 2; flex-direction: row; gap: 10px; }
  .product .price, .product .qin, .product .add { grid-row: 1 / span 2; }
  .product .price { grid-column: 2; }
  .product .qin { grid-column: 3; }
  .product .add { grid-column: 4; }
}
@media (min-width: 1100px) and (max-width: 1499px) {
  .shell { grid-template-columns: 216px minmax(0, 1fr) 360px; gap: 24px; }
}
.top { background: color-mix(in srgb, var(--bg) 96%, transparent); } /* content scrolling underneath should not read through */

/* ===================== v23: TCO-family theme ===================== */
/* Navy chrome and anchor panels over a cool neutral workspace (as in the TCO tool), with the
   Avigilon mark's blue > teal > green used once, as the rule under the header. */
:root {
  --bg: #f5f6f8; --surface: #fff; --surface-2: #f3f6fa; --sunken: #e9eff6;
  --ink: #132033; --ink-2: #34465c; --muted: #586779; --faint: #8b97a6;
  --line: rgba(19, 32, 51, .11); --line-2: #cbd8e6;
  --navy: #0c1a31; --navy-2: #142948; --on-navy: #eaf1fb; --on-navy-2: #b8c8df;
  --brand-rule: linear-gradient(90deg, #006ed7 0%, #0097a9 55%, #8bc53f 100%);
  --r-2: 11px; --r-3: 16px;
  --shadow: 0 1px 2px rgba(20, 40, 80, .05);
  --lift: 0 10px 28px -14px rgba(15, 33, 59, .38);
  --header-h: 60px;
}

/* Header */
.top { background: var(--navy); color: var(--on-navy); border-bottom: 0; backdrop-filter: none; }
.top::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 3px; background: var(--brand-rule); }
.top :focus-visible { outline-color: #8fc3ff; }
.brand { color: #fff; gap: 10px; }
.brand img { width: 30px; height: 29px; object-fit: contain; }
.crumbs, .crumbs a { color: var(--on-navy-2); }
.crumbs a:hover, .crumbs [aria-current] { color: #fff; }
.crumbs .sep { color: rgba(255, 255, 255, .35); }
.crumbs:not(:empty)::before { background: rgba(255, 255, 255, .22); }
.back { color: var(--on-navy); }
.back:hover { background: rgba(255, 255, 255, .1); }
.region-l { color: var(--on-navy-2); }
.top .region select { color: var(--on-navy); border-color: rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .07) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23b8c8df' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 11px center / 10px; }
.top .region select:hover { background-color: rgba(255, 255, 255, .12); }
.top .region option { color: var(--ink); background: #fff; }
body:has(.home-banner) .brand-name { display: none; }
.refine { top: calc(var(--header-h) + 3px); }

/* Home */
.home { display: grid; gap: 14px; }
.home-banner, .bp-head, .sheet-head { color: var(--on-navy);
  background: linear-gradient(100deg, rgba(0, 110, 215, .30), transparent 58%), var(--navy-2); }
.home-banner { padding: 18px 20px; border-radius: var(--r-3); }
.home-banner h1 { font-size: 24px; color: #fff; }
.home-banner p { margin: 4px 0 0; font-size: 14px; color: var(--on-navy-2); }
.platform { border-top: 4px solid var(--blue); }
.card.platform.cloud { border-top-color: var(--blue); }
.card.platform.onprem { border-top-color: var(--teal); }
.platform::after { display: none; }
.platforms .pelco { border-left: 4px solid var(--ink-2); }
@media (max-width: 639px) { .platforms { min-height: calc(100dvh - var(--header-h) - var(--bar-space) - 150px); } .platform { min-height: 150px; } }

/* Controls: sunken blue-grey fields, bordered segments */
.seg, .rail-platform { background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line-2); }
.qadd textarea, .pfilter, .bqty, .product .qin { background: #edf3f8; border-color: var(--line-2); }
.qadd textarea:focus, .pfilter:focus, .bqty:focus, .product .qin:focus { background: #fff; }
.search { border-color: var(--line-2); }
.btn.primary, .add, .cta .btn.addcfg { box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--accent) 70%, transparent); }

/* Cards */
.card, .series-card, .products { border-color: #d7e2ed; }
.series-card.open { border-color: color-mix(in srgb, var(--accent) 45%, #d7e2ed); box-shadow: inset 0 4px 0 var(--accent), var(--lift); }
.series-card.open .series-head { padding-top: 14px; }
.mtile.on { background: var(--accent-tint); }
.resolved { padding: 12px 14px; border: 1px solid #d7e2ed; border-radius: var(--r-2); background: var(--surface-2); }
.rsku { font-weight: 600; }
.sec-title { color: var(--ink); }

/* BOM */
.bombar { background: var(--navy); }
.toast { background: var(--navy); }
.bp-head, .sheet-head { border-bottom: 0; }
.bp-head h2, .sheet-head h2 { color: #fff; }
.bp-head .bp-count { color: var(--on-navy-2); }
.bp-head .linkish, .sheet-head .linkish { color: var(--on-navy); text-decoration-color: rgba(255, 255, 255, .4); }
.bp-head .linkish:disabled, .sheet-head .linkish:disabled { opacity: .45; cursor: default; }
.sheet-head .icon-btn { color: var(--on-navy); }
.sheet-head .icon-btn:hover { background: rgba(255, 255, 255, .1); }
.sheet-head :focus-visible, .bp-head :focus-visible { outline-color: #8fc3ff; }
.bp-foot, .sheet-foot { background: var(--surface-2); }
.totals-row span:last-child { font-size: 22px; }
.bom-lines li.bgroup { color: var(--ink-2); }

@media (min-width: 1100px) {
  .home { max-width: 820px; gap: 18px; }
  .home-banner { padding: 24px 28px; }
  .home-banner h1 { font-size: 30px; }
  .home-banner p { font-size: 15px; }
  .rail-link.on { box-shadow: inset 3px 0 0 var(--accent), var(--shadow); }
  .phead { color: var(--ink-2); }
  .cta { background: var(--surface); }
}

/* ===================== v25: QQv2 board batch 1 ===================== */
/* Header: back + logo + platform on the left, title centred, region on the right. */
.top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.top .back { grid-column: 1; grid-row: 1; }
.top .brand { grid-column: 1; grid-row: 1; min-width: 0; }
.top .back:not([hidden]) + .brand { margin-left: 44px; }
.top-title { grid-column: 2; grid-row: 1; justify-self: center; white-space: nowrap; text-decoration: none; color: #fff; font: 600 18px/1 var(--display); letter-spacing: -.01em; }
.top .region { grid-column: 3; grid-row: 1; justify-self: end; margin-left: 0; }
.brand-scope { font: 500 15px/1 var(--sans); color: var(--on-navy-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-scope:not(:empty) { padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .22); }
@media (max-width: 599px) { .brand-scope { display: none; } }
/* Region: no label, the select hugs its value. */
.top .region select { field-sizing: content; min-width: 0; padding: 0 26px 0 10px; background-position: right 9px center; }

/* Side switcher (rail): Video | Access for the platform picked on the home screen. */
@media (min-width: 1100px) {
  .rail-platform { grid-template-columns: 1fr 1fr; }
  .rail-platform a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
  .rail-platform a svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .rail-platform a.on svg { color: var(--accent); }
}
/* Video | Access switch under the screen title (phones/tablets; the rail carries it on desktop). */
.side-switch { display: flex; margin: -6px 0 14px; width: 100%; max-width: 360px; }
.side-switch a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; border-radius: 7px; text-decoration: none; color: var(--ink-2); font-size: 15px; font-weight: 500; }
.side-switch a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-switch a.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(22, 53, 74, .14); }
.side-switch a.on svg { color: var(--accent); }
@media (min-width: 1100px) { .side-switch { display: none; } }

/* Access cards: same picture-card grid as cameras; icon card where the lists have no photo. */
.access-types .type img { mix-blend-mode: multiply; }
.type.glyph .tglyph { position: absolute; inset: 12px 12px 44px; display: grid; place-items: center; }
.type.glyph .tglyph svg { width: 46%; height: 46%; max-width: 96px; fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.type.glyph { background: linear-gradient(180deg, var(--accent-tint), var(--surface) 70%); }
@media (min-width: 1100px) { .top .back + .brand { margin-left: 0; } }
.access-types .type img { inset: 32px 14px 44px; height: calc(100% - 76px); width: calc(100% - 28px); }
@media (min-width: 1100px) { .top .back:not([hidden]) + .brand { margin-left: 0; } }

/* ===================== v28: home layout ===================== */
/* Home: Cloud | On-Prem side by side, Pelco a smaller card centred under the gap, search wider beneath it.
   No rail and no BOM on the chooser screen. */
body.is-home .bombar, body.is-home .bom-panel, body.is-home .rail { display: none !important; }
body.is-home { --bar-space: 0px; padding-bottom: 0; }
.platforms { grid-template-columns: 1fr; grid-template-rows: none; min-height: 0; }
.platforms .pelco { width: 72%; justify-self: center; min-height: 120px; padding: 16px 18px; border-left: 0; border-top: 4px solid var(--ink-2); }
.platforms .pelco .glyph, .platforms .pelco .glyph svg { width: 30px; height: 30px; color: var(--ink-2); stroke: var(--ink-2); }
.platforms .pelco .label { font-size: 22px; }
.platforms .home-search { width: 100%; justify-self: center; grid-column: 1 / -1; }
@media (min-width: 640px) {
  .platforms { grid-template-columns: 1fr 1fr; }
  .platforms .pelco { grid-column: 1 / -1; width: 46%; min-height: 150px; }
  .platforms .home-search { width: 76%; }
}
@media (min-width: 1100px) {
  body.is-home .shell { grid-template-columns: minmax(0, 1fr); }
  body.is-home main { width: 100%; max-width: 820px; margin: 0 auto; }
  .platforms .pelco { min-height: 170px; padding: 22px 24px; }
  .platforms .pelco .label { font-size: 26px; }
}

/* ===================== v29: home tidy ===================== */
/* No title card; the card cluster sits in the middle of the screen. Search matches the Pelco card's width. */
body.is-home main { display: grid; align-content: center; min-height: calc(100dvh - var(--header-h) - 3px); }
.home { width: 100%; }
.platforms .home-search { width: 72%; }
@media (min-width: 640px) { .platforms .home-search { width: 46%; } }
/* Region: no dropdown arrow, just the value. */
.top .region select { background-image: none; padding: 0 10px; text-align: center; text-align-last: center; }
.top .region select:hover { background-image: none; }
body.is-home main { padding-top: 20px; padding-bottom: 20px; }

/* ===================== v30: platform colours ===================== */
/* Cloud = green (from the Avigilon mark, darkened for legible text/buttons), On-Prem = blue. */
:root { --green: #2f7d18; --green-ink: #24620f; --green-tint: #e8f4df; }
body[data-scope="cloud"] { --accent: var(--green); --accent-ink: var(--green-ink); --accent-tint: var(--green-tint); }
body[data-scope="onprem"] { --accent: var(--blue); --accent-ink: var(--blue-ink); --accent-tint: var(--blue-tint); }
.platform .glyph { color: var(--green); }
.platform.onprem .glyph { color: var(--blue); }
.card.platform.cloud { border-top-color: var(--green); }
.card.platform.onprem { border-top-color: var(--blue); }
.platforms .pelco .glyph { color: var(--ink-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

/* ---------- Access sizing guide (Cloud Access) ---------- */
.sz-entry { flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; padding: 14px 16px; margin: 0 0 4px;
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.sz-entry-i { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--accent-tint); color: var(--accent-ink); }
.sz-entry-i svg, .sz-entry-go svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sz-entry-t { display: grid; gap: 2px; min-width: 0; }
.sz-entry-t b { font-size: 16px; font-weight: 600; line-height: 1.25; }
.sz-entry-t small { font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.sz-entry-go { margin-left: auto; flex: none; color: var(--accent-ink); }
.sz { max-width: 880px; }
.sz-progress { display: grid; gap: 8px; margin: 0 0 18px; }
.sz-count { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.sz-bar { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.sz-bar li { height: 4px; border-radius: 2px; background: var(--sunken); }
.sz-bar li.done { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.sz-bar li.on { background: var(--accent); }
.sz-body { display: grid; gap: 14px; }
.sz-q { font-size: 20px; line-height: 1.25; outline: none; }
.sz-help { margin: -6px 0 0; font-size: 14px; color: var(--muted); }
.sz-note { margin: 0; font-size: 14px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-2); padding: 10px 12px; }
.sz-choices { display: grid; gap: 8px; }
.sz-choice { display: grid; gap: 3px; min-height: 64px; padding: 13px 16px; text-align: left; border: 1px solid var(--line-2); border-radius: var(--r-3); background: var(--surface); cursor: pointer; transition: border-color .12s; }
.sz-choice:hover { border-color: var(--ink-2); }
.sz-choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent); }
.sz-ct { font-size: 16px; font-weight: 600; color: var(--ink); }
.sz-cd { font-size: 13.5px; color: var(--muted); }
.sz-yn .seg button { min-width: 84px; min-height: 42px; font-size: 15px; }
.sz-loc { min-width: 0; margin: 0; padding: 10px 14px 14px; display: grid; gap: 12px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); }
.sz-loc legend { padding: 0 6px; margin-left: -6px; font-weight: 600; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sz-pair, .sz-grid { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
.sz-field { display: grid; gap: 4px; align-content: start; min-width: 0; }
.sz-field > label, .sz-field > .opt-label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.sz-field > small { margin-top: -3px; font-size: 12.5px; color: var(--muted); }
.sz-field .seg { justify-self: start; flex-wrap: wrap; }
.sz-step { gap: 6px; }
.sz-step button { width: 44px; height: 44px; flex: none; }
.sz-in { width: 84px; height: 44px; padding: 0 6px; text-align: center; font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums;
  border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface); }
.sz-text { width: 100%; min-width: 0; height: 44px; padding: 0 12px; font-size: 16px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface); }
.sz-in:focus, .sz-text:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.sz-in[aria-invalid="true"], .sz-text[aria-invalid="true"] { border-color: var(--warn-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn-ink) 15%, transparent); }
.sz-err { margin: 0; font-size: 13px; font-weight: 500; color: var(--warn-ink); }
.sz-rm, .sz-addloc { justify-self: start; }
.sz-tot { margin: 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sz-fill { display: flex; gap: 8px; align-items: center; max-width: 360px; }
.sz-at .pick { justify-self: start; max-width: 100%; }
.sz-at .pick select { max-width: 100%; text-overflow: ellipsis; }
.sz-fill .sz-text { width: 120px; flex: none; }
.sz-cabs { grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); }
.sz-nav { position: sticky; bottom: calc(var(--bar-space) - 8px); z-index: 3; display: flex; gap: 8px; margin-top: 20px; padding: 10px 0;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
  box-shadow: 0 12px 0 var(--surface); /* covers the sliver between the nav and the phone BOM bar */ }
.sz-nav .btn { height: 48px; flex: 1; }
.sz-nav .btn.primary { flex: 2; }
/* review */
.sz-sum { margin: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; }
.sz-sum > div { padding: 9px 12px; border-top: 1px solid var(--line); }
.sz-sum > div:first-child { border-top: 0; }
.sz-sum dt { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sz-sum dd { margin: 2px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.sz-edit { font-weight: 600; color: var(--accent-ink); text-decoration: none; }
.sz-edit:hover { text-decoration: underline; text-underline-offset: 3px; }
.sz-errors ul, .sz-missing ul { margin: 6px 0; padding-left: 18px; }
.sz-missing .mono { font: 12.5px var(--mono); }
.sz-preview { border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; }
.sz-lines { list-style: none; margin: 0; padding: 0; }
.sz-lines li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; grid-template-areas: "q n t" "q u t"; gap: 1px 10px; align-items: start; padding: 9px 12px; border-top: 1px solid var(--line); font-size: 14px; }
.sz-lq { grid-area: q; } .sz-ln { grid-area: n; } .sz-lu { grid-area: u; } .sz-lt { grid-area: t; text-align: right; }
.sz-lines li:first-child { border-top: 0; }
.sz-lines .sz-gh { display: flex; justify-content: space-between; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 7px 12px; }
.sz-lq { font-weight: 600; text-align: right; }
.sz-ln { display: grid; gap: 1px; min-width: 0; }
.sz-lname { font-weight: 500; overflow-wrap: anywhere; }
.sz-ln .sku { font: 12px/1.35 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.sz-lu { font-size: 12.5px; color: var(--muted); }
.sz-sub { margin: 6px 0 -6px; font-size: 15px; color: var(--ink-2); }
.sz-lt { font-weight: 600; white-space: nowrap; }
.sz-total { display: flex; justify-content: space-between; padding: 10px 12px; border-top: 1px solid var(--line-2); font-weight: 700; background: var(--surface-2); }
.sz-notes { margin: 0; padding: 0 0 0 18px; display: grid; gap: 4px; font-size: 13.5px; color: var(--ink-2); }
.sz-opts { border: 1px solid var(--line); border-radius: var(--r-2); padding: 0 12px; }
.sz-opts summary { min-height: 44px; display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.sz-opts[open] { padding-bottom: 12px; }
.sz-opts[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.sz-opt, .sz-opt-group { display: grid; gap: 4px; margin-bottom: 10px; }
.sz-opt small { font-size: 12.5px; color: var(--muted); }
.sz-opt .seg { justify-self: start; }
.sz-done { margin: 0; font-size: 14px; color: var(--accent-ink); font-weight: 500; }
.flag.sized { background: var(--accent-tint); color: var(--accent-ink); }
@media (min-width: 760px) {
  .sz-lines li { grid-template-columns: 52px minmax(0, 1fr) 120px 120px; grid-template-areas: "q n u t"; align-items: baseline; padding: 8px 12px; }
  .sz-ln { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline; }
  .sz-lu { text-align: right; font-size: 13px; }
}
@media (min-width: 640px) { .sz-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sz-choice { align-content: start; } }
