:root {
  --navy: #14243d;
  --ink: #182941;
  --muted: #53637b;
  --blue: #254fa8;
  --blue-deep: #1d408b;
  --blue-soft: #eaf0fc;
  --green: #226749;
  --green-soft: #e8f5ee;
  --amber: #865419;
  --amber-soft: #f9efdc;
  --paper: #f4f6fa;
  --line: #dbe3ef;
  --rule: #e7edf5;
  --white: #fff;
  --surface: #fff;
  --raised: #f1f4f9;
  --hover: #f8faff;
  --field-line: #cfd8e6;
  --action: var(--blue);
  --action-hover: var(--blue-deep);
  --mismatch: #a61b31;
  --mismatch-bg: #fcecef;
  --side-width: 228px;
  --page-gutter: clamp(24px, 3.2vw, 48px);
  --radius: 13px;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: .9375rem;
  line-height: 1.55;
}

[hidden] { display: none !important; }
[data-bs-theme="dark"] {
  --navy: #111d2d;
  --ink: #edf3fc;
  --muted: #b0bfd3;
  --blue: #93b6ff;
  --blue-deep: #bad0ff;
  --blue-soft: #243858;
  --green: #79d6a4;
  --green-soft: #1b3b32;
  --amber: #f2c27d;
  --amber-soft: #46331f;
  --paper: #111a28;
  --line: #35465d;
  --rule: #2e4055;
  --surface: #192637;
  --raised: #223146;
  --hover: #203047;
  --field-line: #536985;
  --action: #255cca;
  --action-hover: #204ba3;
  --mismatch: #ffadb7;
  --mismatch-bg: #442532;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
  --bs-border-color: var(--line);
}

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  color: var(--blue);
  background: var(--surface);
  padding: 8px 14px;
  border-radius: 6px;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

/* Navigation and workspace */
.app-body {
  display: grid;
  grid-template-columns: var(--side-width) minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 30px 17px 19px;
  background: var(--navy);
  color: #c3d0e3;
  overflow-y: auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: var(--white);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 720;
  line-height: 1.25;
  white-space: nowrap;
}
.sidebar .brand { margin-inline: 8px; }
.brand:hover, .brand:focus { color: var(--white); }
.brand small {
  display: block;
  color: #c2d0e5;
  font-size: .68rem;
  font-weight: 550;
  margin-top: 3px;
}
.brand-mark {
  display: flex;
  flex: 0 0 35px;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 35px;
  border-radius: 9px;
  padding-bottom: 8px;
  background: #406bc7;
}
.brand-mark i { width: 4px; height: 7px; border-radius: 3px; background: #f0f5ff; }
.brand-mark i:nth-child(2) { height: 11px; }
.brand-mark i:nth-child(3) { height: 16px; }
.nav-electoral { display: grid; gap: 4px; margin-top: 43px; }
.nav-link-electoral {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 13px;
  min-height: 43px;
  border-radius: 7px;
  color: #c3d0e3;
  font-size: .88rem;
  font-weight: 550;
  text-decoration: none;
}
.nav-link-electoral:hover, .nav-link-electoral:focus-visible { color: var(--white); background: #233954; }
.nav-link-electoral[aria-current] {
  color: var(--white);
  background: #274570;
  font-weight: 680;
}
.nav-link-electoral[aria-current]::before {
  position: absolute;
  inset: 9px auto 9px 0;
  width: 3px;
  background: #9dbdff;
  border-radius: 0 3px 3px 0;
  content: "";
}
.nav-icon {
  display: inline-block;
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  position: relative;
  color: inherit;
  opacity: .84;
}
.nav-icon::before, .nav-icon::after { position: absolute; content: ""; }
.nav-icon--home::before { inset: 4px 2px 1px; border: 1.5px solid currentColor; border-top: 0; border-radius: 1px; }
.nav-icon--home::after { width: 10px; height: 10px; left: 2.5px; top: 1px; border: solid currentColor; border-width: 1.5px 0 0 1.5px; transform: rotate(45deg); }
.nav-icon--form::before, .nav-icon--audit::before { inset: 0 2px; border: 1.5px solid currentColor; border-radius: 2px; }
.nav-icon--form::after, .nav-icon--audit::after { left: 5px; top: 5px; width: 5px; height: 5px; border-block: 1.5px solid currentColor; }
.nav-icon--chart::before { inset: 1px 0 0; border: solid currentColor; border-width: 0 0 1.5px 1.5px; border-bottom-left-radius: 2px; }
.nav-icon--chart::after { inset: 2px 1px 3px 4px; background: linear-gradient(to top, currentColor, currentColor) 0 bottom / 2px 45% no-repeat, linear-gradient(currentColor, currentColor) 50% bottom / 2px 70% no-repeat, linear-gradient(currentColor, currentColor) 100% bottom / 2px 100% no-repeat; }
.nav-icon--clock::before, .nav-icon--settings::before { inset: 0; border: 1.5px solid currentColor; border-radius: 50%; }
.nav-icon--clock::after { left: 7px; top: 3px; width: 4px; height: 5px; border: solid currentColor; border-width: 0 0 1.5px 1.5px; }
.nav-icon--flag::before { inset: 1px auto 0 2px; border-left: 1.5px solid currentColor; }
.nav-icon--flag::after { left: 3px; top: 2px; width: 10px; height: 7px; border: 1.5px solid currentColor; border-radius: 0 2px 2px 0; }
.nav-icon--settings::after { inset: 5px; border: 1.5px solid currentColor; border-radius: 50%; }
.sidebar-context {
  margin: auto 7px 0;
  padding: 19px 0 0;
  border-top: 1px solid #354760;
  color: #becbe0;
  font-size: .76rem;
}
.sidebar-context span { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #90aee1; }
.menu-toggle { display: none; }
.app-area { min-width: 0; }
.workspace-top { background: var(--surface); border-bottom: 1px solid var(--line); }
.workspace-bar, .workspace-main {
  width: min(100%, 1536px);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}
.workspace-bar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.workspace-location { color: var(--muted); font-size: .825rem; }
.workspace-location span { color: #8291a6; margin-inline: 6px; }
.workspace-location strong { color: var(--ink); font-weight: 660; }
.workspace-leading { display: flex; align-items: center; gap: 13px; min-width: 0; }
.sidebar-toggle, .theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.sidebar-toggle-icon { display: block; width: 14px; height: 12px; border: 1px solid currentColor; border-inline-start-width: 4px; border-radius: 2px; }
.theme-icon { font-size: 1.12rem; line-height: 1; }
.login-theme { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.profile { display: flex; align-items: center; gap: 9px; min-width: 0; }
.avatar {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: .79rem;
  font-weight: 750;
}
.profile-name {
  max-width: 185px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .8rem;
  font-weight: 650;
}
.profile form { margin-left: 5px; }
.workspace-main { padding-block: 34px 52px; }

/* Page rhythm and controls */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-bottom: 25px;
}
.section-head h1, .login-panel h1 {
  margin: 5px 0 6px;
  font-size: clamp(1.85rem, 2.85vw, 2.45rem);
  font-weight: 750;
  line-height: 1.14;
  letter-spacing: -.036em;
}
.section-head p, .muted { color: var(--muted); margin-bottom: 0; }
.eyebrow { color: var(--blue); font-weight: 740; font-size: .72rem; letter-spacing: .065em; }
.export-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 2px; }
.surface, .metric, .filter-panel, .record-meta {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.surface {
  min-width: 0;
  padding: clamp(17px, 2vw, 25px);
  margin-bottom: 22px;
  box-shadow: 0 2px 4px #14243d05;
}
.surface h2 { margin: 0 0 17px; font-size: 1.13rem; font-weight: 720; letter-spacing: -.018em; }
.surface h3 { font-size: .92rem; font-weight: 680; }
.metric-grid, .report-grid, .form-grid { display: grid; gap: 16px; margin-bottom: 23px; }
.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { min-width: 0; padding: 17px 19px; }
.metric span, .metric small { display: block; color: var(--muted); font-size: .8rem; }
.metric span { color: var(--ink); font-weight: 620; }
.metric strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--ink);
  font-size: clamp(1.37rem, 2.2vw, 1.9rem);
  line-height: 1.22;
  font-weight: 750;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.metric--success strong { color: var(--green); }
.metric--primary strong { color: var(--blue-deep); }
.metric--pending strong { color: var(--amber); }
.report-grid { grid-template-columns: minmax(0, 2fr) minmax(245px, 1fr); align-items: start; }
.report-grid > .surface { margin-bottom: 0; }
.results-grid { grid-template-columns: minmax(0, 2.45fr) minmax(240px, 1fr); }
.form-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); }
.form-grid label { min-width: 0; }

.subnav {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding: 5px;
  margin-block: 0 19px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.subnav a {
  padding: 8px 13px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 620;
}
.subnav a:hover { background: var(--paper); color: var(--blue); }
.subnav a[aria-current] { color: var(--blue-deep); background: var(--blue-soft); }
.filter-panel { padding: 16px 18px; margin: 0 0 23px; }
.dashboard-filters .filter-grid { max-width: 780px; }
.filter-grid { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 19px; }
.filter-panel .filter-grid { margin-bottom: 0; }
.filter-field { flex: 1 1 145px; max-width: 100%; min-width: 0; }
.filter-field span { display: block; margin-bottom: 5px; font-size: .78rem; font-weight: 660; color: var(--ink); }
.filter-field select, .filter-field input { width: 100%; }
.filter-details { margin-top: 11px; }
.filter-details summary { width: fit-content; color: var(--blue); font-size: .79rem; font-weight: 660; cursor: pointer; }
.filter-details[open] .filter-grid { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rule); }
.count-pill { display: inline-block; min-width: 19px; border-radius: 12px; text-align: center; background: var(--blue-soft); color: var(--blue-deep); }
.btn {
  --bs-btn-border-radius: 8px;
  --bs-btn-font-weight: 640;
  --bs-btn-font-size: .85rem;
  --bs-btn-padding-x: .85rem;
  --bs-btn-padding-y: .52rem;
}
.btn-sm { --bs-btn-padding-x: .6rem; --bs-btn-padding-y: .28rem; --bs-btn-font-size: .78rem; }
.btn-primary {
  --bs-btn-bg: var(--action);
  --bs-btn-border-color: var(--action);
  --bs-btn-hover-bg: var(--action-hover);
  --bs-btn-hover-border-color: var(--action-hover);
  --bs-btn-active-bg: var(--action-hover);
  --bs-btn-active-border-color: var(--action-hover);
  --bs-btn-focus-shadow-rgb: 58, 104, 199;
}
.btn-outline-secondary {
  --bs-btn-color: var(--ink);
  --bs-btn-border-color: var(--field-line);
  --bs-btn-hover-color: var(--blue-deep);
  --bs-btn-hover-bg: var(--blue-soft);
  --bs-btn-hover-border-color: var(--blue);
  --bs-btn-active-color: var(--blue-deep);
  --bs-btn-active-bg: var(--blue-soft);
  --bs-btn-active-border-color: var(--blue);
  background: var(--surface);
}
.form-select, .form-control {
  min-width: 0;
  min-height: 39px;
  border-color: var(--field-line);
  border-radius: 8px;
  background-color: var(--surface);
  font-size: .875rem;
}
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: #6085cf;
  box-shadow: 0 0 0 3px #426ec629;
}
.form-check-input:checked { background-color: var(--action); border-color: var(--action); }
.link-action { color: var(--blue); font-weight: 650; text-decoration: none; }
.link-action:hover { color: var(--blue-deep); text-decoration: underline; }
.link-action span { white-space: nowrap; }

/* Data tables and results */
.table-responsive { border: 1px solid var(--rule); border-radius: 9px; }
.report-table { --bs-table-bg: transparent; --bs-table-border-color: var(--rule); margin: 0; }
.report-table th, .report-table td { padding: .68rem .8rem; }
.report-table th { background: var(--raised); color: var(--muted); font-size: .78rem; font-weight: 690; }
.report-table td { font-size: .845rem; }
.report-table tbody td:first-child { font-weight: 620; }
.report-table tbody tr:last-child td { border-bottom: 0; }
.report-table tbody tr:hover { background: var(--hover); }
.cell-number { text-align: right; font-variant-numeric: tabular-nums; }
td.cell-number, td.cell-list { white-space: nowrap; }
.table-progress { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-progress .track { width: clamp(39px, 6.1vw, 90px); height: 6px; }
.table-progress .track i { background: var(--blue); }
.table-progress > span:last-child { min-width: 47px; text-align: right; }
.empty { margin: 0; padding: 12px 0 2px; color: var(--muted); }
.leader-panel h2 { margin-bottom: 15px; }
.leader-name { margin: 13px 0 4px; font-weight: 720; overflow-wrap: anywhere; }
.leader-votes { color: var(--blue-deep); font-size: 2rem; line-height: 1.15; font-weight: 760; margin: 0 0 12px; font-variant-numeric: tabular-nums; }
.leader-votes span, .leader-share, .leader-footer { color: var(--muted); font-size: .8rem; font-weight: 560; }
.leader-share { margin: 7px 0 0; }
.leader-panel .track i { background: var(--blue); }
.leader-empty { margin: 8px 0; font-weight: 680; }
.leader-footer { display: flex; justify-content: space-between; gap: 10px; padding-top: 13px; border-top: 1px solid var(--rule); margin: 17px 0 0; }
.leader-footer strong { color: var(--ink); }
.badge-soft, .quiet-tag {
  display: inline-block;
  border-radius: 5px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  padding: 3px 8px;
  font-size: .76rem;
  font-weight: 680;
}
.badge-warning, .cutoff { background: var(--amber-soft); color: var(--amber); }
.cutoff { margin-top: 10px; padding: 9px 12px; border-radius: 7px; }
.quiet-tag { background: var(--paper); color: var(--muted); }
.btn[data-chart-mode][aria-pressed=true] { background: var(--action); border-color: var(--action); color: var(--white); }
.bars { display: grid; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 90px minmax(35px, 1fr) auto; gap: 12px; align-items: center; font-size: .84rem; }
.track { display: block; overflow: hidden; height: 7px; background: var(--raised); border-radius: 20px; }
.track i { display: block; height: 100%; border-radius: inherit; }
.pie-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 26px; }
.pie { display: grid; place-items: center; flex: none; width: 173px; height: 173px; border-radius: 50%; }
.pie span { display: grid; align-content: center; width: 108px; height: 108px; text-align: center; background: var(--surface); border-radius: 50%; }
.pie strong { font-size: 1.32rem; }
.legend { list-style: none; padding: 0; margin: 0; }
.legend li { display: grid; grid-template-columns: 10px 75px auto; gap: 9px; align-items: center; padding-block: 3px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; }
.act-photo { max-width: 100%; max-height: 480px; object-fit: contain; }
.audit-scroll { max-height: 28rem; overflow: auto; }

/* Capture form */
.capture-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  list-style: none;
  margin: 0 0 17px;
  padding: 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 620;
}
.capture-steps li, .capture-steps a { display: flex; align-items: center; gap: 7px; }
.capture-steps a { color: inherit; text-decoration: none; }
.capture-steps a:hover { color: var(--blue-deep); text-decoration: underline; }
.capture-steps span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border: 1px solid var(--field-line);
  border-radius: 50%;
  background: var(--surface);
  font-size: .72rem;
}
.capture-steps [aria-current] { color: var(--blue-deep); }
.capture-steps [aria-current] span { border-color: var(--action); background: var(--action); color: var(--white); }
.record-meta { display: flex; flex-wrap: wrap; gap: 12px 26px; padding: 15px 18px; margin: 0 0 20px; }
.record-meta div { flex: 1 1 150px; min-width: 0; }
.record-meta div:first-child { flex-basis: 280px; }
.record-meta dt { color: var(--muted); font-size: .73rem; font-weight: 620; }
.record-meta dd { margin: 2px 0 0; font-size: .86rem; font-weight: 650; overflow-wrap: anywhere; }
.capture-grid { grid-template-columns: minmax(0, 2.15fr) minmax(255px, 1fr); margin-bottom: 16px; }
.capture-side { display: grid; gap: 16px; min-width: 0; }
.capture-side > .surface { margin-bottom: 0; }
.vote-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  padding: 13px;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: var(--paper);
}
.vote-totals label, .capture-field, .evidence-group label, .login-form label { color: var(--ink); font-size: .82rem; font-weight: 650; }
.vote-totals input, .capture-field textarea, .evidence-group input, .login-form input { margin-top: 5px; }
.vote-section {
  --vote-columns: 106px minmax(0, 1fr) minmax(60px, 95px);
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 9px;
}
.vote-heading, .vote-row, .vote-footer { display: grid; grid-template-columns: var(--vote-columns); align-items: center; gap: 11px; padding: 10px 12px; }
.vote-heading { background: var(--raised); color: var(--muted); font-size: .78rem; font-weight: 690; }
.vote-heading > :last-child, .vote-row input, .vote-footer-total { text-align: right; }
.vote-row + .vote-row { border-top: 1px solid var(--rule); }
.vote-row:focus-within { background: var(--hover); }
.list-code {
  justify-self: start;
  min-width: 2.35rem;
  max-width: 100%;
  padding: 5px 7px;
  text-align: center;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 780;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
[data-bs-theme="dark"] .list-code { background: var(--action); color: var(--white); }
.list-code--long { font-size: 1rem; }
.party-name { font-size: .85rem; line-height: 1.35; font-weight: 590; overflow-wrap: anywhere; }
.vote-row input { font-variant-numeric: tabular-nums; }
.vote-footer { border-top: 1px solid var(--line); background: var(--raised); }
.vote-footer--unbalanced { color: var(--mismatch); background: var(--mismatch-bg); }
.vote-footer-label { grid-column: 1 / -2; min-width: 0; line-height: 1.3; }
.vote-footer-label strong, .vote-footer-label small { display: block; }
.vote-footer-label small { margin-top: 3px; font-size: .78rem; }
.vote-footer-total { font-size: clamp(.93rem, 2vw, 1.05rem); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.capture-summary h2 { margin-bottom: 10px; }
.capture-counts { margin: 0 0 13px; }
.capture-counts div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-block: 7px; border-bottom: 1px solid var(--rule); }
.capture-counts dt { font-size: .82rem; font-weight: 560; }
.capture-counts dd { margin: 0; font-size: .88rem; font-weight: 740; font-variant-numeric: tabular-nums; padding-inline: 5px; border-radius: 4px; }
.capture-summary .btn { width: 100%; }
.capture-back { display: block; font-size: .79rem; margin-top: 8px; text-align: center; }
.vote-check { padding-top: 11px; }
.check-line { display: flex; align-items: flex-start; gap: 8px; margin-block: 8px; font-size: .86rem; }
.check-line input { flex: 0 0 auto; }
.capture-field { display: block; margin-top: 12px; }
.evidence-panel h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.evidence-group + .evidence-group { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); }
.evidence-group h3 { margin: 0 0 5px; }
.evidence-group label { display: block; }
.evidence-group p { font-size: .8rem; margin-block: 3px 9px; }
.review-panel { max-width: 780px; }
.review-panel [data-review-totals] { margin: 12px 0; }

/* Sign-in */
.guest-body { background: #edf2fa; }
[data-bs-theme="dark"] .guest-body { background: var(--paper); }
.guest-main { display: grid; align-content: center; min-height: 100vh; padding: 24px; }
.guest-main > .alert { width: min(100%, 960px); margin-inline: auto; }
.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  width: min(100%, 960px);
  min-height: min(510px, calc(100vh - 48px));
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 18px 52px #192f5a12;
}
.login-identity {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  overflow: hidden;
  gap: 70px;
  padding: clamp(34px, 5vw, 62px);
  background: linear-gradient(135deg, var(--navy), #223e76);
  color: var(--white);
}
.login-identity .brand small { display: none; }
.login-identity-title { position: relative; z-index: 1; }
.login-identity-title p { color: #c3d4f2; font-size: .91rem; margin: 0 0 10px; }
.login-identity-title strong { font-size: clamp(2rem, 4vw, 3.36rem); line-height: 1.04; letter-spacing: -.04em; font-weight: 710; }
.login-identity-title em { color: #a8c4ff; font-style: normal; }
.login-emblem {
  position: absolute;
  top: 15%;
  right: -18%;
  width: 85%;
  aspect-ratio: 1;
  border: 1px solid #9fb7e53d;
  border-radius: 50%;
  background: radial-gradient(circle at center, #6089da1a, transparent 75%);
  pointer-events: none;
}
.login-emblem::before, .login-emblem::after { content: ""; position: absolute; border: 1px solid #b5cbf136; border-radius: 50%; }
.login-emblem::before { inset: 11%; }
.login-emblem::after { inset: 22%; }
.login-emblem span, .login-emblem i, .login-emblem b { position: absolute; bottom: 28%; width: 7%; border-radius: 7px; background: #b0c8ff24; }
.login-emblem span { left: 34%; height: 19%; }
.login-emblem i { left: 45%; height: 29%; }
.login-emblem b { left: 56%; height: 40%; }
.login-panel { align-self: center; width: 100%; padding: clamp(30px, 5vw, 68px); }
.login-panel h1 { margin: 0 0 22px; }
.login-mobile-brand { display: none; }
.login-form { display: grid; gap: 16px; }
.login-form label, .login-form input { display: block; width: 100%; }
.login-form input { min-height: 44px; }
.login-form button { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; min-height: 44px; }
.login-form button span { font-size: 1.1rem; line-height: 1; }

@media (max-width: 1050px) {
  :root { --side-width: 193px; }
  .sidebar { padding-inline: 13px; }
  .metric { padding-inline: 13px; }
}
@media (min-width: 911px) {
  .app-body.sidebar-compact { --side-width: 74px; }
  .sidebar-compact .sidebar { padding-inline: 10px; }
  .sidebar-compact .sidebar .brand { justify-content: center; margin-inline: 0; }
  .sidebar-compact .sidebar .brand-label, .sidebar-compact .nav-label, .sidebar-compact .sidebar-context { display: none; }
  .sidebar-compact .nav-link-electoral { justify-content: center; padding-inline: 0; }
  .sidebar-compact .nav-icon { flex-basis: 18px; width: 18px; height: 18px; }
}
@media (max-width: 910px) {
  .app-body { display: block; }
  .sidebar-toggle { display: none; }
  .sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    height: auto;
    padding: 12px var(--page-gutter);
    overflow: visible;
  }
  .sidebar .brand { margin: 0; }
  .sidebar-context { display: none; }
  .nav-electoral { flex-basis: 100%; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); margin: 3px 0 0; }
  .nav-enhanced .menu-toggle { display: inline-flex; gap: 8px; align-items: center; color: var(--white); border: 1px solid #8299bc; }
  .nav-enhanced:not(.nav-open) .nav-electoral { display: none; }
  .workspace-bar { min-height: 53px; }
}
@media (max-width: 680px) {
  :root { --page-gutter: 17px; }
  .workspace-main { padding-block: 21px 34px; }
  .section-head { margin-bottom: 18px; }
  .workspace-location { font-size: .76rem; }
  .profile-name { display: none; }
  .profile .avatar, .profile .theme-label { display: none; }
  .profile form { margin: 0; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { padding: 13px; }
  .report-grid, .results-grid, .capture-grid { grid-template-columns: minmax(0, 1fr); }
  .report-table th, .report-table td { padding: .55rem .62rem; }
  .filter-panel { padding: 13px; }
  .filter-grid { gap: 9px; }
  .filter-field { flex-basis: 124px; }
  .subnav { gap: 3px; }
  .subnav a { padding: 7px 9px; }
  .bar-row { grid-template-columns: 61px minmax(18px, 1fr) auto; gap: 7px; font-size: .75rem; }
  .guest-main { padding: 16px; }
  .login-layout { grid-template-columns: 1fr; min-height: 0; max-width: 430px; }
  .login-identity { display: none; }
  .login-mobile-brand { display: block; margin-bottom: 22px; }
  .login-mobile-brand .brand { color: var(--ink); }
  .login-mobile-brand .brand small { color: var(--muted); }
}
@media (max-width: 540px) {
  .vote-section { --vote-columns: minmax(0, 1fr) 96px; }
  .vote-heading > :nth-child(2) { display: none; }
  .vote-row { grid-template-areas: "code votes" "party party"; row-gap: 6px; }
  .vote-row .list-code { grid-area: code; }
  .vote-row .party-name { grid-area: party; }
  .vote-row input { grid-area: votes; }
  .vote-row input, .vote-totals input { font-size: 1rem; min-height: 42px; }
  .vote-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; }
  .vote-totals label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 390px) {
  :root { --page-gutter: 12px; }
}

/* Mejoras de captura y consulta territorial */
.surface, .metric { border-inline-start-width: 4px; border-inline-start-color: var(--blue); }
.metric--success, .surface--evidence { border-inline-start-color: var(--green); }
.metric--pending { border-inline-start-color: var(--amber); }
.metric--neutral { border-inline-start-color: #627898; }
.record-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: -4px 0 20px; }
.evidence-status { color: var(--muted); font-size: .81rem; }
.evidence-status[data-state="ready"] {
  border-radius: 7px;
  padding: 6px 9px;
  background: var(--green-soft);
  color: var(--green);
}
.photo-actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-block: 8px; }
.photo-actions label { margin: 0; }
.evidence-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.evidence-group:has(.evidence-file:focus-visible) label[for="acta-foto"] { outline: 2px solid var(--blue); outline-offset: 3px; }
.camera-box, .photo-preview { padding: 8px; margin: 10px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.camera-box video, .photo-preview img { display: block; width: 100%; aspect-ratio: 4/3; max-height: 240px; object-fit: contain; border-radius: 5px; background: var(--raised); }
.photo-preview figcaption { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 8px; font-size: .75rem; }
.photo-preview figcaption span { min-width: 0; overflow-wrap: anywhere; }
.report-modes { width: fit-content; max-width: 100%; }
.territory-layout { display: grid; grid-template-columns: minmax(230px, .8fr) minmax(0, 1.42fr); gap: 16px; margin-bottom: 20px; }
.territory-query {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.territory-query h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 12px; }
.territory-query .filter-panel { border: 0; padding: 0; margin-bottom: 10px; }
.territory-query .filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 125px), 1fr)); gap: 9px; }
.territory-query .filter-apply { grid-column: 1 / -1; justify-self: start; }
.territory-map { margin: 0; min-width: 0; }
.territory-map h2 { margin-bottom: 4px; }
.territory-map canvas { display: block; width: min(100%, 640px); height: auto; margin-inline: auto; }
.map-status { text-align: center; color: var(--blue-deep); font-weight: 700; margin: -2px 0 7px; }
.map-credit { font-size: .7rem; color: var(--muted); margin: 0; }
.map-credit a { color: var(--blue-deep); }
.territory-overview { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 15px; }
.territory-overview > div { min-width: 0; }
.territory-overview h2 { margin-bottom: 5px; }
.territory-overview p { overflow-wrap: anywhere; }
.territory-progress { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; min-width: min(260px, 100%); }
.territory-progress strong { font-size: 1.22rem; color: var(--blue-deep); }
.territory-progress > span:not(.track) { color: var(--muted); font-size: .82rem; }
.territory-progress .track { grid-column: 1 / -1; }
.territory-progress .track i { background: var(--blue); }
.territory-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.territory-totals > section:nth-child(2) { border-inline-start-color: var(--green); }
.territory-totals > section:nth-child(3) { border-inline-start-color: #665aa0; }
.territory-totals h2 { margin-bottom: 9px; }
.territory-totals dl { margin: 0; }
.territory-totals dl div { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--rule); padding-block: 7px; }
.territory-totals dt, .territory-totals dd { font-size: .82rem; }
.territory-totals dt { font-weight: 580; }
.territory-totals dd { font-weight: 680; white-space: nowrap; margin: 0; font-variant-numeric: tabular-nums; }
.territory-totals p { margin-top: 7px; }
.bars--named .bar-row { grid-template-columns: minmax(115px, 24%) minmax(25px, 1fr) auto; padding-block: 5px; }
.bar-name { min-width: 0; overflow-wrap: anywhere; }
.bar-name small { display: block; color: var(--muted); }
.legend--named { flex: 1 1 180px; min-width: 0; }
.legend--named li { grid-template-columns: 10px minmax(0, 1fr) auto; font-size: .83rem; }
.legend--named strong { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .territory-layout, .territory-totals { grid-template-columns: minmax(0, 1fr); }
  .territory-totals { gap: 0; }
  .bars--named .bar-row { grid-template-columns: minmax(0, 1fr) auto; }
  .bars--named .bar-row .track { grid-row: 2; grid-column: 1 / -1; }
}
.saved-photo img { display: block; width: 100%; height: auto; max-height: 200px; object-fit: contain; border-radius: 6px; background: var(--paper); margin-bottom: 6px; }

/* Registro y corrección de actas */
.capture-main { display: grid; gap: 14px; min-width: 0; }
.capture-main > .surface { margin: 0; }
.capture-grid .vote-panel, .capture-grid .capture-summary { padding: clamp(16px, 2vw, 25px); }
.capture-grid .vote-totals { background: transparent; border: 0; padding: 0; margin-bottom: 18px; }
.capture-grid .vote-totals input { font-weight: 650; font-variant-numeric: tabular-nums; }
.capture-grid .vote-heading { background: var(--raised); }
.capture-grid .vote-row { padding-block: 7px; }
.capture-grid .vote-row input { font-weight: 650; }
.capture-grid .capture-counts div { padding-block: 10px; }
.capture-counts [data-sum] { font-size: 1.55rem; line-height: 1.2; }
.capture-main .act-attachments { padding: 0; border-inline-start: 4px solid var(--green); }
.act-attachments summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 16px 20px; cursor: pointer; font-weight: 700; list-style: none; }
.act-attachments summary::-webkit-details-marker { display: none; }
.act-attachments summary small, .attachment-help { font-size: .8rem; font-weight: 450; color: var(--muted); }
.act-attachments summary::after { content: ''; margin-inline-start: auto; width: 9px; height: 9px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.act-attachments[open] summary::after { transform: rotate(225deg); }
.attachment-body { border-top: 1px solid var(--rule); padding: 16px 20px; }
.attachment-photos { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,215px),1fr)); gap: 12px; margin-top: 14px; }
.attachment-photos [data-photo-slot] { margin: 0; padding: 12px; border: 1px solid var(--rule); border-radius: 8px; min-width: 0; }
.attachment-photos .photo-actions { margin-bottom: 0; }
.attachment-help { margin: 8px 0 0; }
.attachment-photos [data-photo-slot]:has(.evidence-file:focus-visible) label[for] { outline: 2px solid var(--blue); }
@media (min-width: 992px) {
  .capture-grid .capture-side { position: sticky; top: 80px; }
  .capture-grid { grid-template-columns: minmax(0, 1fr) minmax(250px, 29%); }
}
@media (max-width: 540px) {
  .capture-grid .vote-row { grid-template-columns: minmax(0,1fr) 76px; grid-template-areas: "code votes" "party votes"; row-gap: 3px; }
  .capture-grid .vote-heading, .capture-grid .vote-footer { grid-template-columns: minmax(0,1fr) 76px; }
  .act-attachments summary { padding: 14px; }
  .attachment-body { padding: 14px; }
}
