:root {
  color-scheme: light;
  --ink-950: #10201d;
  --ink-900: #172824;
  --ink-800: #263a35;
  --ink-700: #40534e;
  --ink-600: #61716d;
  --ink-500: #7f8d89;
  --canvas: #f4f6f3;
  --surface: #ffffff;
  --surface-soft: #f9faf8;
  --line: #e1e7e3;
  --line-strong: #cbd5d0;
  --brand-950: #0a2926;
  --brand-900: #103b35;
  --brand-800: #164b42;
  --brand-700: #1d6557;
  --brand-600: #2b806d;
  --brand-500: #3a9a83;
  --brand-100: #dcefe9;
  --brand-50: #eef7f4;
  --gold-600: #b77924;
  --gold-500: #d0983e;
  --gold-100: #f7ead4;
  --blue-600: #3979a6;
  --blue-100: #e2eef6;
  --violet-600: #7460a8;
  --violet-100: #eee9f8;
  --red-600: #b54945;
  --red-100: #f9e6e4;
  --shadow-xs: 0 1px 2px rgb(16 32 29 / 5%);
  --shadow-sm: 0 8px 24px rgb(16 32 29 / 6%);
  --shadow-lg: 0 24px 80px rgb(7 35 31 / 16%);
  --radius-sm: .55rem;
  --radius-md: .85rem;
  --radius-lg: 1.15rem;
  --sidebar-width: 264px;
  --sidebar-collapsed-width: 76px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink-900);
  background: var(--canvas);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.sidebar-open { overflow: hidden; }

a { color: var(--brand-700); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-900); }

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgb(58 154 131 / 28%);
  outline-offset: 2px;
}

svg { display: block; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Application shell */
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  color: #edf6f3;
  background:
    radial-gradient(circle at 10% 88%, rgb(55 138 117 / 24%), transparent 29%),
    linear-gradient(175deg, var(--brand-950) 0%, #0d312d 64%, #0a2825 100%);
  box-shadow: 8px 0 32px rgb(9 34 30 / 7%);
  transition: width .22s ease, transform .22s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-height: 76px;
  padding: 0 1.25rem;
  border-bottom: 1px solid rgb(255 255 255 / 8%);
}

.brand-lockup {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: .7rem;
  color: inherit;
  text-decoration: none;
}

.brand-lockup:hover { color: inherit; }
.sidebar-brand .brand-lockup { flex: 1; }

.brand-lockup > span:last-child { display: grid; line-height: 1.08; }
.brand-lockup strong { font-size: 1.07rem; letter-spacing: -.02em; }
.brand-lockup small { margin-top: .25rem; color: rgb(225 240 235 / 62%); font-size: .66rem; letter-spacing: .095em; text-transform: uppercase; }

.brand-mark {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 11px;
  color: #d7b573;
  background: #fff;
  box-shadow: inset 0 1px rgb(255 255 255 / 8%);
}

.brand-mark svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.brand-mark img { width: 29px; height: 29px; object-fit: contain; }

.campaign-context {
  display: grid;
  margin: 1.25rem 1rem .75rem;
  padding: .95rem 1rem;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 5%);
}

.campaign-context .eyebrow { color: #b7c9c4; }
.campaign-context strong { margin-top: .35rem; color: #fff; font-size: .95rem; }
.campaign-context > span:last-child { margin-top: .12rem; color: #9eb5af; font-size: .73rem; }

.eyebrow, .panel-kicker, .nav-section-label {
  font-size: .67rem;
  font-weight: 750;
  letter-spacing: .105em;
  text-transform: uppercase;
}

.text-accent { color: var(--brand-600); }

.sidebar-nav { display: grid; gap: .18rem; padding: .45rem .75rem 1.5rem; overflow-y: auto; }

.nav-section-label { margin: 1rem .75rem .38rem; color: rgb(207 226 220 / 44%); }

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  min-height: 43px;
  padding: .55rem .75rem;
  border-radius: .65rem;
  color: #bbcbc7;
  font-size: .88rem;
  font-weight: 560;
  text-decoration: none;
  transition: color .16s ease, background .16s ease, transform .16s ease;
}

.nav-item svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.nav-item:hover { color: #fff; background: rgb(255 255 255 / 7%); }
.nav-item.is-active { color: #fff; background: linear-gradient(90deg, rgb(58 154 131 / 28%), rgb(58 154 131 / 13%)); box-shadow: inset 3px 0 var(--brand-500); }
.nav-item small { padding: .12rem .38rem; border-radius: 999px; color: #86a39c; background: rgb(255 255 255 / 5%); font-size: .58rem; letter-spacing: .03em; text-transform: uppercase; }
.nav-count-badge { display: inline-grid; min-width: 21px; height: 21px; padding: 0 .35rem; place-items: center; border-radius: 999px; color: #fff; background: var(--red-600); font-size: .66rem; font-weight: 800; line-height: 1; }
.nav-item.is-disabled { cursor: default; opacity: .62; }
.nav-item.is-disabled:hover { color: #bbcbc7; background: transparent; }

.sidebar-footer { margin-top: auto; padding: 1.25rem 1.5rem 1.4rem; border-top: 1px solid rgb(255 255 255 / 7%); }
.sidebar-footer p { margin: .65rem 0 0; color: #76938c; font-size: .68rem; line-height: 1.55; }
.security-pill { display: inline-flex; align-items: center; gap: .45rem; color: #afc8c1; font-size: .72rem; font-weight: 650; }
.security-pill > span, .online-dot, .public-security > span, .status-chip > span { width: 7px; height: 7px; border-radius: 50%; background: #58bd8e; box-shadow: 0 0 0 4px rgb(88 189 142 / 12%); }

.main-shell { display: flex; min-height: 100vh; margin-left: var(--sidebar-width); flex-direction: column; transition: margin-left .22s ease; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 1rem;
  padding: .7rem clamp(1rem, 2.5vw, 2.25rem);
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 88%);
  backdrop-filter: blur(16px);
}

.topbar-context { display: flex; align-items: center; gap: .65rem; color: var(--ink-600); font-size: .8rem; text-transform: capitalize; }
.topbar-actions { display: flex; align-items: center; gap: .72rem; margin-left: auto; }
.topbar-actions form { margin: 0; }

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: .7rem;
  color: var(--ink-700);
  background: var(--surface);
  cursor: pointer;
}
.icon-button:hover { color: var(--brand-800); border-color: var(--line-strong); background: var(--surface-soft); }
.sidebar-minimize-toggle { flex: 0 0 auto; color: #c5d4d0; border-color: transparent; background: transparent; }
.sidebar-minimize-toggle:hover { color: #fff; border-color: rgb(255 255 255 / 22%); background: transparent; }
.sidebar-minimize-toggle svg { transition: transform .18s ease; }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.menu-toggle, .sidebar-close { display: none; }
.sidebar-scrim { display: none; }

.notification-button { position: relative; border-color: transparent; background: transparent; }
.notification-button > span { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border: 2px solid white; border-radius: 50%; background: #d88755; }

.user-menu-summary { display: flex; align-items: center; gap: .65rem; padding-left: .5rem; }
.avatar { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, var(--brand-600), var(--brand-900)); font-size: .75rem; font-weight: 760; letter-spacing: .04em; box-shadow: 0 0 0 3px var(--brand-50); }
.user-copy { display: grid; min-width: 115px; line-height: 1.2; }
.user-copy strong { max-width: 170px; overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.user-copy small { margin-top: .2rem; color: var(--ink-500); font-size: .68rem; }

.logout-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: .42rem;
  padding: .45rem .7rem;
  border: 1px solid transparent;
  border-radius: .6rem;
  color: var(--ink-600);
  background: transparent;
  cursor: pointer;
}
.logout-button:hover { color: var(--red-600); background: var(--red-100); }
.logout-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.logout-button span { font-size: .75rem; font-weight: 650; }

.page-content { width: min(100%, 1560px); flex: 1 0 auto; margin: 0 auto; padding: clamp(1.25rem, 2.6vw, 2.4rem); }
.site-footer { display: flex; min-height: 32px; align-items: center; justify-content: center; gap: .4rem; padding: .32rem clamp(1rem, 2.5vw, 2.25rem); border-top: 1px solid var(--line); color: var(--ink-500); background: rgb(255 255 255 / 68%); font-size: .68rem; text-align: center; }
.site-footer a { color: var(--brand-700); font-weight: 700; text-decoration: none; }
.site-footer a:hover { color: var(--brand-900); text-decoration: underline; }

/* Shared page components */
h1, h2, h3, p { text-wrap: pretty; }
h1, h2, h3 { color: var(--ink-950); line-height: 1.16; letter-spacing: -.035em; }
h1 { margin: .22rem 0 .45rem; font-size: clamp(1.85rem, 3.4vw, 2.55rem); font-weight: 730; }
h2 { margin: .18rem 0 .28rem; font-size: 1.08rem; font-weight: 720; }
h3 { font-size: .95rem; }

.page-heading, .toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.4rem;
}
.page-heading p, .toolbar p { margin: 0; color: var(--ink-600); }
.heading-actions { display: flex; flex-wrap: wrap; gap: .65rem; }

.button, button.button, form button[type="submit"]:not(.logout-button) {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .58rem .9rem;
  border: 1px solid var(--brand-800);
  border-radius: .63rem;
  color: #fff;
  background-color: var(--brand-700);
  box-shadow: 0 1px 1px rgb(10 41 38 / 12%);
  font-weight: 680;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}
.button:hover, form button[type="submit"]:not(.logout-button):hover { color: #fff; background-color: var(--brand-900); box-shadow: 0 5px 15px rgb(16 59 53 / 15%); transform: translateY(-1px); }
.button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.button-secondary { color: var(--ink-700); border-color: var(--line-strong); background: var(--surface); box-shadow: none; }
.button-secondary:hover { color: var(--brand-800); background: var(--surface-soft); box-shadow: none; }
.button-quiet { min-height: 36px; color: var(--ink-700); border-color: var(--line); background: var(--surface-soft); box-shadow: none; font-size: .76rem; }
.button-full { width: 100%; }
.button:disabled, button:disabled { cursor: not-allowed; opacity: .66; transform: none; }

.card, .panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.card { padding: clamp(1.1rem, 2vw, 1.5rem); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 1rem; }
.stack { display: grid; gap: 1rem; }
.muted { color: var(--ink-600); }

.demo-banner {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1.15rem;
  padding: .72rem .9rem;
  border: 1px solid #e8d6b8;
  border-radius: .75rem;
  color: #6f5229;
  background: linear-gradient(90deg, #fff9ef, #fdfaf5);
}
.demo-icon { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; border-radius: 8px; color: #fff; background: var(--gold-600); font-size: .72rem; font-weight: 800; }
.demo-banner > div { display: flex; flex: 1; align-items: baseline; gap: .5rem; }
.demo-banner strong { font-size: .78rem; }
.demo-banner div span { color: #896f49; font-size: .73rem; }
.demo-label { padding: .18rem .5rem; border: 1px solid #ead8b9; border-radius: 999px; font-size: .62rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.metric-card { position: relative; min-width: 0; padding: 1.1rem 1.15rem 1rem; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.metric-card::after { position: absolute; right: -25px; bottom: -32px; width: 88px; height: 88px; border-radius: 50%; background: var(--brand-50); content: ""; opacity: .62; }
.metric-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.metric-icon { display: grid; width: 37px; height: 37px; place-items: center; border-radius: .68rem; }
.metric-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.metric-icon-green { color: var(--brand-700); background: var(--brand-100); }
.metric-icon-blue { color: var(--blue-600); background: var(--blue-100); }
.metric-icon-amber { color: var(--gold-600); background: var(--gold-100); }
.metric-icon-violet { color: var(--violet-600); background: var(--violet-100); }
.trend { padding: .15rem .42rem; border-radius: 999px; color: var(--ink-600); background: var(--surface-soft); font-size: .65rem; font-weight: 720; }
.trend-up { color: var(--brand-700); background: var(--brand-50); }
.metric-card > p { margin: 0 0 .18rem; color: var(--ink-600); font-size: .77rem; font-weight: 580; }
.metric-value { position: relative; z-index: 1; display: block; font-size: clamp(1.65rem, 2.8vw, 2.15rem); font-weight: 730; letter-spacing: -.045em; line-height: 1.15; }
.metric-caption { position: relative; z-index: 1; display: block; margin-top: .3rem; color: var(--ink-500); font-size: .67rem; }
.metric-progress { position: relative; z-index: 1; height: 4px; margin-top: .72rem; overflow: hidden; border-radius: 99px; background: var(--brand-50); }
.metric-progress span { display: block; height: 100%; border-radius: inherit; background: var(--brand-600); }
.metric-progress-violet { background: var(--violet-100); }
.metric-progress-violet span { background: var(--violet-600); }

/* Dashboard layout and panels */
.dashboard-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; }
.panel { min-width: 0; padding: 1.2rem; }
.chart-panel { grid-column: span 8; }
.distribution-panel { grid-column: span 4; }
.territory-panel { grid-column: span 8; }
.task-panel { grid-column: span 4; }
.activity-panel { grid-column: 1 / -1; }

.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.panel-header p { margin: 0; color: var(--ink-500); font-size: .7rem; }
.panel-kicker { color: var(--brand-600); }
.panel-menu { padding: .2rem .4rem; border: 0; color: var(--ink-500); background: transparent; cursor: pointer; font-weight: 800; letter-spacing: .15em; }

.segmented-control { display: inline-flex; flex: 0 0 auto; padding: .2rem; border: 1px solid var(--line); border-radius: .6rem; background: var(--surface-soft); }
.segmented-control button { min-height: 29px; padding: .25rem .55rem; border: 0; border-radius: .43rem; color: var(--ink-500); background: transparent; font-size: .64rem; cursor: pointer; }
.segmented-control button.is-selected { color: var(--ink-800); background: #fff; box-shadow: var(--shadow-xs); font-weight: 680; }

.chart-legend { display: flex; gap: 1.2rem; margin: 1rem 0 .4rem; color: var(--ink-600); font-size: .66rem; }
.chart-legend span { display: flex; align-items: center; gap: .38rem; }
.legend-line { width: 18px; height: 2px; border-radius: 2px; }
.legend-green { background: var(--brand-600); }
.legend-gold { background: var(--gold-500); }
.line-chart { position: relative; height: 270px; padding: 0 0 27px 38px; }
.line-chart > svg { width: 100%; height: 228px; overflow: visible; }
.chart-grid-lines { fill: none; stroke: #e9eeeb; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-area { fill: url(#areaGreen); }
.chart-line { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; vector-effect: non-scaling-stroke; }
.chart-line-green { stroke: var(--brand-600); }
.chart-line-gold { stroke: var(--gold-500); stroke-dasharray: 5 5; stroke-width: 2.2; }
.chart-points circle { fill: #fff; stroke: var(--brand-600); stroke-width: 3; vector-effect: non-scaling-stroke; }
.chart-points .gold-point { stroke: var(--gold-500); }
.chart-y-labels { position: absolute; inset: -7px auto 27px 0; display: flex; width: 31px; flex-direction: column; justify-content: space-between; color: var(--ink-500); font-size: .61rem; text-align: right; }
.chart-x-labels { position: absolute; right: 0; bottom: 0; left: 38px; display: flex; justify-content: space-between; color: var(--ink-500); font-size: .59rem; }
.weekly-bars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .75rem; height: 276px; margin-top: 1rem; align-items: end; }
.weekly-bar-group { display: grid; gap: .38rem; min-width: 0; text-align: center; }
.weekly-bar-track { display: flex; align-items: end; justify-content: center; gap: .18rem; height: 205px; padding: .45rem .28rem; border: 1px solid var(--line); border-radius: .65rem; background: linear-gradient(180deg, #fbfcfb, #f3f6f4); }
.weekly-bar { width: 13px; min-height: 3px; border-radius: 999px 999px 3px 3px; }
.weekly-bar-contact { background: var(--brand-600); }
.weekly-bar-visit { background: var(--gold-500); }
.weekly-bar-group strong { color: var(--ink-700); font-size: .62rem; }
.weekly-bar-group small { color: var(--ink-500); font-size: .58rem; }
.territory-readiness-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-top: 1rem; }
.territory-readiness-grid article { display: grid; gap: .25rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.territory-readiness-grid span { color: var(--ink-500); font-size: .67rem; font-weight: 650; }
.territory-readiness-grid strong { font-size: 1.45rem; letter-spacing: -.035em; }
.territory-readiness-grid small { color: var(--ink-500); font-size: .64rem; }

.donut-wrap { display: grid; place-items: center; padding: 1rem 0 .65rem; }
.donut { display: grid; width: 154px; height: 154px; place-items: center; border-radius: 50%; background: conic-gradient(var(--brand-600) 0 37.9%, var(--blue-600) 37.9% 52.3%, var(--gold-500) 52.3% 63.7%, #e8ecea 63.7% 100%); box-shadow: inset 0 0 0 1px rgb(16 32 29 / 4%); }
.donut::before { position: absolute; width: 108px; height: 108px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px var(--line); content: ""; }
.donut > div { position: relative; z-index: 1; display: grid; text-align: center; }
.donut strong { font-size: 1.52rem; letter-spacing: -.04em; }
.donut span { color: var(--ink-500); font-size: .65rem; }
.distribution-list { display: grid; gap: .1rem; margin: .25rem 0 0; padding: 0; list-style: none; }
.distribution-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .48rem 0; border-bottom: 1px solid #edf0ee; font-size: .71rem; }
.distribution-list li:last-child { border: 0; }
.distribution-list li > span { display: flex; align-items: center; color: var(--ink-700); }
.distribution-list strong { font-size: .72rem; }
.distribution-list small { margin-left: .25rem; color: var(--ink-500); font-weight: 500; }
.dot { display: inline-block; width: 7px; height: 7px; margin-right: .45rem; border-radius: 50%; }
.dot-green { background: var(--brand-600); }.dot-blue { background: var(--blue-600); }.dot-gold { background: var(--gold-500); }.dot-gray { background: #cdd5d1; }

.status-chip { display: inline-flex; align-items: center; gap: .45rem; flex: 0 0 auto; padding: .3rem .55rem; border-radius: 999px; color: var(--brand-700); background: var(--brand-50); font-size: .63rem; font-weight: 650; }
.status-chip > span { width: 6px; height: 6px; }
.territory-map { position: relative; height: 330px; margin-top: .9rem; overflow: hidden; border: 1px solid var(--line); border-radius: .85rem; background: #f0f4f1; }
.territory-map > svg { width: 100%; height: 100%; }
.map-roads { fill: none; stroke: #c7d2cd; stroke-width: 8; opacity: .72; }
.map-roads path:nth-child(even) { stroke-width: 4; stroke-dasharray: 10 6; }
.map-zones .zone { stroke: #fff; stroke-width: 3; opacity: .83; }
.zone-1, .zone-5 { fill: #75b8a5; }.zone-2 { fill: #4f9e88; }.zone-3, .zone-4 { fill: #a7cdbf; }.zone-6 { fill: #d6c391; }
.map-pins path { fill: var(--brand-900); }.map-pins circle { fill: #fff; }
.map-labels { fill: var(--ink-800); font-size: 12px; font-weight: 700; paint-order: stroke; stroke: rgb(255 255 255 / 88%); stroke-width: 4; }
.map-zoom { position: absolute; top: .8rem; right: .8rem; display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: .55rem; background: #fff; box-shadow: var(--shadow-sm); }
.map-zoom button { width: 32px; height: 30px; padding: 0; border: 0; color: var(--ink-700); background: #fff; font-size: 1rem; cursor: default; }
.map-zoom button + button { border-top: 1px solid var(--line); }
.map-legend { position: absolute; right: .8rem; bottom: .8rem; display: flex; gap: .65rem; padding: .4rem .55rem; border: 1px solid rgb(255 255 255 / 75%); border-radius: .55rem; color: var(--ink-700); background: rgb(255 255 255 / 90%); box-shadow: var(--shadow-xs); backdrop-filter: blur(8px); font-size: .6rem; }
.map-legend span { display: flex; align-items: center; gap: .28rem; }
.map-swatch { width: 8px; height: 8px; border-radius: 2px; }.map-swatch.high { background: #4f9e88; }.map-swatch.medium { background: #a7cdbf; }.map-swatch.low { background: #d6c391; }

.counter-badge { display: grid; min-width: 30px; height: 30px; place-items: center; border-radius: 50%; color: var(--brand-800); background: var(--brand-50); font-size: .72rem; font-weight: 750; }
.task-filter-panel { margin-top: 1rem; }
.task-scope-tabs { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .85rem; }
.task-scope-tabs label { display: inline-flex; min-height: 36px; align-items: center; gap: .35rem; padding: .4rem .65rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-600); background: var(--surface-soft); font-size: .68rem; font-weight: 700; cursor: pointer; }
.task-scope-tabs label:has(input:checked) { color: var(--brand-800); border-color: var(--brand-500); background: var(--brand-50); }
.task-scope-tabs input { margin: 0; accent-color: var(--brand-700); }
.task-quick-filters { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: .55rem; margin-bottom: .9rem; }
.task-quick-filter { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .62rem .72rem; border: 1px solid var(--line); border-radius: .72rem; color: var(--ink-700); background: rgba(255, 255, 255, .72); text-decoration: none; box-shadow: var(--shadow-xs); }
.task-quick-filter span { font-size: .66rem; font-weight: 720; }
.task-quick-filter strong { color: var(--brand-800); font-size: .82rem; }.task-quick-filter:hover, .task-quick-filter.is-active { border-color: var(--brand-400); color: var(--brand-800); background: var(--brand-50); }
.task-filter-grid { display: grid; grid-template-columns: minmax(220px, 1.6fr) minmax(140px, .8fr) minmax(140px, .8fr) minmax(160px, 1fr) auto; align-items: end; gap: .78rem; }
.task-list { display: grid; margin: .75rem 0 0; padding: 0; list-style: none; }
.task-list li { display: grid; grid-template-columns: 21px 1fr auto; align-items: center; gap: .65rem; padding: .73rem 0; border-bottom: 1px solid #edf0ee; }
.task-list li:last-child { border: 0; }
.task-check { display: grid; width: 19px; height: 19px; padding: 0; place-items: center; border: 1.5px solid var(--line-strong); border-radius: 6px; color: white; background: #fff; font-size: .65rem; cursor: default; }
.task-check.is-done { border-color: var(--brand-600); background: var(--brand-600); }
.task-list li > div { display: grid; min-width: 0; }
.profile-task-list .inline-action-form { margin: 0; }
.task-list strong { overflow: hidden; font-size: .72rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.task-list li > div span { margin-top: .18rem; color: var(--ink-500); font-size: .61rem; }
.priority { padding: .16rem .38rem; border-radius: 999px; font-size: .57rem; font-weight: 700; }
.priority.high { color: var(--red-600); background: var(--red-100); }.priority.normal, .priority.medium { color: #936721; background: var(--gold-100); }.priority.low { color: var(--ink-600); background: #eef1ef; }.priority.done { color: var(--brand-700); background: var(--brand-50); }
.task-row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: .35rem; }
.task-modal-form textarea { min-height: 96px; }
.inline-action-form { margin: 0; }
.button-small, button.button-small, form button.button-small[type="submit"] { min-height: 30px; padding: .34rem .55rem; font-size: .64rem; }
.text-button { width: 100%; padding: .65rem 0 0; border: 0; color: var(--brand-700); background: transparent; font-size: .67rem; font-weight: 680; text-align: left; }
.text-button span { float: right; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.dashboard-table-wrap { margin-top: .9rem; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 0; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: .76rem .8rem; border-bottom: 1px solid #e9eeeb; text-align: left; vertical-align: middle; white-space: nowrap; }
th { color: var(--ink-500); background: #fbfcfb; font-size: .61rem; font-weight: 720; letter-spacing: .055em; text-transform: uppercase; }
td { color: var(--ink-700); font-size: .7rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fcfdfc; }
.record-avatar { display: inline-grid; width: 31px; height: 31px; margin-right: .55rem; place-items: center; border-radius: 9px; color: var(--brand-800); background: var(--brand-100); font-size: .6rem; font-weight: 760; vertical-align: middle; }
.avatar-blue { color: var(--blue-600); background: var(--blue-100); }.avatar-gold { color: var(--gold-600); background: var(--gold-100); }.avatar-violet { color: var(--violet-600); background: var(--violet-100); }
.record-copy { display: inline-grid; vertical-align: middle; }
.record-copy strong { color: var(--ink-800); font-size: .69rem; }
.record-copy small { color: var(--ink-500); font-size: .58rem; }
.badge { display: inline-flex; align-items: center; padding: .22rem .5rem; border-radius: 999px; color: var(--brand-700); background: var(--brand-50); font-size: .61rem; font-weight: 680; }
.badge-button { border: 0; font-family: inherit; line-height: inherit; cursor: pointer; appearance: none; }
.badge-button:hover { box-shadow: 0 0 0 2px rgb(24 92 82 / 16%); }
.badge-button:focus-visible { outline: 2px solid var(--brand-700); outline-offset: 2px; }
.badge-success { color: var(--brand-700); background: var(--brand-50); }.badge-warning { color: #8b6324; background: var(--gold-100); }.badge-neutral { color: var(--ink-600); background: #eef1ef; }.badge-info { color: var(--blue-600); background: var(--blue-100); }.badge-danger { color: var(--red-600); background: var(--red-100); }

/* Existing forms and voter screens */
form p { margin: 0 0 1rem; }
label { display: block; margin-bottom: .34rem; color: var(--ink-800); font-size: .75rem; font-weight: 670; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: .58rem .7rem;
  border: 1px solid var(--line-strong);
  border-radius: .58rem;
  color: var(--ink-900);
  background: #fff;
  transition: border .15s ease, box-shadow .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: #aebdb7; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgb(58 154 131 / 12%); outline: 0; }
input[type="checkbox"] { width: auto; min-height: auto; margin-right: .4rem; }
input[type="checkbox"] + label { display: inline; }
.helptext { display: block; margin-top: .28rem; color: var(--ink-500); font-size: .66rem; }
.errorlist { margin: .35rem 0; padding-left: 1.2rem; color: var(--red-600); font-size: .7rem; }
.advanced-search-panel { display: grid; gap: .85rem; }
.basic-search-grid { display: grid; grid-template-columns: minmax(220px, 2fr) minmax(180px, 1fr) auto; align-items: end; gap: .78rem; }
.basic-search-grid .field-group { margin: 0; }
.basic-search-grid-no-identity { grid-template-columns: minmax(220px, 1fr) auto; }
.advanced-search-actions { display: flex; gap: .5rem; align-items: center; }
.advanced-search-actions .button, .advanced-search-actions button { flex: 1; justify-content: center; }
.advanced-search-details { padding-top: .75rem; border-top: 1px solid var(--line); }
.advanced-search-details summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: .52rem .75rem;
  border: 1px solid var(--line-strong);
  border-radius: .6rem;
  color: var(--brand-700);
  background: #fff;
  font-size: .68rem;
  font-weight: 760;
  cursor: pointer;
  list-style: none;
}
.advanced-search-details summary::-webkit-details-marker { display: none; }
.advanced-search-details summary:hover { border-color: #aebdb7; color: var(--brand-800); }
.advanced-search-details[open] summary { margin-bottom: .85rem; }
.advanced-search-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); align-items: end; gap: .78rem; }
.compact-signal { display: block; color: var(--ink-700); font-size: .64rem; line-height: 1.6; }
.quick-filter-button { margin-top: .75rem; }
.list-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin: .85rem 0;
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: rgb(255 255 255 / 72%);
}
.list-summary-card strong { color: var(--ink-900); font-size: 1.15rem; }
.list-summary-card span, .list-summary-card small { color: var(--ink-600); font-size: .68rem; font-weight: 650; }
.datatable-footer-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .75rem .85rem;
  color: var(--ink-600);
  font-size: .68rem;
  font-weight: 650;
}
.datatable-page-size-form { display: inline-flex; align-items: center; gap: .42rem; margin: 0; }
.datatable-page-size-form label { margin: 0; color: var(--ink-600); font-size: .68rem; }
.datatable-page-size-form select { width: auto; min-width: 82px; min-height: 36px; padding: .42rem .62rem; }
.datatable-page-size-form button { min-height: 36px; padding: .42rem .68rem; box-shadow: none; }
.assignment-filter-panel { margin-bottom: 1rem; }
.assignment-workspace-panel .table-wrap { overflow-x: auto; }
.assignment-table-controls { display: flex; align-items: center; gap: .75rem; }
.assignment-table-controls form { margin: 0; }
.assignment-inline-form { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr) auto; align-items: center; gap: .5rem; margin: 0; }
.assignment-inline-form select, .assignment-inline-form input { min-height: 36px; padding: .42rem .58rem; font-size: .66rem; }
.assignment-action-row { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.assignment-modal-form { max-width: none; }
.assignment-modal-form select, .assignment-modal-form input { min-height: 40px; }
.portfolio-filter-panel { margin-bottom: 1rem; }
.portfolio-filter-grid { display: grid; grid-template-columns: minmax(220px, 1.5fr) minmax(160px, .8fr) auto auto; align-items: end; gap: .78rem; }
.portfolio-filter-toggles { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.portfolio-action-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.portfolio-action-row .button-small { padding-inline: .55rem; }
.portfolio-status-form { max-width: none; }
.app-modal {
  width: min(92vw, 520px);
  padding: 0;
  border: 0;
  border-radius: 1.1rem;
  color: var(--ink-800);
  background: transparent;
  box-shadow: none;
}
.app-modal-wide { width: min(94vw, 720px); }
.contact-preferences-modal { width: min(96vw, 1100px); }
.app-modal::backdrop { background: rgba(9, 31, 25, .42); backdrop-filter: blur(3px); }
.app-modal-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 1.1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(249, 251, 249, .98));
  box-shadow: 0 24px 70px rgba(13, 42, 34, .24);
}
.app-modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.15rem .85rem;
  border-bottom: 1px solid var(--line);
}
.app-modal-heading h2 { margin: .12rem 0 .28rem; font-size: 1.08rem; }
.app-modal-heading p { margin: 0; color: var(--ink-500); font-size: .72rem; }
.app-modal-body { padding: .2rem 1.15rem .8rem; }
.app-modal-body p { font-size: .72rem; }
.modal-close-button { width: 34px; height: 34px; font-size: 1.25rem; line-height: 1; }
.app-modal .structured-form { padding: 1rem 1.15rem 1.15rem; }
.app-modal .form-actions { margin-top: .9rem; }
.portfolio-interaction-form { max-width: none; }
.search-grid { display: grid; grid-template-columns: 2fr 1fr auto; align-items: end; gap: .8rem; margin-bottom: 1rem; }
.search-grid > div, .search-grid > p { margin: 0; }
dl { display: grid; grid-template-columns: minmax(130px, 1fr) 2fr; gap: .75rem 1rem; margin: 0; }
dt { color: var(--ink-500); font-size: .72rem; }
dd { margin: 0; color: var(--ink-800); font-size: .75rem; font-weight: 650; }

.messages { margin: 0 0 1rem; padding: 0; list-style: none; }
.messages li, .form-alert { padding: .75rem .9rem; border: 1px solid #cae4db; border-radius: .7rem; color: var(--brand-800); background: var(--brand-50); font-size: .75rem; }
.messages .error { color: #853330; border-color: #f0c9c6; background: var(--red-100); }
.messages .warning { color: #76531d; border-color: #eed8b5; background: #fff7e9; }

/* Residence and operational maps */
.card-heading-row, .section-heading, .history-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.card-heading-row { margin-bottom: 1rem; }
.card-heading-row h2, .section-heading h2 { margin-top: .16rem; }
.card-heading-row .button { min-height: 34px; padding: .38rem .65rem; font-size: .7rem; }
.interaction-history-panel { margin-top: 1rem; }
.privacy-caption { margin: 1rem 0 0; padding-top: .8rem; border-top: 1px solid var(--line); color: var(--ink-500); font-size: .66rem; }

.security-banner {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  padding: .8rem 1rem;
  border: 1px solid #d4e3de;
  border-radius: .8rem;
  color: var(--brand-800);
  background: var(--brand-50);
}
.security-banner-icon { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border-radius: 9px; color: #fff; background: var(--brand-700); font-size: 1.1rem; }
.security-banner > div { display: grid; }.security-banner strong { font-size: .76rem; }.security-banner span { color: var(--ink-600); font-size: .68rem; }

.residence-layout { display: grid; grid-template-columns: minmax(320px, 5fr) minmax(420px, 7fr); align-items: start; gap: 1rem; }
.residence-unified-form { max-width: none; }
.residence-unified-actions { display: flex; justify-content: flex-end; margin-top: 1rem; }
.residence-card, .location-card, .residence-history-panel { padding: clamp(1rem, 2vw, 1.35rem); }
.section-heading { margin-bottom: 1.1rem; }
.section-heading p { margin: 0; color: var(--ink-500); font-size: .7rem; }
.structured-form { display: grid; gap: .9rem; }
.form-grid-two, .coordinate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.form-field { min-width: 0; }
.form-grid-two > .form-field-full { grid-column: 1 / -1; }
.form-field label { margin-bottom: .32rem; }
.form-field textarea { min-height: 70px; resize: vertical; }
.identity-inline-controls { display: flex; width: 100%; align-items: stretch; gap: 0; }
.identity-display-field input[readonly] { width: auto; min-width: 0; flex: 1 1 auto; border-radius: .62rem 0 0 .62rem; color: var(--ink-700); background: var(--surface-soft); cursor: default; }
.identity-display-field input[readonly].is-revealable { cursor: pointer; }
.identity-inline-controls .icon-button { width: 36px; height: auto; min-height: 36px; flex: 0 0 auto; margin-left: -1px; border-radius: 0 .62rem .62rem 0; }
.field-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-top: .45rem; }
.field-actions .helptext { font-size: .62rem; }
.correction-field { padding: .8rem; border: 1px solid #ead8b8; border-radius: .72rem; background: #fffbf3; }
.form-actions { display: flex; justify-content: flex-end; padding-top: .25rem; }
.empty-copy { margin: 0; color: var(--ink-500); font-size: .75rem; }

.map-notice { display: grid; margin-bottom: .75rem; padding: .62rem .72rem; border: 1px solid #ead7b8; border-radius: .65rem; color: #76531d; background: #fff8ec; }
.map-notice strong { font-size: .7rem; }.map-notice span { margin-top: .1rem; font-size: .63rem; }.map-notice code { padding: .05rem .2rem; border-radius: .25rem; background: rgb(119 83 29 / 8%); }
.location-editor-map { width: 100%; height: 370px; margin-bottom: 1rem; overflow: hidden; border: 1px solid var(--line); border-radius: .85rem; background: #e8efeb; }
.location-capture-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin: .7rem 0; }
.location-capture-toolbar [role="status"] { font-size: .66rem; }
.location-form { padding-top: .1rem; }
.territory-validation { display: flex; align-items: flex-start; gap: .6rem; padding: .7rem .75rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface-soft); }
.territory-validation .status-dot { width: 8px; height: 8px; flex: 0 0 auto; margin-top: .35rem; border-radius: 50%; background: var(--gold-500); box-shadow: 0 0 0 4px var(--gold-100); }
.territory-validation > div { display: grid; }.territory-validation strong { font-size: .69rem; }.territory-validation small { margin-top: .12rem; color: var(--ink-500); font-size: .62rem; }

.empty-state.compact { display: grid; padding: 1rem; border: 1px dashed var(--line-strong); border-radius: .75rem; color: var(--ink-700); background: var(--surface-soft); }
.empty-state.compact strong { font-size: .76rem; }.empty-state.compact span { margin-top: .15rem; color: var(--ink-500); font-size: .67rem; }

.residence-history-panel { margin-top: 1rem; }
.history-list { position: relative; display: grid; gap: 0; margin-top: .4rem; }
.history-item { display: grid; grid-template-columns: 18px 1fr; gap: .75rem; min-width: 0; padding: .75rem 0; }
.history-item:not(:last-child) { border-bottom: 1px solid var(--line); }
.history-marker { width: 10px; height: 10px; margin-top: .36rem; border: 2px solid #fff; border-radius: 50%; background: #b8c4c0; box-shadow: 0 0 0 2px #dfe6e2; }
.history-marker.is-current { background: var(--brand-600); box-shadow: 0 0 0 2px var(--brand-100); }
.history-copy { display: grid; min-width: 0; }.history-top strong { overflow-wrap: anywhere; font-size: .75rem; }.history-copy > span { margin-top: .22rem; color: var(--ink-600); font-size: .65rem; }.history-copy > small { margin-top: .15rem; color: var(--ink-500); font-size: .61rem; }

.operational-map-layout { display: grid; grid-template-columns: 245px minmax(0, 1fr); min-height: 650px; gap: 1rem; }
.map-sidebar-panel { display: flex; padding: 1rem; flex-direction: column; }
.map-stat { display: grid; padding: .85rem; border-radius: .8rem; background: linear-gradient(145deg, var(--brand-950), var(--brand-800)); color: #fff; }
.map-stat span { color: #c4d9d3; font-size: .65rem; }.map-stat strong { margin: .15rem 0; font-size: 2rem; letter-spacing: -.05em; }.map-stat small { color: #9dbbb3; font-size: .6rem; }
.map-layer-group, .map-operational-legend { display: grid; gap: .72rem; padding: 1.1rem .2rem; border-bottom: 1px solid var(--line); }
.map-sidebar-panel .nav-section-label { margin: 0 0 .1rem; color: var(--ink-500); }
.map-layer-toggle { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: .5rem; margin: 0; font-size: .7rem; font-weight: 580; }
.map-layer-toggle input { width: 15px; height: 15px; min-height: 0; margin: 0; accent-color: var(--brand-700); }
.map-layer-toggle small { color: var(--ink-500); font-size: .55rem; text-transform: uppercase; }.map-layer-toggle.is-muted { color: var(--ink-500); }
.map-operational-legend { margin-top: auto; border: 0; }
.map-operational-legend > div { display: flex; align-items: center; gap: .55rem; color: var(--ink-600); font-size: .65rem; }
.legend-marker { width: 11px; height: 11px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--line-strong); }.legend-marker.verified { background: var(--brand-700); }.legend-marker.provisional { background: var(--gold-500); }.legend-marker.polling-place { background: #315a9b; }
.legend-cluster { display: grid; width: 22px; height: 22px; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #fff; background: var(--brand-600); box-shadow: 0 0 0 1px var(--brand-100); font-size: .48rem; font-style: normal; font-weight: 750; }

.map-stage { position: relative; min-width: 0; min-height: 650px; padding: 0; overflow: hidden; }
.operational-map { position: absolute; inset: 0; width: 100%; height: 100%; min-height: inherit; background: #e8efeb; }
.map-stage-status { position: absolute; top: 1rem; left: 50%; z-index: 5; padding: .45rem .7rem; border: 1px solid rgb(255 255 255 / 70%); border-radius: 999px; color: var(--ink-700); background: rgb(255 255 255 / 90%); box-shadow: var(--shadow-sm); transform: translateX(-50%); backdrop-filter: blur(8px); font-size: .64rem; font-weight: 650; white-space: nowrap; }
.map-stage-status.is-error { color: var(--red-600); background: rgb(255 244 243 / 94%); }
.maplibregl-map { font-family: inherit; }
.maplibregl-ctrl-group { overflow: hidden; border: 1px solid var(--line); border-radius: .6rem; box-shadow: var(--shadow-sm); }
.maplibregl-popup-content { padding: .8rem; border-radius: .7rem; box-shadow: var(--shadow-lg); }
.map-popup-card { display: grid; min-width: 155px; }.map-popup-card strong { color: var(--ink-900); font-size: .72rem; }.map-popup-card span { margin-top: .2rem; color: var(--ink-700); font-size: .66rem; }.map-popup-card small { color: var(--ink-500); font-size: .59rem; }.map-popup-card a { margin-top: .55rem; font-size: .65rem; font-weight: 700; }

/* Consent ceremony */
.consent-purpose-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.consent-purpose-card { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: .7rem; min-width: 0; padding: .85rem; border: 1px solid var(--line); border-radius: .85rem; color: var(--ink-800); background: var(--surface); box-shadow: var(--shadow-xs); text-decoration: none; }
.consent-purpose-card:hover { color: var(--ink-900); border-color: #bdd7ce; background: #fcfefd; }
.consent-purpose-card.is-selected { border-color: var(--brand-500); background: var(--brand-50); box-shadow: 0 0 0 2px rgb(58 154 131 / 9%); }
.consent-purpose-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: .68rem; color: var(--brand-700); background: var(--brand-100); font-size: 1rem; font-weight: 760; }
.consent-purpose-copy { display: grid; min-width: 0; }.consent-purpose-copy strong { overflow: hidden; font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }.consent-purpose-copy small { margin-top: .15rem; color: var(--ink-500); font-size: .59rem; }

.consent-workspace { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr); align-items: start; gap: 1rem; }
.consent-ceremony, .consent-side-panel, .consent-history-panel { padding: clamp(1rem, 2vw, 1.35rem); }
.consent-notice-meta { display: flex; align-items: baseline; gap: .55rem; margin-bottom: .65rem; color: var(--ink-600); font-size: .65rem; }.consent-notice-meta strong { color: var(--ink-800); }.consent-notice-meta small { margin-left: auto; color: var(--ink-500); }
.consent-notice-content { max-height: 330px; padding: 1.1rem; overflow-y: auto; border: 1px solid var(--line); border-radius: .75rem; color: var(--ink-800); background: #fbfcfb; font-size: .76rem; line-height: 1.7; }
.consent-notice-content:focus { border-color: var(--brand-500); outline: 3px solid rgb(58 154 131 / 12%); }
.consent-decision-form { display: grid; gap: .85rem; margin-top: 1rem; }
.consent-confirmation, .consent-revoke-form > div { padding: .75rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface-soft); }
.consent-confirmation label, .consent-revoke-form label { font-size: .7rem; }
.consent-confirmation .helptext, .consent-revoke-form .helptext { padding-left: 1.45rem; }
.consent-choice-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.consent-choice-actions .consent-deny { color: var(--red-600); border-color: #e8c6c3; background: #fff; box-shadow: none; }
.consent-choice-actions .consent-deny:hover { color: #923b37; background: var(--red-100); box-shadow: none; }
.consent-empty { min-height: 190px; place-content: center; text-align: center; }

.consent-side-panel { position: sticky; top: 92px; }
.consent-current-state { display: block; margin: .3rem 0 1rem; font-size: 1.5rem; letter-spacing: -.04em; }
.consent-side-panel dl { grid-template-columns: 1fr; gap: .2rem; }.consent-side-panel dd { margin-bottom: .6rem; }
.consent-revoke-form { display: grid; gap: .7rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.button-danger-soft, form button.button-danger-soft[type="submit"] { color: var(--red-600); border-color: #e9c6c3; background: var(--red-100); box-shadow: none; }
.button-danger-soft:hover, form button.button-danger-soft[type="submit"]:hover { color: #8f3935; background: #f5d9d6; box-shadow: none; }
.consent-boundary-note { margin: 1rem 0 0; padding-top: .85rem; border-top: 1px solid var(--line); color: var(--ink-500); font-size: .63rem; }
.consent-selection-empty { display: grid; min-height: 230px; margin-bottom: 1rem; place-content: center; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); color: var(--ink-700); background: var(--surface); text-align: center; }.consent-selection-empty span { margin-top: .2rem; color: var(--ink-500); font-size: .68rem; }
.consent-history-panel { margin-top: 1rem; }
.profile-consent-list { display: grid; gap: .15rem; margin: 0; padding: 0; list-style: none; }.profile-consent-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .7rem; }.profile-consent-list li:last-child { border-bottom: 0; }

/* Contacts and suppression */
.restriction-alert, .privacy-warning { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; padding: .85rem 1rem; border: 1px solid #e8c6c3; border-radius: .8rem; color: #873b37; background: var(--red-100); }
.restriction-alert-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: #fff; background: var(--red-600); font-size: 1rem; font-weight: 800; }
.restriction-alert > div, .privacy-warning { display: grid; }.restriction-alert strong, .privacy-warning strong { font-size: .76rem; }.restriction-alert span:not(.restriction-alert-icon), .privacy-warning span { color: #8d5a57; font-size: .67rem; }
.privacy-warning { align-items: start; border-color: #ead6b5; color: #76531d; background: #fff8eb; }.privacy-warning span { color: #896f49; }
.contact-policy-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .65rem; margin-bottom: 1rem; }
.contact-policy-item { display: grid; padding: .72rem .8rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface); box-shadow: var(--shadow-xs); }
.contact-policy-item span { color: var(--ink-500); font-size: .62rem; }.contact-policy-item strong { margin-top: .15rem; color: var(--brand-700); font-size: .7rem; }
.contact-policy-item.is-blocked { border-color: #ebcecb; background: #fff9f8; }.contact-policy-item.is-blocked strong { color: var(--red-600); }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, .75fr); align-items: start; gap: 1rem; }
.contact-list-panel, .restriction-panel, .contact-form-panel, .restriction-form-panel, .reverse-form-panel, .contact-history-panel { padding: clamp(1rem, 2vw, 1.35rem); }
.contact-actions-column { position: sticky; top: 92px; }
.contact-point-list { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.contact-point-list li { display: grid; grid-template-columns: 39px 1fr auto; align-items: center; gap: .75rem; padding: .75rem; border: 1px solid var(--line); border-radius: .78rem; background: var(--surface-soft); }
.contact-type-icon { display: grid; width: 39px; height: 39px; place-items: center; border-radius: .68rem; color: var(--brand-700); background: var(--brand-100); font-size: .75rem; font-weight: 800; }
.contact-point-copy { display: grid; min-width: 0; }.contact-point-copy strong { font-size: .71rem; }.contact-point-copy span { color: var(--ink-800); font-size: .8rem; font-weight: 650; letter-spacing: .02em; }.contact-point-copy small { margin-top: .1rem; color: var(--ink-500); font-size: .6rem; }
.contact-point-actions { display: flex; align-items: center; gap: .45rem; }
.restriction-list { display: grid; gap: .65rem; }.restriction-item { display: flex; align-items: center; justify-content: space-between; gap: .9rem; padding: .8rem; border: 1px solid #ecd0cd; border-radius: .78rem; background: #fffafa; }.restriction-item h3 { margin: .35rem 0 .1rem; font-size: .82rem; }.restriction-item p { margin: 0; color: var(--ink-600); font-size: .66rem; }.restriction-item small { color: var(--ink-500); font-size: .59rem; }
.selected-contact-type { display: flex; align-items: center; justify-content: space-between; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface-soft); }.selected-contact-type span { color: var(--ink-500); font-size: .64rem; }.selected-contact-type strong { font-size: .72rem; }
.check-field, .restriction-confirmation { padding: .72rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface-soft); }.check-field label, .restriction-confirmation label { font-size: .69rem; }.restriction-confirmation { border-color: #ead7b7; background: #fffbf3; }.restriction-confirmation .helptext { padding-left: 1.45rem; }
.mfa-required-note { display: grid; margin-bottom: .85rem; padding: .7rem; border: 1px solid #d7d8eb; border-radius: .68rem; color: var(--violet-600); background: var(--violet-100); }.mfa-required-note strong { font-size: .7rem; }.mfa-required-note span { font-size: .62rem; }
.contact-history-panel { margin-top: 1rem; }
.profile-restriction { display: grid; margin-bottom: .65rem; padding: .65rem .7rem; border: 1px solid #ebcecb; border-radius: .7rem; color: var(--red-600); background: var(--red-100); }.profile-restriction strong { font-size: .7rem; }.profile-restriction span { font-size: .62rem; }
.contact-form-panel .form-actions, .reverse-form-panel .form-actions { gap: .55rem; }

/* Simplified contact workflow */
.simple-contact-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .62fr); align-items: start; gap: 1rem; }
.simple-contact-panel, .simple-contact-form-panel, .request-form-panel, .pending-request-panel, .review-request-panel { padding: clamp(1rem, 2vw, 1.35rem); }
.contact-request-column { position: sticky; top: 92px; }
.simple-contact-list { display: grid; gap: .65rem; }
.simple-contact-row { display: grid; grid-template-columns: 42px minmax(150px, 1fr) auto auto; align-items: center; gap: .8rem; padding: .85rem; border: 1px solid var(--line); border-radius: .82rem; background: var(--surface-soft); }
.simple-contact-row.is-hidden-contact { border-color: #ead5d2; background: #fffafa; }
.simple-contact-copy { display: grid; min-width: 0; }.simple-contact-copy > span { color: var(--ink-500); font-size: .62rem; }.simple-contact-copy > strong { overflow: hidden; color: var(--ink-900); font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }.simple-contact-copy > small { color: var(--ink-500); font-size: .59rem; }
.hidden-contact-value { color: var(--red-600) !important; letter-spacing: .01em; }
.simple-contact-state { display: grid; justify-items: end; gap: .18rem; }.simple-contact-state small { color: var(--red-600); font-size: .56rem; }
.simple-contact-actions { display: flex; align-items: center; justify-content: flex-end; gap: .4rem; }
.pending-chip { display: inline-flex; padding: .26rem .5rem; border-radius: 999px; color: #7c5b26; background: var(--gold-100); font-size: .59rem; font-weight: 700; white-space: nowrap; }
.compact-contact-form-panel { margin-bottom: 1rem; }
.contact-data-form { max-width: none; }
.contact-form-table { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.55fr) minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1.2fr); overflow: hidden; border: 1px solid var(--line-strong); border-radius: .78rem; background: var(--surface-soft); }
.contact-form-cell { display: grid; min-width: 0; align-content: start; gap: .36rem; margin: 0; padding: .72rem; border: 0; border-right: 1px solid var(--line); }
.contact-form-cell:last-child { border-right: 0; }
.contact-form-cell > label, .contact-form-label, .contact-form-cell legend { min-height: 1.8em; margin: 0; padding: 0; color: var(--ink-600); font-size: .65rem; font-weight: 700; line-height: 1.25; }
.contact-form-cell input[type="text"], .contact-form-cell select { min-height: 38px; padding: .45rem .58rem; font-size: .72rem; }
.contact-form-cell .selected-contact-type { min-height: 38px; padding: .45rem .58rem; }
.contact-form-check, .contact-form-choice-options { display: flex; min-height: 38px; align-items: center; gap: .5rem; padding: .45rem .58rem; border: 1px solid var(--line); border-radius: .58rem; background: #fff; cursor: pointer; }
.contact-form-check span, .contact-form-choice-options span { color: var(--ink-800); font-size: .69rem; font-weight: 650; }
.contact-form-choice-options { gap: .75rem; }
.contact-form-choice-options label { display: inline-flex; align-items: center; gap: .3rem; margin: 0; cursor: pointer; }
.contact-form-choice-options input, .contact-form-check input { margin: 0; }
.contact-encryption-note { margin-top: -.45rem; color: var(--ink-500); font-size: .62rem; }
.contact-form-support { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; gap: .75rem; }
.contact-entry-scroll { overflow-x: auto; border: 1px solid var(--line-strong); border-radius: .6rem; }
.contact-entry-table { min-width: 740px; background: #fff; }
.contact-entry-header, .contact-entry-row { display: grid; grid-template-columns: minmax(105px, .82fr) minmax(170px, 1.45fr) minmax(135px, 1fr) minmax(105px, .75fr) minmax(180px, 1.35fr); }
.contact-entry-header { color: var(--ink-600); background: var(--surface-soft); font-size: .6rem; font-weight: 750; letter-spacing: .01em; }
.contact-entry-header span { display: flex; min-height: 32px; align-items: center; padding: .38rem .45rem; border-right: 1px solid var(--line); }
.contact-entry-header span:last-child { border-right: 0; }
.contact-entry-row { border-top: 1px solid var(--line); }
.contact-entry-row.is-secondary { background: #fcfdfc; }
.contact-entry-cell { display: grid; min-width: 0; align-content: center; gap: .2rem; padding: .4rem .45rem; border-right: 1px solid var(--line); }
.contact-entry-cell:last-child { border-right: 0; }
.contact-entry-cell input[type="text"], .contact-entry-cell select { min-height: 32px; padding: .34rem .45rem; font-size: .68rem; }
.contact-entry-type { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }.contact-entry-type > div { display: grid; }.contact-entry-type strong { font-size: .72rem; }.contact-entry-type small { color: var(--ink-500); font-size: .56rem; }
.contact-row-remove { min-height: 0; padding: .24rem .4rem; border: 0; border-radius: .42rem; color: var(--red-600); background: var(--red-100); font-size: .57rem; font-weight: 700; cursor: pointer; }
.contact-primary-toggle { display: inline-flex; min-height: 36px; align-items: center; gap: .38rem; margin: 0; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--surface-soft); cursor: pointer; }.contact-primary-toggle input { margin: 0; }.contact-primary-toggle span { color: var(--ink-700); font-size: .66rem; font-weight: 650; }
.contact-primary-choice { display: inline-flex; width: fit-content; align-items: center; gap: .3rem; margin: 0; cursor: pointer; }.contact-primary-choice input { width: .85rem; height: .85rem; margin: 0; }.contact-primary-choice span { color: var(--ink-700); font-size: .62rem; font-weight: 650; }
.contact-entry-preference fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.contact-preference-options { display: inline-flex; overflow: hidden; width: fit-content; border: 1px solid var(--line); border-radius: .42rem; background: var(--surface-soft); }.contact-preference-options label { display: inline-flex; align-items: center; justify-content: center; gap: .2rem; min-height: 27px; margin: 0; padding: .2rem .42rem; border-left: 1px solid var(--line); cursor: pointer; }.contact-preference-options label:first-child { border-left: 0; }.contact-preference-options label:has(input:checked) { color: var(--brand-800); background: var(--brand-50); }.contact-preference-options input { width: .78rem; height: .78rem; margin: 0; }.contact-preference-options span { font-size: .61rem; font-weight: 700; }
.contact-decision-confirm { display: flex; align-items: flex-start; gap: .32rem; margin: .35rem 0 0; color: var(--ink-600); cursor: pointer; }.contact-decision-confirm input { margin: .12rem 0 0; }.contact-decision-confirm span { font-size: .58rem; font-weight: 600; line-height: 1.25; }
.contact-entry-cell .errorlist { margin: .12rem 0 0; padding-left: .95rem; font-size: .58rem; line-height: 1.3; }
.contact-row-change-reason { display: grid; grid-template-columns: auto minmax(220px, 1fr) auto; grid-column: 1 / -1; align-items: center; gap: .55rem; padding: .52rem .65rem; border-top: 1px solid #ead7b7; background: #fffbf3; }.contact-row-change-reason[hidden] { display: none; }.contact-row-change-reason label { margin: 0; color: #76531d; font-size: .63rem; font-weight: 700; }.contact-row-change-reason input { min-height: 34px; padding: .38rem .5rem; font-size: .68rem; }.contact-row-change-reason > span { color: #896f49; font-size: .57rem; }.contact-row-change-reason .errorlist { grid-column: 2 / -1; margin: 0; }
.contact-entry-row.is-protected { background: #fffafa; }
.protected-contact-value { color: var(--red-600); }.protected-contact-value strong { font-size: .69rem; }.protected-contact-value small { color: var(--ink-500); font-size: .56rem; }
.protected-contact-decision span { display: inline-flex; width: fit-content; padding: .26rem .48rem; border-radius: 999px; color: var(--red-600); background: var(--red-100); font-size: .6rem; font-weight: 700; }
.contact-batch-actions { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-top: .85rem; }
.contact-add-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .42rem; }.contact-add-actions > span { margin-right: .15rem; color: var(--ink-500); font-size: .63rem; font-weight: 650; }.contact-add-actions .button { min-height: 32px; padding: .34rem .55rem; font-size: .62rem; }
.contact-batch-submit { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; }.contact-batch-submit span { max-width: 230px; color: var(--ink-500); font-size: .59rem; text-align: right; }.contact-batch-submit button { white-space: nowrap; }
.request-explanation { display: grid; margin-bottom: .85rem; padding: .7rem; border: 1px solid #d6e4df; border-radius: .68rem; color: var(--brand-800); background: var(--brand-50); }.request-explanation strong { font-size: .7rem; }.request-explanation span { font-size: .62rem; }
.pending-request-list { display: grid; gap: .55rem; }.pending-request-list article { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .65rem; border: 1px solid var(--line); border-radius: .68rem; background: var(--surface-soft); }.pending-request-list article > div { display: grid; }.pending-request-list strong { font-size: .69rem; }.pending-request-list span, .pending-request-list small { color: var(--ink-500); font-size: .59rem; }.pending-request-list .app-modal span { color: inherit; font-size: inherit; }
.review-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.contact-modal-form { max-width: none; }.modal-inline-note { margin: 1rem 1.15rem 0; }
.contact-modal-primary { width: fit-content; }
.contact-modal-choice legend { margin-bottom: .35rem; color: var(--ink-600); font-size: .68rem; font-weight: 700; }
.admin-visibility-note { display: grid; padding: .75rem; border: 1px solid #d8d7e8; border-radius: .72rem; color: var(--violet-600); background: var(--violet-100); }.admin-visibility-note strong { font-size: .7rem; }.admin-visibility-note span { font-size: .61rem; }

/* Public / login shell */
.public-body { min-height: 100vh; background: #edf2ef; }
.public-shell { display: flex; min-height: 100vh; flex-direction: column; background: radial-gradient(circle at 8% 92%, rgb(43 128 109 / 12%), transparent 26%), radial-gradient(circle at 91% 8%, rgb(208 152 62 / 9%), transparent 25%), #f3f6f4; }
.public-header { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 1rem; width: min(1180px, calc(100% - 2rem)); margin: 0 auto; }
.brand-lockup-dark { color: var(--brand-950); }
.brand-lockup-dark small { color: var(--ink-500); }
.brand-lockup-dark .brand-mark { color: #bd8a3d; border-color: #dce5e1; background: #fff; }
.public-security { display: flex; align-items: center; gap: .5rem; color: var(--ink-600); font-size: .67rem; }
.public-security > span { width: 6px; height: 6px; }
.public-content { width: min(1180px, calc(100% - 2rem)); flex: 1 0 auto; margin: 0 auto; padding: clamp(1.5rem, 5vw, 5rem) 0 4rem; }
.public-content.login-content { display: grid; min-height: auto; width: 100%; place-content: center; justify-items: center; padding: 2rem; }
.login-content > .messages { width: 100%; max-width: 360px; }
.login-card { width: 100%; max-width: 360px; padding: clamp(1.5rem, 4vw, 2.4rem); border: 1px solid rgb(255 255 255 / 75%); border-radius: 1.25rem; background: rgb(255 255 255 / 90%); box-shadow: var(--shadow-lg); backdrop-filter: blur(18px); }
.login-card-heading { margin-bottom: 1.35rem; }.login-card-heading h1 { margin: 0; font-size: 1.75rem; }
.form-alert { display: grid; margin-bottom: 1rem; color: var(--red-600); border-color: #efcecb; background: var(--red-100); }.form-alert strong { font-size: .73rem; }.form-alert span { font-size: .66rem; }
.login-form { display: grid; gap: 1rem; }.field-group { display: grid; }.label-row { display: flex; align-items: center; justify-content: space-between; }.label-row span { color: var(--ink-500); font-size: .6rem; }
.login-form input { min-height: 47px; background: #fbfcfb; }
.login-form .button { margin-top: .25rem; }
.mfa-content { min-height: 100vh; }
.mfa-card { max-width: 430px; }
.mfa-card-wide { max-width: 780px; }
.mfa-card-heading { margin-bottom: 1.3rem; }
.mfa-card-heading .eyebrow { display: block; margin-bottom: .45rem; color: var(--brand-600); }
.mfa-card-heading h1 { margin: 0; font-size: clamp(1.65rem, 4vw, 2rem); }
.mfa-card-heading p { margin: .55rem 0 0; color: var(--ink-600); font-size: .78rem; }
.mfa-form { display: grid; gap: 1rem; }
.mfa-form .button { margin-top: .15rem; }
.mfa-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.15rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.mfa-card-footer > a { font-size: .69rem; font-weight: 680; }
.mfa-security-note { display: inline-flex; align-items: center; gap: .42rem; color: var(--ink-500); font-size: .63rem; white-space: nowrap; }
.mfa-security-note > span { width: 6px; height: 6px; border-radius: 50%; background: #58bd8e; box-shadow: 0 0 0 4px rgb(88 189 142 / 12%); }
.mfa-setup-steps { display: grid; gap: .65rem; margin: 0 0 1.25rem; padding-left: 1.25rem; color: var(--ink-700); font-size: .75rem; }
.mfa-enroll-grid { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(240px, .8fr); gap: 1.25rem; }
.mfa-qr-panel, .mfa-confirm-form { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--surface-soft); }
.mfa-qr-panel { text-align: center; }
.mfa-qr-panel h2, .mfa-confirm-form h2 { margin-bottom: .85rem; }
.mfa-qr-panel img { display: block; width: min(260px, 100%); height: auto; margin: 0 auto .8rem; border-radius: .65rem; background: #fff; }
.mfa-qr-panel p { margin: .55rem 0; color: var(--ink-600); font-size: .69rem; }
.mfa-manual-secret { display: block; padding: .6rem; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: .55rem; background: #fff; font-size: .72rem; letter-spacing: .04em; }
.mfa-confirm-form { display: flex; flex-direction: column; justify-content: center; }
.mfa-confirm-form .field-group { margin-bottom: 1rem; }
.mfa-recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin-bottom: 1rem; }
.mfa-recovery-codes code { padding: .65rem .75rem; border: 1px solid var(--line); border-radius: .55rem; color: var(--ink-800); background: var(--surface-soft); font-size: .78rem; text-align: center; }
.mfa-recovery-note { margin: 0 0 1.1rem; color: var(--ink-600); font-size: .7rem; text-align: center; }


/* Guide center */
.guide-heading p { max-width: 720px; }
.guide-recommended-panel { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding: 1.1rem 1.2rem; border-color: #cfe1dc; background: linear-gradient(135deg, #ffffff, #f5fbf8); }
.guide-recommended-panel h2 { margin: .15rem 0 .25rem; }
.guide-recommended-panel p { max-width: 680px; margin: 0; color: var(--ink-600); font-size: .75rem; }
.guide-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.guide-card { position: relative; display: grid; min-height: 168px; align-content: start; gap: .45rem; padding: 1rem; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--ink-800); background: var(--surface); box-shadow: var(--shadow-xs); text-decoration: none; }
.guide-card:hover { color: var(--brand-800); border-color: #bdd7ce; background: #fcfefd; }
.guide-card.is-recommended { border-color: var(--brand-500); box-shadow: 0 0 0 2px rgb(58 154 131 / 10%); }
.guide-card-meta { color: var(--brand-600); font-size: .62rem; font-weight: 750; letter-spacing: .01em; text-transform: uppercase; }
.guide-card strong { color: var(--ink-900); font-size: 1rem; }
.guide-card span:not(.guide-card-meta) { color: var(--ink-600); font-size: .72rem; line-height: 1.45; }
.guide-card b { position: absolute; right: 1rem; bottom: .85rem; color: var(--brand-600); font-size: 1.15rem; }
.guide-breadcrumb { display: flex; align-items: center; gap: .4rem; margin-bottom: .8rem; color: var(--ink-500); font-size: .68rem; font-weight: 650; }
.guide-breadcrumb a { color: var(--brand-700); text-decoration: none; }
.guide-layout { display: grid; grid-template-columns: minmax(220px, 270px) minmax(0, 1fr); align-items: start; gap: 1rem; }
.guide-nav-panel { position: sticky; top: 92px; padding: .9rem; }
.guide-nav-panel .nav-section-label { margin: 0 0 .45rem; color: var(--ink-500); }
.guide-doc-nav { display: grid; gap: .35rem; }
.guide-doc-nav a { display: grid; gap: .16rem; padding: .58rem .65rem; border: 1px solid transparent; border-radius: .6rem; color: var(--ink-700); text-decoration: none; }
.guide-doc-nav a:hover { color: var(--brand-800); background: var(--brand-50); }
.guide-doc-nav a.is-active { border-color: #bdd7ce; color: var(--ink-900); background: #fff; box-shadow: var(--shadow-xs); }
.guide-doc-nav strong { font-size: .7rem; }
.guide-doc-nav span { color: var(--ink-500); font-size: .58rem; font-weight: 650; }
.guide-document { padding: clamp(1.1rem, 2.4vw, 1.65rem); }
.guide-prose { max-width: 860px; color: var(--ink-800); font-size: .82rem; line-height: 1.65; }
.guide-prose h1, .guide-prose h2, .guide-prose h3, .guide-prose h4 { color: var(--ink-950); line-height: 1.2; }
.guide-prose h1 { margin: 0 0 1rem; font-size: 1.45rem; }
.guide-prose h2 { margin: 1.35rem 0 .65rem; padding-top: .2rem; font-size: 1.05rem; }
.guide-prose h3 { margin: 1.05rem 0 .45rem; font-size: .9rem; }
.guide-prose h4 { margin: .85rem 0 .35rem; font-size: .8rem; }
.guide-prose p { margin: 0 0 .82rem; color: var(--ink-700); }
.guide-prose ul, .guide-prose ol { margin: 0 0 1rem; padding-left: 1.25rem; color: var(--ink-700); }
.guide-prose li + li { margin-top: .35rem; }
.guide-prose ol > li { padding-left: .15rem; }
.guide-prose ol > li > p { margin-bottom: .35rem; }
.guide-prose ol > li > p:first-child strong { color: var(--ink-900); }
.guide-prose code { padding: .08rem .25rem; border: 1px solid var(--line); border-radius: .3rem; background: var(--surface-soft); font-size: .74em; }
.guide-table-wrap { max-width: 100%; margin: 0 0 1rem; overflow-x: auto; border: 1px solid var(--line); border-radius: .72rem; background: #fff; }
.guide-table { width: 100%; min-width: 520px; border-collapse: collapse; }
.guide-table th, .guide-table td { padding: .58rem .68rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: .7rem; }
.guide-table th { color: var(--ink-700); background: var(--surface-soft); font-weight: 760; }
.guide-table tr:last-child td { border-bottom: 0; }

/* Responsive */

/* Internal administration */
.admin-overview-grid, .role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.admin-overview-card { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: .8rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--ink-800); background: var(--surface); box-shadow: var(--shadow-xs); text-decoration: none; }
.admin-overview-card:hover { color: var(--brand-800); border-color: #bdd7ce; background: #fcfefd; }
.admin-overview-card > div { display: grid; }.admin-overview-card > div > span, .admin-overview-card small { color: var(--ink-500); font-size: .64rem; }.admin-overview-card strong { margin: .12rem 0; color: var(--ink-900); font-size: 1.45rem; letter-spacing: -.045em; }.admin-overview-card > b { color: var(--brand-600); font-size: 1.15rem; }
.admin-next-panel { margin-top: 1rem; }.admin-next-panel p { margin-bottom: 0; color: var(--ink-600); font-size: .76rem; }
.admin-tabs { display: flex; gap: .25rem; margin: 0 0 1rem; padding: .25rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface-soft); }.admin-tabs a { padding: .46rem .66rem; border-radius: .48rem; color: var(--ink-600); font-size: .7rem; font-weight: 650; text-decoration: none; }.admin-tabs a:hover { color: var(--brand-800); }.admin-tabs a.is-active { color: var(--ink-900); background: #fff; box-shadow: var(--shadow-xs); }
.admin-form-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); align-items: start; gap: 1rem; }.admin-form-card, .admin-side-card, .team-members-card { padding: clamp(1rem, 2vw, 1.35rem); }.admin-side-card h2 { margin-top: .18rem; }.admin-mini-row { display: grid; gap: .14rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }.admin-mini-row:last-of-type { border-bottom: 0; }.admin-mini-row strong { font-size: .7rem; }.admin-mini-row span { color: var(--ink-500); font-size: .61rem; }
.admin-role-fieldset { min-width: 0; margin: 0; padding: .85rem; border: 1px solid var(--line); border-radius: .78rem; background: var(--surface-soft); }.admin-role-fieldset legend { padding: 0 .35rem; color: var(--ink-800); font-size: .72rem; font-weight: 680; }.role-choice-list ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin: 0; padding: 0; list-style: none; }.role-choice-list li { padding: .52rem .58rem; border: 1px solid var(--line); border-radius: .58rem; background: #fff; font-size: .7rem; }.role-choice-list input { margin: 0 .4rem 0 0; }
.role-card { padding: 1.1rem; }.role-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }.role-card h2 { margin: .1rem 0 0; }.role-card ul { display: grid; gap: .43rem; margin: 1rem 0 0; padding: 0; list-style: none; }.role-card li { padding-left: .85rem; color: var(--ink-700); font-size: .68rem; }.role-card li::before { margin-left: -.85rem; color: var(--brand-600); content: "• "; }
.team-members-card { margin-top: 1rem; }.team-members-card form { margin: 0; }.team-members-card .button { min-height: 30px; padding: .3rem .55rem; font-size: .64rem; }
@media (max-width: 1220px) {
.profile-variables-form { gap: 1rem; }.profile-variable-section { min-width: 0; margin: 0; padding: .9rem; border: 1px solid var(--line); border-radius: .78rem; background: var(--surface-soft); }.profile-variable-section legend { padding: 0 .35rem; color: var(--ink-800); font-size: .76rem; font-weight: 700; }.profile-variable-section > p { margin: -.1rem 0 .75rem; color: var(--ink-500); font-size: .67rem; }
.profile-section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }.profile-section-card { padding: 1.1rem; }.profile-section-card header, .profile-section-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }.profile-section-card h2 { margin: .12rem 0 0; }.profile-section-card p { min-height: 2.4em; margin: .9rem 0; color: var(--ink-600); font-size: .72rem; }.profile-section-meta { align-items: center; padding-top: .75rem; border-top: 1px solid var(--line); color: var(--ink-500); font-size: .65rem; }.profile-section-meta a { font-size: .68rem; font-weight: 700; }
.empty-profile-config { display: grid; min-height: 150px; grid-column: 1 / -1; place-content: center; text-align: center; }.empty-profile-config strong { font-size: .8rem; }.empty-profile-config span { max-width: 430px; margin-top: .28rem; color: var(--ink-500); font-size: .7rem; }
.profile-variable-list-card { margin-top: 1rem; padding: clamp(1rem, 2vw, 1.35rem); }.profile-options-field { padding: .8rem; border: 1px solid #d8e4df; border-radius: .75rem; background: var(--brand-50); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-panel, .territory-panel { grid-column: span 7; }
  .distribution-panel, .task-panel { grid-column: span 5; }
  .logout-button span { display: none; }
}

@media (min-width: 981px) {
  body.sidebar-minimized .sidebar { width: var(--sidebar-collapsed-width); }
  body.sidebar-minimized .main-shell { margin-left: var(--sidebar-collapsed-width); }
  body.sidebar-minimized .sidebar-brand { min-height: 76px; padding: 0 0 0 1.1rem; }
  body.sidebar-minimized .sidebar-minimize-toggle svg { transform: rotate(180deg); }
  body.sidebar-minimized .brand-lockup,
  body.sidebar-minimized .campaign-context,
  body.sidebar-minimized .sidebar-footer,
  body.sidebar-minimized .nav-section-label { display: none; }
  body.sidebar-minimized .sidebar-nav { gap: .35rem; padding: .75rem .65rem 1.5rem; overflow-x: hidden; }
  body.sidebar-minimized .nav-item { grid-template-columns: 1fr; width: 44px; min-height: 44px; justify-self: center; place-items: center; padding: 0; border-radius: .75rem; }
  body.sidebar-minimized .nav-item > span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  body.sidebar-minimized .nav-item small { display: none; }
  body.sidebar-minimized .nav-count-badge { position: absolute; top: 1px; right: 1px; min-width: 17px; height: 17px; padding: 0 .25rem; font-size: .55rem; }
}

@media (max-width: 980px) {
  .sidebar { transform: translateX(-102%); transition: transform .22s ease; }
  .sidebar-open .sidebar { transform: translateX(0); }
  .main-shell { margin-left: 0; }
  .menu-toggle, .sidebar-close { display: inline-grid; }
  .sidebar-minimize-toggle { display: none; }
  .sidebar-close { color: #c5d4d0; border-color: rgb(255 255 255 / 10%); background: rgb(255 255 255 / 5%); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 35; width: 100%; height: 100%; border: 0; background: rgb(9 28 25 / 46%); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .sidebar-open .sidebar-scrim { display: block; opacity: 1; pointer-events: auto; }
  .chart-panel, .distribution-panel, .territory-panel, .task-panel { grid-column: 1 / -1; }
  .residence-layout { grid-template-columns: 1fr; }
  .operational-map-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .consent-purpose-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .consent-workspace { grid-template-columns: 1fr; }.consent-side-panel { position: static; }
  .contact-policy-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .contact-layout { grid-template-columns: 1fr; }.contact-actions-column { position: static; }
  .simple-contact-layout { grid-template-columns: 1fr; }.contact-request-column { position: static; }
  .contact-form-table { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-form-cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .contact-form-cell:nth-child(2n) { border-right: 0; }
  .contact-form-cell:last-child { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
}

@media (max-width: 760px) {
  .topbar { min-height: 66px; padding: .6rem .8rem; }
  .topbar-context { display: none; }
  .user-copy { display: none; }
  .user-menu-summary { padding-left: 0; }
  .page-content { padding: 1rem; }
  .site-footer { min-height: auto; flex-direction: column; gap: .08rem; padding: .45rem 1rem; }
  .page-heading, .toolbar { align-items: flex-start; flex-direction: column; gap: .9rem; }
  .heading-actions { width: 100%; }.heading-actions .button { flex: 1; }
  .demo-banner { align-items: flex-start; }.demo-banner > div { display: grid; gap: .1rem; }.demo-label { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .metric-card { padding: .9rem; }.metric-value { font-size: 1.55rem; }
  .panel { padding: 1rem; }.panel-header { gap: .55rem; }.segmented-control { display: none; }
  .line-chart { height: 235px; }.line-chart > svg { height: 194px; }
  .territory-map { height: 285px; }.map-labels { display: none; }
  .territory-readiness-grid { grid-template-columns: 1fr; }
  .search-grid { grid-template-columns: 1fr; }
  .basic-search-grid { grid-template-columns: 1fr; }
  .advanced-search-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .list-summary-card { align-items: flex-start; flex-direction: column; }
  .datatable-footer-controls { align-items: flex-start; flex-direction: column; }
  .assignment-inline-form { grid-template-columns: 1fr; }
  .assignment-table-controls { align-items: flex-start; flex-direction: column-reverse; gap: .5rem; }
  .portfolio-filter-grid { grid-template-columns: 1fr; }
  .task-quick-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-filter-grid { grid-template-columns: 1fr; }
  .datatable-page-size-form { flex-wrap: wrap; }
  dl { grid-template-columns: 1fr; gap: .25rem; } dd { margin-bottom: .55rem; }
  .public-header { min-height: 68px; }.public-security { display: none; }
  .public-content { padding-top: 1.2rem; }
  .public-content.login-content.mfa-content { padding: 1rem; }
  .mfa-enroll-grid { grid-template-columns: 1fr; }
  .operational-map-layout { grid-template-columns: 1fr; min-height: 0; }
  .map-sidebar-panel { display: grid; grid-template-columns: minmax(150px, .8fr) 1fr; gap: .75rem; }
  .map-stat, .map-layer-group { min-width: 0; }.map-layer-group { padding: .2rem; border: 0; }
  .map-operational-legend { display: none; }
  .map-stage { min-height: 520px; }
  .consent-purpose-grid { grid-template-columns: 1fr; }
  .contact-policy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-point-list li { grid-template-columns: 36px 1fr; }.contact-point-actions { grid-column: 2; justify-content: flex-start; }
  .simple-contact-row { grid-template-columns: 38px 1fr auto; }.simple-contact-actions { grid-column: 2 / -1; justify-content: flex-start; }.simple-contact-state { justify-items: end; }
  .contact-entry-scroll { overflow: visible; border: 0; border-radius: 0; }
  .contact-entry-table { min-width: 0; background: transparent; }
  .contact-entry-header { display: none; }
  .contact-entry-row { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: .65rem; overflow: hidden; border: 1px solid var(--line-strong); border-radius: .72rem; background: #fff; }
  .contact-entry-cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .contact-entry-cell::before { color: var(--ink-500); content: attr(data-label); font-size: .58rem; font-weight: 700; }
  .contact-entry-type, .contact-entry-preference { grid-column: 1 / -1; }
  .contact-entry-type::before { display: none; }
  .contact-entry-cell:nth-child(2n) { border-right: 0; }
  .contact-entry-preference { border-right: 0; border-bottom: 0; }
  .contact-row-change-reason { grid-template-columns: 1fr; }.contact-row-change-reason .errorlist { grid-column: auto; }
  .contact-batch-actions { align-items: stretch; flex-direction: column; }
  .contact-batch-submit { justify-content: space-between; }.contact-batch-submit span { text-align: left; }
}

@media (max-width: 500px) {
  .mfa-card { padding: 1.35rem; }
  .mfa-card-footer { align-items: flex-start; flex-direction: column; }
  .mfa-recovery-codes { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr; }
  .dashboard-heading h1 { font-size: 1.8rem; }
  .metric-card { min-height: 145px; }
  .chart-legend { flex-wrap: wrap; }
  .chart-x-labels span:nth-child(even) { display: none; }
  .weekly-bars { grid-template-columns: repeat(4, minmax(0, 1fr)); height: auto; }
  .weekly-bar-track { height: 130px; }
  .territory-map { height: 245px; }
  .map-legend { left: .6rem; right: auto; }
  .activity-panel { padding-right: .75rem; padding-left: .75rem; }
  .form-grid-two, .coordinate-grid { grid-template-columns: 1fr; }
  .advanced-search-grid { grid-template-columns: 1fr; }
  .advanced-search-actions { align-items: stretch; flex-direction: column; }
  .location-editor-map { height: 320px; }
  .operational-map-layout { gap: .75rem; }
  .map-sidebar-panel { grid-template-columns: 1fr; }
  .map-stage { min-height: 440px; }
  .map-page-heading .heading-actions { width: 100%; }
  .consent-choice-actions { grid-template-columns: 1fr; }
  .contact-policy-grid { grid-template-columns: 1fr; }
  .simple-contact-row { grid-template-columns: 36px 1fr; }.simple-contact-state, .simple-contact-actions { grid-column: 2; justify-items: start; justify-content: flex-start; }.contact-choice-options, .review-actions { grid-template-columns: 1fr; }
  .contact-form-table { grid-template-columns: 1fr; }
  .contact-form-cell, .contact-form-cell:nth-child(2n), .contact-form-cell:last-child { grid-column: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .contact-form-cell:last-child { border-bottom: 0; }
  .contact-form-support { grid-template-columns: 1fr; }
  .contact-entry-row { grid-template-columns: 1fr; }
  .contact-entry-type, .contact-entry-preference { grid-column: auto; }
  .contact-entry-cell, .contact-entry-cell:nth-child(2n) { border-right: 0; }
  .consent-notice-meta { align-items: flex-start; flex-direction: column; gap: .15rem; }.consent-notice-meta small { margin-left: 0; }
}


@media (max-width: 980px) {
  .guide-layout { grid-template-columns: 1fr; }
  .guide-nav-panel { position: static; }
  .guide-doc-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .guide-recommended-panel { align-items: stretch; flex-direction: column; }
  .guide-card-grid { grid-template-columns: 1fr; }
  .guide-doc-nav { grid-template-columns: 1fr; }
  .guide-document { padding: 1rem; }
  .guide-prose { font-size: .78rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  .sidebar, .topbar, .heading-actions, .demo-banner, .site-footer { display: none !important; }
  .main-shell { margin: 0; }.page-content { width: 100%; padding: 0; }.panel, .metric-card { break-inside: avoid; box-shadow: none; }
}


/* Voter profile detail */
.voter-profile-page {
  display: grid;
  gap: 1rem;
}

.voter-profile-page h1,
.voter-profile-page h2,
.voter-profile-page h3 {
  letter-spacing: 0;
}

.voter-profile-hero,
.voter-profile-sheet,
.voter-profile-operations {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow-xs);
}

.voter-profile-hero {
  position: relative;
  display: grid;
  gap: 1.15rem;
  padding: clamp(1rem, 2.4vw, 1.55rem);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(249, 251, 249, .96)),
    linear-gradient(135deg, rgba(58, 154, 131, .08), rgba(57, 121, 166, .06));
}

.voter-profile-toolbar,
.profile-action-row,
.voter-profile-title-line,
.voter-profile-meta,
.profile-sheet-header,
.profile-section-title,
.compact-title h2 {
  display: flex;
  align-items: center;
}

.voter-profile-toolbar {
  justify-content: space-between;
  gap: 1rem;
}

.profile-back-link,
.text-link {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  color: var(--ink-600);
  font-size: .7rem;
  font-weight: 700;
  text-decoration: none;
}

.profile-back-link:hover,
.text-link:hover {
  color: var(--brand-800);
}

.profile-back-link svg,
.text-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.profile-action-row {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .55rem;
}

.profile-toolbar-actions { display: block; }
.profile-pending-review { position: absolute; top: 5.15rem; right: clamp(1rem, 2.4vw, 1.55rem); display: grid; width: 230px; min-height: 76px; padding: .65rem .75rem; grid-template-columns: auto minmax(0, 1fr); align-content: center; align-items: center; gap: .22rem .55rem; border: 1px solid #efd7aa; border-radius: .65rem; color: #72501b; background: #fff8e9; font-size: .7rem; line-height: 1.35; text-decoration: none; }
.profile-pending-review:hover { border-color: #ddb767; color: #52380f; background: #fff3d8; }
.profile-pending-review > span:last-child { grid-column: 2; text-decoration: underline; text-underline-offset: 2px; }
.voter-profile-hero.has-pending-review .voter-profile-identity-row { padding-right: 250px; }

.profile-action-row .button {
  min-height: 39px;
  min-width: 0;
  padding: .5rem .78rem;
  border-radius: .55rem;
  font-size: .72rem;
}

.voter-profile-identity-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
}

.voter-profile-avatar {
  display: grid;
  width: 88px;
  height: 88px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 32% 20%, rgba(255, 255, 255, .18), transparent 36%),
    linear-gradient(145deg, var(--brand-500), var(--brand-950));
  box-shadow: 0 14px 36px rgba(16, 59, 53, .18);
  font-size: 1.5rem;
  font-weight: 780;
  text-transform: uppercase;
}

.voter-profile-heading {
  min-width: 0;
}

.voter-profile-title-line {
  flex-wrap: wrap;
  gap: .55rem .75rem;
}

.voter-profile-title-line h1 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}

.voter-profile-meta {
  flex-wrap: wrap;
  gap: .35rem .8rem;
  margin-top: .42rem;
  color: var(--ink-600);
  font-size: .72rem;
}

.voter-profile-meta span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.voter-profile-meta span + span::before {
  width: 4px;
  height: 4px;
  margin-right: .8rem;
  border-radius: 50%;
  background: var(--line-strong);
  content: "";
}

.profile-meta-alert {
  color: var(--red-600);
  font-weight: 760;
}

.profile-meta-alert::before {
  background: var(--red-600) !important;
}

.voter-signal-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: var(--surface-soft);
}

.voter-signal-strip article {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: .18rem .65rem;
  min-width: 0;
  padding: .78rem .85rem;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .72);
}

.voter-signal-strip article:last-child {
  border-right: 0;
}

.voter-signal-strip span:not(.signal-icon) {
  overflow: hidden;
  color: var(--ink-500);
  font-size: .62rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voter-signal-strip strong {
  grid-column: 2;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink-950);
  font-size: .9rem;
  line-height: 1.2;
}

.signal-icon,
.summary-icon {
  display: grid;
  place-items: center;
  color: var(--brand-700);
  background: var(--brand-50);
}

.signal-icon {
  width: 35px;
  height: 35px;
  border-radius: .65rem;
}

.signal-icon svg,
.summary-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.signal-amber {
  color: var(--gold-600);
  background: var(--gold-100);
}

.signal-blue {
  color: var(--blue-600);
  background: var(--blue-100);
}

.voter-profile-tabs {
  display: flex;
  gap: 1.35rem;
  min-width: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.voter-profile-tabs::-webkit-scrollbar {
  display: none;
}

.voter-profile-tabs button {
  flex: 0 0 auto;
  padding: .2rem 0 .68rem;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--ink-600);
  background: transparent;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
}

.voter-profile-tabs button:hover,
.voter-profile-tabs button.is-active {
  color: var(--brand-800);
  border-bottom-color: var(--brand-700);
}

.voter-profile-sheet {
  overflow: hidden;
}

.voter-tab-panel[hidden] {
  display: none;
}

.voter-panel-body {
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.25rem);
}

.summary-link-button {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  color: var(--brand-700);
  background: transparent;
  cursor: pointer;
  font-size: .66rem;
  font-weight: 760;
  text-decoration: none;
}

.summary-link-button:hover {
  color: var(--brand-900);
  text-decoration: underline;
}

.profile-sheet-header,
.profile-section-title {
  justify-content: space-between;
  gap: 1rem;
}

.profile-sheet-header {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(249, 251, 249, .78), rgba(255, 255, 255, .88));
}

.profile-sheet-header h2,
.profile-section-title h2 {
  margin: .12rem 0 0;
}

.voter-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-block {
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.25rem);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.summary-block:nth-child(2n) {
  border-right: 0;
}

.summary-block:nth-child(n + 3) {
  border-bottom: 0;
}

.summary-block header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: .72rem;
  margin-bottom: .95rem;
}

.summary-block header > div {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: .7rem;
}

.summary-block h3 {
  margin: .12rem 0 0;
  font-size: .95rem;
}

.summary-block header a {
  flex: 0 0 auto;
  color: var(--brand-700);
  font-size: .66rem;
  font-weight: 760;
  text-decoration: none;
}

.summary-block header a:hover {
  color: var(--brand-900);
  text-decoration: underline;
}

.summary-icon {
  width: 38px;
  height: 38px;
  border-radius: .7rem;
}

.compact-data-list {
  grid-template-columns: minmax(118px, .78fr) minmax(0, 1fr);
  gap: .54rem .85rem;
}

.compact-data-list dt {
  min-width: 0;
  font-size: .69rem;
}

.compact-data-list dd {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: .72rem;
}

.voter-profile-operations {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, .78fr);
  align-items: stretch;
  overflow: hidden;
}

.operations-main,
.rail-section {
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.25rem);
}

.operations-rail {
  display: grid;
  align-content: start;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(249, 250, 248, .62), rgba(255, 255, 255, .9));
}

.rail-section {
  border-bottom: 1px solid var(--line);
}

.rail-section:last-child {
  border-bottom: 0;
}

.profile-section-title {
  margin-bottom: .85rem;
}

.compact-title {
  margin-bottom: .7rem;
}

.compact-title h2 {
  flex-wrap: wrap;
  gap: .45rem;
  font-size: .98rem;
}

.compact-title h2 span {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  color: var(--ink-700);
  background: #eef1ef;
  font-size: .65rem;
}

.profile-timeline {
  display: grid;
}

.profile-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: .72rem;
  padding: .78rem 0;
}

.profile-timeline-item:first-child {
  padding-top: .15rem;
}

.profile-timeline-item:not(:last-child)::before {
  position: absolute;
  top: 1.55rem;
  bottom: -.55rem;
  left: 5px;
  width: 1px;
  background: var(--line);
  content: "";
}

.profile-timeline-marker {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: .32rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #b8c4c0;
  box-shadow: 0 0 0 2px #dfe6e2;
}

.profile-timeline-marker.is-current {
  background: var(--brand-600);
  box-shadow: 0 0 0 2px var(--brand-100);
}

.profile-timeline-copy {
  min-width: 0;
}

.profile-timeline-copy .history-top {
  align-items: baseline;
}

.profile-timeline-copy .history-top strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: .77rem;
}

.profile-timeline-copy .history-top span {
  flex: 0 0 auto;
  color: var(--ink-500);
  font-size: .63rem;
  font-weight: 650;
}

.profile-timeline-copy p {
  margin: .25rem 0 0;
  color: var(--ink-700);
  font-size: .7rem;
}

.profile-timeline-copy small {
  display: block;
  margin-top: .16rem;
  color: var(--ink-500);
  font-size: .61rem;
}

.unified-task-list {
  margin-top: 0;
}

.unified-task-list li {
  grid-template-columns: 21px minmax(0, 1fr) auto;
  padding: .68rem 0;
}

.unified-list li {
  min-width: 0;
}

.unified-list li > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}


.communication-panel-body {
  background: linear-gradient(180deg, rgba(249, 250, 248, .5), rgba(255, 255, 255, .95));
}

.communication-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: 1rem;
  align-items: start;
}

.communication-section {
  display: grid;
  gap: .85rem;
  min-width: 0;
}

.communication-card {
  display: grid;
  gap: .85rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-xs);
}

.communication-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.communication-card-heading h3,
.communication-channel-card h3 {
  margin: 0;
  font-size: .95rem;
}

.communication-card-heading p,
.communication-channel-card p {
  margin: .16rem 0 0;
  color: var(--ink-500);
  font-size: .68rem;
}

.communication-preference-list,
.communication-history-list,
.message-draft-list {
  display: grid;
  gap: .55rem;
}

.communication-preference-list article,
.communication-history-list article,
.message-draft-list article {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .72rem;
  border: 1px solid var(--line);
  border-radius: .72rem;
  background: var(--surface-soft);
}

.communication-preference-list article > div,
.communication-history-list article > div,
.message-draft-list article > div {
  display: grid;
  min-width: 0;
}

.communication-preference-list strong,
.communication-history-list strong,
.message-draft-list strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: .74rem;
}

.communication-preference-list span:not(.badge),
.communication-history-list span:not(.badge),
.message-draft-list span:not(.badge),
.communication-preference-list small,
.communication-history-list small,
.message-draft-list small,
.message-list-title {
  color: var(--ink-500);
  font-size: .62rem;
}

.message-list-title {
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.communication-channel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}

.communication-channel-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.communication-channel-card.is-disabled {
  background: #fbfcfb;
}

.communication-channel-card.is-disabled h3,
.communication-channel-card.is-disabled p {
  color: var(--ink-500);
}

.communication-compose-form {
  max-width: none;
}

.communication-compose-form textarea {
  min-height: 190px;
  resize: vertical;
}

.email-history-subject {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow-wrap: anywhere;
  border: 0;
  color: var(--brand-800);
  background: transparent;
  cursor: pointer;
  font-size: .74rem;
  font-weight: 760;
  text-align: left;
}

.email-history-subject:hover {
  color: var(--brand-950);
  text-decoration: underline;
}

.email-history-detail {
  display: grid;
  gap: 1rem;
  padding: 1rem 1.15rem;
}

.email-history-detail dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem 1rem;
  margin: 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.email-history-detail dl > div {
  display: grid;
  gap: .12rem;
}

.email-history-detail dt {
  color: var(--ink-500);
  font-size: .6rem;
  font-weight: 700;
}

.email-history-detail dd {
  overflow-wrap: anywhere;
  font-size: .72rem;
}

.email-history-detail h3 {
  margin: .15rem 0 .65rem;
  font-size: .9rem;
}

.email-history-body {
  min-height: 120px;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  color: var(--ink-800);
  background: var(--surface-soft);
  font-size: .72rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.email-history-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 1.15rem 1.15rem;
}

.contact-preferences-modal-form {
  padding: 1rem 1.15rem 1.15rem;
}

.decision-list-full li {
  padding: .8rem 0;
}

button:disabled,
.button:disabled,
form button:disabled[type="submit"] {
  cursor: not-allowed;
  opacity: .58;
  box-shadow: none;
}

@media (max-width: 1180px) {
  .communication-layout {
    grid-template-columns: 1fr;
  }

  .voter-signal-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .voter-signal-strip article:nth-child(2n) {
    border-right: 0;
  }

  .voter-signal-strip article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .voter-profile-operations {
    grid-template-columns: 1fr;
  }

  .operations-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .rail-section {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .rail-section:last-child {
    border-right: 0;
  }
}

@media (max-width: 860px) {
  .communication-channel-grid {
    grid-template-columns: 1fr;
  }

  .communication-card-heading,
  .communication-channel-card {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .voter-profile-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-action-row {
    width: 100%;
    justify-content: flex-start;
  }

  .profile-toolbar-actions { display: grid; width: 100%; gap: .55rem; }
  .profile-pending-review { position: static; display: flex; width: auto; min-height: 0; justify-content: center; }
  .profile-pending-review > span:last-child { grid-column: auto; }
  .voter-profile-hero.has-pending-review .voter-profile-identity-row { padding-right: 0; }

  .profile-action-row .button {
    flex: 1 1 150px;
  }

  .voter-summary-grid,
  .operations-rail {
    grid-template-columns: 1fr;
  }

  .summary-block,
  .summary-block:nth-child(2n),
  .rail-section,
  .rail-section:last-child {
    border-right: 0;
  }

  .summary-block:nth-child(n + 3) {
    border-bottom: 1px solid var(--line);
  }

  .summary-block:last-child,
  .rail-section:last-child {
    border-bottom: 0;
  }

  .rail-section {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 620px) {
  .voter-profile-hero {
    padding: .9rem;
  }

  .voter-profile-identity-row {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: .78rem;
  }

  .voter-profile-avatar {
    width: 64px;
    height: 64px;
    font-size: 1.1rem;
  }

  .voter-profile-title-line h1 {
    font-size: 1.45rem;
  }

  .voter-profile-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: .18rem;
  }

  .voter-profile-meta span + span::before {
    display: none;
  }

  .voter-signal-strip {
    grid-template-columns: 1fr;
  }

  .voter-signal-strip article,
  .voter-signal-strip article:nth-child(2n) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .voter-signal-strip article:last-child {
    border-bottom: 0;
  }

  .compact-data-list {
    grid-template-columns: 1fr;
    gap: .18rem;
  }

  .compact-data-list dd {
    margin-bottom: .44rem;
  }

  .summary-block header > div,
  .profile-section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: .35rem;
  }

  .unified-task-list li {
    grid-template-columns: 21px minmax(0, 1fr);
  }

  .unified-task-list li .button {
    grid-column: 2;
    justify-self: start;
  }

  .profile-timeline-copy .history-top {
    align-items: flex-start;
    flex-direction: column;
    gap: .15rem;
  }
}

@media print {
  .voter-profile-toolbar,
  .voter-profile-tabs,
  .profile-action-row,
  .profile-pending-review {
    display: none !important;
  }
}

/* Global voter autocomplete */
.voter-search-modal { width: min(94vw, 620px); max-height: 90dvh; }
.voter-search-form { max-width: none; margin: 0; padding: 1rem 1.15rem; }
.voter-search-form label { display: block; margin-bottom: .45rem; color: var(--ink-700); font-size: .78rem; font-weight: 700; }
.voter-search-field { position: relative; }
.voter-search-field > svg { position: absolute; top: 15px; left: 13px; width: 20px; height: 20px; fill: none; stroke: var(--brand-700); stroke-width: 1.8; stroke-linecap: round; }
.voter-search-field input { width: 100%; min-height: 50px; padding: .7rem 3rem .7rem 2.7rem; font-size: .9rem; }
.voter-search-field .icon-button { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border: 0; background: transparent; }
.voter-search-status { margin: .8rem 0; color: var(--ink-600); font-size: .76rem; }
.voter-search-results { max-height: min(42dvh, 360px); margin: 0; padding: .25rem; overflow-y: auto; overscroll-behavior: contain; list-style: none; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.voter-search-results li { display: grid; gap: .2rem; padding: .8rem; border-radius: var(--radius-sm); cursor: pointer; overflow-wrap: anywhere; }
.voter-search-results li + li { border-top: 1px solid var(--line); }
.voter-search-results li:hover, .voter-search-results li[aria-selected="true"] { color: var(--brand-900); background: var(--brand-50); box-shadow: inset 3px 0 var(--brand-600); }
.voter-search-results strong { font-size: .88rem; }
.voter-search-results span { color: var(--ink-600); font-size: .72rem; }
.voter-search-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; padding: .8rem 1.15rem; border-top: 1px solid var(--line); color: var(--ink-500); font-size: .68rem; }
.voter-search-modal [hidden] { display: none !important; }

.work-area-planner { display: grid; gap: .65rem; padding: 1rem .2rem; border-bottom: 1px solid var(--line); }
.work-area-planner > button.button[aria-expanded="true"] { color: var(--brand-800); border-color: var(--brand-500); background: var(--brand-100); box-shadow: 0 3px 10px rgb(58 154 131 / 20%); }
.work-area-planner > button.button[aria-expanded="true"]:hover { color: var(--brand-900); border-color: var(--brand-600); background: #cde7df; }
.work-area-planner-body { display: grid; gap: .65rem; }
.work-area-planner-body[hidden] { display: none; }
.work-area-draw-actions { display: grid; }
.work-area-drawing-actions > div { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.work-area-draw-actions .button, .work-area-drawing-actions .button { min-width: 0; padding-right: .55rem; padding-left: .55rem; }
.work-area-drawing-actions { display: grid; gap: .5rem; }
.work-area-drawing-actions > span { color: var(--ink-600); font-size: .63rem; }
.work-area-planner form { display: grid; gap: .6rem; }
.work-area-planner .form-field { min-width: 0; }
.work-area-planner .form-field label { font-size: .62rem; }
.work-area-planner input, .work-area-planner select, .work-area-planner textarea { min-height: 34px; padding: .42rem .5rem; font-size: .66rem; }
.work-area-planner .form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.work-area-form-error { padding: .5rem; border: 1px solid #e8c6c3; border-radius: .45rem; color: var(--red-600); background: var(--red-100); font-size: .61rem; }

.work-area-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.work-area-metrics > div { display: grid; padding: .8rem 1rem; border-top: 2px solid var(--brand-600); background: var(--surface); }
.work-area-metrics span { color: var(--ink-500); font-size: .64rem; }.work-area-metrics strong { font-size: 1.4rem; }
.work-area-detail-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .55fr); gap: 1rem; align-items: start; }
.work-area-map-section { min-width: 0; }
.work-area-map-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .6rem; }
.work-area-map-toolbar .map-layer-group { display: flex; flex-wrap: wrap; padding: 0; border: 0; }
.work-area-redraw-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }.work-area-redraw-actions span { font-size: .62rem; color: var(--ink-600); }
.work-area-detail-map { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: .5rem; overflow: hidden; background: #e8efeb; }
.work-area-edit-panel { position: sticky; top: 92px; padding: 1rem; border-left: 1px solid var(--line); }
.work-area-edit-panel h2 { margin-top: 0; font-size: 1rem; }
.work-area-annul-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.work-area-content-section { margin-top: 1.5rem; }
.work-area-neighborhood-list { display: flex; flex-wrap: wrap; gap: .45rem; }.work-area-neighborhood-list span { padding: .4rem .55rem; border: 1px solid var(--line); border-radius: .35rem; font-size: .67rem; background: var(--surface); }
@media (max-width: 820px) { .work-area-detail-layout { grid-template-columns: 1fr; }.work-area-edit-panel { position: static; border-left: 0; border-top: 1px solid var(--line); }.work-area-map-toolbar { align-items: flex-start; flex-direction: column; }.work-area-detail-map { height: 440px; } }
