:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede7;
  --text: #1d1d1b;
  --muted: #62605a;
  --border: #d9d6cc;
  --accent: #b3261e;
  --accent-text: #ffffff;
  --ok: #1e6b3a;
  --warn-bg: #fff3d6;
  --warn-text: #6b4a00;
  --error-bg: #fde7e5;
  --error-text: #8a1c14;
  --focus: #1a5fb4;
  color-scheme: light;
}
/* Dark: the account's saved theme (data-theme, shared with the ICR apps and CSV-Archive -- see
   common.js's VA.prefs), or the device's setting while none is known (the public forms). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161614;
    --surface: #211f1c;
    --surface-2: #2b2925;
    --text: #eceae4;
    --muted: #a6a39a;
    --border: #3d3a34;
    --accent: #e0594f;
    --accent-text: #1a0806;
    --ok: #6ccf8f;
    --warn-bg: #3a2e10;
    --warn-text: #f2d48a;
    --error-bg: #3d1a17;
    --error-text: #f6b3ad;
    --focus: #7cb0ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161614;
  --surface: #211f1c;
  --surface-2: #2b2925;
  --text: #eceae4;
  --muted: #a6a39a;
  --border: #3d3a34;
  --accent: #e0594f;
  --accent-text: #1a0806;
  --ok: #6ccf8f;
  --warn-bg: #3a2e10;
  --warn-text: #f2d48a;
  --error-bg: #3d1a17;
  --error-text: #f6b3ad;
  --focus: #7cb0ff;
  color-scheme: dark;
}
/* Text size (the same option): scales everything, as in the other apps. */
:root[data-text-size="small"] body { zoom: 0.9; }
:root[data-text-size="large"] body { zoom: 1.15; }
:root[data-text-size="xlarge"] body { zoom: 1.3; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--focus); }
h1 { font-size: 1.35rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
[hidden] { display: none !important; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1rem; background: var(--surface); border-bottom: 3px solid var(--accent);
}
.topbar .who { color: var(--muted); font-size: .9rem; display: flex; gap: .75rem; align-items: center; }

.page { max-width: 640px; margin: 0 auto; padding: 1rem; }
.page.wide { max-width: 1400px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 1rem; margin-bottom: 1rem;
}

label { display: block; font-weight: 600; margin: .9rem 0 .3rem; }
label .hint, .hint { font-weight: 400; color: var(--muted); font-size: .88rem; }
input, select, textarea, button {
  font: inherit; color: inherit;
}
input[type=text], input[type=tel], input[type=date], input[type=time], input[type=password],
input:not([type]), select, textarea {
  width: 100%; padding: .6rem .7rem; min-height: 44px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
}
textarea { min-height: 5rem; resize: vertical; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }

.row { display: flex; gap: .75rem; }
.row > * { flex: 1; min-width: 0; }

button {
  cursor: pointer; min-height: 44px; padding: .55rem 1rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2);
}
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 700; }
button:disabled { opacity: .6; cursor: default; }
button.small { min-height: 34px; padding: .25rem .6rem; font-size: .88rem; }
button.link { background: none; border: none; color: var(--focus); padding: 0; min-height: 0; text-decoration: underline; }

.needs { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.needs label {
  margin: 0; font-weight: 500; display: flex; align-items: center; gap: .5rem;
  padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); cursor: pointer;
}
.needs label:has(input:checked) { border-color: var(--accent); outline: 2px solid var(--accent); }
.needs label:has(input:disabled) { opacity: .55; cursor: default; }
.needs input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--accent); }

.notice { padding: .7rem .8rem; border-radius: 8px; margin: .75rem 0; }
.notice.error { background: var(--error-bg); color: var(--error-text); }
.notice.warn { background: var(--warn-bg); color: var(--warn-text); }
.notice.ok { color: var(--ok); border: 1px solid currentColor; }

.muted { color: var(--muted); }
.actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-top: 1.25rem; }

/* dashboard */
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin-bottom: 1rem; }
.toolbar label { margin: 0 0 .25rem; font-size: .85rem; }
.toolbar input, .toolbar select { width: auto; }
.counts { display: flex; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: .92rem; margin-bottom: .75rem; }
.counts b { color: var(--text); font-variant-numeric: tabular-nums; }


table.appts { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
table.appts th, table.appts td { padding: .55rem .6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.appts th { background: var(--surface-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.appts tr.overdue td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
table.appts tr.closed { opacity: .6; }
table.appts td .sub { color: var(--muted); font-size: .85rem; }
table.appts td input, table.appts td select { min-height: 36px; padding: .3rem .45rem; font-size: .92rem; }
table.appts td.assign { min-width: 11rem; }
table.appts td.status { min-width: 10rem; }
.tag { display: inline-block; font-size: .78rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.tag.overdue { background: var(--error-bg); color: var(--error-text); }
.tag.need-ride_to_polls { background: var(--warn-bg); color: var(--warn-text); }
.saved { color: var(--ok); font-size: .8rem; }
.empty { padding: 2rem; text-align: center; color: var(--muted); }

/* Phones: each row becomes a card. */
@media (max-width: 820px) {
  table.appts, table.appts tbody, table.appts tr, table.appts td { display: block; width: 100%; }
  table.appts thead { display: none; }
  table.appts { border: none; background: none; }
  table.appts tr { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: .75rem; padding: .25rem 0; }
  table.appts tr.overdue { border-left: 4px solid var(--accent); }
  table.appts tr.overdue td:first-child { box-shadow: none; }
  table.appts td { border: none; padding: .3rem .8rem; }
  table.appts td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; }
  .row { flex-direction: column; gap: 0; }
}
@media (max-width: 420px) { .needs { grid-template-columns: 1fr; } }

.intro { margin-top: 0; }
fieldset.plain { border: 0; padding: 0; margin: 0; }
fieldset.plain legend { font-weight: 600; margin: .4rem 0 .5rem; padding: 0; }
h2.section { margin-top: 1.5rem; }
.actions.tight { margin-top: .5rem; }
a.phone { white-space: nowrap; }
table.appts td.when { width: 10.5rem; }
table.appts td.when input { width: 100%; }
@media (max-width: 820px) { table.appts td.when { width: 100%; } }
@media (max-width: 820px) { table.appts td:empty, table.appts td.blank { display: none; } }
.topbar .who { flex-wrap: wrap; justify-content: flex-end; }
.linkbar input { font-family: ui-monospace, monospace; font-size: .85rem; }
@media (max-width: 520px) {
  .topbar { flex-wrap: wrap; }
  .topbar h1 { font-size: 1.1rem; }
}

/* admin nav */
.brand { display: flex; align-items: baseline; gap: 1.25rem; flex-wrap: wrap; }
.nav { display: flex; gap: .9rem; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; padding: .15rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a[aria-current=page] { color: var(--text); border-bottom-color: var(--accent); }
/* A confirm button waiting for its second click (VA.confirmButton): solid red, so it can't be missed. */
button.armed, button.danger.armed { background: #b91c1c; color: #fff; border-color: #7f1d1d; font-weight: 700; box-shadow: 0 0 0 3px rgba(185, 28, 28, .3); }
button.danger { color: var(--error-text); }

/* photo gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; }
.photo { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.photo .frame { display: block; aspect-ratio: 4 / 3; background: var(--surface-2); }
.photo .frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .frame .noimg { display: flex; height: 100%; align-items: center; justify-content: center; color: var(--muted); font-size: .9rem; padding: 1rem; text-align: center; }
.photo .meta { padding: .6rem .7rem; font-size: .9rem; display: grid; gap: .15rem; }
.photo .meta .actions { margin-top: .4rem; }
.photo .volunteer-name { font-size: 1.35rem; font-weight: 800; }
.photo .voter-name { font-size: .9rem; }
.submission-controls { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .4rem; }

/* team table */
table.team { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
table.team th, table.team td { padding: .55rem .6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
table.team th { background: var(--surface-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.team tr.off td { opacity: .55; }
.temp-pw { font-family: ui-monospace, monospace; font-size: 1.05rem; background: var(--warn-bg); color: var(--warn-text); padding: .1rem .4rem; border-radius: 4px; }
@media (max-width: 820px) {
  table.team, table.team tbody, table.team tr, table.team td { display: block; width: 100%; }
  table.team thead { display: none; }
  table.team { border: none; background: none; }
  table.team tr { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: .75rem; padding: .25rem 0; }
  table.team td { border: none; padding: .3rem .8rem; }
  table.team td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; }
}

/* field app */
body.field .page { padding-bottom: 3rem; }
.center { text-align: center; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
label.button {
  display: inline-flex; align-items: center; margin: 0; cursor: pointer; min-height: 44px; padding: .55rem 1rem;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); font-weight: 600;
}
label.button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
label.button:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }

.tabs { display: flex; gap: .25rem; align-items: stretch; margin: 0 0 1rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 2; }
.tabs button, .tabs a {
  border: none; background: none; border-radius: 0; padding: .6rem .7rem; font-weight: 700; color: var(--muted);
  border-bottom: 3px solid transparent; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px;
}
.tabs a { margin-left: auto; font-weight: 600; color: var(--focus); }
.tabs button[aria-selected=true] { color: var(--text); border-bottom-color: var(--accent); }

.day-head { font-size: .95rem; margin: 1.25rem 0 .5rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.day-head.overdue { color: var(--error-text); }
.assignment { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .85rem .95rem; margin-bottom: .75rem; }
.assignment.overdue { border-left: 4px solid var(--accent); }
.assignment.closed { opacity: .65; }
.assignment .top { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.assignment .time { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.assignment .voter { font-size: 1.1rem; font-weight: 700; margin-top: .3rem; }
.assignment .addr { margin: .25rem 0; }
.assignment .notes { background: var(--surface-2); border-radius: 8px; padding: .45rem .6rem; margin: .5rem 0; font-size: .95rem; }
.assignment .quick { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .6rem; }
.assignment .quick a, .assignment .quick button {
  display: flex; justify-content: center; align-items: center; gap: .35rem; min-height: 44px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-decoration: none; font-weight: 600; padding: .4rem;
}
.assignment .quick .done { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.assignment .outcome { margin-top: .6rem; }
.assignment .status-line { margin-top: .5rem; font-weight: 700; }

.previews { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .6rem; }
.previews .thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.previews .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.previews .thumb span { display: flex; height: 100%; align-items: center; justify-content: center; font-size: .8rem; color: var(--muted); text-align: center; padding: .3rem; }
.previews .thumb button { position: absolute; top: 4px; right: 4px; min-height: 28px; width: 28px; padding: 0; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; border: none; }
.gallery.small { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.sub { color: var(--muted); font-size: .85rem; }
.inline-field { display: flex; gap: .5rem; align-items: center; }
.inline-field input { font-family: ui-monospace, monospace; font-size: .85rem; }

/* completed list (dashboard, under the table) */
.completed-section { margin-top: 1.75rem; }
.completed-section h2 { display: flex; align-items: baseline; gap: .5rem; }
ol.completed { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
ol.completed:empty { display: none; }
ol.completed li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; gap: .35rem 1rem; align-items: center; padding: .6rem .8rem; border-bottom: 1px solid var(--border); }
ol.completed li:last-child { border-bottom: none; }
ol.completed li.fresh { animation: fresh 2.5s ease-out; }
@keyframes fresh { from { background: var(--warn-bg); } to { background: transparent; } }
ol.completed .when { font-variant-numeric: tabular-nums; font-weight: 700; }
ol.completed .when .sub { display: block; font-weight: 400; }
ol.completed .what { min-width: 0; }
ol.completed .what .line { display: flex; flex-wrap: wrap; gap: .25rem .6rem; align-items: baseline; }
ol.completed .thumbs { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.thumbs a { display: block; width: 52px; height: 52px; border-radius: 6px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.thumbs a img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs .nophoto { color: var(--muted); font-size: .85rem; }
@media (max-width: 820px) {
  ol.completed li { grid-template-columns: 4.5rem minmax(0, 1fr); }
  ol.completed .thumbs { grid-column: 2; }
}

/* live photo pop-up */
.photo-toast {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 50; width: min(440px, calc(100vw - 2rem));
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .28); animation: toast-in .25s ease-out;
}
@keyframes toast-in { from { transform: translateY(1rem); opacity: 0; } to { transform: none; opacity: 1; } }
.photo-toast .close { position: absolute; top: .4rem; right: .4rem; z-index: 1; min-height: 32px; width: 32px; padding: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; border: none; font-size: 1.1rem; }
.toast-photos { display: grid; gap: 2px; background: #111; }
.toast-photos.n2 { grid-template-columns: 1fr 1fr; }
.toast-photos.n3, .toast-photos.many { grid-template-columns: 1fr 1fr 1fr; }
.toast-photos img { width: 100%; max-height: 52vh; object-fit: contain; display: block; background: #111; }
.toast-photos:not(.n1) img { height: 170px; object-fit: cover; }
.toast-photos .noimg { color: #ddd; padding: 2rem 1rem; text-align: center; }
.toast-body { padding: .7rem .9rem .8rem; display: grid; gap: .15rem; }
.toast-who { font-size: 1.5rem; font-weight: 800; }
.toast-photos .frame { display: block; background: #111; }
.toast-photos video { max-height: 52vh; object-fit: contain; }
.toast-photos .submission-controls { background: var(--surface); }
.toast-timer { height: 4px; background: var(--surface-2); }
.toast-timer span { display: block; height: 100%; background: var(--accent); width: 100%; transform-origin: left; }
.toast-timer span.run { animation: toast-countdown linear forwards; }
@keyframes toast-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .photo-toast, ol.completed li.fresh { animation: none; } }

/* field: accept / on my way / arrived */
.assignment .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-top: .7rem; }
.assignment .step {
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .1rem; min-height: 52px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  padding: .35rem .3rem; font-size: .88rem; text-align: center; line-height: 1.2;
}
.assignment .step.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.assignment .step:disabled { opacity: .5; }
.assignment .step .sub { font-size: .76rem; }
.assignment .step.primary .sub { color: inherit; }
.assignment .step.done { background: none; border-style: dashed; color: var(--ok); }
.assignment.flash { animation: card-flash 1.6s ease-out; }
@keyframes card-flash { from { box-shadow: 0 0 0 4px var(--focus); } to { box-shadow: 0 0 0 4px transparent; } }
.card.notify { border-left: 4px solid var(--focus); }

/* dashboard: canvasser progress */
/* Appointment stage badges (dashboard.js's stageOf): the cycle a ballot-assister moves it through. */
.stage {
  display: inline-block; font-size: .85rem; font-weight: 700; padding: .2rem .65rem; border-radius: 999px;
  white-space: nowrap; margin-bottom: .3rem; border: 1px solid transparent;
}
.stage-unassigned { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.stage-assigned { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.stage-booked { background: color-mix(in srgb, var(--focus) 14%, transparent); color: var(--focus); }
.stage-due { background: var(--warn-bg); color: var(--warn-text); }
.stage-on_the_way { background: color-mix(in srgb, var(--focus) 24%, transparent); color: var(--focus); }
.stage-in_progress { background: var(--focus); color: var(--surface); }
.stage-secured { background: var(--ok); color: var(--surface); }
.stage-unable, .stage-cancelled { background: var(--error-bg); color: var(--error-text); }
.stage.changed { animation: stage-pop 1.2s ease-out 2; }
@keyframes stage-pop { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); } 100% { box-shadow: 0 0 0 .6rem transparent; } }
@media (prefers-reduced-motion: reduce) { .stage.changed { animation: none; outline: 2px solid var(--accent); } }
.status .stage { display: table; }
@media (prefers-reduced-motion: reduce) { .assignment.flash { animation: none; } }

/* Theme / text-size menu in the header (common.js's VA.prefs.mount). */
.prefs-menu { position: relative; }
.prefs-menu summary {
  list-style: none; cursor: pointer; padding: .15rem .55rem; border: 1px solid var(--border);
  border-radius: 6px; font-weight: 600; color: var(--text); user-select: none;
}
.prefs-menu summary::-webkit-details-marker { display: none; }
.prefs-menu[open] summary { background: var(--surface-2); }
.prefs-panel {
  /* Pinned to the screen's right edge -- the button isn't always at the header's end. */
  position: fixed; right: 1rem; top: 3.5rem; z-index: 30; width: min(18rem, calc(100vw - 2rem));
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .75rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25); color: var(--text); display: grid; gap: .6rem;
}
.pref-group { display: flex; flex-wrap: wrap; gap: .35rem .9rem; align-items: center; }
.pref-group b { flex-basis: 100%; font-size: .85rem; }
.pref-choice { display: inline-flex; align-items: center; gap: .3rem; font-size: .9rem; margin: 0; }
.prefs-panel .hint { margin: 0; }

/* Census address check on the dashboard (dashboard.js's addressCheck). */
.addr-check { margin-top: .3rem; display: grid; gap: .25rem; justify-items: start; }
.tag.addr-ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.tag.addr-warn { background: var(--warn-bg); color: var(--warn-text); }

/* Sign-in: "Remember this device for 1 week". */
.remember-device { display: flex; align-items: center; gap: 8px; font-weight: normal; margin-top: 10px; }
.remember-device input { width: auto; margin: 0; }
.remember-hint { margin-top: 0; }

/* "Other apps" menu in the header (common.js's VA.appsMenu). */
.apps-menu { position: relative; }
.apps-menu summary {
  list-style: none; cursor: pointer; padding: .15rem .55rem; border: 1px solid var(--border);
  border-radius: 6px; font-weight: 600; color: var(--text); user-select: none; white-space: nowrap;
}
.apps-menu summary::after { content: ' \25BE'; }
.apps-menu summary::-webkit-details-marker { display: none; }
.apps-menu[open] summary { background: var(--surface-2); }
.apps-panel {
  position: absolute; right: 0; top: calc(100% + .35rem); z-index: 30; min-width: 12rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .4rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25); display: grid; gap: .1rem;
}
.apps-panel a { color: var(--text); text-decoration: none; padding: .45rem .6rem; border-radius: 6px; font-weight: 600; white-space: nowrap; }
.apps-panel a:hover, .apps-panel a:focus-visible { background: var(--surface-2); }
/* Copy-link entries (common.js's appsMenu): buttons styled as the menu's links. */
.apps-panel .apps-copy { color: var(--text); background: none; border: 0; font: inherit; font-weight: 600; text-align: left; padding: .45rem .6rem; border-radius: 6px; white-space: nowrap; cursor: pointer; }
.apps-panel .apps-copy:hover, .apps-panel .apps-copy:focus-visible { background: var(--surface-2); }
.apps-panel .hint { margin: .25rem .6rem .15rem; }
@media (max-width: 640px) { .apps-panel { position: fixed; right: 1rem; left: auto; top: 3.5rem; } }

/* On-screen reminders, e.g. a phonebank callback in 5 min (common.js's VA.reminders). */
.reminder-stack { position: fixed; right: 1rem; bottom: 1rem; z-index: 1000; display: grid; gap: .6rem; width: min(22rem, calc(100vw - 2rem)); }
.reminder-toast { background: var(--surface); color: var(--text); border: 2px solid var(--warn-text, #e0a200); border-radius: 10px; padding: .75rem .9rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.reminder-when { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--warn-text, #e0a200); }
.reminder-title { font-weight: 700; margin-top: .1rem; }
.reminder-detail { font-size: .85rem; margin-top: .1rem; }
.reminder-actions { display: flex; gap: .5rem; margin-top: .5rem; }

/* Field app: "My work" (primary job and shifts). */
.job-picker { display: grid; gap: .4rem; }
.job-picker label { display: flex; gap: .5rem; align-items: center; border: 1px solid var(--border); border-radius: 8px; padding: .5rem .7rem; font-weight: normal; margin: 0; }
.job-picker label:has(input:checked) { border-color: var(--accent); outline: 2px solid var(--accent); }
.job-picker input, .shift-day input { width: auto; margin: 0; }
.shift-editor { display: grid; gap: .3rem; }
.shift-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; min-height: 2.2rem; }
.shift-day { display: flex; align-items: center; gap: .4rem; width: 7.5rem; font-weight: normal; margin: 0; }
.shift-hours { display: flex; align-items: center; gap: .4rem; }
.shift-hours input { width: auto; }

/* Booking hours (dashboard, administrators). */
.booking-hours { margin: 4px 0 12px; }
.booking-hours summary { cursor: pointer; font-size: 14px; }
.booking-hours-grid { display: grid; gap: .35rem; max-width: 34rem; margin: .6rem 0; }
.booking-hours-day { display: grid; grid-template-columns: 8rem 1fr auto 1fr; gap: .5rem; align-items: center; }
.booking-hours-day label { display: flex; align-items: center; gap: .4rem; margin: 0; }
.booking-hours-day label input { width: auto; }
.booking-hours-day input[type=time] { width: auto; }
.booking-hours-day input:disabled { opacity: .45; }
@media (max-width: 520px) { .booking-hours-day { grid-template-columns: 7.2rem 1fr auto 1fr; gap: .3rem; } }

/* Appointment printout controls and landscape report. */
.print-controls { display: flex; align-items: end; gap: .4rem; }
.print-controls label { margin: 0 0 .25rem; font-size: .85rem; }
.print-controls select { width: auto; min-height: 34px; padding: .25rem .45rem; }
.print-report { display: none; }
.print-report h1 { font-size: 1.5rem; margin-bottom: .2rem; }
.print-generated, .print-sub { color: #444; font-size: .85rem; }
.print-generated { margin: 0 0 .8rem; }
.print-group { margin: 0 0 .8rem; }
.print-group h2 { margin: 0 0 .25rem; font-size: 1rem; }
.print-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 9pt; line-height: 1.25; }
.print-table th, .print-table td { border: 1px solid #777; padding: .25rem .35rem; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.print-table th { background: #eee; }
.print-table th:nth-child(1) { width: 13%; }
.print-table th:nth-child(2) { width: 20%; }
.print-table th:nth-child(3) { width: 15%; }
.print-table th:nth-child(4) { width: 27%; }
.print-table th:nth-child(5) { width: 25%; }
.print-empty { margin: .2rem 0 .5rem; font-style: italic; }

@media print {
  @page { size: letter landscape; margin: .35in; }
  body.printing-appointments { background: #fff; color: #111; font-size: 9pt; }
  body.printing-appointments > * { display: none !important; }
  body.printing-appointments #dashboard-view { display: block !important; max-width: none; margin: 0; padding: 0; }
  body.printing-appointments #dashboard-view > :not(#print-report) { display: none !important; }
  body.printing-appointments #print-report { display: block !important; }
  body.printing-appointments #print-report h1 { font-size: 16pt; }
  body.printing-appointments .print-generated, body.printing-appointments .print-sub { color: #333; }
  body.printing-appointments .print-group { break-inside: avoid; }
  body.printing-appointments .print-table tr { break-inside: avoid; }
  body.printing-appointments .print-table thead { display: table-header-group; }
}

/* photo gallery: groups, videos, hover card */
.photo-group { margin-bottom: 1.4rem; }
.group-heading { font-size: 1rem; margin: .4rem 0 .6rem; }
.photo .frame { position: relative; }
.photo .frame video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.video-badge { position: absolute; left: .4rem; bottom: .4rem; background: rgba(0,0,0,.65); color: #fff; font-size: .75rem; padding: .1rem .4rem; border-radius: 4px; pointer-events: none; }
.photo:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 2px; }
.photo-tip { position: absolute; z-index: 1000; width: 300px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); padding: .7rem .8rem; font-size: .85rem; pointer-events: none; }
.photo-tip .tip-title { font-weight: 700; font-size: .95rem; margin-bottom: .3rem; }
.photo-tip .tip-line { display: grid; grid-template-columns: 6.5rem 1fr; gap: .4rem; padding: .1rem 0; }
.photo-tip .tip-label { color: var(--muted); }
.photo-tip .tip-map { height: 150px; margin-top: .5rem; border-radius: 6px; overflow: hidden; }
.photo-tip .tip-map[hidden] { display: none; }
.photo-tip .tip-source, .photo-tip .tip-nomap { margin-top: .35rem; }
.toast-photos video, .thumbs video, .previews video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }

/* appointment window, language, backup phone */
.window-inputs { display: flex; gap: .3rem; align-items: center; margin-top: .25rem; }
.window-inputs input { width: auto; min-width: 0; }
.planned { margin-top: .2rem; }
select.language, input.backup-phone { margin-top: .3rem; font-size: .85rem; }
.tag.language { background: var(--surface-2); color: var(--text); }
.window-hint { margin: .4rem 0 0; }

/* route planner */
.routes-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); gap: 1rem; align-items: start; }
.routes-map { height: calc(100vh - 220px); min-height: 420px; border-radius: 10px; border: 1px solid var(--border); position: sticky; top: 1rem; }
.routes-list { display: grid; gap: .8rem; }
@media (max-width: 900px) {
  .routes-layout { grid-template-columns: 1fr; }
  .routes-map { position: static; height: 55vh; }
}
.plan-settings { margin-bottom: .8rem; }
.plan-settings input[type=number] { width: 7rem; }
.route-card { padding: .8rem .9rem; margin: 0; }
.route-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
.route-head h3 { margin: 0; font-size: 1rem; }
.route-chip { width: 14px; height: 14px; border-radius: 4px; display: inline-block; align-self: center; }
ol.stops, ul.stops { list-style: none; margin: .6rem 0; padding: 0; display: grid; gap: .4rem; }
ul.stops.plain li { padding: .25rem 0; }
.stop { display: grid; grid-template-columns: 1.8rem 1fr auto; gap: .5rem; align-items: start; padding: .4rem; border-radius: 8px; border: 1px solid transparent; }
.stop:hover, .stop.flash { border-color: var(--border); background: var(--surface-2); }
.stop.late { border-color: var(--accent); }
.stop-num { font-weight: 700; text-align: center; background: var(--surface-2); border-radius: 50%; width: 1.6rem; height: 1.6rem; line-height: 1.6rem; font-size: .85rem; }
.stop-line { display: flex; flex-wrap: wrap; gap: .4rem; align-items: baseline; }
.stop-time { min-width: 4.5rem; }
.stop .move { width: auto; font-size: .8rem; min-height: 30px; }
.route-assign input { width: auto; flex: 1; min-width: 10rem; }
.stop-pin { background: none; border: none; }
.pin-badge { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font: 700 12px/1 system-ui, sans-serif; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.pin-badge.faded { opacity: .8; }
.pin-popup { display: grid; gap: .15rem; font-size: .85rem; min-width: 180px; }
.leaflet-container { font: inherit; }
.assignment .time .window-sub { display: block; font-size: .78rem; font-weight: 400; color: var(--muted); }

/* "Your name" suggestions on the ballot-photo form, and the gallery's unify-name search. */
.campaign-edit { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.extra-voters { display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.combine-choice { display: flex; gap: .4rem; align-items: baseline; font-size: .85rem; }
.extra-count { display: flex; gap: .3rem; flex-wrap: wrap; }
.extra-voter-names { display: flex; flex-direction: column; gap: .3rem; width: 100%; }
.unify-choice { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.unify-results { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.me-results { display: grid; gap: 6px; margin: 6px 0; }
.me-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.unify { display: grid; gap: 4px; margin-top: 4px; }

/* The header folding behind "☰ Menu" when it doesn't fit (common.js's VA.foldingHeader). */
.topbar .nav-toggle { display: none; }
.topbar.nav-measuring, .topbar.nav-measuring * { flex-wrap: nowrap !important; flex-shrink: 0 !important; white-space: nowrap !important; }
.topbar.nav-compact { flex-wrap: wrap; row-gap: 0; }
/* The title with the button on its row; the links, then the account items, open below it. */
.topbar.nav-compact .brand { display: contents; }
.topbar.nav-compact .nav-toggle { display: inline-flex; align-items: center; margin-left: auto; }
.topbar.nav-compact .nav, .topbar.nav-compact .who { display: none !important; }
.topbar.nav-compact.menu-open .nav:not([hidden]),
.topbar.nav-compact.menu-open .who:not([hidden]) { display: flex !important; flex-direction: column; flex-basis: 100%; }
.topbar.nav-compact.menu-open .nav { order: 2; gap: 0; margin-top: .5rem; }
.topbar.nav-compact.menu-open .nav a { padding: .65rem .25rem; border-top: 1px solid var(--border); border-bottom: 0; font-size: 1rem; }
.topbar.nav-compact.menu-open .who { order: 3; align-items: flex-start; gap: .6rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.topbar.nav-compact.menu-open .apps-panel,
.topbar.nav-compact.menu-open .prefs-panel { position: static; box-shadow: none; margin-top: .4rem; }

/* The independent ballot-photo form: a phone number or an address, one is enough (ballot-photos.js). */
.contact-either { border: 1px solid var(--border) !important; border-radius: 10px; padding: .75rem 1rem 1rem !important; margin: .75rem 0 !important; }
.contact-either legend { padding: 0 .35rem !important; }
.contact-either legend em { font-style: normal; text-decoration: underline; }
.contact-or { margin: .5rem 0 -.25rem; color: var(--muted); font-size: .85rem; font-weight: 600; text-align: center; }
.contact-status { margin: .6rem 0 0; padding: .45rem .7rem; border-radius: 8px; font-size: .9rem; background: var(--surface-2); }
.contact-status.problem { background: var(--error-bg); color: var(--error-text); }

/* "Upload photos of 4 ballots" -- the voter plus their +1 to +5. */
.ballot-count { font-size: 1.05rem; margin: .4rem 0; }
.ballot-count strong { font-size: 1.15rem; }
