/* dominion: shared styles for every page. The design pass (ledger D15): WCAG level AAA, so every word is at 7:1
   against what it stands on (the quiet grey too), every control is 44 px or more and wears a dark ring when it has the
   keyboard's focus, and nothing moves for anyone who asks for less motion. Headings and big numbers are in Anek
   Telugu (SIL OFL 1.1, fonts/OFL.txt), served from here since the content security policy admits no other font. */
@font-face { font-family: 'Anek Telugu'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/static/fonts/anek-telugu-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Anek Telugu'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/static/fonts/anek-telugu-telugu.woff2') format('woff2');
  unicode-range: U+0951-0952, U+0964-0965, U+0B83, U+0C00-0C7F, U+1CD5-1CD6, U+1CD8, U+1CDA, U+1CF2, U+200C-200D,
    U+25CC; }
:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --ink: #161b22;           /* 17:1 on white */
  --muted: #434c57;         /* 8.7:1 on white, 7.9:1 on the page's grey */
  --faint: #6b7480;         /* lines and marks only, never words */
  --line: #dde1e6;
  --field: #7a8592;         /* a field's edge: 3.75:1 on white */
  --accent: #0a4f8f;        /* 8.3:1 on white, and white on it */
  --accent-ink: #ffffff;
  --accent-soft: #e3eef9;
  --danger: #8c1d18;        /* 9.1:1 */
  --ok: #1b5e20;            /* 7.9:1 */
  --focus: #102a6b;
  --bar: #12171d;
  --bar-ink: #ffffff;
  --bar-link: #c9d2dc;      /* 12:1 on the bar */
  --bar-quiet: #aab4bf;     /* 8.6:1 on the bar */
  --bar-mark: #8cb8e8;      /* the open page's underline */
  --topbar-h: 60px;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Telugu", "Nirmala UI", Gautami, sans-serif;
  --display: "Anek Telugu", var(--font);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #06365f; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px; min-height: var(--topbar-h);
          padding: 8px 16px; background: var(--bar); color: var(--bar-ink); }
.topbar :focus-visible { outline-color: #ffffff; }
.topbar .brand { display: flex; align-items: baseline; gap: 8px; min-height: 44px; padding: 6px 4px; margin-right: 10px;
                 color: var(--bar-ink); text-decoration: none; font: 800 24px/1.25 var(--display); letter-spacing: -.01em;
                 white-space: nowrap; }
.topbar .brand small { font: 500 14px/1 var(--font); color: var(--bar-quiet); letter-spacing: 0; }
.topbar nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.topbar nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 10px;
                color: var(--bar-link); font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.topbar nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.topbar nav a.active { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 700;
                       box-shadow: inset 0 -3px 0 var(--bar-mark); }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--bar-quiet); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
               max-width: 14ch; }
.topbar button { min-height: 44px; border: 1px solid rgba(255, 255, 255, .4); background: transparent; color: var(--bar-ink);
                 border-radius: 10px; padding: 0 16px; font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.topbar button:hover { background: rgba(255, 255, 255, .1); }
/* On a phone the page links get a row of their own, shared evenly: they do not fit beside the brand and the sign-out
   button. --topbar-h follows, so the map still starts below the bar. */
@media (max-width: 640px) {
  :root { --topbar-h: 112px; }
  .topbar { display: grid; grid-template-columns: auto 1fr auto; grid-auto-rows: 52px; gap: 0 6px; padding: 4px 10px;
            min-height: 0; }
  .topbar .brand { grid-area: 1 / 1; font-size: 22px; }
  .topbar .spacer { grid-area: 1 / 2; }
  .topbar .logout { grid-area: 1 / 3; }
  .topbar nav { grid-row: 2; grid-column: 1 / -1; align-self: start; }
  .topbar nav a { flex: 1; justify-content: center; padding: 0 10px; }
  .topbar .brand small, .topbar .who { display: none; }
  .topbar button { padding: 0 12px; }
}

/* page frame */
.wrap { max-width: 1280px; margin: 0 auto; padding: 20px 20px 48px; }
h1 { font: 700 28px/1.2 var(--display); margin: 4px 0 16px; }
h2 { font: 700 21px/1.3 var(--display); margin: 0 0 10px; }
h3 { font-size: 17px; line-height: 1.35; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px;
         margin-bottom: 18px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
@media (max-width: 640px) {
  .wrap { padding: 14px 12px 40px; }
  .panel { padding: 16px; }
  h1 { font-size: 25px; }
}

/* forms */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
input[type=text], input[type=password], input[type=search], input[type=number], input[type=tel], select, textarea {
  width: 100%; min-height: 48px; padding: 8px 12px; border: 2px solid var(--field); border-radius: 10px;
  background: #fff; color: var(--ink); font-size: 16px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px;
  border-color: var(--focus); }
button.primary, button.secondary, button.danger { min-height: 44px; padding: 8px 18px; border-radius: 10px;
  border: 2px solid transparent; cursor: pointer; font-weight: 700; }
button.primary { background: var(--accent); color: var(--accent-ink); }
button.primary:hover { background: #06365f; }
button.secondary { background: #fff; border-color: var(--accent); color: var(--accent); }
button.secondary:hover { background: var(--accent-soft); }
button.danger { background: #fff; border-color: var(--danger); color: var(--danger); }
button.danger:hover { background: #fbeceb; }
button:disabled { opacity: .55; cursor: default; }
a.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 18px;
           border: 2px solid var(--accent); border-radius: 10px; background: #fff; color: var(--accent); font-weight: 700;
           text-decoration: none; }
a.button:hover { background: var(--accent-soft); }
a.button.primary { border-color: transparent; background: var(--accent); color: var(--accent-ink); }
a.button.primary:hover { background: #06365f; color: var(--accent-ink); }
label.field small { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); }
label.tick { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 4px 0 8px; font-size: 16px;
             cursor: pointer; }
label.tick input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }

/* sending a volunteer their link (invite.js) */
.share { margin-top: 12px; padding: 14px; border: 2px solid #b9d3ec; border-radius: var(--radius); background: #f5f9fd; }
.share-head { margin: 0 0 10px; font-weight: 700; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.share-buttons > * { flex: 1 1 auto; text-align: center; }
.share input[readonly] { font-size: 14px; color: var(--muted); }
.share .msg { margin: 0; min-height: 0; }
.share > p.muted { margin: 8px 0 0; }
.msg { min-height: 1.5em; margin: 8px 0 0; font-size: 15px; }
.msg.err { color: var(--danger); font-weight: 600; }
.msg.ok { color: var(--ok); font-weight: 600; }
.note { margin: 12px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); font-size: 15px;
        word-break: break-word; }

/* a volunteer's mark and a candidate's (common.js roleMark, ledger V3.2, V3.3) */
.mark { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px 2px 6px; border-radius: 99px;
        font-size: 14px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.mark svg { flex: none; width: 16px; height: 16px; }
.mark.vol { background: #fff1bf; color: #5c4400; }
.mark.cand { background: #4b45c6; color: #fff; }

/* the volunteers' pages here (/join, /reset, and /password for a volunteer; common.js sevakBar): the portal's look,
   sky behind and leaf green for what is pressed, words at 7:1 on the white panels and forest green on the sky
   (ledger D15) */
body.sevak-page { --bg: #87ceeb; --ink: #10261a; --muted: #415446; --field: #6b8a72; --accent: #1b5e20;
  --accent-soft: #eef7f0; --line: #d3ead8; --focus: #102a6b; --radius: 24px; }
body.sevak-page:lang(te) { line-height: 1.7; }
.sevak-bar { display: flex; align-items: center; gap: 10px; max-width: 600px; margin: 0 auto; padding: 10px 16px 0;
  padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.sevak-bar .spacer { flex: 1; }
.sevak-brand { display: inline-flex; align-items: center; min-height: 44px; color: #0e3b14; font: 800 20px/1.2 var(--display);
  text-decoration: none; }
.sevak-brand:hover { color: #0e3b14; text-decoration: underline; }
.lang-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 12px; border: 0;
  border-radius: 999px; background: #fff; color: #0e3b14; font-size: 16px; font-weight: 700; cursor: pointer;
  box-shadow: 0 1px 3px rgba(14, 59, 20, .2); }
.lang-switch:hover { background: #eef7f0; }
.lang-switch svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.sevak-bar .link-btn { min-height: 44px; padding: 0 8px; border: 0; background: none; color: #0e3b14; font-size: 16px;
  font-weight: 700; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.sevak-page .panel { border: 0; box-shadow: 0 10px 26px rgba(14, 59, 20, .14); }
.sevak-page h1 { color: #1b5e20; }
.sevak-page .wrap > h1 { color: #0e3b14; }
.sevak-page input[type=text], .sevak-page input[type=password], .sevak-page input[type=tel] { min-height: 52px;
  border-radius: 14px; font-size: 17px; }
.sevak-page button.primary { min-height: 58px; border-radius: 999px; font-size: 18px;
  box-shadow: 0 4px 12px rgba(27, 94, 32, .3); }
.sevak-page button.primary:hover { background: #0e3b14; }

/* tables */
table.grid { width: 100%; border-collapse: collapse; font-size: 15px; }
table.grid th, table.grid td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left;
                               vertical-align: top; }
table.grid thead th { border-bottom: 2px solid #c3c9d0; }
table.grid th { font-size: 14px; color: var(--ink); font-weight: 700; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
/* table.grid.stack: on a phone each row becomes a block, each cell a line with its column's name (data-label) beside
   it, so nothing hides off the right edge; a cell without a label heads its row */
@media (max-width: 640px) {
  table.grid.stack thead { display: none; }
  table.grid.stack, table.grid.stack tbody, table.grid.stack tr { display: block; }
  table.grid.stack tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.grid.stack td { display: flex; gap: 10px; padding: 3px 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  table.grid.stack td[data-label]::before { content: attr(data-label); flex: none; width: 7.5em; color: var(--muted);
                                            font-size: 14px; padding-top: 1px; }
  table.grid.stack td:empty { display: none; }
}
