/* Voter slip lookup — saffron theme.
   #F97D09 is the brand colour, but white text on it measures 2.64:1, well
   under the 4.5:1 minimum, so it is never used behind small white type.
   It carries fills with DARK text (6.0:1); the deep saffron-brown --ink
   (8.6:1 against white) does the work wherever white text is needed. */

:root {
  --brand:     #F97D09;
  --brand-deep:#A84B00;
  --ink:       #7A3A00;
  --ink-deep:  #4A2100;
  --ink-soft:  #FFF0DD;
  --paper:     #FFFBF6;
  --card:      #FFFFFF;
  --rule:      #EEDFCB;
  --muted:     #7A5B42;
  --ok:        #0F7A4D;
  --warn:      #B4321F;
  --r:         10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-deep);
  font-family: "Hind", "Noto Sans Devanagari", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

.wrap { max-width: 620px; margin: 0 auto; padding: 4px 18px 20px; }

/* ---- site header ---- */
.site { background: var(--card); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 5; }
.site-in {
  max-width: 620px; margin: 0 auto; padding: 11px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

/* ---- candidate bar (only when branding is on) ---- */
.candbar { background: var(--accent, #B8341F); color: #fff; }
.candbar-in {
  max-width: 620px; margin: 0 auto; padding: 9px 18px;
  display: flex; align-items: center; gap: 11px;
}
.candbar-in > img:first-child {
  width: 40px; height: 48px; object-fit: cover; border-radius: 5px;
  border: 1.5px solid rgba(255,255,255,.55); flex: none;
}
.cb-txt { min-width: 0; line-height: 1.25; }
.cb-txt b { display: block; font-size: 16px; font-weight: 600; }
.cb-txt span { display: block; font-size: 13px; opacity: .88; }
.cb-badge {
  margin-left: auto; text-align: center; flex: none;
  background: #fff; color: #241708; border-radius: 7px; padding: 3px 9px 4px; line-height: 1.1;
}
.cb-badge b { display: block; font-size: 19px; font-weight: 700; }
.cb-badge span { display: block; font-size: 9px; color: var(--muted); }
.cb-sym { width: 42px; height: 42px; background: #fff; border-radius: 50%; flex: none;
  object-fit: cover; border: 1.5px solid rgba(255,255,255,.7); }

/* ---- hero ---- */
.hero { padding: 26px 0 4px; }

/* ---- masthead ---- */

.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 6px 0 22px;
}
.mark { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.mark svg { flex: none; }
.mark span { font-size: 16px; letter-spacing: -0.01em; }

.lang { display: flex; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; background: var(--card); }
.lang button {
  border: 0; background: none; padding: 6px 14px; cursor: pointer;
  font: inherit; font-size: 14px; color: var(--muted);
}
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ---- search ---- */

h1 { font-size: 30px; line-height: 1.25; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.015em; }
.lede { color: var(--muted); margin: 0 0 20px; font-size: 15.5px; }

.field { display: flex; gap: 8px; }
.field input {
  flex: 1; min-width: 0;
  padding: 15px 16px;
  font: inherit; font-size: 18px;
  border: 1.5px solid var(--rule); border-radius: var(--r);
  background: var(--card); color: var(--ink-deep);
}
.field input:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.field input::placeholder { color: #B39B84; }

button.go {
  border: 0; border-radius: var(--r); background: var(--ink); color: #fff;
  padding: 0 22px; font: inherit; font-weight: 600; font-size: 17px; cursor: pointer;
}
button.go:hover { background: var(--ink-deep); }
button.go:disabled { opacity: .55; cursor: default; }
button.go:focus-visible { outline: 3px solid var(--ink-deep); outline-offset: 2px; }

.hint { font-size: 13.5px; color: var(--muted); margin: 10px 2px 0; }
.hint b { font-weight: 600; color: var(--ink); }

/* ---- states ---- */

.msg {
  margin-top: 22px; padding: 16px 18px; border-radius: var(--r);
  background: var(--card); border: 1px solid var(--rule);
}
.msg.bad { border-color: #E9C7C0; background: #FDF5F3; color: var(--warn); }
.msg h2 { font-size: 17px; margin: 0 0 4px; font-weight: 600; }
.msg p { margin: 0; font-size: 15px; color: var(--muted); }
.msg.bad p { color: #8A3A2C; }

/* ---- the slip ---- */

.slip {
  margin-top: 24px; background: var(--card);
  border: 1px solid var(--rule); border-radius: var(--r);
  overflow: hidden;
}

/* Perforated stub edge — the slip is a thing you tear off and carry. */
.stub {
  background: var(--brand); color: var(--ink-deep); padding: 14px 18px 16px;
  position: relative;
}
.stub::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 14px;
  background: radial-gradient(circle at 7px 7px, var(--card) 6.5px, transparent 7px);
  background-size: 16px 14px;
}
.stub .ps-label { font-size: 12.5px; opacity: .8; margin: 0 0 2px; }
.stub .ps { font-size: 17px; font-weight: 600; margin: 0; line-height: 1.35; }
.stub .ps-addr { font-size: 14px; opacity: .85; margin: 6px 0 0; }

.who { padding: 22px 18px 4px; }
.who .nm { font-size: 25px; font-weight: 600; margin: 0; letter-spacing: -0.015em; line-height: 1.25; }
.who .rel { color: var(--muted); margin: 3px 0 0; font-size: 15.5px; }
.who .meta { color: var(--muted); margin: 10px 0 0; font-size: 14.5px; }
.who .epic {
  display: inline-block; margin-top: 12px; padding: 4px 10px;
  background: var(--ink-soft); border-radius: 6px;
  font-size: 15px; font-weight: 600; letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}

/* Booth and serial are what the voter is actually here for, so they get the
   only large figures on the page. */
.nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--rule); margin: 20px 0 0; }
.nums div { background: var(--card); padding: 13px 14px 15px; }
.nums dt { font-size: 12.5px; color: var(--muted); margin: 0 0 1px; }
.nums dd.txt { font-size: 17px; font-weight: 600; line-height: 1.3; }
.nums dd { margin: 0; font-size: 26px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }

.acts { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 18px 18px; border-top: 1px solid var(--rule); }
.acts a, .acts button {
  flex: 1 1 auto; text-align: center; text-decoration: none;
  border: 1.5px solid var(--rule); border-radius: 8px; background: var(--card);
  padding: 11px 14px; font: inherit; font-size: 15px; font-weight: 500;
  color: var(--ink-deep); cursor: pointer;
}
.acts .wa { border-color: #B7E0C6; color: #0B6B41; }
.acts a:hover, .acts button:hover { border-color: var(--ink); }
.acts a:focus-visible, .acts button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.flagnote {
  margin: 0; padding: 11px 18px; background: #FFF8E8;
  border-top: 1px solid #F0E0BC; font-size: 13.5px; color: #79571A;
}

/* ---- name-match list ---- */

.matches { margin-top: 24px; }
.matches > p { font-size: 14.5px; color: var(--muted); margin: 0 0 10px; }
.match {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 13px 15px; margin-bottom: 8px; font: inherit;
}
.match:hover { border-color: var(--ink); }
.match:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.match .n { display: block; font-weight: 600; font-size: 17px; }
.match .d { display: block; color: var(--muted); font-size: 14px; margin-top: 3px; line-height: 1.45; }

.foot { margin-top: 34px; text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.foot a { color: var(--ink); }

@media (max-width: 420px) {
  .field { flex-direction: column; }
  button.go { padding: 14px; }
  /* Two up, with the ward spanning the full row — three columns squeezes
     long ward names, and an odd count would otherwise leave a dead cell. */
  .nums { grid-template-columns: repeat(2, 1fr); }
  .nums div:last-child { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: no-preference) {
  .slip, .msg { animation: rise .22s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } }
}

/* ---- print: the slip only, on paper ---- */
@media print {
  body { background: #fff; font-size: 12pt; }
  .top, .field, .hint, .acts, .foot, .searchbox, .matches { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .slip { border: 1.5px solid #000; margin: 0; page-break-inside: avoid; }
  .stub { background: #fff !important; color: #000 !important; border-bottom: 1.5px dashed #000; }
  .stub::after { display: none; }
  .nums { background: #000; }
  .nums dd { color: #000; }
  .who .epic { background: #fff; border: 1px solid #000; }
}


/* ---- coverage strip ---- */
.facts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r);
  overflow: hidden; margin-top: 30px;
}
.facts div { background: var(--card); padding: 14px 12px 13px; text-align: center; }
.facts b { display: block; font-size: 24px; font-weight: 700; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.facts b.sm { font-size: 15px; line-height: 1.3; }
.facts span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ---- how it works ---- */
.how, .faq { margin-top: 34px; }
.how h2, .faq h2 { font-size: 18px; font-weight: 600; margin: 0 0 13px; letter-spacing: -.01em; }

.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 9px; }
.steps li {
  counter-increment: s; background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--r); padding: 13px 15px 14px 46px; position: relative;
}
.steps li::before {
  content: counter(s); position: absolute; left: 14px; top: 13px;
  width: 22px; height: 22px; border-radius: 50%; background: var(--ink-soft); color: var(--ink);
  font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.steps b { display: block; font-size: 15.5px; font-weight: 600; }
.steps span { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; line-height: 1.45; }

/* ---- faq ---- */
.faq details {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 12px 15px; margin-bottom: 8px;
}
.faq summary { font-size: 15.5px; font-weight: 500; cursor: pointer; list-style: none; position: relative; padding-right: 22px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0; top: -2px; font-size: 20px; color: var(--ink); font-weight: 400;
}
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 9px 0 0; font-size: 14.5px; color: var(--muted); line-height: 1.55; }

/* ---- footer ---- */
.foot {
  max-width: 620px; margin: 40px auto 0; padding: 20px 18px 40px;
  border-top: 1px solid var(--rule); text-align: center;
  color: var(--muted); font-size: 13.5px; line-height: 1.6;
}
.foot p { margin: 0 0 6px; }
.foot .src { font-size: 12.5px; }
.foot .imp { font-size: 11px; margin-top: 12px; line-height: 1.5; }

@media print { .site, .candbar, .facts, .how, .faq, .foot { display: none !important; } }
