/* Fonts are self-hosted (SIL Open Font License, see /fonts). No third-party requests. */
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 600 800;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("/fonts/public-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --paper: #f7f3ec;
  --surface: #fffdf9;
  --ink: #1b1814;
  --muted: #6b645b;
  --line: #e4ddd1;
  --line-strong: #cfc6b8;
  --accent: #c2380b;
  --accent-hover: #a82f08;
  --on-accent: #ffffff;
  --accent-soft: #fbe7dc;
  --mark: #fff2c9;
  --ok: #2f7d4f;
  --dem: #2457a6;
  --rep: #b3261e;
  --ind: #6b4fa0;
  --focus: #1b1814;
  --tab-on: #fffdf9;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 12px;
  --tap: 48px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16120e;
    --surface: #1f1a15;
    --ink: #f3eee6;
    --muted: #a89f92;
    --line: #322b24;
    --line-strong: #4a4137;
    --accent: #ff7a45;
    --accent-hover: #ff9466;
    --on-accent: #1a0d05;
    --accent-soft: #3a2216;
    --mark: #4a3a12;
    --ok: #5ccf8f;
    --dem: #8fb5ff;
    --rep: #ff8a80;
    --ind: #c9b0ff;
    --focus: #f3eee6;
    --tab-on: #3d352c;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
  padding: 0 20px env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
}
main, .top, .foot { max-width: 620px; margin: 0 auto; }
a { color: var(--accent); text-underline-offset: 2px; }
p { margin: 0 0 14px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1:focus, h1:focus-visible { outline: none; }

svg.i {
  width: 1.15em; height: 1.15em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Header */
.top { padding: 18px 0 0; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap);
  color: var(--accent); font-weight: 700; text-decoration: none; letter-spacing: .01em;
}
.mark { width: 30px; height: 30px; color: var(--accent); }

/* Type */
.display {
  font-family: var(--display); font-weight: 800; font-optical-sizing: auto;
  font-size: clamp(2rem, 9vw, 3.9rem); line-height: 1.02; letter-spacing: -.02em;
  margin: 28px 0 16px; text-wrap: balance;
}
.display em { font-style: normal; color: var(--accent); }
.h1 { font-family: var(--display); font-weight: 750; font-size: clamp(1.7rem, 5.5vw, 2.2rem); line-height: 1.12; letter-spacing: -.01em; margin: 4px 0 18px; }
.h2 { font-family: var(--display); font-weight: 700; font-size: 1.4rem; line-height: 1.2; margin: 0; }
.sub { font-size: 1.15rem; color: var(--muted); max-width: 32em; margin-bottom: 28px; }
.eyebrow { font-size: .95rem; color: var(--muted); margin: 0; }
.fine { font-size: .9rem; color: var(--muted); font-weight: 400; }

/* Buttons */
.btn {
  font: inherit; font-weight: 650; min-height: var(--tap); padding: 10px 18px;
  border-radius: var(--radius); border: 1.5px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none; line-height: 1.2; text-align: center;
  transition: background-color .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.quiet { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.quiet:hover { border-color: var(--ink); }
.btn.big { width: 100%; min-height: 60px; font-size: 1.1rem; }
.btn[aria-busy="true"] { opacity: .7; cursor: progress; }
.link {
  font: inherit; color: var(--accent); background: none; border: 0; padding: 8px 0; min-height: var(--tap);
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; text-decoration: none;
}
.link:hover { text-decoration: underline; }

/* Lookup */
.lookup { display: grid; gap: 8px; margin-bottom: 6px; }
.lookup label, .pgrid label { font-weight: 650; font-size: .95rem; }
input[type=text], textarea {
  font: inherit; color: inherit; background: var(--surface);
  border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  min-height: var(--tap); padding: 10px 14px; width: 100%;
}
input[type=text]:focus, textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 64px; }
.ziprow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
#zip { font-size: 1.4rem; letter-spacing: .08em; min-height: 56px; font-variant-numeric: tabular-nums; }
#zip-btn { min-height: 56px; }
@media (max-width: 380px) {
  .ziprow { grid-template-columns: 1fr; }
  #zip-btn { width: 100%; }
}
.alt { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 6px 0 4px; }
#addr-form { margin-top: 8px; }
.status { min-height: 1.5em; margin: 10px 0; font-weight: 600; }
.status.error { color: var(--rep); }
#v-home .fine { margin-top: 28px; max-width: 30em; }

/* Views */
.view { padding-bottom: 24px; }
.viewbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 10px 0 2px; }
.back { margin-left: -2px; }

/* Issue picker */
.issues { border: 0; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 999px;
  border: 1.5px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: .95rem; cursor: pointer;
}
.chip input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.issue-card { border-left: 4px solid var(--accent); padding: 4px 0 4px 16px; margin: 6px 0 22px; }
.issue-card h2 { font-family: var(--display); font-weight: 700; font-size: 1.3rem; line-height: 1.2; margin: 0 0 4px; }
.issue-card .who { color: var(--muted); font-size: .95rem; margin-bottom: 8px; }
.issue-card p:last-child { margin-bottom: 0; }
.start-label { display: inline-flex; align-items: center; gap: 10px; }
.start-meta { display: block; font-weight: 400; font-size: .9rem; opacity: .9; }

/* Ambiguity note */
.ambig {
  background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; margin: 26px 0 0;
}
.ambig p { margin: 0 0 6px; }
.ambig .alt { margin: 0; }

/* Directory */
.dirhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 40px 0 0; padding-top: 22px; border-top: 1px solid var(--line); }
.dir-note { margin: 2px 0 10px; }
.group-title { font-weight: 700; font-size: .95rem; margin: 22px 0 4px; color: var(--muted); }
.row {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 4px 14px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; background: var(--line); }
.avatar.init { display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--accent); background: var(--accent-soft); font-size: .95rem; }
.nm { font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.role { color: var(--muted); font-size: .92rem; line-height: 1.35; }
.party { font-family: var(--sans); font-weight: 700; margin-left: 4px; font-size: .9rem; }
.party.D { color: var(--dem); } .party.R { color: var(--rep); } .party.I { color: var(--ind); }
.acts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.acts .act { justify-content: center; padding: 8px 10px; }
.act {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px;
  border-radius: 999px; border: 1.5px solid var(--line-strong); color: var(--ink); text-decoration: none;
  font-weight: 600; font-size: .95rem; background: var(--surface); max-width: 100%;
}
.act span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act.call { border-color: var(--accent); color: var(--accent); }
.act:hover { border-color: var(--ink); }
.act .lbl { color: var(--muted); font-weight: 400; }
.staff { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; padding: 10px 12px; border-radius: var(--radius); background: var(--accent-soft); }
.staff-who { flex: 1 1 100%; font-size: .92rem; line-height: 1.35; }
.staff-role { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); }
.staff .act { min-height: 40px; }
.staff-tip { margin: 8px 0 0; }
.alt-district { grid-column: 1 / -1; font-size: .9rem; color: var(--muted); margin-top: 6px; }
.alt-district .link { min-height: 36px; padding: 4px 0; font-size: .9rem; }
.vacant { color: var(--muted); font-style: italic; padding: 14px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 560px) {
  .row { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .acts { grid-column: 3; grid-row: 1; margin-top: 0; display: flex; justify-content: flex-end; }
  .acts .act { padding: 8px 14px; }
  .alt-district, .staff { grid-column: 2 / -1; }
  .staff-who { flex: 1 1 auto; }
}

/* Calling */
.dots { display: flex; gap: 6px; list-style: none; padding: 0; margin: 8px 0 18px; }
.dots li { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.dots li.done { background: var(--accent); }
.dots li.now { background: var(--ink); }
.callcard { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 16px; align-items: center; margin-bottom: 16px; }
.callcard .avatar { width: 76px; height: 76px; }
.callcard .nm { font-family: var(--display); font-weight: 750; font-size: 1.6rem; line-height: 1.1; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 3px 10px; border-radius: 999px;
  background: var(--mark); font-size: .85rem; font-weight: 650;
}
.callbtn { margin-bottom: 8px; }
.callbtn .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.callbtn > span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; text-align: left; }
.callbtn .where { font-weight: 400; font-size: .9rem; opacity: .9; }
.more-phones { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.nophone { color: var(--muted); margin: 0 0 8px; }

.personal { margin: 18px 0 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.personal summary { min-height: var(--tap); display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 650; flex-wrap: wrap; }
.personal summary::marker { color: var(--accent); }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 8px; }
.pgrid .span2 { grid-column: 1 / -1; }
.pgrid > div { display: grid; gap: 6px; }
@media (max-width: 420px) { .pgrid { grid-template-columns: 1fr; } }

.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--line); padding: 4px; border-radius: calc(var(--radius) + 4px); gap: 4px; margin: 14px 0 10px; }
.tabs button {
  font: inherit; font-weight: 650; min-height: 44px; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--tab-on); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.script {
  white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; font-size: 1.08rem; line-height: 1.6;
}
.script .subj { display: block; font-weight: 700; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.script mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 3px; }
.script-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.script-actions .btn { flex: 1 1 auto; }

.outcome { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.outcome-q { font-weight: 650; margin-bottom: 10px; }
.outcome-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.outcome-btns .btn { flex-direction: column; gap: 6px; padding: 12px 8px; font-size: .92rem; }
@media (max-width: 420px) {
  .outcome-btns { grid-template-columns: 1fr; }
  .outcome-btns .btn { flex-direction: row; justify-content: flex-start; }
}
.next { margin-top: 8px; float: right; }
.outcome::after { content: ""; display: block; clear: both; }

/* Done */
.counter { font-weight: 650; }
.sharecard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 18px 0; }
.share-text { font-family: var(--display); font-weight: 650; font-size: 1.25rem; line-height: 1.3; margin-bottom: 4px; }
.share-url { margin-bottom: 14px; }
.share-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btns .btn { flex: 1 1 auto; }

/* Footer, toast */
.foot { border-top: 1px solid var(--line); margin-top: 32px; padding: 18px 0 28px; color: var(--muted); font-size: .88rem; }
.foot a { color: inherit; }
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 999px; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0,0,0,.2); max-width: calc(100% - 40px); text-align: center; z-index: 10;
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
