/* Quest QR — app + landing styles | Version: 01.01.00 */
@font-face { font-family: "JB Mono"; src: url(fonts/jbmono-800.woff2) format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "JB Mono"; src: url(fonts/jbmono-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JB Mono"; src: url(fonts/jbmono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url(fonts/intertight-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url(fonts/intertight-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Unbounded"; src: url(fonts/unbounded-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #050806;
  --bg-2: #08100b;
  --ink: #e9efe9;
  --ink-2: #b9c4bb;
  --muted: #869489;
  --faint: #3c4840;
  --line: rgba(124, 242, 154, .12);
  --line-2: rgba(124, 242, 154, .26);
  --panel: rgba(8, 14, 10, .82);
  --panel-hi: rgba(13, 22, 16, .94);
  --green: #7cf29a;
  --green-ink: #04110a;
  --amber: #ffb547;
  --red: #ff6b81;
  --blue: #5a8ff0;
  --s-scans: #2fae5e;   /* validated chart pair (dark surface) */
  --s-unique: #5a8ff0;
  --mono: "JB Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Unbounded", var(--sans);
  --gutter: clamp(16px, 3vw, 32px);
  --side: 232px;
  --r: 2px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
::selection { background: var(--green); color: var(--green-ink); }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- backgrounds ---------- */
.grid-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 70% -10%, rgba(124,242,154,.10), transparent 55%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 85%);
}
.scan-lines { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .35;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.25) 0 1px, transparent 1px 3px); }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; min-height: 40px;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink); cursor: pointer; border-radius: var(--r);
  font: 700 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:hover { border-color: var(--green); color: var(--green); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--green); border-color: var(--green); color: var(--green-ink); }
.btn.primary:hover { background: #a3f7b9; color: var(--green-ink); }
.btn.danger:hover { border-color: var(--red); color: var(--red); }
.btn.ghost { border-color: transparent; }
.btn.sm { padding: 6px 10px; min-height: 30px; font-size: 11px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.icon-btn { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; border-radius: var(--r); }
.icon-btn:hover { color: var(--green); border-color: var(--line-2); }
.icon-btn svg { width: 17px; height: 17px; }

label.f { display: block; margin: 0 0 14px; }
label.f > span, .f-label { display: block; font: 700 11px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 7px; }
.f-help { display: block; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=number], input[type=tel],
input[type=search], input[type=datetime-local], select, textarea {
  width: 100%; padding: 10px 12px; min-height: 40px; background: rgba(2,5,3,.7); border: 1px solid var(--line-2); border-radius: var(--r);
  color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 84px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(124,242,154,.12); }
input[type=color] { width: 44px; height: 40px; padding: 3px; background: rgba(2,5,3,.7); border: 1px solid var(--line-2); border-radius: var(--r); cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--green); }
input[type=checkbox] { accent-color: var(--green); width: 16px; height: 16px; }
.row { display: flex; gap: 12px; align-items: flex-end; }
.row > * { flex: 1; min-width: 0; }
.row > .none { flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.check { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; cursor: pointer; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border: 1px solid var(--line-2); border-radius: 22px; background: rgba(2,5,3,.7); transition: .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked + i { border-color: var(--green); background: rgba(124,242,154,.18); }
.switch input:checked + i::after { left: 19px; background: var(--green); }
.switch input:focus-visible + i { outline: 2px solid var(--green); outline-offset: 2px; }

/* ---------- panels ---------- */
.panel { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; backdrop-filter: blur(6px); }
.panel > h2, .panel-h { font: 700 11.5px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.panel-h .sp { flex: 1; }
.panel > h2 svg, .panel-h svg, .sub > h3 svg { width: 15px; height: 15px; flex: none; color: var(--green); }
.brk::before, .brk::after { content: ""; position: absolute; width: 12px; height: 12px; border: 2px solid var(--green); pointer-events: none; }
.brk::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.brk::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ---------- app shell ---------- */
.shell { position: relative; z-index: 2; display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: rgba(4,7,5,.82); backdrop-filter: blur(10px); padding: 18px 14px; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font: 700 15px/1 var(--mono); letter-spacing: .02em; padding: 4px 8px 22px; text-decoration: none !important; }
.brand b { color: var(--green); }
.brand .mark { width: 28px; height: 28px; flex: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.brand .mark i { background: var(--green); border-radius: 1px; }
.brand .mark i:nth-child(2), .brand .mark i:nth-child(4), .brand .mark i:nth-child(9) { opacity: .25; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav .sec { display: flex; align-items: center; gap: 11px; padding: 9px 10px; color: var(--ink-2); border-radius: var(--r); font-size: 14px; text-decoration: none; border: 1px solid transparent; }
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.nav a:hover { color: var(--ink); background: rgba(124,242,154,.05); }
.nav a.on { color: var(--green); border-color: var(--line-2); background: rgba(124,242,154,.07); }
.nav .sec { font: 700 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--faint); padding: 18px 10px 8px; }
.side .grow { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid var(--line); margin-top: 10px; }
.me .av { width: 32px; height: 32px; display: grid; place-items: center; background: rgba(124,242,154,.12); color: var(--green); font: 700 13px/1 var(--mono); border: 1px solid var(--line-2); flex: none; }
.me .who { min-width: 0; flex: 1; }
.me .who b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who small { color: var(--muted); font: 400 11px/1.2 var(--mono); }

.main { min-width: 0; padding: 0 var(--gutter) 60px; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 20px 0 18px; position: sticky; top: 0; z-index: 10;
  background: linear-gradient(var(--bg) 70%, transparent); }
.topbar h1 { font: 700 clamp(19px, 2.4vw, 24px)/1.15 var(--display); letter-spacing: -.01em; }
.topbar .crumb { font: 400 12px/1 var(--mono); color: var(--muted); display: block; margin-bottom: 6px; }
.topbar .sp { flex: 1; }
.menu-btn { display: none; }
.notice { border: 1px solid rgba(255,181,71,.35); background: rgba(255,181,71,.07); color: var(--amber); padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.view { animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ---------- stat tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.tile { padding: 16px 18px; }
.tile .k { font: 700 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.tile .v { font: 700 clamp(26px, 3vw, 34px)/1.1 var(--display); margin-top: 10px; font-variant-numeric: tabular-nums; }
.tile .d { font: 400 12px/1 var(--mono); color: var(--muted); margin-top: 8px; }
.tile .d .up { color: var(--green); } .tile .d .down { color: var(--red); }

.dash { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; }
.dash .wide { grid-column: 1 / -1; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

/* globe */
.globe-panel { display: flex; flex-direction: column; }
.globe-wrap { position: relative; height: 380px; flex: 1 1 auto; min-height: 380px; margin: -6px -6px 0; }
.globe-wrap canvas { width: 100% !important; height: 100% !important; display: block; }
.globe-tip { position: absolute; pointer-events: none; padding: 6px 10px; background: var(--panel-hi); border: 1px solid var(--line-2); font: 400 12px/1.3 var(--mono); white-space: nowrap; transform: translate(-50%, -130%); opacity: 0; transition: opacity .15s; }
.globe-legend { position: absolute; left: 6px; bottom: 6px; font: 400 11px/1.4 var(--mono); color: var(--muted); }
.attrib { font: 400 10.5px/1.3 var(--mono); color: var(--faint); margin-top: 8px; }
.attrib a { color: inherit; text-decoration: underline; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .ax { font: 400 10.5px var(--mono); fill: var(--muted); }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; padding: 8px 10px; background: var(--panel-hi); border: 1px solid var(--line-2); font: 400 12px/1.45 var(--mono); white-space: nowrap; opacity: 0; transition: opacity .12s; }
.chart-tip b { color: var(--ink); }
.chart-tip i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 1px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font: 400 12px/1 var(--mono); color: var(--ink-2); margin: 0 0 10px; }
.legend i { display: inline-block; width: 12px; height: 4px; margin-right: 7px; vertical-align: middle; border-radius: 2px; }
.legend i.bar { height: 10px; width: 10px; }
.bars { display: flex; flex-direction: column; gap: 9px; }
.bars .b { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: 13.5px; }
.bars .b .lb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.bars .b .tr { height: 8px; background: rgba(124,242,154,.06); border-radius: 0 4px 4px 0; position: relative; }
.bars .b .fl { position: absolute; inset: 0 auto 0 0; background: var(--s-scans); border-radius: 0 4px 4px 0; transform-origin: left; animation: grow .8s cubic-bezier(.2,.8,.2,1) both; }
@keyframes grow { from { transform: scaleX(0); } }
.bars .b .n { font: 700 12px/1 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; min-width: 2.5em; text-align: right; }
.empty { color: var(--muted); font-size: 14px; padding: 18px 0; text-align: center; }
.empty .big { display: block; font: 700 18px/1.3 var(--display); color: var(--ink); margin-bottom: 6px; }
.feed { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.feed li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; align-items: center; }
.feed .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.feed .dot.bot { background: var(--faint); box-shadow: none; }
.feed time { font: 400 11.5px/1 var(--mono); color: var(--muted); }
.feed small { color: var(--muted); }

/* ---------- links list ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { flex: 1; min-width: 200px; position: relative; }
.toolbar .search svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); }
.toolbar .search input { padding-left: 36px; }
.toolbar select { width: auto; min-width: 140px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); }
.seg button { border: 0; background: none; padding: 8px 12px; min-height: 38px; color: var(--muted); cursor: pointer; font: 700 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.seg button.on { background: rgba(124,242,154,.12); color: var(--green); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 20px; font-size: 12.5px; color: var(--ink-2); background: none; cursor: pointer; }
.chip i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip.on { border-color: var(--green); color: var(--green); background: rgba(124,242,154,.08); }
.chip .x { opacity: .6; margin-left: 2px; }
.quota { font: 400 12px/1 var(--mono); color: var(--muted); display: flex; align-items: center; gap: 10px; }
.quota .meter { width: 90px; height: 5px; background: rgba(124,242,154,.1); border-radius: 3px; overflow: hidden; }
.quota .meter i { display: block; height: 100%; background: var(--green); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.lcard { padding: 0; display: flex; flex-direction: column; transition: border-color .2s, transform .2s; }
.lcard:hover { border-color: var(--line-2); transform: translateY(-2px); }
.lcard .top { display: flex; gap: 14px; padding: 16px 16px 12px; cursor: pointer; }
.lcard .thumb { width: 72px; height: 72px; flex: none; background: #fff; display: grid; place-items: center; border-radius: var(--r); overflow: hidden; }
.lcard .thumb img, .lcard .thumb canvas { width: 100%; height: 100%; object-fit: contain; }
.lcard .meta { min-width: 0; flex: 1; }
.lcard h3 { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.lcard .code { font: 400 12px/1.3 var(--mono); color: var(--green); word-break: break-all; }
.lcard .dest { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.lcard .badges { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; font: 700 10px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em; border: 1px solid var(--line-2); color: var(--ink-2); border-radius: var(--r); }
.badge.off { color: var(--red); border-color: rgba(255,107,129,.4); }
.badge.warn { color: var(--amber); border-color: rgba(255,181,71,.4); }
.badge.ok { color: var(--green); border-color: rgba(124,242,154,.4); }
.badge svg { width: 11px; height: 11px; }
.lcard .bot { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-top: 1px solid var(--line); margin-top: auto; }
.lcard .scans { font: 700 18px/1 var(--display); font-variant-numeric: tabular-nums; }
.lcard .scans small { display: block; font: 400 10.5px/1.4 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.spark { flex: 1; height: 30px; }
.spark svg { width: 100%; height: 100%; display: block; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font: 700 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 10px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.t td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: rgba(124,242,154,.035); }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.t-wrap { overflow-x: auto; }

/* ---------- editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 480px; gap: 18px; align-items: start; }
.steps { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.steps button { flex: 1; min-width: 92px; border: 1px solid var(--line); background: var(--panel); padding: 11px 10px; cursor: pointer; text-align: left; color: var(--muted); border-radius: var(--r); }
.steps button b { display: block; font: 700 10px/1 var(--mono); letter-spacing: .1em; color: var(--faint); margin-bottom: 5px; }
.steps button span { font-size: 13.5px; font-weight: 600; }
.steps button.on { border-color: var(--green); color: var(--ink); background: rgba(124,242,154,.07); }
.steps button.on b { color: var(--green); }
.types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
@media (min-width: 1500px) { .types { grid-template-columns: repeat(9, minmax(0, 1fr)); } .types button small { display: none; } }
.types button { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; border: 1px solid var(--line); background: rgba(2,5,3,.5); cursor: pointer; text-align: left; border-radius: var(--r); transition: .15s; }
.types button svg { width: 20px; height: 20px; color: var(--green); }
.types button b { font-size: 13.5px; }
.types button small { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.types button:hover { border-color: var(--line-2); }
.types button.on { border-color: var(--green); background: rgba(124,242,154,.08); }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; margin-bottom: 16px; }
.opt-grid button { aspect-ratio: 1; border: 1px solid var(--line); background: rgba(2,5,3,.5); cursor: pointer; display: grid; place-items: center; padding: 8px; border-radius: var(--r); position: relative; }
.opt-grid button svg { width: 100%; height: 100%; }
.opt-grid button span { position: absolute; bottom: 3px; left: 0; right: 0; font: 400 9.5px/1 var(--mono); color: var(--muted); text-align: center; }
.opt-grid button.on { border-color: var(--green); background: rgba(124,242,154,.08); }
.opt-grid.frames button svg { width: 70%; height: 70%; margin-bottom: 10px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.swatches button { width: 30px; height: 30px; border: 1px solid var(--line-2); cursor: pointer; border-radius: var(--r); padding: 0; position: relative; overflow: hidden; }
.swatches button::after { content: ""; position: absolute; inset: 50% 0 0 0; background: var(--b); }
.color-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.color-row .lab { flex: 1; font-size: 13.5px; color: var(--ink-2); }
.color-row input[type=text] { width: 100px; flex: none; font-family: var(--mono); font-size: 13px; }
.sub { border-top: 1px dashed var(--line-2); margin: 18px 0 14px; padding-top: 16px; }
.sub > h3 { font: 700 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.repeat { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.repeat .ri { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 8px; align-items: center; }
.repeat .ri.w3 { grid-template-columns: 90px 1fr auto; }
.repeat .ri.ab { grid-template-columns: 1fr 74px auto; }

.preview { position: sticky; top: 84px; }
.preview .stage { position: relative; background: radial-gradient(circle at 50% 40%, rgba(124,242,154,.08), transparent 65%), rgba(2,5,3,.6);
  border: 1px solid var(--line); aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; }
.preview .stage .flat { position: absolute; inset: 4%; display: grid; place-items: center; transition: opacity .3s, transform .4s; }
.preview .stage .flat img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 18px 30px rgba(0,0,0,.5)); }
.preview .stage canvas.three { position: absolute; inset: 0; width: 100% !important; height: 100% !important; opacity: 0; transition: opacity .4s; pointer-events: none; }
.preview .stage.is3d .flat { opacity: 0; transform: scale(.9); }
.preview .stage.is3d canvas.three { opacity: 1; pointer-events: auto; }
.preview .stage .mode { position: absolute; top: 10px; right: 10px; z-index: 3; }
.preview .target { font: 400 11.5px/1.4 var(--mono); color: var(--muted); word-break: break-all; margin: 10px 0 0; }
.scancheck { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); margin-top: 10px; font-size: 13px; }
.scancheck .led { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); flex: none; }
.scancheck.ok .led { background: var(--green); box-shadow: 0 0 10px var(--green); }
.scancheck.warn .led { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.scancheck.bad .led { background: var(--red); box-shadow: 0 0 10px var(--red); }
.scancheck .why { color: var(--muted); font-size: 12px; display: block; }
.dl-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 10px; }
.dl-note { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 10px 12px; border: 1px dashed var(--line-2); color: var(--muted); font-size: 12.5px; }
.dl-note svg { width: 15px; height: 15px; flex: none; color: var(--green); }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input { flex: 1; }
.range-val { font: 700 13px var(--mono); color: var(--green); min-width: 1.5em; text-align: right; }
.chips .chip.on { border-color: var(--green); }
.save-bar { display: flex; gap: 10px; margin-top: 14px; }
.save-bar .btn { flex: 1; }

/* ---------- detail ---------- */
.detail-head { display: grid; grid-template-columns: 180px 1fr; gap: 20px; align-items: center; margin-bottom: 14px; }
.detail-head .qrbox { background: #fff; padding: 8px; aspect-ratio: 1; display: grid; place-items: center; border-radius: var(--r); }
.detail-head .qrbox img, .detail-head .qrbox canvas { width: 100%; height: 100%; object-fit: contain; }
.detail-head h2 { font: 700 clamp(18px, 2.2vw, 24px)/1.2 var(--display); margin-bottom: 6px; word-break: break-word; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13.5px; margin: 10px 0 14px; }
.kv dt { color: var(--muted); font: 400 11.5px/1.6 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.kv dd { margin: 0; word-break: break-all; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.range { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.range .sp { flex: 1; }
.copy { cursor: pointer; border-bottom: 1px dashed var(--line-2); }

/* ---------- modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.65); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--bg-2); border: 1px solid var(--line-2); padding: 22px; position: relative; animation: pop .25s cubic-bezier(.2,.8,.2,1); }
.modal.wide { width: min(760px, 100%); }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal h2 { font: 700 18px/1.3 var(--display); margin-bottom: 16px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { padding: 12px 16px; background: var(--panel-hi); border: 1px solid var(--line-2); border-left: 3px solid var(--green); font-size: 14px; animation: pop .25s; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.toast.err { border-left-color: var(--red); }
.loading { display: grid; place-items: center; min-height: 220px; color: var(--muted); font: 400 13px var(--mono); }
.loading::before { content: ""; width: 26px; height: 26px; border: 2px solid var(--line-2); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- landing ---------- */
.landing { position: relative; z-index: 2; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) 27vw minmax(320px, 400px); align-items: center; gap: clamp(24px, 3vw, 48px); padding: 32px clamp(16px, 4vw, 64px); }
.landing .auth { grid-column: 3; }
#hero3d { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; display: block; }
.landing .copy { max-width: 640px; }
.eyebrow { font: 700 12px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--green); display: inline-flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--green); }
.landing h1 { font: 700 clamp(36px, 6vw, 76px)/1.02 var(--display); letter-spacing: -.03em; margin: 18px 0 18px; }
.landing h1 em { font-style: normal; color: var(--green); }
.landing .lede { font-size: clamp(16px, 1.6vw, 19px); color: var(--ink-2); max-width: 520px; margin: 0 0 26px; }
.feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 560px; }
.feat { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); padding: 10px 12px; border: 1px solid var(--line); background: rgba(5,8,6,.55); backdrop-filter: blur(4px); }
.feat svg { width: 18px; height: 18px; color: var(--green); flex: none; margin-top: 1px; }
.auth { padding: 28px; background: rgba(6,10,8,.86); }
.auth h2 { font: 700 20px/1.2 var(--display); margin-bottom: 4px; }
.auth p { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.auth .btn.primary { width: 100%; min-height: 46px; font-size: 13px; }
.auth .err { color: var(--red); font-size: 13.5px; min-height: 1.4em; margin: 4px 0 10px; }
.auth .alt { text-align: center; margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.auth .alt button { background: none; border: 0; color: var(--green); cursor: pointer; padding: 0; }
.hp { position: absolute; left: -9999px; }
.ver { position: fixed; bottom: 12px; left: 16px; z-index: 3; font: 400 11px/1 var(--mono); color: var(--faint); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .editor { grid-template-columns: minmax(0, 1fr) 400px; }
  .dash { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 84vw); transform: translateX(-102%); transition: transform .25s; }
  .side.open { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.6); }
  .menu-btn { display: inline-grid; }
  .editor { grid-template-columns: 1fr; }
  .preview { position: static; order: -1; }
  .preview .stage { max-width: 480px; margin: 0 auto; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols2, .cols3 { grid-template-columns: 1fr; }
  .landing { grid-template-columns: 1fr; padding-top: 34vh; }
  .landing .auth { grid-column: 1; }
  .landing .copy { max-width: none; }
}
@media (max-width: 560px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .detail-head { grid-template-columns: 110px 1fr; gap: 14px; }
  .feats { grid-template-columns: 1fr; }
  .topbar .btn .lbl { display: none; }
  .globe-wrap { height: 300px; }
  .tile .v { font-size: 24px; }
  .repeat .ri { grid-template-columns: 1fr; }
  .repeat .ri.ab, .repeat .ri.w3 { grid-template-columns: 1fr 70px auto; }
  .bars .b { grid-template-columns: minmax(70px, 38%) 1fr auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}
