/* Campaign voter portal: mobile first, light and dark themes, no external assets. */
:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #f7f9fa;
  --text: #121a21;
  --muted: #5d6b78;
  --border: #e1e6ea;
  --accent: #0f766e;
  --accent-strong: #0b5e58;
  --accent-soft: #e3f4f2;
  --accent-text: #ffffff;
  --accent-ink: #0f766e;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok-bg: #e5f6ea; --ok-text: #14532d;
  --err-bg: #fdecea; --err-text: #8a1c12;
  --info-bg: #e8f1fb; --info-text: #1d4f8a;
  --secret-bg: #fff6db; --secret-text: #6b4e00;
  --shadow: 0 1px 2px rgba(16, 24, 32, .05), 0 4px 14px rgba(16, 24, 32, .06);
  --radius: 14px;
  --radius-sm: 10px;
  --tap: 44px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1215;
    --surface: #171c20;
    --surface-2: #1d2328;
    --text: #e9edf0;
    --muted: #96a3ae;
    --border: #2a3238;
    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --accent-soft: #123a36;
    --accent-text: #06201d;
    --accent-ink: #5eead4;
    --danger: #f97066;
    --danger-soft: #3a1714;
    --ok-bg: #12301d; --ok-text: #9be2b2;
    --err-bg: #3a1714; --err-text: #ffb4ab;
    --info-bg: #142640; --info-text: #a8cbf5;
    --secret-bg: #3a2f0c; --secret-text: #f6d77a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0e1215;
    --surface: #171c20;
    --surface-2: #1d2328;
    --text: #e9edf0;
    --muted: #96a3ae;
    --border: #2a3238;
    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --accent-soft: #123a36;
    --accent-text: #06201d;
    --accent-ink: #5eead4;
    --danger: #f97066;
    --danger-soft: #3a1714;
    --ok-bg: #12301d; --ok-text: #9be2b2;
    --err-bg: #3a1714; --err-text: #ffb4ab;
    --info-bg: #142640; --info-text: #a8cbf5;
    --secret-bg: #3a2f0c; --secret-text: #f6d77a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Thaana", "MV Boli", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body.has-tabbar { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
a { color: var(--accent-ink); }
h1 { font-size: 1.35rem; line-height: 1.25; margin: 0 0 .75rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
p { margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.icon { flex: none; vertical-align: middle; }

/* --- top bar ------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  padding: .5rem max(1rem, env(safe-area-inset-left)) .5rem max(1rem, env(safe-area-inset-right));
  padding-top: calc(.5rem + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; text-decoration: none; color: var(--text); }
.brand-sub { color: var(--muted); font-weight: 500; }
.brand-mark {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: var(--accent-text);
}
.brand-mark.big { width: 52px; height: 52px; border-radius: 15px; }
.topnav { display: none; gap: .25rem; flex: 1; }
.topnav a {
  padding: .45rem .75rem; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500;
}
.topnav a:hover { color: var(--text); background: var(--surface-2); }
.topnav a[aria-current] { color: var(--accent-ink); background: var(--accent-soft); }

.account { margin-left: auto; position: relative; }
.account summary {
  list-style: none; display: flex; align-items: center; gap: .5rem; cursor: pointer;
  min-height: var(--tap); padding: 0 .25rem; border-radius: 999px;
}
.account summary::-webkit-details-marker { display: none; }
.account-avatar {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 700;
}
.account-name { display: none; color: var(--muted); }
.account-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: .75rem; display: grid; gap: .25rem;
}
.account-menu a, .account-menu button.link {
  display: block; text-align: left; padding: .6rem .5rem; border-radius: 8px; text-decoration: none; width: 100%;
}
.account-menu a:hover, .account-menu button.link:hover { background: var(--surface-2); }
.account-menu form { margin: 0; }

/* --- bottom tab bar (phones, admins) -------------------------------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-top: 1px solid var(--border);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: .35rem 0; min-height: 52px; justify-content: center;
  text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600; border-radius: 12px;
}
.tabbar a[aria-current] { color: var(--accent-ink); }
.tabbar a[aria-current] .icon { background: var(--accent-soft); border-radius: 999px; padding: 3px 14px; width: 50px; height: 28px; }

/* --- layout ------------------------------------------------------------- */
.page { max-width: 1120px; margin: 0 auto; padding: 1rem max(1rem, env(safe-area-inset-left)) 1.5rem; }
.center { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1rem; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.narrow { width: 100%; max-width: 440px; margin-left: auto; margin-right: auto; }

/* --- forms -------------------------------------------------------------- */
label { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; font-weight: 500; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: .6rem; }
input, select, button, .button {
  font: inherit; font-size: 16px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .6rem .8rem; min-height: var(--tap);
}
input[type=checkbox] { min-height: 0; width: 20px; height: 20px; accent-color: var(--accent); }
input[type=file] { padding: .5rem; background: var(--surface-2); }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
button:focus-visible, .button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:disabled { opacity: .7; }
button, .button {
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem; white-space: nowrap; font-weight: 600; background: var(--surface-2);
}
button:hover, .button:hover { border-color: var(--muted); }
button:active, .button:active { transform: translateY(1px); }
.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: var(--danger-soft); }
.link { border: 0; background: none; color: var(--accent-ink); padding: 0; min-height: 0; font-weight: 500; }
.wide { width: 100%; }
.big { min-height: 52px; font-size: 1.05rem; border-radius: 12px; }
.small { min-height: 36px; padding: .35rem .7rem; font-size: .88rem; }

.form, .form .row { display: grid; gap: 1rem; }
.form { grid-template-columns: minmax(0, 1fr); }
.form input, .form select, .form textarea { min-width: 0; max-width: 100%; }
.form .row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.form > button { justify-self: start; }
.card.narrow form, form.narrow { display: grid; gap: 1rem; }
form.card.narrow { display: grid; gap: 1rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.actions.split { margin-top: 1rem; }
form.inline { margin: 0; }

/* --- search page -------------------------------------------------------- */
.searchbar { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 10; margin: -.25rem 0 .75rem; }
.search-input {
  display: flex; align-items: center; gap: .5rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: .3rem .3rem .3rem .9rem; box-shadow: var(--shadow);
}
.search-input .icon { color: var(--muted); }
.search-input input { flex: 1; min-width: 0; border: 0; padding: .55rem 0; background: transparent; }
.search-input input:focus { outline: none; }
.search-input:focus-within { outline: 2px solid var(--accent); }
.search-input button { border-radius: 12px; padding: .5rem 1rem; }

.chips, .active-filters { display: flex; gap: .5rem; overflow-x: auto; padding: .1rem 0 .6rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.active-filters { flex-wrap: wrap; overflow: visible; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; flex: none;
  padding: .4rem .9rem; min-height: 36px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  text-decoration: none; font-size: .9rem; font-weight: 600;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chip.removable { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }

.filter-panel { padding: 0; overflow: hidden; }
.filter-panel > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem;
  padding: .85rem 1.1rem; font-weight: 600; min-height: var(--tap);
}
.filter-panel > summary::-webkit-details-marker { display: none; }
.filter-panel > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.filter-panel[open] > summary::after { transform: rotate(180deg); }
.filter-panel .count {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: .78rem;
}
.filters { display: grid; gap: .85rem; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.filters input, .filters select { width: 100%; min-width: 0; }
.filter-panel .filters { padding: 0 1.1rem 1.1rem; }
.filters .actions { grid-column: 1 / -1; }
.filters .actions .primary { flex: 1; }
.range { display: flex; gap: .4rem; align-items: center; }
.range input { width: 50%; min-width: 0; }
form.card.filters { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.resultbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; margin: .25rem 0 .75rem; }
.resultbar p { margin: 0; }
.export { display: flex; gap: .4rem; }

.voter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.vcard {
  position: relative; display: flex; align-items: center; gap: .85rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .75rem .8rem; box-shadow: var(--shadow); transition: border-color .15s, transform .1s;
}
.vcard:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.vcard:active { transform: scale(.995); }
.vcard-main { flex: 1; min-width: 0; }
.vcard-name {
  display: block; font-weight: 650; font-size: 1.02rem; color: var(--text); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vcard-name::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); } /* whole card is tappable */
.vcard-meta { margin: .05rem 0 .3rem; color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcard-tags { display: flex; gap: .35rem; flex-wrap: wrap; margin: 0; }
.vcard-tags:empty { display: none; }
.tag.deceased { background: var(--text); color: var(--surface); border-color: transparent; }
.vcard.deceased { opacity: .62; }
.vcard.deceased .vcard-name { text-decoration: line-through; text-decoration-thickness: 1px; }
/* Where the voter is registered to vote: its own line, so it reads at a glance */
.vcard-loc {
  display: flex; align-items: center; gap: .3rem; margin: 0 0 .35rem;
  font-size: .86rem; font-weight: 600; color: var(--accent-ink); min-width: 0;
}
.vcard-loc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcard-loc .icon { flex: none; }
.tag {
  display: inline-block; padding: .05rem .5rem; border-radius: 6px; font-size: .78rem; font-weight: 600;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.tag.party { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.call {
  position: relative; z-index: 1; flex: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  width: var(--tap); height: var(--tap); border-radius: 50%;
  background: var(--accent); color: var(--accent-text); text-decoration: none; font-weight: 600;
}
.call-number { display: none; }

.avatar { display: inline-grid; place-items: center; flex: none; object-fit: cover; background: var(--surface-2); color: var(--muted); font-weight: 700; }
.avatar.sm { width: 36px; height: 36px; border-radius: 50%; }
.avatar.md { width: 56px; height: 56px; border-radius: 14px; font-size: 1.3rem; border: 1px solid var(--border); }
.avatar.lg { width: 112px; height: 112px; border-radius: 20px; font-size: 2.6rem; border: 1px solid var(--border); }

.empty { text-align: center; padding: 2rem 1rem; }

/* --- voter detail ------------------------------------------------------- */
.backlink {
  display: inline-flex; align-items: center; gap: .2rem; margin: 0 0 .75rem; min-height: var(--tap);
  text-decoration: none; font-weight: 600;
}
.profile-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.profile-head h1 { margin-bottom: .4rem; }
.call-wide { width: 100%; margin-bottom: 1rem; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: 0; }
.facts > div { background: var(--surface-2); border-radius: var(--radius-sm); padding: .6rem .8rem; min-width: 0; }
.facts > div.wide { grid-column: 1 / -1; }
.facts dt { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.facts dd { margin: .1rem 0 0; font-weight: 600; overflow-wrap: anywhere; }
.actions.split > * { flex: 1; }
.actions.split button, .actions.split .button { width: 100%; }

/* --- login -------------------------------------------------------------- */
.login { background: radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg); }
.login-card { padding: 1.6rem; }
.login-head { text-align: center; display: grid; justify-items: center; gap: .5rem; margin-bottom: .25rem; }
.login-head h1 { margin: .25rem 0 0; }

/* --- tables (admin pages) ----------------------------------------------- */
.table-wrap {
  margin-bottom: 1rem; overflow-x: auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
tr.inactive td { opacity: .55; }
td.detail { max-width: 420px; word-break: break-word; font-size: .85rem; }
td .actions { gap: .35rem; }
td .actions button { padding: .3rem .6rem; min-height: 36px; font-size: .85rem; }

@media (max-width: 719px) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: .6rem .9rem; border-bottom: 1px solid var(--border); }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack td { border: 0; padding: .25rem 0; display: flex; gap: .75rem; align-items: center; }
  table.stack td[data-label]:not([data-label=""])::before {
    content: attr(data-label); flex: 0 0 92px; font-size: .78rem; font-weight: 600; color: var(--muted);
    text-transform: uppercase; letter-spacing: .03em;
  }
  table.stack td.detail { max-width: none; }
  .table-wrap:has(table.stack) { overflow: visible; }
}

/* --- misc --------------------------------------------------------------- */
.badge { display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-weight: 600; }
.badge.warn { color: var(--danger); border-color: var(--danger); }
.flash { padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-weight: 500; }
.flash-success { background: var(--ok-bg); color: var(--ok-text); }
.flash-error { background: var(--err-bg); color: var(--err-text); }
.flash-info { background: var(--info-bg); color: var(--info-text); }
.flash-secret { background: var(--secret-bg); color: var(--secret-text); font-family: ui-monospace, monospace; word-break: break-all; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin: 1rem 0; align-items: center; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stats div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem 1rem; }
.stats strong { display: block; font-size: 1.35rem; }
.stats span { color: var(--muted); font-size: .85rem; }
pre.output {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem;
  overflow-x: auto; max-height: 520px; font-size: .8rem; line-height: 1.45; white-space: pre;
}
details.card > summary { cursor: pointer; min-height: 28px; }
form.apply { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
ol, ul { padding-left: 1.25rem; }

/* --- canvassing ---------------------------------------------------------- */
:root {
  /* Status colours validated as a categorical set (CVD-safe in stacking order, light and dark). */
  --st-new: #8a96a3; --st-contacted: #1baf7a; --st-followup: #2a78d6; --st-noanswer: #eb6834;
  --track: #e6eaee;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --st-new: #7d8995; --st-contacted: #199e70; --st-followup: #3987e5; --st-noanswer: #d95926; --track: #2a3238; }
}
:root[data-theme="dark"] { --st-new: #7d8995; --st-contacted: #199e70; --st-followup: #3987e5; --st-noanswer: #d95926; --track: #2a3238; }
.st-new { --st: var(--st-new); }
.st-contacted { --st: var(--st-contacted); }
.st-followup { --st: var(--st-followup); }
.st-noanswer { --st: var(--st-noanswer); }
.chip b { font-weight: 800; margin-left: .15rem; }
.status-chips .chip:not(.on)[class*="st-"]::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--st);
}
.status-chips .chip.on[class*="st-"] {
  background: color-mix(in srgb, var(--st) 18%, var(--surface)); border: 2px solid var(--st); color: var(--text);
}

.vcard { flex-direction: column; align-items: stretch; gap: .55rem; border-left: 4px solid var(--st, var(--border)); }
.vcard:hover { border-left-color: var(--st, var(--border)); }
.vcard-top { display: flex; align-items: center; gap: .85rem; }
.status-form { position: relative; z-index: 1; display: flex; align-items: center; gap: .5rem; }
.status-form select {
  flex: 1; min-height: 40px; padding: .4rem .7rem; font-weight: 600;
  border-color: color-mix(in srgb, var(--st, var(--border)) 45%, var(--border));
  background: color-mix(in srgb, var(--st, transparent) 9%, var(--surface));
}
.save-state { font-size: .82rem; color: var(--muted); min-width: 4.5rem; }
.vcard-notes {
  position: relative; margin: 0; padding: .45rem .65rem; border-radius: 8px; font-size: .88rem;
  background: var(--surface-2); color: var(--muted); white-space: pre-line;
}
.house-head { list-style: none; grid-column: 1 / -1; padding: .6rem .2rem 0; }
.house-head h2 { margin: 0; font-size: 1.05rem; }

.canvass { display: grid; gap: .85rem; margin-bottom: 1rem; padding: .9rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.segmented { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.segmented legend { font-size: .88rem; font-weight: 500; color: var(--muted); margin-bottom: .35rem; padding: 0; }
.seg { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span {
  display: flex; align-items: center; justify-content: center; min-height: var(--tap); padding: .4rem .5rem;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-weight: 600; text-align: center;
}
.seg input:checked + span {
  background: color-mix(in srgb, var(--st) 18%, var(--surface)); border: 2px solid var(--st); color: var(--text);
}
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
textarea {
  font: inherit; font-size: 16px; color: var(--text); background: var(--surface); width: 100%;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .8rem; resize: vertical;
}
textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.canvass-foot { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.small-text { font-size: .85rem; }

/* --- dashboard & agents ------------------------------------------------- */
.page-head { margin-bottom: 1rem; }
.page-head h1 { margin-bottom: .2rem; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.kpi {
  display: flex; flex-direction: column; gap: .15rem; padding: .8rem .9rem; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  color: var(--text); text-decoration: none;
}
.kpi.hero { grid-column: 1 / -1; }
.kpi strong { font-size: 1.5rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi.hero strong { font-size: 2.2rem; }
.kpi-label { display: flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.link-kpi:hover { border-color: var(--accent); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }

.pbar { display: block; width: 100%; height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.pbar.lg { height: 14px; margin-top: .4rem; }
.pbar.sm { height: 8px; }
.pbar rect { stroke: var(--surface); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.seg-contacted { fill: var(--st-contacted); background: var(--st-contacted); }
.seg-followup { fill: var(--st-followup); background: var(--st-followup); }
.seg-noanswer { fill: var(--st-noanswer); background: var(--st-noanswer); }
.seg-track { background: var(--track); border: 1px solid var(--border); }
.legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin: 0 0 .6rem; font-size: .85rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }

.dash-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 519px) { .dash-filters { grid-template-columns: 1fr 1fr; } .dash-filters label:last-of-type { grid-column: 1 / -1; } }

.house-list, .assign-list, .agent-grid, .leaders { list-style: none; margin: 0; padding: 0; }
.house-list { display: grid; gap: .5rem; margin-bottom: 1rem; }
.house-row {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .65rem .8rem .75rem; display: grid; gap: .45rem;
}
.house-row.done { border-color: color-mix(in srgb, var(--st-contacted) 55%, var(--border)); }
.house-link { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; text-decoration: none; color: var(--text); }
.house-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.house-meta { display: flex; gap: .4rem; align-items: center; flex: none; font-size: .85rem; color: var(--muted); }
.house-meta .tag { display: inline-flex; align-items: center; gap: .2rem; }
.st-tag-followup { background: color-mix(in srgb, var(--st-followup) 15%, var(--surface)); color: var(--text); border-color: transparent; }
.leaders li { display: flex; justify-content: space-between; padding: .45rem 0; border-bottom: 1px solid var(--border); }
.leaders li:last-child { border-bottom: 0; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin: .5rem 0 .6rem; }
.list-head h2 { margin: 0; }
.list-head select { min-height: 38px; padding: .3rem .6rem; }

.next-up {
  display: grid; gap: .2rem; text-decoration: none; color: var(--text);
  border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.next-up strong { font-size: 1.3rem; }
.next-up .button { justify-self: start; margin-top: .4rem; }

.agent-grid { display: grid; gap: .6rem; margin-bottom: 1rem; }
.agent-card { margin: 0; display: grid; gap: .6rem; }
.agent-card.inactive { opacity: .6; }
.agent-top { display: flex; align-items: center; gap: .75rem; }
.agent-top > div { flex: 1; min-width: 0; }
.agent-top p { margin: 0; }
.agent-pct { font-size: 1.3rem; }
.agent-foot { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin: 0; }
.checks { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.checks legend { font-size: .88rem; color: var(--muted); font-weight: 500; padding: 0; margin-bottom: .35rem; }
.checks .check { color: var(--text); font-size: 1rem; }
.assign-list { display: grid; margin: .6rem 0 1rem; }
.assign-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 42%); gap: .6rem; align-items: center;
  padding: .55rem 0; border-bottom: 1px solid var(--border);
}
.assign-list li[hidden] { display: none; }
.assign-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .5rem; align-items: center; }
.assign-main .pbar { grid-column: 1 / -1; }
.assign-list select { min-height: 40px; padding: .35rem .55rem; width: 100%; }

/* --- WhatsApp ---------------------------------------------------------------- */
:root { --wa: #1f9d57; --wa-text: #ffffff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --wa: #25d366; --wa-text: #052e16; }
}
:root[data-theme="dark"] { --wa: #25d366; --wa-text: #052e16; }
.contact-btns { position: relative; z-index: 1; display: flex; gap: .45rem; flex: none; }
.wa {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--tap); height: var(--tap); border-radius: 50%;
  background: var(--wa); color: var(--wa-text); text-decoration: none;
}
.contact-wide { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: 1rem; }
.contact-wide .button:only-child { grid-column: 1 / -1; }
.wa-wide { background: var(--wa); border-color: var(--wa); color: var(--wa-text); }
.wa-wide:hover { filter: brightness(1.05); border-color: var(--wa); }

.sms {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--tap); height: var(--tap); border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); text-decoration: none;
}
.sms-wide { color: var(--text); }
.status-form { flex-wrap: wrap; }
.status-form .contact-btns { margin-left: auto; }
.status-form select { flex: 1 1 120px; min-width: 0; }
.status-form .save-state { min-width: 0; }
.status-form .save-state:empty { display: none; }
.contact-wide { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }

/* --- colour & appearance --------------------------------------------------- */
.appearance { display: grid; gap: .35rem; padding: .4rem .5rem; }
.appearance-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem; }
.appearance-btns button { min-height: 36px; padding: .3rem .4rem; }
.appearance-btns button.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.swatch {
  position: relative; flex-direction: row; align-items: center; gap: .6rem; padding: .6rem .7rem;
  min-height: var(--tap); border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); font-weight: 600; cursor: pointer;
}
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch:has(input:checked) { border: 2px solid var(--text); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch-chip { width: 26px; height: 26px; border-radius: 8px; flex: none; border: 1px solid rgba(0, 0, 0, .12); }
.sw-teal { background: #0f766e; } .sw-mdp { background: #f5c400; } .sw-blue { background: #1d4ed8; }
.sw-green { background: #15803d; } .sw-purple { background: #6d28d9; } .sw-red { background: #b91c1c; }

/* --- campaign scope --------------------------------------------------------- */
.campaign-banner {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem .75rem; flex-wrap: wrap;
  margin: 0 0 .9rem; padding: .5rem .6rem .5rem .9rem; border-radius: var(--radius-sm); font-size: .9rem;
  background: var(--accent-soft); color: var(--text);
}
.campaign-banner.all { background: var(--secret-bg); color: var(--secret-text); }
.party-checks { display: grid; gap: .5rem; }
.party-option {
  display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; min-height: var(--tap);
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
}
.party-option span { display: flex; justify-content: space-between; gap: .75rem; flex: 1; }
.party-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- wider screens ------------------------------------------------------ */
@media (min-width: 720px) {
  .topnav { display: flex; }
  .tabbar { display: none; }
  body.has-tabbar { padding-bottom: 0; }
  .account-name { display: inline; }
  .page { padding-top: 1.5rem; }
  h1 { font-size: 1.5rem; }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters .actions .primary { flex: 0 1 auto; }
  .voter-list { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: .75rem; }
  .contact-wide { grid-template-columns: repeat(3, auto); justify-content: start; }
  .call-number { display: inline; }
  .avatar.lg { width: 150px; height: 150px; }
  .profile { display: grid; grid-template-columns: 1fr; max-width: 760px; }
  .facts { grid-template-columns: repeat(3, 1fr); }
  .segmented { grid-template-columns: repeat(4, 1fr); }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi.hero { grid-column: span 2; grid-row: span 2; justify-content: center; }
  .agent-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .house-list { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
  .call-wide { width: auto; justify-self: start; }
  .actions.split > * { flex: 0 1 auto; }
}


/* Individual voter assignment */
.vcard-top .pick { width: 1.35rem; height: 1.35rem; flex: none; accent-color: var(--accent); margin: 0;
  position: relative; z-index: 2; } /* above the card-wide link, so a tap ticks instead of opening the voter */
.tag.agent-tag { display: inline-flex; align-items: center; gap: .2rem; }
.assign-one { display: grid; gap: .35rem; margin: 1rem 0; }
.assign-one select { width: 100%; }
.assign-one p { margin: 0; }
.bulk-assign .wide-row { grid-column: 1 / -1; margin: 0; }

/* Who changed the voter last */
.vcard-who { margin: 0; display: flex; flex-wrap: wrap; gap: .1rem .9rem; }
.vcard-who:empty { display: none; }
.vcard-who strong { color: var(--text); font-weight: 600; }

/* My dashboard: latest voters this person reached */
.st-tag-contacted { background: color-mix(in srgb, var(--st-contacted) 15%, var(--surface)); color: var(--text); border-color: transparent; }
.st-tag-noanswer { background: color-mix(in srgb, var(--st-noanswer) 15%, var(--surface)); color: var(--text); border-color: transparent; }
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .6rem; padding: .6rem 0; border-top: 1px solid var(--border); min-width: 0; }
.recent-list li:first-child { border-top: 0; }
.recent-list a { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.recent-list .muted { flex-basis: 100%; }

/* Dashboard date range */
.range-picker { display: grid; gap: .5rem; margin: 0 0 1rem; }
.range-picker .chips { margin: 0; }
.range-dates { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; }
.range-dates label { display: grid; gap: .2rem; font-size: .85rem; color: var(--muted); flex: 1 1 8.5rem; min-width: 0; }
.range-dates input { width: 100%; min-width: 0; }
.leaders a { color: inherit; }

/* Campaign messages and picture */
.msg-form { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1rem; }
.msg-form h3, .picture-box h3 { margin: 0; font-size: 1.02rem; }
.picture-box { display: grid; gap: .6rem; margin-top: 1rem; padding: .9rem; border-radius: 12px; background: var(--bg); }
.picture-preview { max-width: 100%; max-height: 260px; border-radius: 10px; justify-self: start; }
.picture-page { display: grid; place-items: center; min-height: 100vh; margin: 0; background: #111; }
.picture-page img { max-width: 100%; max-height: 100vh; }

/* --- Viber -------------------------------------------------------------------- */
:root { --viber: #6f4fd8; --viber-text: #ffffff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --viber: #9b87f5; --viber-text: #160f33; }
}
:root[data-theme="dark"] { --viber: #9b87f5; --viber-text: #160f33; }
.viber {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--tap); height: var(--tap); border-radius: 50%;
  background: var(--viber); color: var(--viber-text); text-decoration: none;
}
.viber-wide { background: var(--viber); border-color: var(--viber); color: var(--viber-text); }
.viber-wide:hover { filter: brightness(1.05); border-color: var(--viber); }
.toast {
  position: fixed; left: 50%; bottom: calc(5.5rem + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 50; max-width: calc(100% - 32px); padding: .6rem .9rem; border-radius: 10px;
  background: var(--text); color: var(--bg); font-size: .9rem; box-shadow: 0 6px 20px rgb(0 0 0 / .2);
}

/* Pager: jump to a page, voters per page */
.page-jump { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; justify-content: center; }
.page-jump label { display: flex; align-items: center; gap: .35rem; color: var(--muted); }
.page-jump input { width: 4.2rem; min-height: 40px; text-align: center; }
.page-size { display: flex; justify-content: center; margin: .5rem 0 1rem; }
.page-size label { display: flex; align-items: center; gap: .5rem; color: var(--muted); }
.page-size select { width: auto; min-height: 40px; }

/* Voter page: others at the same address */
.housemates { margin-top: 1.25rem; }
.mate-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.mate a {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--st, var(--border));
  border-radius: 12px; color: inherit; text-decoration: none;
}
.mate a:hover { border-color: var(--accent); }
.mate-main { display: grid; min-width: 0; flex: 1; }
.mate-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mate .tag { flex: none; }
.st-tag-new { background: var(--surface-2); color: var(--muted); border-color: transparent; }

/* 100% confirmed (only the 'admin' account sees these) */
.cf-form { margin: .35rem 0 0; }
.cf-btn {
  display: inline-flex; align-items: center; gap: .3rem; min-height: 32px; padding: .2rem .6rem;
  border-radius: 999px; font-size: .82rem; font-weight: 600;
  background: var(--surface-2); border: 1px dashed var(--border); color: var(--muted);
}
.cf-btn.on { background: color-mix(in srgb, var(--st-contacted) 16%, var(--surface)); border: 1px solid var(--st-contacted); color: var(--text); }
.cf-tag { display: inline-flex; align-items: center; gap: .2rem; background: color-mix(in srgb, var(--st-contacted) 16%, var(--surface)); color: var(--text); border-color: transparent; }
.confirm-box { display: grid; gap: .55rem; margin: 0 0 1rem; padding: .85rem; border-radius: 12px; border: 1px dashed var(--border); background: var(--bg); }
.confirm-box.on { border: 1px solid var(--st-contacted); background: color-mix(in srgb, var(--st-contacted) 8%, var(--surface)); }
.confirm-head { margin: 0; display: grid; gap: .1rem; }
.confirm-head strong { display: inline-flex; align-items: center; gap: .35rem; }
.cf-widget { display: grid; gap: .25rem; margin-bottom: 1rem; color: inherit; text-decoration: none; }
.cf-widget strong { font-size: 2rem; line-height: 1.1; }
.cf-widget:hover { border-color: var(--accent); }
.cf-actions { flex-wrap: wrap; margin: 0 0 1rem; }
.confirm-box label { display: grid; gap: .25rem; min-width: 0; }
.confirm-box input { width: 100%; min-width: 0; box-sizing: border-box; }

/* Users and agents page */
.person-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; }
.person { border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .8rem; background: var(--surface); }
.person.inactive { opacity: .6; }
.person-head { display: flex; align-items: center; gap: .7rem; }
.person-main { flex: 1; min-width: 0; }
.person-main p { margin: .1rem 0 0; }
.person-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; margin-top: .6rem; }
.person-actions > form > button { padding: .35rem .7rem; font-size: .9rem; font-weight: 500; min-height: 0; }
.person-actions details { flex: 1 1 100%; }
.person-actions details:not([open]) { flex: 0 0 auto; }
.person-actions summary { cursor: pointer; padding: .35rem .7rem; border: 1px solid var(--border); border-radius: 8px; font-size: .9rem; list-style: none; }
.person-actions summary::-webkit-details-marker { display: none; }
.person-actions details[open] > summary { margin-bottom: .5rem; }
.danger-box summary { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.add-agent { border-top: 1px solid var(--border); padding-top: 1rem; }
.tag.unassigned-tag { border-style: dashed; }
.pick-tools { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 0; }
.thaana { font-family: "Faruma", "MV Faseyha", "Noto Sans Thaana", "MV Boli", sans-serif; }
.unassign-all { margin-top: 1rem; }
.unassign-all > summary { display: inline-block; }
.agent-pdf { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .4rem 0 0; }
.rename-box > summary { cursor: pointer; padding: .3rem .65rem; border: 1px solid var(--border); border-radius: 8px; font-size: .9rem; list-style: none; display: inline-block; }
.rename-box > summary::-webkit-details-marker { display: none; }
.rename-box[open] > summary { margin-bottom: .4rem; }
.small-head { font-size: 1rem; margin: 1rem 0 .4rem; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.timeline li { border-left: 3px solid var(--border); padding: .15rem 0 .15rem .65rem; }
.note-meta { margin: 0; color: var(--muted); display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.note-text { margin: .1rem 0 0; white-space: pre-wrap; }
button.linklike { background: none; border: 0; padding: 0; color: var(--danger); text-decoration: underline; font-size: inherit; cursor: pointer; min-height: 0; }
.change-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.change { padding: .6rem .8rem; }
.change p { margin: 0; }
.change-head { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.change-voter { margin-top: .2rem !important; }
.change-what { margin-top: .25rem !important; white-space: pre-wrap; }
.note-meta form { display: inline; margin: 0; }
.share-panel { margin: .75rem 0; }
.share-panel > summary { cursor: pointer; font-weight: 600; display: flex; gap: .4rem; align-items: center; }
.share-panel .checks { border: 0; padding: 0; margin: 0; }
.share-cards { display: grid; gap: .6rem; margin: .8rem 0; }
.share-card { width: 100%; max-width: 520px; border: 1px solid var(--border); border-radius: 10px; }
.share-text { white-space: pre-wrap; background: var(--surface-2); padding: .7rem; border-radius: 8px; }
.dv-sample { font-size: 1.5rem; margin: .4rem 0 .8rem; direction: rtl; }
.cf-access { display: inline; margin: 0; }
.cf-access label { display: flex; gap: .4rem; align-items: center; }
.vcard { scroll-margin-top: 140px; }
.vcard.just-viewed { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); transition: box-shadow .4s; }

/* --- announcements ------------------------------------------------------ */
.urgent-banner {
  display: flex; align-items: flex-start; gap: .6rem; margin: 0 0 .9rem; padding: .7rem .7rem .7rem .8rem;
  border-radius: var(--radius-sm); background: var(--err-bg); color: var(--err-text); border-left: 4px solid currentColor;
}
.urgent-banner .urgent-icon { flex: none; margin-top: .1rem; }
.urgent-banner .urgent-body { flex: 1; min-width: 0; }
.urgent-banner p { margin: .2rem 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.urgent-banner button { flex: none; }
.announce-form textarea { width: 100%; }
.announce-form .check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; }
.announce-list { list-style: none; padding: 0; display: grid; gap: .75rem; }
.announce { scroll-margin-top: 140px; }
.announce.urgent { border-left: 4px solid var(--err-text); }
.announce.ended { opacity: .6; }
.announce.just { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); }
.announce-head { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: 0 0 .4rem; }
.announce-text { white-space: pre-line; overflow-wrap: anywhere; margin: 0 0 .6rem; }
.badge-urgent { background: var(--err-bg); color: var(--err-text); }
.announce .actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.announce .actions form { margin: 0; }
.wa-btn { display: inline-flex; gap: .4rem; align-items: center; }
.seen-by { margin-top: .6rem; font-size: .9rem; }
.seen-by ul { list-style: none; padding: 0; margin: .4rem 0; display: grid; gap: .2rem; }

/* --- agent dashboard links ---------------------------------------------- */
.agent-link { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--border); }
.agent-link p { margin: 0 0 .4rem; }
.agent-link-btns { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0; }
.agent-link-btns form { margin: 0; }
.agent-link-btns select { min-height: 0; padding: .2rem .4rem; }
.al-stamp { display: inline-block; font-size: .8rem; font-weight: 600; padding: .15rem .6rem; border-radius: 999px;
  background: var(--secret-bg); color: var(--secret-text); margin: .2rem 0 .5rem; }
.al-list, .al-voters { list-style: none; padding: 0; margin: 0; }
.al-house { margin: 1rem 0; }
.al-house h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
.al-voters { display: grid; gap: .5rem; }
.al-voter { display: flex; gap: .7rem; align-items: center; padding: .6rem .7rem; }
.al-voter > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.al-voter p { margin: .2rem 0 0; }
.al-voter img, .al-nophoto { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-2); }
.al-nophoto { display: grid; place-items: center; color: var(--muted); }
.al-voter .badge { flex: none; }

/* --- call centre ------------------------------------------------------------ */
.seg-refused { fill: #8e5bd6; background: #8e5bd6; }
.seg-wrong { fill: var(--muted); background: var(--muted); }
.seg-track-fill { fill: var(--track); }
.outcomes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .outcomes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.call-form .actions { flex-wrap: wrap; }
.call-history { list-style: none; margin: 0; padding: 0; }
.call-history li { padding: .6rem 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: .35rem .5rem; align-items: baseline; }
.call-history li:last-child { border-bottom: 0; }
.call-history li p { flex-basis: 100%; margin: .15rem 0 0; white-space: pre-wrap; word-break: break-word; }
ol.call-history.card { padding: .25rem 1rem; }
.out-tag-reached { background: var(--ok-bg); color: var(--ok-text); }
.out-tag-refused, .out-tag-wrongnumber { background: var(--err-bg); color: var(--err-text); }
.out-tag-callback { background: var(--info-bg); color: var(--info-text); }
.daychart { width: 100%; height: auto; max-height: 220px; }
.daychart text { font-size: 7px; fill: var(--muted); }
.island-card .checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .4rem; }
a.kpi { color: inherit; text-decoration: none; }
.island-meta { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin: .35rem 0 0; color: var(--muted); }
.queue-counts { color: var(--muted); margin: 0 0 .75rem; }
