@charset "UTF-8";
/* ==========================================================================
   QRgen — design system (v1.1)

   The code is the stage. Everything else floats on glass: a HUD of pills at
   the top, an icon dock at the side, a tool panel that slides out of it, and
   dialogs for the rest. Dark by default, because the artwork is what should
   glow; a light theme for daylight and for judging pale palettes.
   ========================================================================== */

@font-face { font-family: 'Outfit'; src: url('fonts/outfit-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/inter-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #07070b;
  --bg-2: #0e0e15;
  --accent: #a78bfa;
  --accent-2: #f472b6;
  --glass: rgba(12, 12, 18, .74);
  --glass-2: rgba(22, 22, 32, .96);
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --text: #eeeef4;
  --muted: rgba(238, 238, 244, .58);
  --faint: rgba(238, 238, 244, .32);
  --input: rgba(255, 255, 255, .05);
  --hover: rgba(255, 255, 255, .08);
  --good: #4ade80; --good-wash: rgba(74, 222, 128, .14);
  --warn: #fbbf24; --warn-wash: rgba(251, 191, 36, .14);
  --danger: #f87171; --danger-wash: rgba(248, 113, 113, .14);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --display: 'Outfit', var(--font);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 20px; --r-sm: 12px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --shadow: 0 24px 64px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .06);
  --tint: color-mix(in oklab, var(--accent) 22%, transparent);
  --tint-soft: color-mix(in oklab, var(--accent) 10%, transparent);
  --ring: color-mix(in oklab, var(--accent) 50%, transparent);
  --checker: conic-gradient(#15151d 25%, #0c0c12 0 50%, #15151d 0 75%, #0c0c12 0) 0 0 / 24px 24px;
  --dock-w: 62px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f4f8; --bg-2: #e9eaf0;
  --accent: #6d5bff; --accent-2: #e0409a;
  --glass: rgba(255, 255, 255, .72); --glass-2: rgba(255, 255, 255, .97);
  --line: rgba(20, 20, 40, .1); --line-2: rgba(20, 20, 40, .18);
  --text: #15161f; --muted: rgba(21, 22, 31, .62); --faint: rgba(21, 22, 31, .36);
  --input: rgba(20, 20, 40, .05); --hover: rgba(20, 20, 40, .08);
  --good: #15803d; --good-wash: rgba(21, 128, 61, .12);
  --warn: #b45309; --warn-wash: rgba(180, 83, 9, .12);
  --danger: #b91c1c; --danger-wash: rgba(185, 28, 28, .12);
  --shadow: 0 20px 50px rgba(20, 22, 40, .16), inset 0 1px 0 rgba(255, 255, 255, .7);
  --checker: conic-gradient(#e2e3ea 25%, #f3f4f8 0 50%, #e2e3ea 0 75%, #f3f4f8 0) 0 0 / 24px 24px;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3f4f8; --bg-2: #e9eaf0;
    --accent: #6d5bff; --accent-2: #e0409a;
    --glass: rgba(255, 255, 255, .72); --glass-2: rgba(255, 255, 255, .97);
    --line: rgba(20, 20, 40, .1); --line-2: rgba(20, 20, 40, .18);
    --text: #15161f; --muted: rgba(21, 22, 31, .62); --faint: rgba(21, 22, 31, .36);
    --input: rgba(20, 20, 40, .05); --hover: rgba(20, 20, 40, .08);
    --good: #15803d; --good-wash: rgba(21, 128, 61, .12);
    --warn: #b45309; --warn-wash: rgba(180, 83, 9, .12);
    --danger: #b91c1c; --danger-wash: rgba(185, 28, 28, .12);
    --shadow: 0 20px 50px rgba(20, 22, 40, .16), inset 0 1px 0 rgba(255, 255, 255, .7);
    --checker: conic-gradient(#e2e3ea 25%, #f3f4f8 0 50%, #e2e3ea 0 75%, #f3f4f8 0) 0 0 / 24px 24px;
    color-scheme: light;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font: 13.5px/1.45 var(--font); overflow: hidden; overscroll-behavior: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { position: fixed; inset: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button, input { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
a { color: var(--accent); }
svg.ic { width: 20px; height: 20px; flex: none; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.ic.big { width: 52px; height: 52px; stroke-width: 1.4; }
h3, p { margin: 0; }
p + p { margin-top: .6em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--input); padding: .1em .4em; border-radius: 6px; }
small { color: var(--faint); font-weight: 500; }
.h { font: 700 10.5px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; }
.h:first-child { margin-top: 2px; }
.hint { color: var(--muted); font-size: 12.5px; }
.sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 3px; flex: none; }
.desk { display: none; }
@media (min-width: 760px) { .desk { display: inline-flex; } }

/* ---------- glass ---------- */
.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .012)), var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) { :root { --glass: var(--glass-2); } }

/* ---------- stage ---------- */
#stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; }
#stage:active { cursor: grabbing; }
#stage-bg { position: absolute; inset: 0; background: var(--checker); }
#stage-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 42%, transparent 25%, var(--bg) 100%); opacity: .8; }
#stage-wrap { position: absolute; left: 50%; top: 50%; transform-origin: 0 0; will-change: transform; }
#stage-wrap canvas { display: block; border-radius: 6px; filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .45)) drop-shadow(0 4px 10px rgba(0, 0, 0, .25)); }
#stage-wrap.pulse canvas { animation: pulse-out .55s var(--ease); }
@keyframes pulse-out { 0% { filter: brightness(1.35) drop-shadow(0 0 30px var(--accent)); } 100% { filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .45)); } }

#status { position: absolute; left: 50%; bottom: calc(18px + var(--sab)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px 0 12px; border-radius: 999px; font: 500 12px/1 var(--mono); color: var(--muted); white-space: nowrap; max-width: calc(100vw - 28px); z-index: 15; pointer-events: none; }
#status .st-check { display: flex; align-items: center; gap: 8px; color: var(--text); font-family: var(--font); font-weight: 600; }
#status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 10px transparent; transition: .3s; }
#status.ok .dot { background: var(--good); box-shadow: 0 0 12px var(--good); }
#status.bad .dot { background: var(--danger); box-shadow: 0 0 12px var(--danger); }
#status.warn .dot { background: var(--warn); box-shadow: 0 0 12px var(--warn); }
#status.busy .dot { animation: pulse 1s ease-in-out infinite; background: var(--accent); }
@keyframes pulse { 50% { opacity: .3; } }
#status .st-meta { display: flex; gap: 12px; overflow: hidden; }
#zoomctl { position: absolute; right: calc(14px + var(--sar)); bottom: calc(18px + var(--sab)); display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; z-index: 15; }
#zoomctl button { min-width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted); border-radius: 999px; display: grid; place-items: center; cursor: pointer; padding: 0 8px; font: 600 11px/1 var(--mono); }
#zoomctl button:hover { color: var(--text); background: var(--hover); }
#warnings { position: absolute; left: 50%; bottom: calc(68px + var(--sab)); transform: translateX(-50%); list-style: none; margin: 0; padding: 8px 12px; border-radius: 14px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--warn); max-width: min(560px, calc(100vw - 28px)); z-index: 14; pointer-events: none; }
#warnings li.error { color: var(--danger); }
#warnings li.info { color: var(--muted); }

/* ---------- HUD ---------- */
#hud { position: absolute; top: calc(12px + var(--sat)); left: calc(14px + var(--sal)); right: calc(14px + var(--sar)); display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none; z-index: 20; }
#hud > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 9px; height: 44px; padding: 0 10px; border-radius: 999px; flex: none; }
.mark svg { width: 22px; height: 22px; color: var(--accent); stroke: none; }
.wordmark { font: 400 14px/1 var(--display); letter-spacing: .34em; text-transform: uppercase; padding-left: .1em; }
.ver { font: 500 10px/1 var(--mono); letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); background: var(--input); border-radius: 999px; padding: 5px 7px 4px; cursor: pointer; transition: .2s; }
.ver:hover { color: var(--text); border-color: var(--accent); box-shadow: 0 0 12px var(--tint); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill { display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; height: 44px; }
.pill button, .ibtn { position: relative; height: 36px; min-width: 36px; padding: 0; border-radius: 999px; border: 0; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; transition: background .2s, color .2s, transform .2s, box-shadow .2s; }
.pill button:hover, .ibtn:hover { color: var(--text); background: var(--hover); }
.pill button:active, .ibtn:active { transform: scale(.92); }
.pill button.on { color: var(--accent); background: var(--tint); box-shadow: 0 0 16px var(--tint); }
.pill button:disabled { opacity: .28; cursor: default; background: transparent; }
.pill button.accent { padding: 0 14px 0 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 600; font-size: 13px; box-shadow: 0 6px 18px var(--tint); }
.pill button.accent:hover { filter: brightness(1.08); }
.pill button .lbl { display: none; }
@media (min-width: 760px) { .pill button.accent .lbl { display: inline; } }
.ico-moon { display: none; }
:root[data-theme="dark"] .ico-sun { display: none; } :root[data-theme="dark"] .ico-moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ico-sun { display: none; } :root:not([data-theme="light"]) .ico-moon { display: block; } }
.ibtn.glass { width: 44px; height: 44px; }

/* ---------- dock ---------- */
#dock { position: absolute; right: calc(14px + var(--sar)); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 22px; z-index: 30; }
#dock button { position: relative; width: 48px; height: 48px; border-radius: 15px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; transition: background .2s, color .2s, box-shadow .25s, transform .2s; }
#dock button:hover { color: var(--text); background: var(--hover); }
#dock button:active { transform: scale(.94); }
#dock button .ic { width: 22px; height: 22px; }
#dock button span { position: absolute; right: calc(100% + 12px); top: 50%; transform: translateY(-50%) translateX(6px); font: 600 10px/1 var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--text); background: var(--glass-2); border: 1px solid var(--line); padding: 7px 10px; border-radius: 8px; opacity: 0; pointer-events: none; transition: .2s var(--ease); white-space: nowrap; }
#dock button:hover span { opacity: 1; transform: translateY(-50%); }
#dock button.on { color: var(--accent); background: var(--tint); box-shadow: inset 0 0 0 1px var(--ring), 0 0 24px var(--tint); }
#dock button.on span { display: none; }
.dock-sep { height: 1px; margin: 4px 10px; background: var(--line-2); }
body.mode-qr .bc-only, body.mode-barcode .qr-only { display: none !important; }

/* ---------- tool panel ---------- */
#pop { position: absolute; right: calc(14px + var(--sar) + var(--dock-w) + 12px); top: 50%; transform: translateY(-50%); width: min(400px, calc(100vw - 120px)); max-height: min(80vh, 780px); border-radius: var(--r); display: flex; flex-direction: column; z-index: 25; animation: popin .22s var(--ease); }
@keyframes popin { from { opacity: 0; transform: translateY(-50%) translateX(10px); } }
.pop-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 10px 18px; border-bottom: 1px solid var(--line); flex: none; }
.pop-title { font: 500 12px/1 var(--display); letter-spacing: .26em; text-transform: uppercase; }
.pop-tools { display: flex; gap: 2px; }
.pop-pin[aria-pressed="true"] { color: var(--accent); background: var(--tint); }
.pop-body { overflow: auto; padding: 14px 18px 18px; overscroll-behavior: contain; scrollbar-width: thin; }
.pb { display: flex; flex-direction: column; gap: 10px; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span:first-child { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; gap: 6px; align-items: baseline; }
input[type="text"], input[type="url"], input[type="email"], input[type="tel"], input[type="number"], input[type="datetime-local"], textarea, .select {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--input); color: var(--text); font-size: 16px; outline: none; transition: box-shadow .15s, border-color .15s;
}
@media (min-width: 760px) { input[type="text"], input[type="url"], input[type="email"], input[type="tel"], input[type="number"], input[type="datetime-local"], textarea, .select { font-size: 13.5px; } }
textarea { resize: vertical; line-height: 1.4; font-family: var(--mono); font-size: 12.5px; }
input:focus-visible, textarea:focus-visible, .select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.select { appearance: none; -webkit-appearance: none; padding-right: 32px; 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; }
.select option { color: #111; background: #fff; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px 12px; }
@media (max-width: 420px) { .grid-2 { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 32px; font-size: 13px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.slider { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; }
.slider > span:first-child { grid-column: 1 / -1; }
.slider output { font: 600 11px/1 var(--mono); color: var(--muted); min-width: 40px; text-align: right; }
input[type="range"] { width: 100%; height: 26px; margin: 0; accent-color: var(--accent); }
.colour-input { display: flex; align-items: center; gap: 8px; }
.colour-input input[type="color"] { width: 40px; height: 40px; padding: 0; border: 1px solid var(--line-2); border-radius: 11px; background: none; cursor: pointer; flex: none; }
.colour-input input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
.colour-input input[type="color"]::-webkit-color-swatch { border: none; border-radius: 8px; }
.colour-input .hex { font-family: var(--mono); text-transform: lowercase; }
.adv { border-top: 1px solid var(--line); padding-top: 6px; }
.adv summary { cursor: pointer; font: 700 10.5px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 8px 0; list-style: none; }
.adv summary::-webkit-details-marker { display: none; }
.adv summary::before { content: '▸ '; }
.adv[open] summary::before { content: '▾ '; }
.adv .grid-2 { margin-top: 6px; }
.payload { margin: 6px 0 0; padding: 10px 12px; background: var(--input); border-radius: 10px; font-size: 11.5px; white-space: pre-wrap; word-break: break-all; max-height: 110px; overflow: auto; color: var(--muted); font-family: var(--mono); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--input); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; transition: background .15s, transform .08s, box-shadow .15s; }
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; box-shadow: 0 6px 18px var(--tint); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 12px; border-radius: 9px; }
.btn.danger { color: var(--danger); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .ic { width: 17px; height: 17px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* chips, segmented, tiles, swatches */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--input); font-weight: 600; font-size: 12.5px; cursor: pointer; color: var(--muted); transition: .15s; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.segmented { display: inline-flex; padding: 3px; background: var(--input); border-radius: 11px; gap: 2px; max-width: 100%; }
.segmented button { min-height: 32px; padding: 0 12px; border: none; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.segmented button.active { background: var(--glass-2); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 7px; }
.tiles-wide { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.tile { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 7px 4px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--input); cursor: pointer; color: var(--muted); font-size: 10.5px; font-weight: 600; transition: border-color .15s, background .15s, color .15s; }
.tile svg { width: 42px; height: 42px; border-radius: 8px; background: #fff; }
.tiles-wide .tile svg { width: 76px; height: 54px; }
.tile:hover { border-color: var(--line-2); color: var(--text); }
.tile.active { border-color: var(--accent); background: var(--tint-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--ring); }
.palettes { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch { display: inline-flex; width: 52px; height: 32px; border-radius: 10px; border: 1px solid var(--line-2); overflow: hidden; cursor: pointer; padding: 0; background: none; }
.swatch span { flex: 1; height: 100%; }
.swatch.single { width: 32px; }
.swatch:hover { border-color: var(--accent); }
.contrast { margin-top: 10px; font-size: 12.5px; padding: 8px 10px; border-radius: 10px; background: var(--input); color: var(--muted); }
.contrast.bad { background: var(--danger-wash); color: var(--danger); }
.contrast.warn { background: var(--warn-wash); color: var(--warn); }
.contrast.ok { background: var(--good-wash); color: var(--good); }

/* dropzone */
.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--r-sm); padding: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over, .dropzone:focus-visible { border-color: var(--accent); background: var(--tint-soft); outline: none; }
.dropzone-inner { display: flex; align-items: center; gap: 12px; }
.dropzone-thumb { width: 60px; height: 60px; border-radius: 12px; background: var(--checker); flex: none; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); color: var(--muted); }
.dropzone-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
#logo-options { display: flex; flex-direction: column; gap: 8px; }

/* project rows */
.rows { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.row-item { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.row-item input { min-height: 34px; font-size: 12.5px; padding: 6px 10px; font-family: var(--mono); }
.row-item.active input:first-child { border-color: var(--accent); }
.row-item .ibtn { width: 32px; height: 32px; }

/* ---------- gallery ---------- */
#gallery { position: absolute; left: calc(14px + var(--sal)); top: calc(66px + var(--sat)); bottom: calc(18px + var(--sab)); width: min(380px, calc(100vw - 28px)); border-radius: var(--r); display: flex; flex-direction: column; z-index: 26; animation: slidein .25s var(--ease); }
@keyframes slidein { from { opacity: 0; transform: translateX(-12px); } }
.g-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 10px 18px; border-bottom: 1px solid var(--line); font: 500 12px/1 var(--display); letter-spacing: .26em; text-transform: uppercase; flex: none; }
.g-scroll { overflow: auto; padding: 12px 18px 18px; overscroll-behavior: contain; }
.g-scroll h3 { font: 700 10.5px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 14px 0 8px; display: flex; align-items: center; justify-content: space-between; }
.g-scroll h3:first-child { margin-top: 2px; }
.g-scroll .hint { margin-top: 4px; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.thumb { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--input); cursor: pointer; text-align: left; color: var(--muted); transition: .15s; }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; background: #fff; }
.thumb span { font-size: 10.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb:hover { border-color: var(--line-2); color: var(--text); }
.thumb.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--ring); color: var(--accent); }
.thumb .del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; min-width: 0; border-radius: 8px; background: var(--glass-2); opacity: 0; display: grid; place-items: center; }
.thumb .del .ic { width: 14px; height: 14px; }
.thumb:hover .del { opacity: 1; }

/* ---------- dialogs ---------- */
.dlg { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100vw; height: 100vh; margin: 0; inset: 0; display: none; place-items: center; overflow: hidden; color: var(--text); }
.dlg[open] { display: grid; }
.dlg::backdrop { background: rgba(4, 4, 8, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dlg-card { width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 24px - var(--sat) - var(--sab)); overflow: auto; border-radius: var(--r); padding: 0 20px 20px; display: flex; flex-direction: column; gap: 12px; animation: popup .22s var(--ease); overscroll-behavior: contain; outline: none; }
.dlg-wide .dlg-card { width: min(980px, calc(100vw - 24px)); height: min(820px, calc(100vh - 24px - var(--sat) - var(--sab))); }
@keyframes popup { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 10px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--glass-2); z-index: 1; margin: 0 -20px; }
.dlg-title { font: 500 12px/1 var(--display); letter-spacing: .26em; text-transform: uppercase; }
.ex-preview { display: flex; align-items: center; gap: 14px; }
.ex-preview canvas { width: 120px; height: auto; border-radius: 8px; background: var(--checker); border: 1px solid var(--line); }
.ex-dims { font: 500 12px/1.6 var(--mono); color: var(--muted); }

.help-layout { display: grid; grid-template-columns: 1fr; gap: 12px; min-height: 0; flex: 1; }
@media (min-width: 760px) { .help-layout { grid-template-columns: 200px minmax(0, 1fr); } .help-toc { position: sticky; top: 56px; align-self: start; } }
.help-toc { display: flex; flex-wrap: wrap; gap: 4px; }
@media (min-width: 760px) { .help-toc { flex-direction: column; flex-wrap: nowrap; } }
.help-toc a { display: block; padding: 7px 10px; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.help-toc a:hover { background: var(--input); color: var(--text); }
.help-toc a.active { background: var(--tint-soft); color: var(--accent); }
.prose { max-width: 72ch; font-size: 14px; line-height: 1.55; }
.prose h2 { font: 500 20px/1.3 var(--display); letter-spacing: .01em; margin: 1.6em 0 .5em; scroll-margin-top: 70px; }
.prose h2:first-child { margin-top: .4em; }
.prose h3 { font-size: 14.5px; font-weight: 700; margin: 1.3em 0 .4em; }
.prose p { margin: 0 0 .8em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 .8em; }
.prose li { margin: .25em 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 13px; margin: .6em 0 1em; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.prose .note { background: var(--tint-soft); border-radius: 10px; padding: 10px 14px; margin: .8em 0; }
.prose .warn { background: var(--warn-wash); border-radius: 10px; padding: 10px 14px; margin: .8em 0; }
.prose kbd { font-family: var(--mono); font-size: 11.5px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--input); }

.about-hero { display: flex; gap: 14px; align-items: center; }
.about-hero img { border-radius: 16px; flex: none; }
.about-name { font: 400 22px/1.2 var(--display); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; }
.about-meta { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; margin: 0; font-size: 13px; }
.about-meta dt { font: 700 10.5px/1.8 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.about-meta dd { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.changelog { display: flex; flex-direction: column; gap: 10px; }
.changelog .rel { border-left: 2px solid var(--accent); padding-left: 12px; }
.changelog .rel-head { display: flex; gap: 10px; align-items: baseline; font-weight: 700; font-size: 13px; }
.changelog ul { margin: 4px 0 0; padding-left: 1.1em; color: var(--muted); font-size: 12.5px; }
.about-links { color: var(--muted); font-size: 13px; }

/* ---------- scanner ---------- */
#scan { position: absolute; inset: 0; z-index: 40; background: var(--bg); display: grid; grid-template-rows: 1fr auto; }
@media (min-width: 900px) { #scan { grid-template-rows: 1fr; grid-template-columns: minmax(0, 1fr) 380px; } }
.scan-stage { position: relative; background: #050508; overflow: hidden; display: grid; place-items: center; }
.scan-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scan-idle { position: relative; z-index: 1; color: #d6d8e6; text-align: center; padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.scan-idle .hint { color: #8d92a8; max-width: 380px; }
.scan-top { position: absolute; top: calc(12px + var(--sat)); left: calc(14px + var(--sal)); right: calc(14px + var(--sar)); display: flex; justify-content: space-between; align-items: center; z-index: 2; }
.scan-top .ibtn { cursor: pointer; }
.scan-side { padding: 14px 16px calc(14px + var(--sab)); display: flex; flex-direction: column; gap: 10px; overflow: auto; max-height: 48vh; border-radius: var(--r) var(--r) 0 0; }
@media (min-width: 900px) { .scan-side { max-height: none; border-radius: 0; border-left: 1px solid var(--line); } }
.scan-result { border-radius: var(--r-sm); border: 1px solid var(--line); padding: 12px; background: var(--input); min-height: 80px; }
.scan-result.ok { border-color: var(--good); background: var(--good-wash); }
.scan-result.bad { border-color: var(--danger); background: var(--danger-wash); }
.result-kind { font: 700 10.5px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.result-title { font-size: 16px; font-weight: 700; word-break: break-word; }
.result-verdict { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; margin: 6px 0; }
.result-verdict.ok { color: var(--good); } .result-verdict.bad { color: var(--danger); }
.result-fields { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12.5px; margin: 8px 0; }
.result-fields dt { color: var(--muted); font-weight: 600; }
.result-fields dd { margin: 0; word-break: break-word; font-family: var(--mono); font-size: 12px; }
.result-raw { font-family: var(--mono); font-size: 11.5px; white-space: pre-wrap; word-break: break-all; background: var(--input); border-radius: 8px; padding: 8px 10px; margin: 8px 0; max-height: 120px; overflow: auto; color: var(--muted); }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.history-head { display: flex; justify-content: space-between; align-items: center; }
.scan-history { display: flex; flex-direction: column; gap: 6px; }
.scan-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--input); text-align: left; cursor: pointer; color: var(--text); }
.scan-item:hover { border-color: var(--line-2); }
.scan-item .k { font: 700 9.5px/1 var(--mono); color: var(--accent); background: var(--tint-soft); padding: 5px 6px; border-radius: 6px; text-transform: uppercase; }
.scan-item .v { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.scan-item .t { font-size: 10.5px; color: var(--faint); }

/* check list */
.checklist { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; }
.check-item { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; background: var(--input); font: 500 12px/1.3 var(--mono); color: var(--muted); word-break: break-all; }
.check-item .tick { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; }
.check-item.done { color: var(--text); background: var(--good-wash); }
.check-item.done .tick { background: var(--good); border-color: var(--good); color: #fff; }
.check-item.wrong { background: var(--danger-wash); color: var(--danger); }
#stage.logo-hover { cursor: move; }

/* ---------- toast & modal ---------- */
.toast { position: absolute; left: 50%; bottom: calc(72px + var(--sab)); transform: translateX(-50%); z-index: 60; padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 13px; max-width: min(92vw, 480px); text-align: center; animation: popup .2s var(--ease); }
.modal-back { position: absolute; inset: 0; z-index: 55; background: rgba(4, 4, 8, .5); display: grid; place-items: center; padding: 16px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal { border-radius: var(--r); padding: 20px; width: min(100%, 440px); display: flex; flex-direction: column; gap: 12px; animation: popup .18s var(--ease); }
.modal h3 { font: 500 16px/1.3 var(--display); }

/* ---------- mobile ---------- */
@media (max-width: 759px) {
  :root { --dock-w: 0px; }
  #hud { left: calc(10px + var(--sal)); right: calc(10px + var(--sar)); top: calc(8px + var(--sat)); gap: 6px; flex-wrap: wrap; }
  .brand { height: 40px; padding: 0 8px; gap: 7px; }
  .actions { width: 100%; justify-content: space-between; flex-wrap: nowrap; gap: 4px; }
  .actions .pill { padding: 3px; }
  #hud [data-act="copy"], #hud [data-act="about"], #hud [data-act="install"], #hud [data-act="share"], #hud .desk { display: none !important; }
  #zoomctl { display: none; }
  .wordmark { font-size: 12px; letter-spacing: .28em; }
  .pill { height: 40px; padding: 3px; } .pill button, .ibtn { height: 34px; min-width: 34px; }
  .pill button.accent { padding: 0 8px; }
  #dock { top: auto; right: auto; bottom: calc(10px + var(--sab)); left: 50%; transform: translateX(-50%); flex-direction: row; gap: 0; padding: 4px; border-radius: 20px; max-width: calc(100vw - 20px); overflow-x: auto; }
  #dock button { width: 44px; height: 44px; flex: none; }
  #dock button span { display: none; }
  .dock-sep { width: 1px; height: auto; margin: 10px 4px; }
  #pop { top: auto; right: 0; left: 0; bottom: calc(66px + var(--sab)); transform: none; width: auto; max-height: 62vh; border-radius: var(--r) var(--r) 0 0; margin: 0 8px; animation: sheet .25s var(--ease); }
  @keyframes sheet { from { opacity: 0; transform: translateY(16px); } }
  #status { bottom: calc(66px + var(--sab)); font-size: 11px; height: 34px; gap: 8px; }
  body.pop-open #status, body.pop-open #warnings, body.pop-open #zoomctl { opacity: 0; pointer-events: none; }
  #warnings { bottom: calc(108px + var(--sab)); }
  #gallery { left: 8px; right: 8px; width: auto; top: auto; bottom: calc(66px + var(--sab)); max-height: 70vh; border-radius: var(--r) var(--r) 0 0; animation: sheet .25s var(--ease); }
  .dlg-card { width: calc(100vw - 16px); }
  .toast { bottom: calc(130px + var(--sab)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { #hud, #dock, #pop, #gallery, #status, #zoomctl { display: none !important; } }
