:root {
  --bg: #050a1a; --panel: rgba(10, 20, 46, .62); --line: rgba(110, 180, 255, .2);
  --cyan: #3fd8ff; --blue: #2f7bff; --violet: #9a7bff; --text: #eaf2ff; --dim: #8ea3c7;
  --green: #3df0a8; --red: #ff5d6e; --orange: #ffb340;
  --top: 64px; --bottom: 76px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overflow: hidden; }
canvas#bg, canvas#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
canvas#gl { touch-action: none; z-index: 1; }
#labels { position: fixed; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.label3d { position: absolute; left: 0; top: 0; will-change: transform; }
.label3d i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.label3d span { position: absolute; left: 12px; top: -11px; white-space: nowrap; font-size: 11.5px; padding: 3px 8px; border-radius: 999px; background: rgba(5, 12, 30, .78); border: 1px solid var(--line); color: var(--text); backdrop-filter: blur(6px); }

.glass { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; backdrop-filter: blur(16px) saturate(130%); -webkit-backdrop-filter: blur(16px) saturate(130%); box-shadow: 0 10px 40px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .06); }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 4px; font-size: 11px; letter-spacing: .22em; color: var(--cyan); font-weight: 700; }
h1, h2, h3 { margin: 0; line-height: 1.1; }

/* topbar */
#topbar { position: fixed; z-index: 10; top: 0; left: 0; right: 0; height: var(--top); display: flex; align-items: center; gap: 14px; padding: 0 18px; background: linear-gradient(180deg, rgba(3, 7, 18, .92), rgba(3, 7, 18, 0)); }
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--text); font: 700 18px var(--font); cursor: pointer; white-space: nowrap; padding: 0; }
.brand em { font-style: normal; color: var(--cyan); }
#nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; padding: 6px 2px; justify-content: center; }
#nav::-webkit-scrollbar { display: none; }
#nav button { background: transparent; color: var(--dim); border: 1px solid transparent; border-radius: 999px; padding: 7px 13px; font: 600 13px var(--font); cursor: pointer; white-space: nowrap; transition: .2s; }
#nav button:hover { color: var(--text); background: rgba(80, 140, 255, .12); }
#nav button.active { color: #03121f; background: linear-gradient(90deg, var(--cyan), #7aa7ff); box-shadow: 0 0 18px rgba(63, 216, 255, .45); }
.icon-btn { background: var(--panel); border: 1px solid var(--line); color: var(--text); width: 38px; height: 38px; border-radius: 12px; font-size: 18px; cursor: pointer; }
.icon-btn:hover { border-color: var(--cyan); }

/* buttons */
.btn { font: 700 13px var(--font); color: var(--text); background: rgba(40, 80, 160, .28); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; cursor: pointer; transition: transform .15s, box-shadow .2s, border-color .2s, background .2s; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.btn:hover { border-color: var(--cyan); box-shadow: 0 0 16px rgba(63, 216, 255, .25); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.small { padding: 7px 11px; font-size: 12px; border-radius: 10px; }
.btn.big { padding: 14px 24px; font-size: 15px; border-radius: 14px; }
.btn.primary { color: #03121f; background: linear-gradient(90deg, var(--cyan), #6aa2ff); border-color: transparent; }
.btn.danger { background: rgba(255, 93, 110, .18); border-color: rgba(255, 93, 110, .55); color: #ff9aa6; }
.btn.ghost { background: transparent; }
.btn.toggle.on { border-color: var(--cyan); color: var(--cyan); }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 600 12px var(--font); color: var(--text); background: rgba(60, 100, 200, .2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; cursor: pointer; }
.chip:hover, .chip.on { border-color: var(--cyan); color: var(--cyan); }
.row { display: flex; gap: 6px; flex-wrap: wrap; }

/* pages */
#pages { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
.page { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility .45s; padding: var(--top) 18px var(--bottom); }
.page.active { opacity: 1; visibility: visible; }
.page > * { pointer-events: auto; }
.page.scroll { overflow-y: auto; pointer-events: auto; background: linear-gradient(180deg, rgba(4, 8, 20, .55), rgba(4, 8, 20, .82)); padding: calc(var(--top) + 10px) clamp(14px, 4vw, 56px) calc(var(--bottom) + 24px); }
.page-head { max-width: 1200px; margin: 0 auto 18px; }
.page-head h2 { font-size: clamp(26px, 4vw, 40px); }
.lead { color: var(--dim); max-width: 780px; line-height: 1.55; margin: 8px 0 0; }
.small-text { font-size: 13px; color: var(--dim); line-height: 1.5; margin: 8px 0; }
.small-text.strong { color: var(--text); font-weight: 700; margin-bottom: 4px; }
.warn { font-size: 12px; color: var(--orange); line-height: 1.45; margin: 8px 0 0; }

/* home */
.hero { position: absolute; left: clamp(14px, 4vw, 64px); top: 50%; transform: translateY(-50%); width: min(520px, calc(100vw - 28px)); padding: 28px 30px; max-height: calc(100vh - var(--top) - var(--bottom) - 6px); overflow-y: auto; }
.hero-logo { filter: drop-shadow(0 0 18px rgba(63, 216, 255, .5)); }
.hero h1 { font-size: clamp(38px, 6vw, 62px); letter-spacing: .02em; font-weight: 800; }
.hero h1 span { background: linear-gradient(90deg, var(--cyan), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { font-size: clamp(17px, 2.2vw, 22px); color: var(--cyan); margin: 8px 0 4px; font-weight: 600; }
.sub { color: var(--dim); line-height: 1.55; margin: 6px 0 14px; }
.credits { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.55; }
.credits img { background: #fff; border-radius: 50%; padding: 2px; flex: none; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 8px; }
.fine { font-size: 11px; color: var(--dim); margin: 6px 0 0; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 18px; max-width: 1240px; margin: 0 auto; }
.card { display: flex; flex-direction: column; overflow: hidden; }
.card .thumb { position: relative; aspect-ratio: 640 / 440; background: radial-gradient(circle at 50% 40%, #12295a, #060c1f); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .num { position: absolute; top: 10px; left: 10px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: rgba(5, 12, 30, .8); border: 1px solid var(--line); color: var(--cyan); }
.tag { position: absolute; top: 10px; right: 10px; font-size: 10px; letter-spacing: .12em; font-weight: 800; padding: 5px 9px; border-radius: 999px; background: rgba(61, 240, 168, .14); color: var(--green); border: 1px solid rgba(61, 240, 168, .4); }
.tag.warn-tag { background: rgba(255, 179, 64, .14); color: var(--orange); border-color: rgba(255, 179, 64, .45); }
.card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { font-size: 20px; }
.card .desc { color: var(--dim); font-size: 13.5px; line-height: 1.5; margin: 0; }
.card .purpose { font-size: 13px; line-height: 1.5; margin: 0; padding: 9px 11px; border-left: 3px solid var(--violet); background: rgba(154, 123, 255, .08); border-radius: 0 10px 10px 0; }
.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; font-size: 13px; background: rgba(0, 0, 0, .22); border-radius: 12px; padding: 11px 12px; }
.price-grid .k { color: var(--dim); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.price-grid .v { font-weight: 700; font-family: var(--mono); font-size: 14px; }
.price-grid .wide { grid-column: 1 / -1; }
.badge { display: inline-block; font: 700 10.5px var(--font); letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; border: 1px solid; }
.badge.verified { color: var(--green); border-color: rgba(61, 240, 168, .5); background: rgba(61, 240, 168, .1); }
.badge.approximate { color: var(--cyan); border-color: rgba(63, 216, 255, .5); background: rgba(63, 216, 255, .1); }
.badge.confirm, .badge.unknown { color: var(--orange); border-color: rgba(255, 179, 64, .55); background: rgba(255, 179, 64, .1); }
.badge.bundled { color: var(--violet); border-color: rgba(154, 123, 255, .55); background: rgba(154, 123, 255, .1); }
.price-note { font-size: 11.5px; color: var(--dim); line-height: 1.45; margin: 0; }
.card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.nolink { font-size: 12px; color: var(--orange); border: 1px dashed rgba(255, 179, 64, .5); border-radius: 10px; padding: 8px 11px; display: inline-block; }
.note { max-width: 1240px; margin: 22px auto 0; padding: 18px 22px; font-size: 13.5px; line-height: 1.6; color: var(--dim); }
.note b { color: var(--text); }

/* viewer */
.viewer-left { position: absolute; left: 18px; top: calc(var(--top) + 8px); width: 230px; padding: 14px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - var(--top) - var(--bottom) - 90px); overflow-y: auto; }
.pill-list { display: flex; flex-direction: column; gap: 6px; }
.pill-list button { text-align: left; background: rgba(40, 80, 160, .2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 8px 10px; font: 600 12.5px var(--font); cursor: pointer; }
.pill-list button.on { border-color: var(--cyan); color: var(--cyan); background: rgba(63, 216, 255, .1); }
.viewer-info { position: absolute; right: 18px; top: calc(var(--top) + 8px); width: min(370px, calc(100vw - 36px)); padding: 18px; max-height: calc(100vh - var(--top) - var(--bottom) - 90px); overflow-y: auto; }
.viewer-info h3 { font-size: 22px; margin: 2px 0 8px; }
.spec { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 10px 0; }
.spec td { padding: 5px 0; border-bottom: 1px solid rgba(110, 180, 255, .1); vertical-align: top; }
.spec td:first-child { color: var(--dim); padding-right: 10px; width: 46%; }
.toolbar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom) + 8px); display: flex; gap: 6px; padding: 8px; flex-wrap: wrap; justify-content: center; align-items: center; max-width: calc(100vw - 24px); }
.dots { display: inline-flex; gap: 5px; margin: 0 6px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: #27406e; cursor: pointer; transition: .2s; }
.dots i.on { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.asm-caption { position: absolute; left: 18px; top: calc(var(--top) + 8px); width: min(400px, calc(100vw - 36px)); padding: 18px 20px; }
.asm-caption h3 { font-size: 22px; margin-bottom: 6px; }
.asm-caption p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--dim); }
.asm-caption .eyebrow { color: var(--cyan); }

/* machine side panel */
.side { position: absolute; right: 18px; top: calc(var(--top) + 8px); width: min(310px, calc(100vw - 36px)); padding: 18px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - var(--top) - var(--bottom) - 8px); overflow-y: auto; }
.side.wide { width: min(420px, calc(100vw - 36px)); }
.side h3 { font-size: 22px; }
.steps { padding-left: 20px; margin: 4px 0; } .steps li { margin: 3px 0; }
.thanks { margin: 8px 0 0; text-align: center; font-weight: 700; line-height: 1.5; } .thanks span { color: var(--cyan); font-weight: 500; }
.id-list { display: grid; grid-template-columns: 1fr; gap: 5px; max-height: 46vh; overflow-y: auto; padding-right: 3px; }
.id-list button { display: grid; grid-template-columns: 28px 1fr; gap: 8px; text-align: left; align-items: center; background: rgba(40, 80, 160, .18); border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; color: var(--text); cursor: pointer; font: 600 12px var(--font); }
.id-list button:hover, .id-list button.on { border-color: var(--cyan); }
.id-list b { color: var(--cyan); font-family: var(--mono); } .id-list small { display: block; color: var(--dim); font-family: var(--mono); font-weight: 400; margin-top: 2px; font-size: 11px; }

/* companion */
#companion { position: fixed; z-index: 6; left: 18px; bottom: calc(var(--bottom) + 8px); width: min(470px, calc(100vw - 36px)); padding: 10px; }
.comp-head { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--dim); margin-bottom: 8px; gap: 8px; }
.comp-head .icon-btn { width: 28px; height: 28px; font-size: 13px; border-radius: 8px; }
#comp-canvas { width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; display: block; background: #02040a; border: 1px solid var(--line); cursor: pointer; touch-action: manipulation; }

/* presenter bar */
#presenter { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; height: var(--bottom); padding: 8px 18px 10px; display: flex; flex-direction: column; justify-content: center; gap: 6px; background: linear-gradient(0deg, rgba(3, 7, 18, .95), rgba(3, 7, 18, 0)); }
.caption { text-align: center; font-size: 13px; color: var(--dim); min-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caption b { color: var(--text); }
.pcontrols { display: flex; align-items: center; gap: 12px; justify-content: center; }
.progress { display: flex; gap: 6px; align-items: center; flex: 0 1 560px; }
.progress i { flex: 1; height: 6px; border-radius: 4px; background: #1a2a52; cursor: pointer; position: relative; transition: .25s; }
.progress i.done { background: rgba(63, 216, 255, .5); } .progress i.on { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.progress i:hover { transform: scaleY(1.6); }

/* modal / toast */
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(2, 5, 14, .7); padding: 16px; }
.modal-card { width: min(640px, 100%); max-height: 86vh; overflow: auto; padding: 22px; background: rgba(8, 16, 38, .95); }
.modal-card h3 { font-size: 22px; margin-bottom: 4px; }
.cmp { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13px; } .cmp th, .cmp td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; } .cmp th { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.toast { position: fixed; z-index: 40; left: 50%; bottom: calc(var(--bottom) + 70px); transform: translateX(-50%); background: rgba(10, 20, 46, .96); border: 1px solid var(--cyan); padding: 11px 18px; border-radius: 12px; font-size: 13px; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); max-width: 90vw; }

/* cost */
.cost-grid { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.panel { padding: 18px 18px 14px; }
.panel h3 { font-size: 18px; margin-bottom: 10px; }
.tbl-wrap { overflow-x: auto; }
table.cost { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
table.cost th { text-align: left; color: var(--dim); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; padding: 8px 8px; border-bottom: 1px solid var(--line); }
table.cost td { padding: 10px 8px; border-bottom: 1px solid rgba(110, 180, 255, .1); vertical-align: middle; }
table.cost td.r, table.cost th.r { text-align: right; font-family: var(--mono); }
table.cost tr.muted td { color: var(--dim); }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty button { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); background: rgba(40, 80, 160, .25); color: var(--text); font-size: 15px; cursor: pointer; }
.qty button:hover { border-color: var(--cyan); }
.qty input { width: 42px; text-align: center; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); color: var(--text); border-radius: 8px; height: 26px; font: 600 13px var(--mono); }
.total-box { text-align: center; padding: 18px 10px; border-radius: 16px; margin: 10px 0 14px; background: linear-gradient(135deg, rgba(47, 123, 255, .22), rgba(154, 123, 255, .2)); border: 1px solid var(--line); }
.total-box .lbl { font-size: 11px; letter-spacing: .14em; color: var(--dim); }
.total-box .amt { font: 800 clamp(30px, 4.4vw, 42px) var(--mono); color: #fff; text-shadow: 0 0 24px rgba(63, 216, 255, .5); margin: 4px 0; }
.total-box .tag2 { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 4px 10px; border-radius: 999px; color: var(--orange); border: 1px solid rgba(255, 179, 64, .55); background: rgba(255, 179, 64, .1); }
.sumrow { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 13px; border-bottom: 1px solid rgba(110, 180, 255, .1); }
.sumrow span:last-child { font-family: var(--mono); font-weight: 700; text-align: right; }
.sumrow.muted { color: var(--dim); }
.ship-in { display: flex; gap: 8px; align-items: center; margin: 10px 0; font-size: 12.5px; color: var(--dim); }
.ship-in input { width: 100px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); color: var(--text); border-radius: 8px; height: 30px; padding: 0 8px; font: 600 13px var(--mono); }
.list-note { font-size: 12px; color: var(--dim); line-height: 1.5; margin: 6px 0 0; }
.list-note ul { margin: 4px 0 0; padding-left: 18px; }

#print-report { display: none; }
@media print {
  body > *:not(#print-report) { display: none !important; }
  html, body { overflow: visible !important; background: #fff !important; height: auto; }
  #print-report { display: block !important; position: static; color: #111; font-family: var(--font); background: #fff; padding: 8mm; }
}

/* responsive */
@media (max-width: 900px) {
  :root { --top: 56px; --bottom: 74px; }
  #topbar { padding: 0 10px; gap: 8px; } .brand b { display: none; }
  #nav { justify-content: flex-start; }
  .cost-grid { grid-template-columns: 1fr; }
  .viewer-left { width: auto; right: 10px; left: 10px; top: calc(var(--top) + 4px); flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px; max-height: none; }
  .viewer-left .pill-list { flex-direction: row; flex-wrap: wrap; } .viewer-left .chips { display: none; }
  .viewer-info { top: auto; right: 8px; left: 8px; width: auto; bottom: calc(var(--bottom) + 62px); max-height: 30vh; }
  .side, .side.wide { top: auto; left: 8px; right: 8px; width: auto; bottom: calc(var(--bottom) + 4px); max-height: 38vh; padding: 14px; }
  .asm-caption { left: 8px; right: 8px; width: auto; top: calc(var(--top) + 4px); padding: 12px 14px; } .asm-caption h3 { font-size: 18px; } .asm-caption .warn { display: none; }
  .hero { left: 8px; right: 8px; width: auto; top: auto; bottom: calc(var(--bottom) + 4px); transform: none; max-height: 56vh; padding: 16px 18px; }
  .hero-logo { width: 52px; height: 52px; } .credits img { width: 48px; height: 48px; } .hero .sub { display: none; }
  #companion { left: 8px; right: 8px; width: auto; bottom: auto; top: calc(var(--top) + 4px); max-width: 420px; margin: 0 auto; }
  .toolbar { bottom: calc(var(--bottom) + 4px); }
  .page.scroll { padding-left: 12px; padding-right: 12px; }
  .caption { font-size: 12px; }
  .pcontrols .btn { padding: 8px 10px; } .progress { flex: 1; }
}
@media (max-width: 900px) and (max-height: 760px) { .viewer-info { max-height: 24vh; } .side { max-height: 34vh; } }
@media (max-width: 520px) { .id-list { max-height: 22vh; } .btn.big { padding: 12px 16px; font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { .page { transition: none; } * { scroll-behavior: auto !important; } }
