@font-face { font-family: 'Inter'; font-weight: 400 700; font-display: swap; src: url('/fonts/inter-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+20B9, U+2190-22FF; }
@font-face { font-family: 'Inter'; font-weight: 400 700; font-display: swap; src: url('/fonts/inter-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02FF, U+1D00-1EFF, U+20A0-20C0; }
@font-face { font-family: 'Archivo'; font-weight: 500 800; font-display: swap; src: url('/fonts/archivo-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20B9; }
@font-face { font-family: 'Archivo'; font-weight: 500 800; font-display: swap; src: url('/fonts/archivo-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02FF, U+20A0-20C0; }

/* Samaksh Scan: a warranty card, not a dashboard. Bright and high-contrast for
   phones in sunlight; plum = Samaksh, copper = money earned (the conductor),
   earth green = genuine, phase red = fake. */
:root {
  --ink: #16130f; --ink-2: #2d2822;
  --violet: #6a2c91; --violet-2: #8a44b8; --violet-soft: #f4edf9;     /* Samaksh plum */
  --wire: #c26a14; --wire-soft: #fcf1e4; --wire-line: #f1d4b0;      /* copper */
  --paper: #f2f3f5; --card: #ffffff; --line: #e2e4e8; --line-2: #d3d6dc;
  --text: #16130f; --muted: #5d6169; --faint: #8f949c;
  --ok: #0b7a45; --ok-soft: #e6f4ec; --bad: #c92a1d; --bad-soft: #fcebea; --warn: #a2560a; --warn-soft: #fdf2e2;
  --r: 16px; --r-sm: 10px;
  --sh: 0 1px 0 rgba(22,19,15,.04), 0 6px 18px -8px rgba(22,19,15,.12);
  --f-display: 'Archivo', 'Inter', system-ui, sans-serif;
  --f-body: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Noto Sans Devanagari', sans-serif;
  --f-mono: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Consolas, monospace;
  --tabbar: 0px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--paper); color: var(--text); font: 16px/1.5 var(--f-body); min-height: 100dvh; padding-bottom: var(--tabbar); }
body.has-tabbar { --tabbar: calc(68px + env(safe-area-inset-bottom)); }
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--f-display); letter-spacing: -.015em; margin: 0; color: var(--ink); }
h1 { font-size: 28px; line-height: 1.1; font-weight: 800; }
h2 { font-size: 20px; line-height: 1.2; font-weight: 750; }
h3 { font-size: 16px; line-height: 1.3; font-weight: 700; }
p { margin: 6px 0; }
.hi { display: block; font-size: 12.5px; opacity: .72; font-weight: 500; margin-top: 2px; letter-spacing: 0; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; }
.mono { font-family: var(--f-mono); letter-spacing: .08em; }
:focus-visible { outline: 3px solid var(--violet-2); outline-offset: 2px; border-radius: 8px; }
.wrap { max-width: 520px; margin: 0 auto; padding: 0 16px 40px; }
.wrap.wide { max-width: 1180px; }
.ic { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- top bar ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; max-width: 520px; margin: 0 auto; }
.bar.wide { max-width: 1180px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--f-display); font-weight: 800; letter-spacing: .16em; font-size: 14px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark { width: 28px; height: 28px; border-radius: 8px; background: var(--violet); display: grid; place-items: center; position: relative; }
.brand .mark i { width: 12px; height: 4px; border-radius: 2px; background: #fff; box-shadow: 0 -5px 0 -0.5px rgba(255,255,255,.55), 0 5px 0 -0.5px rgba(255,255,255,.55); }
.brand small { font-family: var(--f-body); letter-spacing: 0; font-weight: 600; color: var(--muted); font-size: 13px; white-space: nowrap; }
.bar .who { font-size: 13px; color: var(--muted); max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .who a { color: var(--ink); font-weight: 600; }
.bar .who a.signin { display: inline-flex; padding: 7px 14px; border-radius: 99px; border: 1.5px solid var(--line-2); }

/* ---------- hero: a plain, bright band (pages: join, home, me) ---------- */
.hero { background: var(--card); color: var(--ink); border-radius: var(--r); padding: 20px 18px; margin: 4px 0 14px; border: 1px solid var(--line); position: relative; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 700; color: var(--violet); }
.hero h1 { margin-top: 6px; }
.hero p { color: var(--muted); }

/* the wallet: a dark card, like a bank card, so the balance reads first */
.hero.wallet-card { background: var(--ink); color: #fff; border: 0; padding: 20px; box-shadow: 0 16px 30px -16px rgba(22,19,15,.6); }
.hero.wallet-card .eyebrow { color: #e7a35a; }
.hero.wallet-card .money { color: #fff; }
.hero.wallet-card p { color: rgba(255,255,255,.7); }
.hero.wallet-card .btn[disabled] { opacity: 1; background: rgba(255,255,255,.1); color: rgba(255,255,255,.5); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.18); }

/* ---------- the ticket: every scan result is a warranty card ---------- */
.ticket { position: relative; max-width: 520px; margin: 4px auto 0; padding: 0 16px; }
.ticket .card-top { background: var(--card); border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; padding: 14px 18px 18px; position: relative; overflow: hidden; }
.ticket .card-top::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--state, var(--faint)); }
.ticket .tear { height: 22px; background:
  radial-gradient(circle at 0 50%, var(--paper) 10px, transparent 10.5px) left / 50% 100% no-repeat,
  radial-gradient(circle at 100% 50%, var(--paper) 10px, transparent 10.5px) right / 50% 100% no-repeat, var(--card);
  border-left: 0; border-right: 0; position: relative; }
.ticket .tear::after { content: ''; position: absolute; left: 18px; right: 18px; top: 50%; border-top: 2px dashed var(--line-2); }
.ticket .stub { background: var(--card); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 20px 20px; padding: 10px 18px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.ticket .stub .mono { color: var(--ink); font-weight: 700; font-size: 15px; }
.ticket .kicker { display: flex; justify-content: space-between; align-items: center; font: 700 11px/1 var(--f-display); letter-spacing: .18em; text-transform: uppercase; color: var(--faint); margin-top: 6px; }
.ticket.ok { --state: var(--ok); } .ticket.bad { --state: var(--bad); } .ticket.wait { --state: var(--wire); }

/* the stamp */
.seal-wrap { display: grid; place-items: center; padding: 14px 0 4px; }
.seal { width: 128px; height: 128px; color: var(--faint); }
.seal.ok { color: var(--ok); } .seal.bad { color: var(--bad); } .seal.wait { color: var(--wire); }
.seal .r1, .seal .r2 { fill: none; stroke: currentColor; }
.seal .r1 { stroke-width: 3.2; } .seal .r2 { stroke-width: 1.2; }
.seal text { fill: currentColor; font: 800 10.5px var(--f-display); letter-spacing: 2.6px; }
.seal .mark { fill: none; stroke: currentColor; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.seal.ok, .seal.bad { animation: stamp .42s cubic-bezier(.3,1.5,.5,1) .15s both; transform-origin: 50% 50%; }
.seal.wait .r1 { stroke-dasharray: 8 7; animation: spin 2.4s linear infinite; transform-origin: 64px 64px; }
@keyframes stamp { 0% { transform: scale(1.9) rotate(-22deg); opacity: 0; } 70% { opacity: 1; } 100% { transform: scale(1) rotate(-9deg); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
.verdict { text-align: center; margin-top: 8px; }
.verdict h1 { font-size: 26px; }
.verdict .code { margin-top: 4px; color: var(--muted); font-size: 14px; }

/* ---------- cards and lists ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--sh); margin: 12px 0; }
.card.flat { box-shadow: none; background: transparent; border-style: dashed; border-color: var(--line-2); }
.card.tint { background: var(--violet-soft); border-color: #e3d3ef; box-shadow: none; }
.card.wire { background: var(--wire-soft); border-color: var(--wire-line); box-shadow: none; }
.card > h2 + p, .card > h3 + p { color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; }
.row.top { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
details summary { cursor: pointer; }

/* ---------- product ---------- */
.product { display: flex; gap: 14px; align-items: center; }
.thumb { width: 84px; height: 84px; border-radius: 14px; background: #f7f7f8; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.thumb .ph { font-family: var(--f-display); font-weight: 800; font-size: 28px; color: var(--violet); opacity: .45; }
.product .name { font: 750 17px/1.25 var(--f-display); color: var(--ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; padding: 4px 10px; border-radius: 99px; background: var(--violet-soft); color: var(--violet); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.warn { background: var(--warn-soft); color: var(--warn); } .chip.wire { background: var(--wire-soft); color: var(--wire); }
.chip.ghost { background: transparent; border: 1px solid var(--line-2); color: var(--muted); }
.row .chip + .chip { margin-left: 0; }

/* ---------- money: copper ---------- */
.money { font-family: var(--f-display); font-weight: 800; font-size: 52px; letter-spacing: -.035em; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.money small { font-size: .42em; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.plus { color: var(--wire); }
.pop { animation: pop .5s cubic-bezier(.2,1.6,.4,1) .55s both; }
@keyframes pop { from { transform: translateY(8px) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.split { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--line); margin: 12px 0 8px; gap: 2px; }
.split i { display: block; border-radius: 99px; }
.split .a { background: var(--ok); } .split .b { background: var(--wire); } .split .c { background: #d9c2e8; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.legend b { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }

/* ---------- buttons and forms ---------- */
.btn { appearance: none; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 2px 8px; flex-direction: column; min-height: 54px; padding: 10px 18px; border-radius: 14px; font: 700 16px/1.2 var(--f-body); cursor: pointer; background: var(--violet); color: #fff; width: 100%; transition: transform .08s ease, background .15s, box-shadow .15s; text-align: center; text-decoration: none !important; box-shadow: 0 1px 0 rgba(0,0,0,.08), inset 0 -2px 0 rgba(0,0,0,.14); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:hover { background: #5a2380; }
.btn .hi { color: inherit; margin: 0; font-size: 12px; opacity: .78; }
.btn.wire { background: var(--wire); color: #fff; } .btn.wire:hover { background: #a85a0e; }
.btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line-2); box-shadow: none; }
.btn.ghost:hover { background: #f7f7f8; border-color: var(--faint); }
.btn.dark { background: var(--ink); } .btn.dark:hover { background: #000; }
.btn.light { background: #fff; color: var(--ink); }
.btn.small { min-height: 38px; font-size: 14px; padding: 6px 14px; width: auto; border-radius: 10px; flex-direction: row; box-shadow: none; }
.btn.danger { background: var(--bad); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn .ic { width: 20px; height: 20px; }
.btn.withic { flex-direction: row; gap: 10px; }
label.f { display: block; font-size: 14px; font-weight: 650; margin: 14px 0 6px; color: var(--ink); }
label.f .hi { display: inline; margin-left: 6px; font-weight: 500; }
input, select, textarea { width: 100%; font: 16px var(--f-body); padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--line-2); background: #fff; color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 4px rgba(106,44,145,.12); }
.otp { font-size: 28px; letter-spacing: .45em; text-align: center; font-family: var(--f-mono); font-weight: 700; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices button { appearance: none; border: 1.5px solid var(--line-2); background: #fff; border-radius: 10px; padding: 10px 14px; font: 600 14px var(--f-body); color: var(--text); cursor: pointer; min-height: 44px; }
.choices button:hover { border-color: var(--faint); }
.choices button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 12px 0; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--violet); }
.err { color: var(--bad); background: var(--bad-soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 10px 0; }
.note { color: var(--muted); font-size: 13.5px; }
.dev { background: #fffbe6; border: 1px dashed #e6c35c; color: #6b5300; border-radius: 10px; padding: 8px 10px; font-size: 13px; margin: 8px 0; }

/* ---------- home ---------- */
.home-top { max-width: 520px; margin: 0 auto; padding: 6px 16px 0; }
.home-top h1 { font-size: 34px; line-height: 1.04; letter-spacing: -.03em; margin: 14px 0 8px; }
.home-top h1 em { font-style: normal; color: var(--violet); }
.home-top .lead { color: var(--muted); font-size: 15.5px; margin: 0 0 18px; }
.scan-tile { display: flex; align-items: center; gap: 16px; background: var(--ink); color: #fff; border-radius: 20px; padding: 18px; text-decoration: none !important; position: relative; overflow: hidden; box-shadow: 0 14px 30px -14px rgba(22,19,15,.55); }
.scan-tile .qrbox { width: 64px; height: 64px; border-radius: 14px; background: #fff; display: grid; place-items: center; flex: none; position: relative; }
.scan-tile .qrbox svg { width: 40px; height: 40px; }
.scan-tile .qrbox::after { content: ''; position: absolute; left: 8px; right: 8px; height: 2px; background: var(--wire); top: 12px; box-shadow: 0 0 10px var(--wire); animation: beam 1.8s ease-in-out infinite alternate; }
.scan-tile b { display: block; font: 800 22px/1.1 var(--f-display); }
.scan-tile span { font-size: 13.5px; color: rgba(255,255,255,.7); }
.scan-tile .go { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.1); display: grid; place-items: center; flex: none; }
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 6px; }
.trust div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; font-size: 12.5px; line-height: 1.3; color: var(--muted); }
.trust b { display: block; font: 800 18px/1.1 var(--f-display); color: var(--ink); margin-bottom: 2px; }
.section-label { font: 700 11.5px/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 22px 0 10px; }

/* role rows */
.roles { display: grid; gap: 10px; }
.role { display: flex; gap: 14px; align-items: center; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; cursor: pointer; width: 100%; font: inherit; color: inherit; text-decoration: none !important; box-shadow: var(--sh); }
a.role:hover { border-color: var(--line-2); }
.role .ico { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; background: var(--violet-soft); color: var(--violet); flex: none; }
.role .ico.copper { background: var(--wire-soft); color: var(--wire); } .role .ico.green { background: var(--ok-soft); color: var(--ok); }
.role .ico .ic { width: 24px; height: 24px; }
.role b { display: block; font: 750 16px/1.25 var(--f-display); color: var(--ink); }
.role .muted { display: block; font-size: 13.5px; line-height: 1.4; margin-top: 2px; }
.role .chev { margin-left: auto; color: var(--faint); }

/* ---------- scanner ---------- */
.viewfinder { position: relative; border-radius: 22px; overflow: hidden; background: #000; aspect-ratio: 3 / 4; }
.viewfinder video { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewfinder .frame { position: absolute; inset: 20% 14%; border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.5); }
.viewfinder .frame::before { content: ''; position: absolute; inset: 0; border-radius: 18px; border: 3px solid #fff; clip-path: polygon(0 0, 22% 0, 22% 4%, 4% 4%, 4% 22%, 0 22%, 0 100%, 0 78%, 4% 78%, 4% 96%, 22% 96%, 22% 100%, 78% 100%, 78% 96%, 96% 96%, 96% 78%, 100% 78%, 100% 22%, 96% 22%, 96% 4%, 78% 4%, 78% 0); }
.viewfinder .beam { position: absolute; left: 16%; right: 16%; height: 2px; background: var(--wire); box-shadow: 0 0 14px var(--wire); top: 22%; animation: beam 2s ease-in-out infinite alternate; }
@keyframes beam { from { top: 22%; } to { top: 76%; } }
.scan-tile .qrbox::after { animation-name: beam2; }
@keyframes beam2 { from { top: 12px; } to { top: 50px; } }
.viewfinder .hint { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; font-weight: 600; text-shadow: 0 1px 6px rgba(0,0,0,.6); }

/* ---------- tabs (my pages) ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; margin: 4px 0 12px; scrollbar-width: none; background: #e7e9ec; padding: 4px; border-radius: 12px; }
.tabs button { appearance: none; border: 0; background: transparent; padding: 9px 11px; border-radius: 9px; font: 650 13.5px var(--f-body); color: var(--muted); white-space: nowrap; cursor: pointer; flex: 1 0 auto; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* ---------- bottom tab bar (signed-in phone pages) ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); display: flex; justify-content: center; }
.tabbar nav { display: grid; grid-template-columns: 1fr 1fr 1fr; width: 100%; max-width: 520px; align-items: end; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font: 650 11.5px var(--f-body); color: var(--muted); padding: 6px 0 2px; text-decoration: none !important; }
.tabbar a.on { color: var(--ink); }
.tabbar a.on .ic { stroke-width: 2.3; }
.tabbar a.scan .ring { width: 56px; height: 56px; margin-top: -24px; border-radius: 50%; background: var(--violet); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 18px -6px rgba(106,44,145,.6), 0 0 0 5px #fff; }
.tabbar a.scan .ring .ic { width: 26px; height: 26px; }
.tabbar a.scan { color: var(--ink); }

/* ---------- toasts ---------- */
.toast { position: fixed; left: 50%; bottom: calc(22px + var(--tabbar)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 50; max-width: calc(100% - 32px); animation: toast .25s ease-out; }
@keyframes toast { from { transform: translate(-50%, 10px); opacity: 0; } }

/* bottom actions on phone pages */
.dock { padding: 6px 0 16px; display: grid; gap: 8px; }

/* ---------- admin ---------- */
.admin-shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100dvh; }
.side { background: #fff; border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100dvh; overflow: auto; }
.side .brand { color: var(--ink); padding: 2px 8px 14px; }
.side .brand small { color: var(--faint) !important; }
.side button { display: flex; justify-content: space-between; align-items: center; width: 100%; appearance: none; border: 0; background: transparent; color: var(--muted); text-align: left; font: 600 14px var(--f-body); padding: 9px 12px; border-radius: 9px; cursor: pointer; position: relative; }
.side button:hover { background: var(--paper); color: var(--ink); }
.side button.on { background: var(--violet-soft); color: var(--violet); }
.side button.on::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--violet); }
.side .count { background: var(--wire); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; font-weight: 800; }
.side .group { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--faint); padding: 16px 12px 6px; font-weight: 700; }
.main { padding: 26px 32px 60px; min-width: 0; max-width: 1280px; }
.main > h1 { font-size: 28px; }
.main > h1 + p.muted { margin-top: 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 18px 0; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh); }
.stat .n { font-family: var(--f-display); font-size: 30px; font-weight: 800; letter-spacing: -.025em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.4; }
.funnel { display: grid; gap: 10px; }
.funnel .step { display: grid; grid-template-columns: 170px 1fr 70px; gap: 12px; align-items: center; font-size: 14px; }
.funnel .barbg { height: 12px; background: var(--paper); border-radius: 99px; overflow: hidden; }
.funnel .barfill { height: 100%; background: var(--violet); border-radius: 99px; }
.funnel .step:nth-child(n+3) .barfill { background: var(--violet-2); }
.funnel .step:last-child .barfill { background: var(--ok); }
.funnel b { text-align: right; font-variant-numeric: tabular-nums; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 11px 14px; background: #fafbfc; border-bottom: 1px solid var(--line); font-weight: 700; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: #fafbfc; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }
.tools input, .tools select { width: auto; min-width: 180px; padding: 9px 12px; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.card.empty { border-style: dashed; box-shadow: none; }
.dots { background: #fff; border: 1px solid var(--line); border-radius: var(--r); width: 100%; height: 360px; }
.minibar { display: inline-block; height: 8px; border-radius: 99px; background: var(--violet-2); vertical-align: middle; margin-right: 8px; }
.drawer { position: fixed; inset: 0; background: rgba(22,19,15,.35); display: flex; justify-content: flex-end; z-index: 40; }
.drawer > div { width: min(520px, 100%); background: var(--paper); height: 100%; overflow: auto; padding: 20px; box-shadow: -20px 0 40px rgba(0,0,0,.15); }
.main .card h3 { margin-bottom: 4px; }

/* ---------- overview: findings first, then the evidence ---------- */
.ov-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.ov-wait { display: flex; gap: 8px; }
.ov-wait a { display: flex; flex-direction: column; align-items: center; min-width: 78px; padding: 8px 10px; border-radius: 12px; background: #fff; border: 1px solid var(--line); font-size: 11.5px; color: var(--muted); text-decoration: none !important; }
.ov-wait a b { font: 800 20px/1.1 var(--f-display); color: var(--faint); }
.ov-wait a.has { border-color: var(--wire-line); background: var(--wire-soft); color: var(--warn); } .ov-wait a.has b { color: var(--wire); }
.findings { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 18px 0 14px; }
.finding { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 16px; text-decoration: none !important; color: var(--muted); font-size: 13.5px; line-height: 1.45; position: relative; overflow: hidden; box-shadow: var(--sh); }
.finding::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tone); }
.finding .tone { font: 700 10.5px/1 var(--f-body); letter-spacing: .12em; text-transform: uppercase; color: var(--tone); }
.finding b { font: 750 17px/1.25 var(--f-display); color: var(--ink); letter-spacing: -.01em; }
.finding.bad { --tone: var(--bad); } .finding.warn { --tone: var(--wire); } .finding.ok { --tone: var(--ok); }
a.finding:hover { border-color: var(--line-2); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 14px; overflow: hidden; }
.kpi { padding: 14px 18px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi > b { font: 800 30px/1.1 var(--f-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi > b small { font: 600 14px var(--f-body); color: var(--faint); letter-spacing: 0; }
.kpi > em { font-style: normal; font-size: 12px; color: var(--muted); line-height: 1.35; }
.kpi .meter { display: block; height: 4px; border-radius: 4px; background: var(--paper); margin-top: 6px; overflow: hidden; } .kpi .meter i { display: block; height: 100%; min-width: 2px; background: var(--violet); border-radius: 4px; }
.ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.ov-grid .card { margin: 0; padding: 18px 20px; } .ov-grid .span2 { grid-column: 1 / -1; }
.ov-grid h3 { font-size: 17px; line-height: 1.25; letter-spacing: -.01em; }
.ov-grid .sub { color: var(--muted); font-size: 13px; margin: 3px 0 12px; max-width: 70ch; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .ax { font: 11px var(--f-body); fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .val { font: 600 11px var(--f-body); fill: var(--ink); font-variant-numeric: tabular-nums; }
.chart .empty-note { font: 600 14px var(--f-body); fill: var(--faint); }
.chart .hit:hover path { opacity: .78; } .chart .hit:hover rect { fill: rgba(22,19,15,.035); }
.lg { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 4px; } .lg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hb { display: grid; gap: 9px; }
.hb-row { display: grid; grid-template-columns: minmax(120px, 36%) 1fr auto; gap: 4px 10px; align-items: center; font-size: 13.5px; }
.hb-l { color: var(--ink); } .hb-t { height: 14px; background: transparent; border-radius: 0 4px 4px 0; } .hb-t i { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.hb-v { font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; } .hb-n { grid-column: 2 / -1; font-size: 11.5px; color: var(--muted); margin-top: -4px; }
.tbl table.t { border: 0; border-radius: 0; } .tbl table.t th { background: transparent; padding-left: 0; } .tbl table.t td { padding-left: 0; }
.tbl table.t th.num, .tbl table.t td.num { padding-right: 22px; } .tbl table.t th:last-child, .tbl table.t td:last-child { padding-right: 0; }
.rate { display: inline-block; width: 120px; height: 8px; background: var(--paper); border-radius: 8px; overflow: hidden; vertical-align: middle; margin-right: 8px; } .rate i { display: block; height: 100%; min-width: 2px; background: var(--violet); border-radius: 8px; }
.rate-n { font-variant-numeric: tabular-nums; font-weight: 600; } .zero { color: var(--faint); }
.tip { position: fixed; z-index: 80; background: var(--ink); color: #fff; font-size: 12.5px; padding: 7px 10px; border-radius: 8px; pointer-events: none; max-width: 280px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
@media (max-width: 1000px) { .ov-grid { grid-template-columns: 1fr; } .kpi { border-right: 0; border-bottom: 1px solid var(--line); } }

@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 10; height: auto; display: flex; gap: 4px; padding: 8px 10px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .side .brand, .side .group { display: none; }
  .side button { width: auto; white-space: nowrap; flex: none; }
  .side button.on::before { display: none; }
  .main { padding: 16px; }
  .funnel .step { grid-template-columns: 110px 1fr 46px; }
}
@media (max-width: 380px) { .home-top h1 { font-size: 29px; } .money { font-size: 44px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .seal { transform: rotate(-9deg); } }
