/* ProScan theme — dark neon (MONEXA-inspired): near-black surfaces, lime accent, spectrum glow */
:root {
  --lime: #c6ff3d;
  --neon: linear-gradient(100deg, #a855f7 0%, #ff4fd8 22%, #ffd23f 48%, #3dffa2 72%, #38bdf8 100%);
  --neon-soft: linear-gradient(100deg, rgba(168,85,247,.35), rgba(255,210,63,.3), rgba(61,255,162,.3), rgba(56,189,248,.35));
  --warm: linear-gradient(120deg, #ff8a00 0%, #ffb800 55%, #ffd96a 100%);
  --danger: #ff4d5e;
  --ok: #3dffa2;
  --radius: 22px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* light (optional) */
  --bg: #f2f2f5;
  --card: #ffffff;
  --card-2: #f0f0f4;
  --text: #0d0d12;
  --muted: #6e6e7a;
  --line: #e3e3ea;
  --primary: #0d0d12;
  --on-primary: #c6ff3d;
  --accent-text: #4d7c00;
  --primary-soft: #ececf2;
  --shadow: 0 6px 22px rgba(10, 10, 20, .07);
}
:root[data-theme="dark"] {
  --bg: #08080b;
  --card: #141418;
  --card-2: #1d1d23;
  --text: #f5f5f7;
  --muted: #8d8d99;
  --line: #26262e;
  --primary: #c6ff3d;
  --on-primary: #0a0a0c;
  --accent-text: #c6ff3d;
  --primary-soft: #1f2412;
  --shadow: 0 8px 30px rgba(0, 0, 0, .45);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: "Inter", "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; overscroll-behavior: none; letter-spacing: -.01em; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; transition: transform .12s ease, background .2s, opacity .2s; }
button:active { transform: scale(.96); }
input, select, textarea { font: inherit; color: var(--text); background: var(--card-2); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px; width: 100%; outline: none; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(198, 255, 61, .15); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--lime); }
input[type=range] { padding: 0; border: 0; background: transparent; accent-color: var(--lime); box-shadow: none; }
svg.ic { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
#app { display: flex; flex-direction: column; height: 100%; position: relative; }

/* top bar */
#topbar { display: flex; align-items: center; gap: 6px; padding: calc(12px + var(--safe-top)) 12px 10px 18px; background: var(--bg); z-index: 5; min-height: 60px; }
#topbar.hidden { display: none; }
#topbar h1 { flex: 1; margin: 0; font-size: 21px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.02em; }
#topbar h1 .brand { background: var(--neon); -webkit-background-clip: text; background-clip: text; color: transparent; }
#backBtn { margin-left: -8px; }
#topActions { display: flex; gap: 6px; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--card); }
.icon-btn:active { background: var(--card-2); }
.icon-btn.on { background: var(--primary); color: var(--on-primary); }
#view { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 16px 110px; -webkit-overflow-scrolling: touch; }
body.hide-nav #view { padding-bottom: 28px; }
#view.full { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
#view.enter > * { animation: rise .35s cubic-bezier(.2, .8, .2, 1) both; }
#view.enter > *:nth-child(2) { animation-delay: .04s; }
#view.enter > *:nth-child(3) { animation-delay: .08s; }

/* floating bottom nav */
#bottomnav { position: absolute; left: 14px; right: 14px; bottom: calc(12px + var(--safe-bottom)); display: flex; justify-content: space-around; align-items: center;
  background: rgba(22, 22, 27, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 28px; padding: 8px 6px; box-shadow: 0 12px 34px rgba(0, 0, 0, .45); z-index: 6; }
:root[data-theme="light"] #bottomnav { background: rgba(13, 13, 18, .94); }
#bottomnav button { display: flex; flex-direction: column; align-items: center; gap: 3px; color: #8d8d99; padding: 4px 8px; min-width: 56px; }
#bottomnav button small { font-size: 10.5px; font-weight: 600; }
#bottomnav button.active { color: #fff; }
#bottomnav button.active svg { color: var(--lime); filter: drop-shadow(0 0 6px rgba(198, 255, 61, .6)); }
#bottomnav .fab { width: 56px; height: 56px; min-width: 56px; border-radius: 50%; justify-content: center; margin-top: -30px; color: #0a0a0c;
  background: var(--neon); box-shadow: 0 0 0 5px var(--bg), 0 8px 26px rgba(255, 79, 216, .35), 0 6px 22px rgba(61, 255, 162, .25); }
#bottomnav .fab svg { width: 26px; height: 26px; stroke-width: 2.3; }
body.hide-nav #bottomnav { display: none; }

/* cards & text */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; border: 1px solid var(--line); }
.section-title { display: flex; align-items: center; justify-content: space-between; font-weight: 700; margin: 22px 2px 12px; font-size: 17px; }
.section-title a, .link { color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lbl { display: block; font-size: 12px; color: var(--muted); margin: 16px 0 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.hidden { display: none !important; }

/* buttons — pills */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px; border-radius: 999px;
  background: var(--primary); color: var(--on-primary); font-weight: 700; min-height: 50px; }
.btn:disabled { opacity: .45; }
.btn.block { width: 100%; }
.btn.secondary { background: var(--card-2); color: var(--text); border: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.glow { position: relative; margin-top: 16px; box-shadow: 0 0 24px rgba(198, 255, 61, .35); }
.btn-row { display: flex; gap: 10px; margin-top: 16px; }
.btn-row .btn { flex: 1; }
.btn-row.wrap .btn { flex: 1 1 40%; }
/* glowing spectrum border (like the Add/Send pills) */
.neon-border { position: relative; background: var(--card-2); border: 0; }
.neon-border::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; background: var(--neon);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }

/* home hero — the "balance" card */
.hero { position: relative; border-radius: 28px; padding: 22px 18px 18px; background: radial-gradient(120% 90% at 50% -10%, #2a2a33 0%, #141418 55%); overflow: hidden; color: #fff; }
:root[data-theme="light"] .hero { background: radial-gradient(120% 90% at 50% -10%, #2a2a33 0%, #0d0d12 60%); }
.hero::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; background: var(--neon);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .9; pointer-events: none; }
.hero::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: -60px; height: 90px; background: var(--neon); filter: blur(48px); opacity: .35; pointer-events: none; }
.hero .label { text-align: center; color: #9a9aa6; font-size: 13px; font-weight: 600; }
.hero .big { text-align: center; font-size: 46px; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 2px; }
.hero .big small { font-size: 18px; color: #9a9aa6; font-weight: 700; margin-left: 4px; }
.hero .pill-chip { display: flex; align-items: center; gap: 8px; margin: 10px auto 18px; width: max-content; background: rgba(255, 255, 255, .07); border-radius: 999px; padding: 6px 14px 6px 6px; font-size: 13px; font-weight: 600; color: #ddd; }
.toggle { width: 34px; height: 20px; border-radius: 10px; background: var(--lime); position: relative; flex: none; }
.toggle::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #0a0a0c; top: 3px; right: 3px; }
.hero .actions { display: flex; gap: 10px; position: relative; z-index: 1; }
.hero .actions button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; height: 52px; border-radius: 999px; color: #fff; font-weight: 700; background: rgba(255, 255, 255, .06); }
.hero .actions button svg { width: 20px; height: 20px; }

/* promo banner */
.banner { display: flex; align-items: center; gap: 12px; margin-top: 14px; border-radius: 22px; padding: 16px; background: var(--warm); color: #1a1000; cursor: pointer; position: relative; overflow: hidden; }
.banner b { font-size: 15px; display: block; }
.banner span { font-size: 12.5px; opacity: .8; }
.banner .bic { width: 54px; height: 54px; border-radius: 16px; background: rgba(0, 0, 0, .85); color: var(--lime); display: flex; align-items: center; justify-content: center; flex: none; }
.banner .bic svg { width: 28px; height: 28px; }

.search { position: relative; margin-bottom: 14px; }
.search input { padding-left: 44px; border-radius: 999px; background: var(--card); height: 50px; }
.search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; }

/* quick tiles */
.qgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qitem { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 11.5px; font-weight: 600; line-height: 1.2;
  padding: 14px 4px 12px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); color: var(--text); }
.qitem .qi { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--c, var(--lime));
  background: color-mix(in srgb, var(--c, #c6ff3d) 14%, transparent); box-shadow: inset 0 0 0 2px var(--c, var(--lime)), 0 0 16px color-mix(in srgb, var(--c, #c6ff3d) 35%, transparent); }
.qitem .qi svg { width: 21px; height: 21px; }

/* big category tiles (like Books 25%) */
.stat-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.stile { border-radius: 22px; padding: 14px; background: var(--card); border: 1px solid var(--line); position: relative; overflow: hidden; cursor: pointer; text-align: left; }
.stile .t { color: var(--muted); font-size: 12px; font-weight: 600; }
.stile .v { font-size: 28px; font-weight: 800; margin-top: 4px; letter-spacing: -.03em; }
.stile .v small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.stile .bar { height: 6px; border-radius: 3px; background: var(--card-2); margin-top: 10px; overflow: hidden; }
.stile .bar > div { height: 100%; background: var(--neon); border-radius: 3px; }
.stile .glow-ic { position: absolute; right: 12px; top: 12px; color: var(--c); filter: drop-shadow(0 0 8px var(--c)); }

/* file rows — like transactions */
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 20px; padding: 10px 6px 10px 10px; border: 1px solid var(--line); cursor: pointer; }
.file-item .thumb { width: 46px; height: 46px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden;
  font-size: 10px; font-weight: 800; color: var(--c, var(--lime)); background: color-mix(in srgb, var(--c, #c6ff3d) 12%, transparent); box-shadow: inset 0 0 0 2px var(--c, var(--lime)); }
.file-item .thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; padding: 3px; }
.file-item .thumb.ring { --c: var(--lime); }
.file-item .meta { flex: 1; min-width: 0; }
.file-item .name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.file-item .sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.file-item .amount { text-align: right; font-size: 13px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.file-item .amount b { font-weight: 700; }
.file-item .fav { color: #ffd23f; }
.file-item .fav svg { width: 14px; height: 14px; fill: #ffd23f; }
.file-item .icon-btn { background: transparent; width: 36px; height: 36px; }
.file-item.selected { box-shadow: 0 0 0 2px var(--lime); }
.folder-item .thumb { --c: #ffb800; }
.empty { text-align: center; color: var(--muted); padding: 34px 20px; }
.empty svg { width: 54px; height: 54px; opacity: .5; margin-bottom: 8px; }

.tabs { display: flex; background: var(--card); border-radius: 999px; padding: 5px; margin-bottom: 14px; border: 1px solid var(--line); }
.tabs button { flex: 1; padding: 10px; border-radius: 999px; font-weight: 700; color: var(--muted); font-size: 14px; }
.tabs button.active { background: var(--primary); color: var(--on-primary); }
.tool-cat { margin-bottom: 6px; }

/* overlays */
#overlays > * { position: fixed; inset: 0; z-index: 50; }
.scrim { background: rgba(0, 0, 0, .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.scrim.centered { align-items: center; padding: 20px; }
.sheet { background: var(--card); width: 100%; max-width: 560px; border-radius: 28px 28px 0 0; padding: 8px 18px calc(18px + var(--safe-bottom));
  max-height: 88vh; overflow-y: auto; animation: up .25s cubic-bezier(.2, .8, .2, 1); border-top: 1px solid var(--line); }
.sheet .grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 6px auto 14px; }
.sheet h3, .dialog h3 { margin: 4px 0 14px; font-size: 18px; font-weight: 800; }
.sheet .opt { display: flex; align-items: center; gap: 14px; padding: 13px 8px; width: 100%; text-align: left; border-radius: 14px; font-weight: 600; }
.sheet .opt svg { color: var(--accent-text); }
.sheet .opt:active { background: var(--card-2); }
.sheet .opt.danger, .sheet .opt.danger svg { color: var(--danger); }
.dialog { background: var(--card); width: 100%; max-width: 420px; border-radius: 28px; padding: 20px; animation: pop .2s cubic-bezier(.2, .8, .2, 1); max-height: 90vh; overflow-y: auto; border: 1px solid var(--line); }
.dialog label, .field label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 7px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.field { margin-bottom: 6px; }
.full-overlay { background: var(--bg); display: flex; flex-direction: column; animation: slide .25s cubic-bezier(.2, .8, .2, 1); }
.full-overlay > header { display: flex; align-items: center; gap: 8px; padding: calc(12px + var(--safe-top)) 12px 10px; background: var(--bg); }
.full-overlay > header h2 { flex: 1; margin: 0; font-size: 19px; font-weight: 800; }
.full-overlay > .body { flex: 1; overflow: auto; padding: 8px 16px 24px; }
.success-ring { width: 74px; height: 74px; border-radius: 50%; margin: 6px auto 12px; display: flex; align-items: center; justify-content: center; color: #0a0a0c;
  background: var(--lime); box-shadow: 0 0 0 8px rgba(198, 255, 61, .15), 0 0 40px rgba(198, 255, 61, .45); animation: pop .35s cubic-bezier(.2, 1.4, .4, 1); }
.success-ring svg { width: 36px; height: 36px; stroke-width: 3; }
@keyframes fade { from { opacity: 0 } }
@keyframes up { from { transform: translateY(60px); opacity: .4 } }
@keyframes pop { from { transform: scale(.9); opacity: .3 } }
@keyframes slide { from { transform: translateX(30px); opacity: .3 } }
@keyframes rise { from { transform: translateY(14px); opacity: 0 } }

#toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-bottom)); transform: translateX(-50%) translateY(10px); background: #f5f5f7; color: #0a0a0c;
  padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 86vw; text-align: center; box-shadow: 0 8px 26px rgba(0, 0, 0, .4); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.loader { background: rgba(0, 0, 0, .65); display: flex; align-items: center; justify-content: center; z-index: 90 !important; backdrop-filter: blur(3px); }
.loader .box { background: var(--card); border-radius: 26px; padding: 26px 28px; display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 220px; border: 1px solid var(--line); font-weight: 600; }
.spinner { width: 44px; height: 44px; border-radius: 50%; background: conic-gradient(from 0deg, #a855f7, #ff4fd8, #ffd23f, #3dffa2, #38bdf8, #a855f7);
  -webkit-mask: radial-gradient(circle, transparent 15px, #000 16px); mask: radial-gradient(circle, transparent 15px, #000 16px); animation: spin .9s linear infinite; }
.progress { width: 100%; height: 6px; background: var(--card-2); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: var(--neon); width: 0; transition: width .2s; }
@keyframes spin { to { transform: rotate(360deg) } }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); font-size: 13px; font-weight: 650; }
.chip svg { width: 16px; height: 16px; }
.chip.active { background: var(--primary); color: var(--on-primary); border-color: transparent; }

/* pdf pages */
.pages { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 14px; }
.page-wrap { position: relative; background: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); border-radius: 4px; }
.page-wrap canvas.pdfc { display: block; width: 100%; height: 100%; border-radius: 4px; }
.page-wrap .pnum { position: absolute; right: 8px; bottom: 8px; background: rgba(10, 10, 12, .75); color: #fff; font-size: 11px; padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.page-wrap svg.anno { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.viewer-bg { background: var(--bg); flex: 1; overflow: auto; }
.preview-img { max-width: 100%; display: block; margin: 0 auto; box-shadow: 0 6px 24px rgba(0, 0, 0, .3); background: #fff; border-radius: 6px; }
.toolbar { display: flex; gap: 4px; background: var(--card); margin: 0 10px calc(10px + var(--safe-bottom)); padding: 6px; border-radius: 24px; overflow-x: auto; border: 1px solid var(--line); scrollbar-width: none; }
.toolbar::-webkit-scrollbar { display: none; }
.toolbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 8px; min-width: 62px; border-radius: 18px; font-size: 11px; font-weight: 600; color: var(--muted); flex: none; }
.toolbar button.on { background: var(--primary); color: var(--on-primary); }
.subbar { display: flex; gap: 10px; align-items: center; padding: 8px 14px; overflow-x: auto; min-height: 52px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); flex: none; }
.swatch.on { box-shadow: 0 0 0 2px var(--lime); }

.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; }
.pthumb { position: relative; background: var(--card); border-radius: 18px; padding: 7px; border: 1px solid var(--line); text-align: center; font-size: 12px; font-weight: 600; cursor: pointer; }
.pthumb canvas, .pthumb img { width: 100%; display: block; background: #fff; border-radius: 8px; }
.pthumb.sel { box-shadow: 0 0 0 2px var(--lime), 0 0 18px rgba(198, 255, 61, .35); }
.pthumb .check { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; background: var(--lime); color: #0a0a0c; display: none; align-items: center; justify-content: center; z-index: 1; }
.pthumb .check svg { width: 16px; height: 16px; stroke-width: 3; }
.pthumb.sel .check { display: flex; }
.pthumb .pactions { display: flex; justify-content: center; margin-top: 4px; }
.pthumb .pactions button { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.pthumb .pactions svg { width: 16px; height: 16px; }

/* scanner */
.scanner { background: #000; color: #fff; flex: 1; display: flex; flex-direction: column; position: relative; }
.scanner .stage { flex: 1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.scanner video, .scanner .stage canvas.overlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.scanner .controls { display: flex; align-items: center; justify-content: space-around; padding: 18px 10px calc(22px + var(--safe-bottom)); background: #000; }
.scanner .shutter { width: 76px; height: 76px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px #000, 0 0 0 7px transparent; position: relative; }
.scanner .shutter::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; background: var(--neon); z-index: -1; }
.scanner .shutter:active { background: var(--lime); }
.scanner .side-btn { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; width: 74px; color: #fff; font-weight: 600; }
.scanner .side-btn svg { width: 26px; height: 26px; }
.scanner .batch-thumb { width: 48px; height: 60px; border-radius: 10px; border: 2px solid var(--lime); overflow: visible; position: relative; background: #1d1d23; }
.scanner .batch-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.scanner .batch-thumb b { position: absolute; top: -9px; right: -9px; background: var(--lime); color: #0a0a0c; border-radius: 10px; font-size: 11px; padding: 1px 7px; }
.scanner .topctl { position: absolute; top: calc(12px + var(--safe-top)); left: 12px; right: 12px; display: flex; justify-content: space-between; z-index: 3; }
.scanner .topctl .icon-btn { background: rgba(20, 20, 24, .7); color: #fff; backdrop-filter: blur(8px); }
.scanner .topctl .icon-btn.on { background: var(--lime); color: #000; }
.scanner .hint { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); text-align: center; font-size: 13px; z-index: 2; background: rgba(20, 20, 24, .75); padding: 8px 14px; border-radius: 999px; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.scanner .hint:empty { display: none; }
.scanner .nocam { padding: 30px; text-align: center; color: #bbb; position: relative; z-index: 1; }
.scanner .nocam svg { width: 48px; height: 48px; color: var(--lime); }
.crop-stage { flex: 1; position: relative; background: #000; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.crop-stage .cwrap { position: relative; }
.crop-stage .cwrap canvas { display: block; }
.crop-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.handle { fill: rgba(198, 255, 61, .35); stroke: #c6ff3d; }
.filter-strip { display: flex; gap: 12px; overflow-x: auto; padding: 12px; background: #000; }
.filter-strip button { color: #aaa; font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 5px; font-weight: 600; }
.filter-strip canvas { width: 62px; height: 78px; object-fit: cover; border-radius: 12px; border: 2px solid transparent; }
.filter-strip button.on canvas { border-color: var(--lime); box-shadow: 0 0 14px rgba(198, 255, 61, .5); }
.filter-strip button.on { color: #fff; }
.dark-bar { display: flex; justify-content: space-around; align-items: center; background: #000; color: #fff; padding: 10px 6px calc(14px + var(--safe-bottom)); }
.dark-bar button { color: #fff; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; min-width: 60px; font-weight: 600; }
.dark-bar button.primary { background: var(--lime); color: #0a0a0c; border-radius: 999px; padding: 8px 18px; }

.sigpad { width: 100%; height: 200px; background: #fff; border: 1px dashed #bbb; border-radius: 18px; touch-action: none; display: block; }
.sig-list { display: flex; gap: 10px; flex-wrap: wrap; }
.sig-list .s { position: relative; background: #fff; border-radius: 14px; padding: 8px; cursor: pointer; }
.sig-list .s img { height: 50px; display: block; }
.sig-list .s button { position: absolute; top: -8px; right: -8px; background: var(--danger); color: #fff; border-radius: 50%; width: 22px; height: 22px; font-size: 12px; }

.result-box { word-break: break-word; white-space: pre-wrap; background: var(--card-2); border-radius: 16px; padding: 14px; font-size: 15px; max-height: 40vh; overflow: auto; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14px; }
.kv b { color: var(--muted); font-weight: 600; }
.badge { display: inline-block; background: var(--primary-soft); color: var(--accent-text); font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; letter-spacing: .03em; }
.drop-hint { border: 1.5px dashed var(--line); border-radius: 24px; padding: 30px 14px; text-align: center; color: var(--muted); cursor: pointer; background: var(--card); }
.drop-hint svg { width: 44px; height: 44px; color: var(--accent-text); }
[hidden] { display: none !important; }
