/* चुनाव सारथी: the pages outside the app shell (v3, Session A).
   - The app's activation page (activate.html, screens 08 to 11);
   - the product site and purchase (site/, screens 01 to 07);
   - the seller console (site/console/, screens 51 to 53).
   The tokens and components are the design reference's
   (docs/design/v3-mockup.html), with v2's rules kept (DESIGN.md): no
   visible text under 16 px (the reference's 12 to 15 px helper text is
   16 px here, an accepted difference in docs/v3-plan.md), tap targets of
   48 px, body text at 7:1 or better in both themes, and the self-hosted
   Devanagari font, so no page loads a third-party file. The site copies
   this file at build time (site/build.mjs); there is one source. */

@font-face {
  font-family: "Noto Sans Devanagari";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/noto-sans-devanagari-subset.woff2") format("woff2");
  unicode-range: U+0020-007E, U+00A0, U+0900-097F, U+200C-200D, U+20B9, U+25CC, U+A8E0-A8FF;
}

:root {
  --font-hi: "Noto Sans Devanagari", "Nirmala UI", Mangal, sans-serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --text-sm: 16px;
  --text-body: 17px;
  --text-lg: 19px;
  /* #105a55, not the reference's #115e59: 7:1 on the page and card backgrounds (#115e59 is 6.99:1 on #f4f6f5). */
  --brand: #105a55;
  --brand-ink: #ffffff;
  --app-bg: #f4f6f5;
  --app-card: #ffffff;
  --app-ink: #1a2420;
  --app-muted: #3f4a46;
  --app-line: #d9e0dd;
  --input-line: #8a9893;
  --sup: #14532d;
  --sup-bg: #e4f2e8;
  --und: #6b3d00;
  --und-bg: #fbefd9;
  --opp: #8c1d18;
  --opp-bg: #fbe6e4;
  --lean: #1d4e89;
  --lean-bg: #e5eef8;
  --on-tag: #ffffff;
  --none-bg: #eef1f0;
  --wa: #0b5d3b;
  --warn-bg: #fff3dc;
  --focus: #f2b04a;
  --bubble: #dcf8c6;
  --bubble-ink: #1b2a1f;
  --bubble-link: #0b5a87;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --brand: #6ccbbe; --brand-ink: #0b0f0d;
  --app-bg: #121816; --app-card: #1b2320; --app-ink: #e8eeeb; --app-muted: #b4c1bc; --app-line: #2c3733; --input-line: #6d7b76;
  --sup: #7ccf96; --sup-bg: #173322; --und: #e9b562; --und-bg: #3a2a10; --opp: #f3aaa4; --opp-bg: #3d1a18; --lean: #a9c8f0; --lean-bg: #172a40;
  --on-tag: #0b0f0d; --none-bg: #242e2a; --wa: #7ccf96; --warn-bg: #3a2e14;
  --bubble: #1f3a2a; --bubble-ink: #e8eeeb; --bubble-link: #8db6ea;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #6ccbbe; --brand-ink: #0b0f0d;
    --app-bg: #121816; --app-card: #1b2320; --app-ink: #e8eeeb; --app-muted: #b4c1bc; --app-line: #2c3733; --input-line: #6d7b76;
    --sup: #7ccf96; --sup-bg: #173322; --und: #e9b562; --und-bg: #3a2a10; --opp: #f3aaa4; --opp-bg: #3d1a18; --lean: #a9c8f0; --lean-bg: #172a40;
    --on-tag: #0b0f0d; --none-bg: #242e2a; --wa: #7ccf96; --warn-bg: #3a2e14;
    --bubble: #1f3a2a; --bubble-ink: #e8eeeb; --bubble-link: #8db6ea;
    color-scheme: dark;
  }
}
/* Larger text: v2's "बड़े अक्षर", as on the app. */
:root[data-text-size="large"] { --text-sm: 17px; --text-body: 21px; --text-lg: 23px; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--app-bg);
  color: var(--app-ink);
  font-family: var(--font-hi);
  font-size: var(--text-body);
  line-height: 1.55;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
a { color: var(--brand); font-weight: 600; }
/* A link inside a sentence still gets a 48 px tap area. */
p a { display: inline-flex; align-items: center; min-height: 48px; }

/* One column at phone width, centred on a wider screen. */
.page { max-width: 480px; margin: 0 auto; padding: 16px 16px 32px; display: flex; flex-direction: column; gap: 14px; }
.page > * { flex-shrink: 0; min-width: 0; }
.page.wide { max-width: 760px; }
/* A page part drawn by script, spaced as the page is. */
.flow { display: flex; flex-direction: column; gap: 14px; }
.flow > * { flex-shrink: 0; min-width: 0; }
.page.has-sticky { padding-bottom: 112px; }

h1 { margin: 0; font-size: 36px; line-height: 1.25; font-weight: 600; color: var(--brand); }
h2 { margin: 0; font-size: 21px; line-height: 1.3; font-weight: 600; }
h1.setup-title { font-size: 23px; line-height: 1.3; color: var(--app-ink); }
.tagline { margin: 0; font-size: 23px; line-height: 1.35; font-weight: 600; }
p { margin: 0; }

.brandrow { display: flex; gap: 12px; align-items: center; }
.brandrow b { color: var(--brand); font-size: 20px; }
.logo-mark { width: 48px; height: 48px; border-radius: 12px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 600; font-size: 20px; flex: none; }

.card { background: var(--app-card); border-radius: 16px; padding: 14px; display: grid; gap: 10px; border: 1px solid var(--app-line); }
.card.hero { background: var(--brand); color: var(--brand-ink); border: 0; }
.card.hero .sub, .card.hero .kicker { color: inherit; opacity: .95; }
.card.warn { background: var(--warn-bg); border: 0; }
.card.plain { background: var(--none-bg); border: 0; }
.card.price { border: 2px solid var(--brand); }
.card h2 { font-size: 19px; }
.card .cand { font-size: 19px; }
.kicker { font-size: var(--text-sm); font-weight: 600; color: var(--app-muted); }
.sub, .hint { font-size: var(--text-sm); color: var(--app-muted); margin: 0; }
.big { font-size: 30px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; font-family: var(--font-ui); }
.money { font-family: var(--font-ui); font-weight: 600; font-variant-numeric: tabular-nums; }
.spread { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.center { text-align: center; justify-self: center; }

.btn {
  appearance: none; border: 0; box-sizing: border-box; cursor: pointer; min-height: 52px; border-radius: 14px;
  padding: 10px 16px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600;
  font-size: var(--text-lg); text-align: center; text-decoration: none; width: 100%; background: transparent;
}
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.ghost { color: var(--brand); border: 1.5px solid var(--brand); }
.btn.wa { background: var(--wa); color: #ffffff; }
.btn.onbrand { background: var(--brand-ink); color: var(--brand); }
:root[data-theme="dark"] .btn.wa { color: #0b0f0d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.wa { color: #0b0f0d; } }
.btn.danger { background: var(--opp); color: var(--on-tag); }
.btn.small { min-height: 48px; font-size: var(--text-sm); padding: 6px 14px; border-radius: 12px; width: auto; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: default; }
.link {
  appearance: none; background: none; border: 0; cursor: pointer; color: var(--brand); font-weight: 600;
  font-size: var(--text-sm); min-height: 48px; padding: 0 4px; text-decoration: underline; text-underline-offset: 3px;
}
.link.plain { text-decoration: none; }

.field { display: grid; gap: 6px; }
.field label, .field .label { font-size: var(--text-sm); font-weight: 600; }
.input {
  width: 100%; min-height: 52px; border-radius: 12px; border: 1.5px solid var(--input-line); background: var(--app-card);
  padding: 10px 14px; font: 18px var(--font-hi); color: var(--app-ink);
}
.input.code { font-family: var(--font-mono); letter-spacing: .08em; font-size: 20px; text-transform: uppercase; }
.input[aria-invalid="true"] { border-color: var(--opp); }
.inwrap { position: relative; }
.inwrap .input { padding-right: 96px; }
.inwrap .in-act {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); appearance: none; border: 0; background: none;
  color: var(--brand); font-weight: 600; font-size: var(--text-sm); cursor: pointer; min-height: 48px; padding: 0 12px;
}
.error { color: var(--opp); font-size: var(--text-sm); font-weight: 600; }

.list { background: var(--app-card); border: 1px solid var(--app-line); border-radius: 16px; overflow: hidden; }
.result {
  appearance: none; border: 0; border-top: 1px solid var(--app-line); background: transparent; cursor: pointer; display: block;
  width: 100%; text-align: left; padding: 12px 14px; min-height: 48px; color: inherit;
}
.result:first-child { border-top: 0; }
.result b { font-weight: 600; }
.result small { display: block; color: var(--app-muted); font-size: var(--text-sm); }
.result[aria-pressed="true"] { background: color-mix(in srgb, var(--brand) 12%, var(--app-card)); }
.result mark { background: color-mix(in srgb, var(--brand) 22%, transparent); color: inherit; border-radius: 3px; }

.menu { background: var(--app-card); border: 1px solid var(--app-line); border-radius: 16px; overflow: hidden; }
.menu button {
  appearance: none; border: 0; border-top: 1px solid var(--app-line); background: transparent; cursor: pointer; width: 100%;
  display: flex; gap: 12px; align-items: center; padding: 13px 14px; min-height: 56px; text-align: left; color: inherit;
}
.menu button:first-child { border-top: 0; }
.menu button small { display: block; color: var(--app-muted); font-size: var(--text-sm); }
.menu button[aria-pressed="true"] { background: color-mix(in srgb, var(--brand) 12%, var(--app-card)); }
.menu .mi { width: 36px; height: 36px; border-radius: 10px; background: var(--none-bg); display: grid; place-items: center; flex: none; color: var(--brand); }
.menu .mi svg { width: 22px; height: 22px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  appearance: none; cursor: pointer; white-space: nowrap; border-radius: 999px; padding: 6px 14px; min-height: 48px;
  font-size: var(--text-sm); border: 1px solid var(--app-line); background: var(--app-card); color: inherit;
  display: inline-flex; gap: 6px; align-items: center;
}
a.chip { text-decoration: none; }
.chip[aria-pressed="true"] { background: var(--app-ink); color: var(--app-bg); border-color: var(--app-ink); }
.chip[disabled] { opacity: .6; cursor: default; }

.steps { display: flex; gap: 6px; align-items: center; font-size: var(--text-sm); color: var(--app-muted); }
.steps i { height: 6px; flex: 1; border-radius: 3px; background: var(--app-line); }
.steps i.on { background: var(--brand); }

.wards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ward {
  appearance: none; cursor: pointer; border: 1.5px solid var(--app-line); background: var(--app-card); color: inherit;
  border-radius: 12px; padding: 6px 2px; min-height: 56px; text-align: center; display: grid; line-height: 1.2;
}
.ward b { font-size: 18px; font-family: var(--font-ui); }
.ward span { font-size: var(--text-sm); color: var(--app-muted); font-family: var(--font-ui); }
.ward[aria-pressed="true"] { border-color: var(--brand); border-width: 2px; background: color-mix(in srgb, var(--brand) 12%, var(--app-card)); }
.ward[disabled] { opacity: .6; cursor: default; }
.ward[disabled] span { font-family: var(--font-hi); }

.sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; background: var(--app-card); border-top: 1px solid var(--app-line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
}
.sticky .inner { max-width: 480px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.sticky .count { flex: 1; font-size: var(--text-sm); }
.sticky .btn { flex: 1; }

.agree {
  display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; font-size: var(--text-sm);
  background: var(--none-bg); border-radius: 12px; padding: 12px; cursor: pointer;
}
.agree input { width: 26px; height: 26px; margin: 1px 0 0; accent-color: var(--brand); }

details.fold summary { cursor: pointer; font-weight: 600; color: var(--brand); list-style: none; min-height: 32px; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold[open] summary { margin-bottom: 8px; }

.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 12px; font-size: var(--text-sm); font-weight: 600; white-space: nowrap; }
.t-sup { background: var(--sup-bg); color: var(--sup); }
.t-und { background: var(--und-bg); color: var(--und); }
.t-opp { background: var(--opp-bg); color: var(--opp); }
.t-none { background: var(--none-bg); color: var(--app-muted); }
.t-lean { background: var(--lean-bg); color: var(--lean); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: var(--text-sm); margin: 0; }
.kv dt { color: var(--app-muted); }
.kv dd { margin: 0; }
.or { display: flex; align-items: center; gap: 10px; color: var(--app-muted); font-size: var(--text-sm); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--app-line); }
.srow { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; }
.still { background: var(--none-bg); border-radius: 12px; padding: 8px 10px; display: grid; gap: 6px; font-size: var(--text-sm); }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--app-line); }
.mrow:first-child { border-top: 0; }
.mrow .nm { font-weight: 600; }
.mrow .nm small { display: block; font-weight: 400; font-size: var(--text-sm); color: var(--app-muted); }
.bar { height: 8px; border-radius: 999px; background: var(--app-line); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; background: var(--brand); }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--text-sm); }
.bubble { background: var(--bubble); color: var(--bubble-ink); border-radius: 12px 12px 12px 4px; padding: 10px 12px; font-size: var(--text-sm); line-height: 1.5; display: grid; gap: 8px; }
.bubble u { color: var(--bubble-link); text-decoration: none; overflow-wrap: anywhere; }
.ready { display: flex; gap: 10px; align-items: center; background: var(--sup-bg); color: var(--sup); border-radius: 12px; padding: 10px 12px; font-weight: 600; font-size: var(--text-sm); }
.qr { display: grid; justify-items: center; gap: 6px; }
.qr svg, .qr img { background: #ffffff; border-radius: 10px; padding: 8px; }
.shot { border-radius: 14px; border: 1px solid var(--app-line); width: 100%; height: auto; display: block; background: var(--none-bg); }

.scrim { position: fixed; inset: 0; background: rgba(10, 18, 15, .5); z-index: 6; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; z-index: 7; background: var(--app-bg);
  border-radius: 22px 22px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 12px;
}
.sheet > .inner { max-width: 480px; width: 100%; margin: 0 auto; display: grid; gap: 12px; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--app-line); justify-self: center; }
.sheet .sh { display: flex; justify-content: space-between; align-items: center; }
.close { appearance: none; border: 0; background: none; cursor: pointer; color: var(--app-muted); width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; }

.footer { text-align: center; font-size: var(--text-sm); color: var(--app-muted); border-top: 1px solid var(--app-line); padding-top: 12px; display: grid; gap: 4px; }
.footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 4px; }
.footer a { font-weight: 500; color: var(--app-muted); min-height: 48px; display: inline-flex; align-items: center; padding: 0 6px; }

/* The product page (screen 01). */
.lead { font-size: var(--text-body); }
h2.section { margin-top: 10px; font-size: 22px; }
.live { text-decoration: none; min-height: 48px; display: inline-flex; align-items: center; white-space: normal; flex: 1; min-width: 0; border-radius: 16px; }
.shots { display: grid; gap: 12px; }
.poster { margin: 0; position: relative; overflow: hidden; display: grid; gap: 10px; padding: 14px; border-radius: 18px; background: var(--brand); color: var(--brand-ink); }
.poster-band { position: absolute; right: -38px; top: 18px; transform: rotate(35deg); background: var(--und); color: var(--on-tag); font-size: var(--text-sm); padding: 2px 44px; }
.poster-screen { display: grid; gap: 6px; background: var(--app-card); color: var(--app-ink); border-radius: 12px; padding: 10px 12px; font-size: var(--text-sm); margin-right: 36px; }
.poster figcaption { font-size: var(--text-sm); }
.feature { gap: 10px; }
.feat { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start; }
.feat b { font-size: 18px; display: block; }
.fico { width: 30px; height: 30px; color: var(--brand); }
.input-mini { border: 1.5px solid var(--input-line); border-radius: 10px; padding: 4px 10px; background: var(--app-card); }

/* Long-form text: the policy pages. */
.prose { display: grid; gap: 12px; }
.prose h2 { font-size: 19px; margin-top: 8px; }
.prose ul { margin: 0; padding-left: 22px; display: grid; gap: 6px; }

/* The console is English, in the UI font. */
.console { font-family: var(--font-ui); }
.mono-code { font-family: var(--font-mono); letter-spacing: .04em; }
.console .mono { font-family: var(--font-mono); letter-spacing: .04em; }

/* Drawn symbols: the Devanagari subset has no ticks, crosses or arrows. */
.ico { width: 1.15em; height: 1.15em; vertical-align: -.2em; }
.tk { display: inline-block; width: .38em; height: .72em; border: solid currentColor; border-width: 0 .14em .14em 0; transform: rotate(45deg); margin: 0 .3em 0 .2em; vertical-align: .05em; }
.xx { display: inline-block; position: relative; width: .8em; height: .8em; vertical-align: -.05em; }
.xx::before, .xx::after { content: ""; position: absolute; left: 50%; top: 0; width: .13em; height: 100%; background: currentColor; transform: translateX(-50%) rotate(45deg); border-radius: 1px; }
.xx::after { transform: translateX(-50%) rotate(-45deg); }
.chev { display: inline-block; width: .45em; height: .45em; border: solid currentColor; border-width: .13em .13em 0 0; transform: rotate(45deg); margin: 0 .25em 0 .3em; vertical-align: .08em; }
.chev.down { transform: rotate(135deg); vertical-align: .2em; }
.chev.up { transform: rotate(-45deg); vertical-align: -.05em; }
.spin { display: inline-block; width: .9em; height: .9em; border: .14em solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -.1em; margin-right: .3em; }
@media (prefers-reduced-motion: no-preference) { .spin { animation: turn 1s linear infinite; } }
@keyframes turn { to { transform: rotate(360deg); } }
