/* ============ Instant Bond Checker — design system ============ */
:root {
  --fs: 1;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --r-lg: 22px; --r-md: 16px; --r-sm: 12px;
  --tab-h: 68px; --top-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* result states (shared, tuned per theme below) */
  --st-verified: #0f9d6b; --st-verified-bg: #e3f7ee;
  --st-found: #c77a07; --st-found-bg: #fff3dc;
  --st-none: #64748b; --st-none-bg: #eef1f4;
  --st-detected: #2563eb; --st-detected-bg: #e6eeff;
  --st-confirmed: #7c3aed; --st-confirmed-bg: #f0e9ff;
  --danger: #dc2626; --danger-bg: #fdecec;
  --gold: #f2b93b; --gold-2: #d58b0f; --gold-ink: #3d2700;
}

/* ---------- themes ---------- */
[data-theme="emerald"] {
  --bg: #f3f6f4; --bg-2: #e9efeb; --surface: #ffffff; --surface-2: #f5f8f6; --border: #e1e8e4;
  --text: #0f1f1a; --muted: #5d6f68; --primary: #0b6e57; --primary-2: #0f8c6e; --primary-ink: #ffffff; --soft: #e2f3ed;
  --hero-1: #0f8c6e; --hero-2: #064034; --bar: #f3f6f4; --shadow: 0 1px 2px rgba(10, 40, 30, .06), 0 8px 24px rgba(10, 40, 30, .06);
  color-scheme: light;
}
[data-theme="emerald-dark"] {
  --bg: #0a1411; --bg-2: #0e1b17; --surface: #12211c; --surface-2: #172a24; --border: #213830;
  --text: #e7f3ee; --muted: #8fa89f; --primary: #2dd4a4; --primary-2: #34e0b0; --primary-ink: #04261c; --soft: #153a2f;
  --hero-1: #0f6e57; --hero-2: #062a22; --bar: #0a1411; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
[data-theme="midnight"] {
  --bg: #0a0e1c; --bg-2: #0f1426; --surface: #131a30; --surface-2: #19213b; --border: #26304f;
  --text: #eef1fb; --muted: #9aa4c4; --primary: #f2c04d; --primary-2: #ffd36e; --primary-ink: #231800; --soft: #2a2a2e;
  --hero-1: #26355f; --hero-2: #0c1124; --bar: #0a0e1c; --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 30px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
[data-theme="ocean"] {
  --bg: #f2f6fb; --bg-2: #e7eef8; --surface: #ffffff; --surface-2: #f5f8fc; --border: #dde6f2;
  --text: #0c1a2b; --muted: #5b6b80; --primary: #0a66c2; --primary-2: #1a7fe0; --primary-ink: #ffffff; --soft: #e3eefb;
  --hero-1: #1479d8; --hero-2: #0a2e5c; --bar: #f2f6fb; --shadow: 0 1px 2px rgba(10, 30, 60, .06), 0 8px 24px rgba(10, 30, 60, .07);
  color-scheme: light;
}
[data-theme="royal"] {
  --bg: #100c1d; --bg-2: #161127; --surface: #1c1630; --surface-2: #231c3b; --border: #342a55;
  --text: #f1edfc; --muted: #a59cc4; --primary: #a78bfa; --primary-2: #c4b5fd; --primary-ink: #1a0f3a; --soft: #2c2350;
  --hero-1: #5b3fc4; --hero-2: #1d1442; --bar: #100c1d; --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 30px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
[data-theme="sand"] {
  --bg: #faf6ef; --bg-2: #f3ece0; --surface: #fffdf9; --surface-2: #f8f2e8; --border: #ebe1d0;
  --text: #2a1d0e; --muted: #7a6a55; --primary: #b45309; --primary-2: #c96a14; --primary-ink: #ffffff; --soft: #f7e7cf;
  --hero-1: #c2410c; --hero-2: #5a2306; --bar: #faf6ef; --shadow: 0 1px 2px rgba(60, 30, 0, .06), 0 8px 24px rgba(60, 30, 0, .07);
  color-scheme: light;
}
[data-theme="rose"] {
  --bg: #fff6f9; --bg-2: #fbeaf0; --surface: #ffffff; --surface-2: #fff4f8; --border: #f5dde7;
  --text: #2b0f1c; --muted: #84606f; --primary: #d61f69; --primary-2: #e8457f; --primary-ink: #ffffff; --soft: #fde3ee;
  --hero-1: #e0336f; --hero-2: #5c0b2e; --bar: #fff6f9; --shadow: 0 1px 2px rgba(60, 0, 20, .06), 0 8px 24px rgba(60, 0, 20, .07);
  color-scheme: light;
}
[data-theme="amoled"] {
  --bg: #000000; --bg-2: #050505; --surface: #0c0c0c; --surface-2: #141414; --border: #222222;
  --text: #f5f5f5; --muted: #8f8f8f; --primary: #34d399; --primary-2: #6ee7b7; --primary-ink: #002417; --soft: #0f2a20;
  --hero-1: #0c3b2e; --hero-2: #000000; --bar: #000000; --shadow: none;
  color-scheme: dark;
}
[data-theme="emerald-dark"], [data-theme="midnight"], [data-theme="royal"], [data-theme="amoled"] {
  --st-verified: #34d399; --st-verified-bg: rgba(52, 211, 153, .14);
  --st-found: #fbbf24; --st-found-bg: rgba(251, 191, 36, .14);
  --st-none: #94a3b8; --st-none-bg: rgba(148, 163, 184, .12);
  --st-detected: #60a5fa; --st-detected-bg: rgba(96, 165, 250, .15);
  --st-confirmed: #c4b5fd; --st-confirmed-bg: rgba(196, 181, 253, .15);
  --danger: #f87171; --danger-bg: rgba(248, 113, 113, .14);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: calc(16px * var(--fs)); -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.45;
  min-height: 100dvh; overflow-x: hidden; transition: background .3s var(--ease), color .3s var(--ease);
}
[dir="rtl"] body, [dir="rtl"] .input, [dir="rtl"] button { font-family: 'Plus Jakarta Sans', 'Noto Nastaliq Urdu', system-ui, sans-serif; }
[dir="rtl"] .mono, [dir="rtl"] .digits, [dir="rtl"] .numgrid { font-family: var(--mono); }
body.no-scroll { overflow: hidden; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; line-height: 1.2; }
h2 { font-size: 1.15rem; } h3 { font-size: 1.02rem; margin-bottom: .4rem; } h4 { font-size: .95rem; margin-bottom: .5rem; }
p { margin: .35rem 0; }
button { font: inherit; color: inherit; cursor: pointer; }
.ic { flex-shrink: 0; vertical-align: -0.2em; }
.mono { font-family: var(--mono); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .tiny { font-size: .74rem; } .big { font-size: 1.08rem; font-weight: 700; }
.center { text-align: center; } .right { text-align: end; } .op8 { opacity: .85; }
.row { display: flex; align-items: center; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .center-x { justify-content: center; }
.gap { gap: 12px; } .gap-s { gap: 8px; } .grow { flex: 1; min-width: 0; } .nowrap { white-space: nowrap; }
.mt { margin-top: 16px; } .mt-s { margin-top: 10px; } .mb { margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.text-success { color: var(--st-verified); } .text-danger { color: var(--danger) !important; }
.linklike { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- splash / offline / update ---------- */
#splash { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 14px; background: radial-gradient(circle at 30% 20%, #14b88a, #05302a 70%); color: #fff; font-size: 1.1rem; transition: opacity .45s var(--ease); }
#splash img { filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .35)); animation: pulse 1.4s ease-in-out infinite; }
#splash.hide { opacity: 0; pointer-events: none; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.offline-bar { display: none; position: sticky; top: 0; z-index: 30; background: #3f3f46; color: #fff; text-align: center; font-size: .78rem; padding: 4px 8px; }
body.offline .offline-bar { display: block; }
.update-banner { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab-h) + var(--safe-b) + 12px); z-index: 40; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--text); color: var(--bg); box-shadow: var(--shadow); max-width: 560px; margin: 0 auto; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 12px 0;
  display: flex; align-items: center; gap: 6px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; }
.brand-logo { width: 36px; height: 36px; flex-shrink: 0; filter: drop-shadow(0 4px 10px rgba(11, 110, 87, .25)); }
.brand-logo svg { width: 100%; height: 100%; display: block; }
.brand-text { font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.brand-text b { color: var(--primary); }
.tb-title { font-size: 1.08rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent; color: var(--text); transition: background .2s; flex-shrink: 0; }
.icon-btn:hover, .icon-btn:active { background: var(--surface-2); }
.badge-dot { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .66rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }

/* ---------- view ---------- */
.view { padding: 14px 16px calc(var(--tab-h) + var(--safe-b) + 28px); max-width: 640px; margin: 0 auto; }
.view.enter .view-inner { animation: viewIn .35s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }
.view-inner > * + * { margin-top: 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-top: 22px !important; }
.section-head h2 { font-size: 1.05rem; }
.section-head a, .section-head button { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.group-title { display: flex; align-items: center; gap: 8px; margin-top: 22px !important; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; height: calc(var(--tab-h) + var(--safe-b)); padding: 0 6px var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--border);
}
@media (min-width: 700px) { .tabbar { left: 50%; right: auto; width: 640px; transform: translateX(-50%); bottom: 12px; border-radius: 24px; border: 1px solid var(--border); box-shadow: var(--shadow); padding-bottom: 0; height: var(--tab-h); } }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: .7rem; font-weight: 600; padding: 6px 0; transition: color .2s; }
.tab-ic { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 15px; transition: background .25s var(--ease), transform .2s; }
.tab.active { color: var(--primary); }
.tab.active .tab-ic { background: var(--soft); }
.tab:active .tab-ic { transform: scale(.92); }
.tab-scan .tab-ic { width: 56px; height: 56px; border-radius: 20px; margin-top: -26px; color: #fff; background: linear-gradient(140deg, var(--hero-1), var(--hero-2)); box-shadow: 0 10px 24px color-mix(in srgb, var(--hero-1) 45%, transparent), inset 0 1px 0 rgba(255, 255, 255, .25); }
.tab-scan.active .tab-ic { background: linear-gradient(140deg, var(--gold), var(--gold-2)); color: var(--gold-ink); }

/* ---------- cards ---------- */
.card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); color: var(--text); }
button.card { width: 100%; text-align: start; }
.card-tint { background: linear-gradient(160deg, var(--soft), var(--surface) 70%); }
.card-hero {
  position: relative; overflow: hidden; color: #fff; border: 0; padding: 20px 18px;
  background: radial-gradient(120% 140% at 0% 0%, var(--hero-1) 0%, var(--hero-2) 75%);
  box-shadow: 0 18px 40px -12px color-mix(in srgb, var(--hero-2) 70%, transparent);
}
.hero-glow { position: absolute; width: 280px; height: 280px; right: -90px; top: -120px; border-radius: 50%; background: radial-gradient(circle, rgba(242, 185, 59, .35), transparent 65%); pointer-events: none; }
.hero-title { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; }
.hero-title .ic { color: var(--gold); }
.hero-sub { opacity: .85; font-size: .88rem; margin-bottom: 14px; }
.hero-form { display: grid; gap: 12px; position: relative; }
.hero-form .select { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .22); }
.hero-form .select option { color: #111; }
.hero-form .digits .db { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #fff; }
.hero-form .digits .db.filled { background: rgba(255, 255, 255, .2); border-color: var(--gold); }
.hero-form .digits .db.cursor { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .2); }

.hello { display: flex; align-items: center; justify-content: space-between; }
.h-name { font-size: 1.55rem; font-weight: 800; }
.avatar { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 1.15rem; background: linear-gradient(140deg, hsl(var(--h) 70% 45%), hsl(calc(var(--h) + 30) 70% 30%)); box-shadow: 0 6px 16px hsl(var(--h) 60% 30% / .35); flex-shrink: 0; }
.avatar.lg { width: 52px; height: 52px; } .avatar.xl { width: 84px; height: 84px; font-size: 2rem; margin: 0 auto 10px; }

.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px dashed var(--border); font-size: .85rem; }
.banner-demo { background: var(--st-found-bg); border-color: color-mix(in srgb, var(--st-found) 40%, transparent); color: var(--text); }
.banner-demo .ic { color: var(--st-found); }
.banner-official { background: var(--st-verified-bg); border: 1px solid color-mix(in srgb, var(--st-verified) 35%, transparent); color: var(--text); }
.banner-official .ic { color: var(--st-verified); }
.src-link { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }

.win-strip { display: flex; align-items: center; gap: 12px; background: linear-gradient(120deg, #fff3c4, #f8c94a 60%, #e09a1a); color: #3d2700; border: 0; }
.win-strip .ws-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: rgba(255, 255, 255, .5); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 8px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); color: var(--text); min-width: 0; }
.stat b { font-size: .95rem; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.stat span:last-child { font-size: .7rem; color: var(--muted); white-space: nowrap; }
.stat-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--soft); color: var(--primary); margin-bottom: 4px; }
.stat-ic.gold { background: #fdf0cc; color: #b26b00; }
@media (max-width: 340px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.hscroll { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 16px 6px; margin: 10px -16px 0 !important; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.up-card { scroll-snap-align: start; flex: 0 0 140px; display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--r-md); color: #fff; background: linear-gradient(150deg, hsl(var(--h) 65% 42%), hsl(calc(var(--h) + 25) 70% 22%)); box-shadow: 0 10px 20px -10px hsl(var(--h) 60% 25% / .6); }
.up-denom { font-weight: 700; font-size: .85rem; opacity: .9; }
.up-days b { font-size: 1.8rem; font-weight: 800; letter-spacing: -.03em; }
.up-date, .up-prize { font-size: .75rem; opacity: .85; }

.ds-card .li-ic { background: var(--soft); color: var(--primary); }

/* ---------- lists ---------- */
.list { padding: 4px; }
.list.card { padding: 4px; }
.list-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text); text-align: start; transition: background .15s; }
.list-item + .list-item { border-top: 1px solid var(--border); border-radius: 0; }
a.list-item:hover, button.list-item:hover, a.list-item:active, button.list-item:active { background: var(--surface-2); }
.li-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; background: hsl(var(--h, 160) 60% 50% / .14); color: hsl(var(--h, 160) 55% 40%); }
[data-theme="emerald-dark"] .li-ic, [data-theme="midnight"] .li-ic, [data-theme="royal"] .li-ic, [data-theme="amoled"] .li-ic { color: hsl(var(--h, 160) 70% 65%); }
.li-num { display: grid; place-items: center; min-width: 44px; height: 38px; padding: 0 6px; border-radius: 12px; background: var(--soft); color: var(--primary); font-family: var(--mono); font-weight: 700; font-size: .85rem; }
.li-win { background: linear-gradient(90deg, var(--st-verified-bg), transparent 80%); }
.list-item.unread b::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-inline-end: 6px; vertical-align: middle; }
.count { min-width: 22px; height: 22px; border-radius: 11px; padding: 0 6px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 14px; border: 1px solid transparent; font-weight: 700; font-size: .95rem; white-space: nowrap; transition: transform .12s, filter .2s, background .2s; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: linear-gradient(140deg, var(--primary-2), var(--primary)); color: var(--primary-ink); box-shadow: 0 8px 18px -8px var(--primary); }
.btn-gold { background: linear-gradient(140deg, #ffe08a, var(--gold) 45%, var(--gold-2)); color: var(--gold-ink); box-shadow: 0 10px 22px -10px var(--gold-2), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-glass { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .25); padding: 0 14px; }
.btn-soft { background: var(--soft); color: var(--primary); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: var(--danger-bg); color: var(--danger); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .84rem; border-radius: 11px; }
.btn-block { width: 100%; }
.btn-round { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .45); color: #fff; backdrop-filter: blur(8px); }
.btn-round.on { background: var(--gold); color: var(--gold-ink); }
.bond-head .btn-round { background: var(--surface-2); color: var(--text); }
.spin .ic { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.action-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .74rem; font-weight: 600; text-align: center; }
.act .ic { color: var(--primary); }
.act:active { transform: scale(.97); }

/* ---------- chips / segments ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 4px; margin: 0 -16px; scrollbar-width: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chips::-webkit-scrollbar { display: none; }
.sheet .chips { margin: 0 -18px; padding: 2px 18px 4px; }
.chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .84rem; font-weight: 600; white-space: nowrap; transition: all .2s var(--ease); }
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 6px 14px -8px var(--primary); }
.chip-win { border-color: color-mix(in srgb, var(--st-verified) 50%, transparent); }
.chip-win .ic { color: var(--st-verified); }
.chip-xs { padding: 4px 10px; font-size: .74rem; font-family: var(--mono); }
.chip-xs small { font-family: var(--font); color: var(--muted); font-size: .66rem; }
.demo-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.seg { display: flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 700; font-size: .86rem; transition: all .2s var(--ease); }
.seg button.active { background: var(--surface); color: var(--primary); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.seg-lg button { min-height: 44px; }

.dbadge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: hsl(var(--h) 60% 50% / .14); color: hsl(var(--h) 60% 35%); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.pill-success { background: var(--st-verified-bg); color: var(--st-verified); }
.pill-warn { background: var(--st-found-bg); color: var(--st-found); }
.pill-info { background: var(--st-detected-bg); color: var(--st-detected); }
.pill-muted { background: var(--st-none-bg); color: var(--st-none); }
.pill-glass { background: rgba(255, 255, 255, .16); color: #fff; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; margin-top: 12px; }
.field > label { font-size: .8rem; font-weight: 700; color: var(--muted); }
.input, .select { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 1rem; outline: none; transition: border .2s, box-shadow .2s; }
textarea.input { resize: vertical; min-height: 90px; }
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-inline-end: 36px; }
[dir="rtl"] .select { background-position: 20px 50%, 14px 50%; }
input[type="range"] { width: 100%; accent-color: var(--primary); }
input[type="checkbox"] { accent-color: var(--primary); width: 18px; height: 18px; }
.search { display: flex; align-items: center; gap: 8px; position: relative; }
.search > span { position: absolute; inset-inline-start: 14px; color: var(--muted); display: grid; }
.search .input { padding-inline-start: 42px; }

.digits { position: relative; display: block; cursor: text; }
.digits-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; caret-color: transparent; z-index: 2; }
.digits-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.db { display: grid; place-items: center; aspect-ratio: 4 / 5; max-height: 64px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface-2); font-family: var(--mono); font-weight: 700; font-size: 1.6rem; color: var(--text); transition: all .18s var(--ease); }
.db.filled { border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); background: var(--surface); transform: translateY(-1px); }
.db.cursor { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
.db.cursor:empty::after { content: ''; width: 2px; height: 1.4rem; background: currentColor; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.toggle-row:last-of-type { border-bottom: 0; }
.card > .toggle-row:first-child { padding-top: 0; }
.switch { appearance: none; -webkit-appearance: none; position: relative; width: 50px !important; height: 30px !important; border-radius: 15px; background: var(--border); flex-shrink: 0; transition: background .25s var(--ease); cursor: pointer; margin: 0; }
.switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .25s var(--ease); }
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(20px); }
[dir="rtl"] .switch:checked::after { transform: translateX(-20px); }

/* ---------- results ---------- */
#ck-result.pop > * { animation: pop .4s var(--ease) both; }
#ck-result.pop > *:nth-child(2) { animation-delay: .05s; } #ck-result.pop > *:nth-child(3) { animation-delay: .1s; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.result-head { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-lg); margin-bottom: 12px; }
.rh-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; flex-shrink: 0; }
.rh-title { font-weight: 800; font-size: 1.15rem; }
.rh-sub { font-size: .84rem; opacity: .9; }
.rh-verified { background: linear-gradient(130deg, #0f9d6b, #065f46); color: #fff; box-shadow: 0 14px 30px -14px #065f46; }
.rh-verified .rh-icon { background: linear-gradient(140deg, #ffe08a, var(--gold-2)); color: var(--gold-ink); animation: trophy 1.2s var(--ease); }
.rh-found { background: linear-gradient(130deg, #f59e0b, #b45309); color: #fff; }
.rh-found .rh-icon { background: rgba(255, 255, 255, .22); }
.rh-none { background: var(--st-none-bg); color: var(--text); }
.rh-none .rh-icon { background: var(--surface); color: var(--st-none); }
@keyframes trophy { 0% { transform: scale(.4) rotate(-20deg); } 60% { transform: scale(1.15) rotate(6deg); } }

.match { position: relative; padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.match + .match { margin-top: 12px; }
.match::before { content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 5px; }
.state-verified::before { background: var(--st-verified); } .state-found::before { background: var(--st-found); } .state-none::before { background: var(--st-none); }
.match-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.match-tier { display: flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.match-amt { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.state-verified .match-amt { color: var(--st-verified); } .state-found .match-amt { color: var(--st-found); }
.state-chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px; font-size: .74rem; font-weight: 800; white-space: nowrap; }
.sc-verified { background: var(--st-verified-bg); color: var(--st-verified); }
.sc-found { background: var(--st-found-bg); color: var(--st-found); }
.sc-none { background: var(--st-none-bg); color: var(--st-none); }
.sc-detected { background: var(--st-detected); color: #fff; }
.sc-confirmed { background: var(--st-confirmed); color: #fff; }
.sc-idle { background: rgba(0, 0, 0, .55); color: #fff; }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 14px; }
.kv-grid > div { display: grid; gap: 1px; min-width: 0; }
.kv-grid span { font-size: .72rem; color: var(--muted); font-weight: 600; }
.kv-grid b { font-size: .9rem; overflow-wrap: anywhere; }
.net-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: .8rem; color: var(--muted); }
.net-row b { color: var(--text); }
.caveat { display: flex; gap: 8px; align-items: flex-start; font-size: .8rem; color: var(--muted); margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.caveat .ic { margin-top: 2px; }
.caveat.warn { background: var(--st-found-bg); color: color-mix(in srgb, var(--st-found) 70%, var(--text)); }
.caveat.danger { background: var(--danger-bg); color: var(--danger); }
.disclaimer { display: block; font-size: .74rem; color: var(--muted); margin-top: 14px; line-height: 1.5; }
.disclaimer .ic { margin-inline-end: 4px; }

/* ---------- wallet ---------- */
.card-wallet { color: #fff; border: 0; background: radial-gradient(130% 160% at 100% 0%, var(--hero-1), var(--hero-2) 70%); position: relative; overflow: hidden; }
.card-wallet::after { content: ''; position: absolute; right: -40px; bottom: -60px; width: 200px; height: 200px; border-radius: 50%; border: 30px solid rgba(255, 255, 255, .05); }
.wallet-count { font-size: 2rem; font-weight: 800; } .wallet-count small { font-size: .9rem; font-weight: 600; opacity: .8; }
.wallet-split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .15); }
.wallet-split div { display: grid; } .wallet-split span { font-size: .72rem; opacity: .8; } .wallet-split b { font-size: 1.05rem; }
.bond-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.bond-num { font-size: 2.2rem; font-weight: 800; margin-top: 8px; color: var(--text); }

/* ---------- draws ---------- */
.denom-card { color: #fff; border: 0; background: linear-gradient(150deg, hsl(var(--h) 60% 40%), hsl(calc(var(--h) + 25) 70% 18%)); }
.denom-card h2 { font-size: 1.3rem; }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.tiers div { display: grid; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .12); }
.tiers span { font-size: .7rem; opacity: .85; } .tiers b { font-size: 1rem; } .tiers small { opacity: .8; font-size: .72rem; }
.big-nums { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px !important; }
.big-nums span { padding: 10px 14px; border-radius: 12px; font-size: 1.2rem; font-weight: 700; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.numgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 4px; padding: 10px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); max-height: 420px; overflow: auto; font-family: var(--mono); font-size: .82rem; }
.numgrid span { padding: 4px 2px; text-align: center; border-radius: 6px; }
.numgrid span:hover { background: var(--soft); }
mark { background: var(--gold); color: var(--gold-ink); border-radius: 3px; padding: 0 1px; }

/* ---------- scanner ---------- */
.viewfinder { position: relative; aspect-ratio: 3 / 4; max-height: 62vh; width: 100%; border-radius: var(--r-lg); overflow: hidden; background: radial-gradient(circle at 50% 40%, #1f2b28, #050807); box-shadow: var(--shadow); }
.viewfinder video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.viewfinder.live video { opacity: 1; }
.vf-shade { position: absolute; inset: 0; pointer-events: none; }
.vf-roi { position: absolute; left: 8%; right: 8%; top: 40%; height: 18%; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45); pointer-events: none; }
.vf-roi .c { position: absolute; width: 26px; height: 26px; border: 4px solid var(--gold); }
.vf-roi .tl { top: -3px; left: -3px; border-right: 0; border-bottom: 0; border-radius: 14px 0 0 0; }
.vf-roi .tr { top: -3px; right: -3px; border-left: 0; border-bottom: 0; border-radius: 0 14px 0 0; }
.vf-roi .bl { bottom: -3px; left: -3px; border-right: 0; border-top: 0; border-radius: 0 0 0 14px; }
.vf-roi .br { bottom: -3px; right: -3px; border-left: 0; border-top: 0; border-radius: 0 0 14px 0; }
.vf-line { position: absolute; left: 6px; right: 6px; height: 2px; top: 50%; background: linear-gradient(90deg, transparent, var(--gold), transparent); box-shadow: 0 0 12px var(--gold); opacity: 0; }
.viewfinder.live .vf-line { opacity: 1; animation: scanline 2s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { top: 12%; } 50% { top: 88%; } }
.vf-idle { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; color: #e5efe9; background: rgba(0, 0, 0, .35); z-index: 2; }
.viewfinder.live .vf-idle { display: none; }
.vf-status { position: absolute; left: 0; right: 0; bottom: 16px; display: flex; justify-content: center; z-index: 3; padding: 0 12px; }
.vf-status .state-chip { font-size: .82rem; padding: 8px 14px; max-width: 100%; white-space: normal; text-align: center; backdrop-filter: blur(8px); }
.vf-tools { position: absolute; top: 12px; right: 12px; display: grid; gap: 8px; z-index: 3; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .2); border-top-color: var(--gold); animation: spin .8s linear infinite; margin: 0 auto; }
.sheet .spinner { border-color: var(--border); border-top-color: var(--primary); margin: 20px auto 10px; }

/* ---------- settings ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.theme-grid.compact { grid-template-columns: repeat(3, 1fr); }
.swatch { display: grid; gap: 6px; padding: 6px; border-radius: 14px; border: 2px solid transparent; background: var(--surface-2); text-align: center; }
.swatch.active { border-color: var(--primary); }
.sw-preview { position: relative; display: block; height: 46px; border-radius: 10px; overflow: hidden; border: 1px solid rgba(128, 128, 128, .25); }
.sw-preview span { position: absolute; left: 10px; bottom: 8px; width: 46%; height: 12px; border-radius: 6px; }
.sw-preview i { position: absolute; right: 0; top: 0; bottom: 0; width: 50%; }
.sw-name { font-size: .72rem; font-weight: 700; }
.kv-list { display: grid; gap: 0; }
.kv-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.kv-list > div:last-child { border-bottom: 0; }
.kv-list span { color: var(--muted); } .kv-list b { text-align: end; }
.latest-table { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: .78rem; }
.latest-table div { display: flex; justify-content: space-between; gap: 6px; } .latest-table span { color: var(--muted); }
details summary { cursor: pointer; font-weight: 700; color: var(--primary); padding: 6px 0; }
.color-dot { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; background: hsl(var(--h) 65% 45%); }
.color-dot.active { border-color: var(--text); }
.profile-card, .install-card { display: flex; align-items: center; gap: 14px; }
.install-card { background: linear-gradient(130deg, var(--soft), var(--surface)); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); color: var(--text); }
.install-card .ic:first-child { color: var(--primary); }
.profile-hero h2 { font-size: 1.3rem; }

/* ---------- guide / about ---------- */
.steps { margin: 10px 0 0; padding-inline-start: 22px; display: grid; gap: 10px; font-size: .9rem; }
.steps .pill { margin-inline-start: 4px; }
.card p { font-size: .9rem; }
.prose h3 { margin-top: 16px; }
.about-hero { text-align: center; padding: 18px 0 6px; }
.about-logo { width: 104px; height: 104px; margin: 0 auto 14px; filter: drop-shadow(0 16px 30px rgba(11, 110, 87, .35)); }
.about-logo svg { width: 100%; height: 100%; }
.about-hero h1 { font-size: 1.6rem; font-weight: 800; }
.feat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.feat { display: grid; gap: 2px; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.feat .ic { color: var(--primary); margin-bottom: 4px; } .feat b { font-size: .86rem; } .feat span { font-size: .74rem; color: var(--muted); }
.empty { text-align: center; padding: 40px 20px; }
.empty-ic { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 24px; background: var(--soft); color: var(--primary); }
.empty h3 { font-size: 1.1rem; } .empty .btn { margin-top: 14px; }

/* ---------- sheet ---------- */
.sheet-host { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.sheet-host.open { pointer-events: auto; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(5, 10, 8, .5); opacity: 0; transition: opacity .25s; backdrop-filter: blur(2px); }
.sheet-host.open .sheet-backdrop { opacity: 1; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow: auto; background: var(--bg); border-radius: 26px 26px 0 0; padding: 8px 18px calc(22px + var(--safe-b)); transform: translateY(100%); transition: transform .32s var(--ease); box-shadow: 0 -20px 50px rgba(0, 0, 0, .25); max-width: 640px; margin: 0 auto; overscroll-behavior: contain; }
.sheet-host.open .sheet { transform: none; }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--border); margin: 4px auto 14px; }
.sheet-title { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; margin-bottom: 6px; }
.sheet .match { box-shadow: none; }
.onb { text-align: center; } .onb .field { text-align: start; }
.onb-logo { width: 84px; height: 84px; margin: 4px auto 12px; } .onb-logo svg { width: 100%; height: 100%; }
.onb h2 { font-size: 1.35rem; }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: calc(var(--top-h) + var(--safe-t) + 8px); left: 0; right: 0; z-index: 60; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 520px; padding: 12px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-size: .88rem; font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); transform: translateY(-14px); opacity: 0; transition: all .3s var(--ease); }
.toast.show { transform: none; opacity: 1; }
.toast-success .ic { color: var(--st-verified); } .toast-error .ic { color: var(--danger); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media (min-width: 700px) { .view { padding-bottom: calc(var(--tab-h) + 48px); } }
