html, body { height: 100%; max-height: 100%; overflow: hidden; position: fixed; width: 100%; }

/* ── Geist (self-hosted, variable) ─────────────────────────────────────────── */
@font-face {
  font-family: 'Geist';
  src: url('fonts/Geist.woff2') format('woff2');
  font-weight: 100 900; font-display: swap; font-style: normal;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('fonts/GeistMono.woff2') format('woff2');
  font-weight: 100 900; font-display: swap; font-style: normal;
}

:root {
  /* Base palette — rgb(5, 30, 64) and tones */
  --navy:        #051e40;
  --navy-dark:   #030f21;
  --navy-mid:    #0a2a52;
  --navy-light:  #0f3366;
  --navy-border: #1a4a80;

  /* Primary action — cream → pale gold gradient with glow (Patriot brand) */
  --cream:        #fdfbe8;
  --cream-2:      #f4ecae;
  --cream-text:   #1a1206;
  --cream-glow:   rgba(244, 236, 174, 0.45);
  --cream-grad:   linear-gradient(180deg, #fefdf4 0%, #f4ecae 100%);

  /* Legacy --amber aliases kept so existing rules still resolve sanely */
  --amber:       var(--cream);
  --amber-bright:#ffffff;
  --amber-dim:   rgba(244,236,174,0.14);
  --amber-glow:  var(--cream-glow);

  --green:       #10b981;
  --green-dim:   #064e3b;
  --red:         #ef4444;
  --red-dim:     #7f1d1d;
  --danger-bg:   rgba(127, 29, 29, 0.28);
  --blue:        #60a5fa;
  --blue-dim:    #1e3a5f;
  --purple:      #a78bfa;
  --purple-dim:  #2e1065;

  --text-primary:   #f0f6ff;
  --text-secondary: #a8c0da;
  --text-muted:     #4a6a8a;

  --mono: 'Geist', 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --sans: 'Geist', 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--sans);
  background: var(--navy);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
}

.screen { display: none; z-index: 1; }
.screen.active {
  display: flex; flex-direction: column;
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  height: 100dvh;
  overflow: hidden;
  -webkit-overflow-scrolling: none;
  background: var(--navy);
  z-index: 1;
}
.moverlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.75); z-index: 9999;
  align-items: flex-end; justify-content: center;
}

#screen-login {
  justify-content: flex-start;
  align-items: center;
  padding: 0;
  background: var(--navy);
  position: fixed;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  height: 100%;
  height: 100dvh;
  z-index: 9000;
}
#screen-login::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5,30,64,.55) 0%, rgba(5,30,64,.82) 45%, var(--navy) 100%),
    url('backdrop.png') top center / 100% auto no-repeat;
}
.login-wrap {
  width: 100%; max-width: 420px; position: relative; z-index: 1;
  padding: 56px 26px 40px; min-height: 100%;
  display: flex; flex-direction: column;
}
.login-welcome {
  text-align: center; font-size: 19px; font-weight: 600;
  color: var(--text-primary); margin-bottom: 14px;
}
.login-logo { text-align: center; margin-bottom: 18px; }
.login-logo .patriot-logo { width: 100%; max-width: 290px; height: auto; display: block; margin: 0 auto; }
.login-tagline {
  text-align: center; font-family: var(--sans); font-size: 12px; font-weight: 600;
  color: var(--text-secondary); letter-spacing: .14em; text-transform: uppercase;
  line-height: 1.5; margin-bottom: 30px;
}
.login-forgot-wrap { text-align: center; margin-top: 18px; }
.login-forgot-link {
  font-size: 14px; font-weight: 600; color: var(--text-primary);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.login-forgot-link:hover { color: var(--cream); }
.login-foot-email a, .prof-footer-email a { color: inherit; text-decoration: none; }
.login-foot-email a:hover, .prof-footer-email a:hover { color: var(--cream); }
.login-foot { text-align: center; margin-top: 34px; }
.login-foot-label {
  font-family: var(--sans); font-size: 11px; font-weight: 600; color: var(--text-secondary);
  letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px;
}
.login-foot-email { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 28px; }
.login-foot-rb { width: 150px; height: auto; display: block; margin: 0 auto 16px; opacity: .95; }
.login-foot-promoter {
  font-size: 12px; color: var(--text-muted); line-height: 1.6; max-width: 360px; margin: 0 auto;
}
.login-logo .login-icon { width: 72px; height: auto; display: block; margin: 0 auto 14px; }
.login-logo .wordmark { font-family: var(--mono); font-size: 26px; font-weight: 600; color: #ffffff; }
.login-logo .tagline  { font-family: var(--mono); font-size: 11px; color: var(--text-muted); letter-spacing: .1em; text-transform: uppercase; margin-top: 4px; }
.adm-logo-icon { width: 20px; height: auto; vertical-align: middle; margin-right: 2px; position: relative; top: -1px; }
.login-card {
  background: rgba(10, 42, 82, 0.72);
  border: 1px solid var(--navy-border);
  border-radius: 20px; padding: 26px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}

.fg { margin-bottom: 16px; }
.fg:last-child { margin-bottom: 0; }
.fl {
  display: block; font-family: var(--sans); font-size: 11px; font-weight: 600;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 7px;
}
.fi {
  width: 100%; background: var(--navy-dark); border: 1px solid var(--navy-border);
  border-radius: 12px; padding: 15px 16px; font-family: var(--sans);
  font-size: 15px; color: var(--text-primary); outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.fi:focus { border-color: var(--cream-2); box-shadow: 0 0 0 3px rgba(244,236,174,.12); }
.fi::placeholder { color: var(--text-muted); }
.fi:disabled, .fi[readonly] { opacity: .7; cursor: not-allowed; }
select.fi { cursor: pointer; }
textarea.fi { resize: vertical; min-height: 88px; font-size: 14px; }
.fi-locked-wrap { position: relative; }
.fi-locked-wrap .fi {
  padding-right: 44px; color: var(--text-secondary);
  cursor: default; opacity: .85;
}
.fi-locked-wrap .fi:focus { border-color: var(--navy-border); box-shadow: none; }
.fi-lock-ico {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; background: var(--text-muted); pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.7' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.7' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.fhint { font-size: 11px; color: var(--text-muted); margin-top: 5px; font-family: var(--mono); }
.prof-branch-list { display: flex; flex-direction: column; gap: 8px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 16px; border: none; border-radius: 14px;
  font-family: var(--sans); font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all .15s; letter-spacing: .01em;
  -webkit-appearance: none;
}
.btn-p  {
  background: var(--cream-grad); color: var(--cream-text);
  box-shadow: none; transition: all .15s, box-shadow .15s;
}
.btn-p:hover  { filter: brightness(1.04); box-shadow: 0 0 22px var(--cream-glow); }
.btn-p:active { filter: brightness(.97); }
.btn-s  {
  background: var(--navy-light); color: var(--text-secondary);
  border: 1px solid var(--navy-border); box-shadow: none;
}
.btn-s:hover { border-color: var(--cream-2); color: var(--cream); }
.btn-d  {
  background: var(--danger-bg); color: var(--red);
  border: 1px solid rgba(239,68,68,.5); box-shadow: none;
}
.btn-d:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn-sm { padding: 9px 16px; font-size: 13px; width: auto; border-radius: 10px; }
.btn-xs { padding: 6px 12px; font-size: 12px; width: auto; border-radius: 8px; }

.topbar {
  background: var(--navy-mid); border-bottom: 1px solid var(--navy-border);
  padding: 0 16px; display: flex; align-items: center; gap: 11px;
  z-index: 100; flex-shrink: 0; height: 56px; min-height: 56px;
}
.tb-back {
  width: 36px; height: 36px; background: var(--navy-light); border: 1px solid var(--navy-border);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-secondary); font-size: 17px; transition: all .15s; flex-shrink: 0;
}
.tb-back:hover { border-color: var(--amber); color: var(--amber); }
.tb-title { flex: 1; }
.tb-title h1 { font-family: var(--mono); font-size: 11px; font-weight: 600; }
.tb-title p  { font-size: 11px; color: var(--text-muted); font-family: var(--mono); margin-top: 1px; }
.tb-action {
  height: 34px; padding: 0 13px; background: var(--navy-light); color: var(--text-secondary);
  border: 1px solid var(--navy-border); border-radius: 8px; font-family: var(--mono); font-size: 12px;
  font-weight: 600; cursor: pointer; white-space: nowrap; transition: all .15s;
}
.tb-action:hover { border-color: var(--amber); color: var(--amber); }
.tb-action.sec { background: var(--navy-light); color: var(--text-secondary); border: 1px solid var(--navy-border); }
.tb-action.sec:hover { border-color: var(--amber); color: var(--amber); }

.content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; min-height: 0; max-height: 100%; }
.content.np { padding: 0; }
.max-mobile { max-width: 480px; margin: 0 auto; }

.slabel {
  font-family: var(--sans); font-size: 12px; font-weight: 700;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: .12em;
  padding: 18px 0 10px;
}
.slabel:first-child { padding-top: 0; }
.slabel-row { display: flex; align-items: center; justify-content: space-between; }

/* Electoral-roll residents shown above Voting Intention */
.er-names-card {
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-radius: 16px; padding: 8px 16px;
}
.er-name-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; font-size: 15px; font-weight: 600; color: var(--text-primary);
  border-bottom: 1px solid var(--navy-border);
}
.er-name-row:last-child { border-bottom: none; }
.er-name-ico {
  width: 18px; height: 18px; flex-shrink: 0; background: var(--text-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.7' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.7' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.card {
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-radius: 16px; overflow: hidden; margin-bottom: 10px;
  cursor: pointer; transition: border-color .15s, transform .1s;
}
.card:hover { border-color: var(--cream-2); }
.card:active { transform: scale(.99); }
.card.nc { cursor: default; }
.card.nc:hover { border-color: var(--navy-border); }
.cbody { padding: 15px 16px; }
.crow  { display: flex; align-items: center; gap: 11px; }
.cicon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.ci-amber  { background: rgba(255,255,255,0.10); color: #ffffff; border: 1px solid rgba(255,255,255,0.25); }
.ci-green  { background: var(--green-dim); color: var(--green); }
.ci-blue   { background: var(--blue-dim); color: var(--blue); }
.ci-red    { background: var(--red-dim); color: var(--red); }
.ci-grey   { background: var(--navy-light); color: var(--text-muted); }
.ci-purple { background: var(--purple-dim); color: var(--purple); }
.ctext { flex: 1; min-width: 0; }
.ctitle { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.csub { font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmeta { font-family: var(--mono); font-size: 11px; color: var(--text-muted); text-align: right; flex-shrink: 0; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px;
  border-radius: 999px; font-family: var(--sans); font-size: 11px; font-weight: 700;
  white-space: nowrap; letter-spacing: .02em;
}
.p-amber  { background: #f59e0b; color: #1a1206; }
.p-green  { background: #2563eb; color: #fff; }
.p-blue   { background: #3b82f6; color: #fff; }
.p-red    { background: #ef4444; color: #fff; }
.p-grey   { background: #64748b; color: #fff; }
.p-purple { background: #a855f7; color: #fff; }
.vi-pill {
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.18);
}

.addr-list { background: transparent; border: none; border-radius: 0; overflow: visible; display: flex; flex-direction: column; gap: 12px; }
.addr-item {
  padding: 16px 16px; border: 1px solid var(--navy-border); border-radius: 16px;
  background: var(--navy-mid);
  cursor: pointer; transition: background .12s, border-color .12s;
  display: flex; gap: 12px; align-items: center;
}
.addr-item:last-child { border-bottom: 1px solid var(--navy-border); }
.addr-item:hover  { background: var(--navy-light); }
.addr-item:active { background: var(--navy-light); }
.addr-item::after {
  content: ''; width: 8px; height: 8px; flex-shrink: 0;
  border-right: 2px solid var(--text-muted); border-top: 2px solid var(--text-muted);
  transform: rotate(45deg); margin-left: 2px;
}
.addr-item.addr-dnv {
  background: var(--danger-bg); border-color: rgba(239,68,68,.45);
}
.addr-dist { font-family: var(--mono); font-size: 11px; color: var(--cream); width: 40px; flex-shrink: 0; padding-top: 2px; text-align: center; }
.addr-lines { flex: 1; min-width: 0; }
.addr-lines strong { font-size: 16px; font-weight: 600; display: block; line-height: 1.3; }
.addr-lines span   { font-family: var(--mono); font-size: 12px; color: var(--text-muted); }
.addr-lines .visited { color: var(--green); margin-left: 8px; }
.addr-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.addr-chip {
  font-family: var(--mono); font-size: 10px; padding: 2px 7px; border-radius: 20px;
  white-space: nowrap; font-weight: 500;
}
.addr-chip.spoke    { background: rgba(34,197,94,.15); color: #4ade80; }
.addr-chip.no-ans   { background: rgba(156,163,175,.12); color: #9ca3af; }
.addr-chip.refused  { background: rgba(239,68,68,.12); color: #f87171; }
.addr-chip.dnv      { background: rgba(239,68,68,.2); color: #f87171; }
.addr-chip.other    { background: rgba(245,158,11,.1); color: var(--amber); }
.addr-chip.party    { background: rgba(99,102,241,.15); color: #a5b4fc; }
.addr-chip.tag      { background: rgba(20,184,166,.12); color: #2dd4bf; }
.addr-chip.date     { background: transparent; color: var(--text-muted); padding-left: 0; }

.outcome-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin: 8px 0; }
.outcome-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 4px; background: var(--navy-light); border: 1.5px solid var(--navy-border);
  border-radius: 10px; cursor: pointer; transition: all .15s;
  font-family: var(--mono); font-size: 10px; font-weight: 500; color: var(--text-muted); text-align: center;
  user-select: none; -webkit-user-select: none; line-height: 1.2;
}
.outcome-btn .oi { font-size: 18px; }
.outcome-btn:hover { border-color: var(--amber); color: var(--amber); }
.outcome-btn.sel   { border-color: var(--amber); background: var(--navy-dark); color: var(--amber); }
.lit-checklist { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.lit-checklist-empty { font-size: 12px; color: var(--text-muted); font-family: var(--mono); padding: 6px 0; }
.lit-check-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border: 1.5px solid var(--navy-border); border-radius: 8px;
  background: var(--navy-light); cursor: pointer; transition: all .15s; user-select: none;
}
.lit-check-item:hover { border-color: var(--amber); }
.lit-check-item.sel { border-color: var(--amber); background: var(--navy-dark); }
.lit-check-item input[type=checkbox] { accent-color: var(--amber); width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; pointer-events: none; }
.lit-check-item .lit-label { font-size: 13px; color: var(--text-primary); flex: 1; }
#p-supporter-toggle:hover { border-color: rgba(255,255,255,.35) !important; }

.tag-grid { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0; }
.show-all-tags-btn {
  display: block; width: 100%; margin: 2px 0 8px;
  padding: 7px 12px; border-radius: 10px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);
  color: var(--text-muted); font-family: var(--mono); font-size: 11px;
  cursor: pointer; text-align: center; transition: all .15s;
}
.show-all-tags-btn:hover { border-color: rgba(255,255,255,.25); color: #fff; background: rgba(255,255,255,.08); }
.tag-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 12px; background: var(--navy-light); border: 1.5px solid var(--navy-border);
  border-radius: 20px; font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--text-muted); cursor: pointer; transition: all .15s;
  user-select: none; -webkit-user-select: none;
}
.tag-chip:hover { border-color: var(--blue); color: var(--blue); }
.tag-chip.sel   { background: var(--blue-dim); border-color: var(--blue); color: var(--blue); }
.tag-chip .tick { display: none; }
.tag-chip.sel .tick { display: inline; }

.tag-chip.key {
  border-color: var(--green) !important;
  color: var(--green) !important;
  background: var(--green-dim) !important;
}
.tag-chip.key .star { display: inline; }
.tag-chip .star { display: none; margin-right: 1px; }

.tag-chip.strong {
  border-color: var(--amber) !important;
  color: var(--amber) !important;
  background: var(--navy-dark) !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.22);
}
.tag-chip.strong .star { display: inline; color: var(--amber); }
.tag-chip.strong .tick { display: none; }

/* ── Causes chip colours (per-kind) ─────────────────────────────────────── */
/* National = amber, Local = purple, Party = party.color (passed via --cause-color). */
.tag-chip.cause-national {
  border-color: rgba(245, 158, 11, .45);
  color: var(--text-secondary);
}
.tag-chip.cause-national:hover { border-color: var(--amber); color: var(--amber); }
.tag-chip.cause-national.sel {
  background: rgba(245, 158, 11, .18);
  border-color: var(--amber);
  color: var(--amber);
}

.tag-chip.cause-local {
  border-color: rgba(139, 92, 246, .45);
  color: var(--text-secondary);
}
.tag-chip.cause-local:hover { border-color: #a78bfa; color: #a78bfa; }
.tag-chip.cause-local.sel {
  background: rgba(139, 92, 246, .18);
  border-color: #8b5cf6;
  color: #c4b5fd;
}

.tag-chip.cause-party {
  border-color: color-mix(in srgb, var(--cause-color, #888) 55%, transparent);
  color: var(--text-secondary);
}
.tag-chip.cause-party:hover {
  border-color: var(--cause-color, #888);
  color: var(--cause-color, #888);
}
.tag-chip.cause-party.sel {
  background: color-mix(in srgb, var(--cause-color, #888) 22%, transparent);
  border-color: var(--cause-color, #888);
  color: var(--cause-color, #888);
}

.party-list { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }

.party-row {
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-radius: 16px; overflow: hidden;
  transition: border-color .15s, background .15s;
}
.party-row.sel { border-color: var(--navy-border); background: var(--navy-mid); }
/* RB selected but no level chosen — show buttons without dark background */
.party-row.sel-rb-open { border-color: var(--navy-border); }
.party-row.sel-rb-open .party-btn { background: transparent; }
.party-row.sel-rb-open .party-support { display: block; background: transparent; }

.party-btn {
  display: flex; align-items: center; gap: 12px; padding: 16px 16px;
  cursor: pointer; user-select: none;
  font-size: 16px; font-weight: 600; color: var(--text-primary);
  transition: color .15s;
}
.party-btn .pdot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.party-btn .pdot--none { background: transparent; }
.party-row.sel .party-btn { color: var(--text-primary); }
.party-btn .pcheck {
  margin-left: auto; flex-shrink: 0;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--pc, #64748b); color: #fff; font-size: 14px; font-weight: 700;
  opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s;
}
.party-row.sel .party-btn .pcheck { opacity: 1; transform: scale(1); }

.party-support {
  display: none; padding: 0 16px 16px;
  border-top: none;
}
.party-row.sel .party-support { display: block; }
.ps-label { font-family: var(--mono); font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 7px; padding-top: 10px; }
.ps-scale  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.ps-dot {
  flex: 1; min-width: 56px; height: 38px; border-radius: 7px;
  border: 1.5px solid var(--navy-border); background: var(--navy);
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--text-muted);
}
.ps-dot:hover { border-color: var(--amber); color: var(--amber); }
.ps-dot.sel-activist { background: var(--navy-dark);          border-color: var(--amber); color: var(--amber); }
.ps-dot.sel-positive { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.ps-dot.sel-maybe    { background: rgba(245,158,11,.12); border-color: #f59e0b; color: #f59e0b; }
.ps-dot.sel-negative { background: var(--red-dim);   border-color: var(--red);   color: var(--red);   }

.pt-search { position: relative; margin: 10px 0 7px; }
.pt-search input {
  width: 100%; padding: 9px 9px 9px 30px;
  background: var(--navy); border: 1px solid var(--navy-border);
  border-radius: 8px; font-family: var(--sans); font-size: 13px;
  color: var(--text-primary); outline: none; transition: border-color .15s;
}
.pt-search input:focus { border-color: var(--amber); }
.pt-search .si { position: absolute; left: 9px; top: 50%; transform:translateY(-50%); font-size: 13px; color: var(--text-muted); pointer-events: none; }
.pt-grid { display: flex; flex-wrap: wrap; gap: 6px; }

.pt-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px; background: var(--navy); border: 1.5px solid var(--navy-border);
  border-radius: 16px; font-family: var(--mono); font-size: 11px; font-weight: 500;
  color: var(--text-muted); cursor: pointer; transition: all .15s;
}
.pt-chip .tick { display: none; }
.pt-chip.sel .tick { display: inline; }

.pt-chip.pos        { border-color: #065f46; color: #6ee7b7; }
.pt-chip.pos:hover  { border-color: var(--green); color: var(--green); background: var(--green-dim); }
.pt-chip.pos.sel    { border-color: var(--green); color: var(--green); background: var(--green-dim); }

.pt-chip.neg        { border-color: #7f1d1d; color: #fca5a5; }
.pt-chip.neg:hover  { border-color: var(--red); color: var(--red); background: var(--red-dim); }
.pt-chip.neg.sel    { border-color: var(--red); color: var(--red); background: var(--red-dim); }

.pinned-reasons {
  display: flex; flex-wrap: wrap; gap: 5px;
  min-height: 0; padding: 0 13px 10px;
}
.pinned-reasons:empty { padding: 0; }
.pinned-reason {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border-radius: 14px;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  cursor: pointer; transition: opacity .15s;
  user-select: none;
}
.pinned-reason:active { opacity: .6; }
.pinned-reason.pos { background: var(--green-dim); border: 1px solid var(--green); color: var(--green); }
.pinned-reason.neg { background: var(--red-dim);   border: 1px solid var(--red);   color: var(--red);   }

.pt-section-lbl {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; margin: 9px 0 5px;
  display: flex; align-items: center; gap: 6px;
}
.pt-section-lbl.pos { color: var(--green); }
.pt-section-lbl.neg { color: var(--red); }

.visit-entry {
  background: var(--navy-light); border-left: 3px solid var(--navy-border);
  padding: 11px 13px; border-radius: 0 10px 10px 0; margin-bottom: 9px;
}
.ve-spoke      { border-left-color: var(--green); }
.ve-no-answer  { border-left-color: #f59e0b; }
.ve-refused    { border-left-color: var(--red); }
.ve-other      { border-left-color: #f59e0b; }
.ve-dnv        { border-left-color: var(--red); }
.ve-date { font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.ve-outcome { font-size: 13px; font-weight: 500; margin-top: 2px; }
.ve-by  { font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.ve-notes { font-size: 13px; color: var(--text-secondary); margin-top: 5px; font-style: italic; }

.person-card {
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-radius: 13px; padding: 13px 15px; margin-bottom: 9px;
}
.phead { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.pavatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--navy-light);
  border: 1px solid var(--navy-border); display: flex; align-items: center;
  justify-content: center; font-size: 15px; flex-shrink: 0;
}
.pname { font-weight: 500; font-size: 14px; }
.pmeta { font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.ptags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.ptag {
  background: var(--blue-dim); color: var(--blue);
  padding: 3px 8px; border-radius: 12px; font-family: var(--mono); font-size: 10px; font-weight: 500;
  user-select: none; -webkit-user-select: none;
}
.pedit {
  margin-left: auto; padding: 6px 11px;
  background: var(--amber); border: none;
  border-radius: 8px; font-family: var(--mono); font-size: 11px;
  font-weight: 600; color: var(--navy-dark); cursor: pointer; transition: all .15s;
}
.pedit:hover { background: var(--amber-bright); }
.pc-block {
  border-left: 3px solid var(--navy-border); padding: 7px 10px;
  margin-bottom: 7px; border-radius: 0 8px 8px 0; background: rgba(255,255,255,.02);
}
.pc-block-title {
  font-size: 12px; font-weight: 600; margin-bottom: 4px;
}
.pc-block-sub {
  font-family: var(--mono); font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px;
}
.pc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

/* ── Home header: location / search / view-toggle — all equal height ──────── */
#screen-home #home-content { --hdr-h: 48px; }

.sbar { position: relative; margin-bottom: 12px; }
.sbar-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 15px; pointer-events: none; }
.sbar-icon--search {
  width: 20px; height: 20px; left: 18px; font-size: 0; background: var(--text-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.sinput {
  width: 100%; height: var(--hdr-h, 48px); padding: 0 16px 0 46px;
  background: var(--navy-dark); border: 1px solid var(--navy-border);
  border-radius: 14px; font-family: var(--sans); font-size: 15px;
  color: var(--text-primary); outline: none; box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s; -webkit-appearance: none;
}
.sinput:focus { border-color: var(--cream-2); box-shadow: 0 0 0 3px rgba(244,236,174,.12); }
.sinput::placeholder { color: var(--text-muted); }

.gps-status {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--hdr-h, 48px); box-sizing: border-box;
  padding: 5px 6px 5px 16px; background: var(--navy-mid);
  border: 1px solid var(--navy-border); border-radius: 14px;
}
.gps-status--bare {
  background: transparent; border: none; border-radius: 0;
  padding: 0; min-height: 0;
}
.home-gps-hint {
  display: flex; flex-direction: row; align-items: center;
  justify-content: center; text-align: center; gap: 10px;
  padding: 40px 24px;
}
.home-gps-hint-txt {
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  color: var(--text-muted);
}
.home-gps-disabled {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.home-gps-hint-line {
  display: flex; flex-direction: row; align-items: center;
  justify-content: center; gap: 10px;
}
.home-gps-hint .gps-action { font-size: 14px; padding: 9px 18px; }
.gps-label { font-family: var(--sans); font-size: 15px; font-weight: 700; line-height: 1.2; color: var(--text-primary); flex: 1; min-width: 0; }
.gps-action {
  flex-shrink: 0; border: 1px solid var(--navy-border);
  background: var(--navy-light); color: var(--text-secondary);
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  padding: 8px 16px; border-radius: 10px; cursor: pointer;
  transition: filter .15s, background .15s, color .15s;
}
.gps-action:hover { color: var(--cream); border-color: var(--cream-2); }
.gps-action--enable {
  background: var(--cream-grad); color: var(--cream-text); border-color: transparent;
}
.gps-action--enable:hover { filter: brightness(1.04); color: var(--cream-text); }
.gps-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; transition: background .3s; }
.gps-dot.active   { background: var(--green); box-shadow: 0 0 8px var(--green); animation: gpspulse 2s infinite; }
.gps-dot.seeking  { background: #f59e0b; animation: gpspulse 1s infinite; }
.gps-dot.error    { background: var(--red); box-shadow: 0 0 8px rgba(239,68,68,.6); }
.gps-dot.disabled { background: var(--red); box-shadow: 0 0 8px rgba(239,68,68,.5); }
@keyframes gpspulse { 0%,100%{opacity:1} 50%{opacity:.35} }

.div { height: 1px; background: var(--navy-border); margin: 15px 0; }

/* ── Person / Voting-Intention page ─────────────────────────────────────── */
#screen-person { background: var(--navy); }
#screen-person .content { background: var(--navy); }
/* No horizontal divider lines on this page */
#screen-person .div { display: none !important; }

.topbar--person,
.topbar--article {
  height: auto; min-height: 0; align-items: center; gap: 24px;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top,0px));
  background: linear-gradient(180deg, #13223F 0%, #030E24 100%);
  border-bottom: 1px solid #22406E;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.05);
}
.topbar--person .tb-back,
.topbar--article .tb-back {
  background: transparent; border: none; font-size: 24px; color: var(--text-muted);
  width: 24px; height: 24px; margin-top: 0; align-self: center; line-height: 1;
}
.topbar--person .tb-back:hover,
.topbar--article .tb-back:hover { color: var(--cream); border: none; }
.topbar--person .tb-title,
.topbar--article .tb-title { flex: 1; padding: 0; align-self: center; }
.topbar--person .tb-title h1,
.topbar--article .tb-title h1 {
  font-family: var(--sans); font-size: 18px; font-weight: 700; line-height: 1.3;
  color: var(--text-primary); white-space: normal;
}
.topbar--person .tb-title p,
.topbar--article .tb-title p {
  display: flex; align-items: center; gap: 5px; margin-top: 3px;
  font-family: var(--sans); font-size: 13px; color: var(--text-muted);
}
.pa-pin {
  width: 13px; height: 13px; background: var(--text-muted); flex-shrink: 0;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.pa-status {
  flex-shrink: 0; align-self: center;
  background: var(--cream-grad); color: var(--cream-text);
  font-family: var(--sans); font-size: 13px; font-weight: 700;
  padding: 8px 15px; border-radius: 12px; white-space: nowrap;
  border: none; cursor: pointer; transition: filter .15s;
}
.pa-status:hover { filter: brightness(1.04); }
.pa-status:active { filter: brightness(.97); }
.pa-status:disabled { opacity: .6; cursor: default; }

/* Resident selector */
.p-residents { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.p-res-list { display: flex; flex-direction: column; gap: 10px; }
.p-res {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-radius: 16px; padding: 12px 16px; cursor: pointer;
  font-family: var(--sans); font-size: 16px; font-weight: 600;
  color: var(--text-primary); text-align: left; transition: border-color .15s;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: manipulation;
}
.p-res--active { border-color: var(--navy-border); }
.p-res-av {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--navy-light); position: relative;
}
.p-res-av::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 22px; height: 22px; background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.p-res-name { flex: 1; min-width: 0; }
.p-res-check {
  margin-left: auto; flex-shrink: 0; cursor: pointer;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 2px solid var(--text-muted);
  color: transparent; font-size: 14px; font-weight: 700;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.p-res-check:hover { border-color: var(--cream-2); }
.p-res--active .p-res-check {
  background: #fff; border-color: #fff; color: var(--cream-text);
}
/* Avatar always keeps its party/blue colour with a white user icon —
   selection is shown by the tick badge only. */

/* Resident edit fields on one line */
.p-edit-row { display: flex; gap: 8px; margin: 4px 0 6px; }
.p-edit-row .fg { flex: 1; min-width: 0; margin-bottom: 0; }
.p-edit-row .fi { width: 100%; box-sizing: border-box; }

.p-res-all, .p-res-add {
  width: 100%; background: var(--navy-light); border: 1px solid var(--navy-border);
  border-radius: 14px; padding: 12px; cursor: pointer;
  font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--text-secondary);
  transition: color .15s, border-color .15s;
}
.p-res-actions { display: flex; gap: 10px; }
.p-res-actions .p-res-add { flex: 1; width: auto; }
.p-res-all:hover, .p-res-add:hover { color: var(--cream); border-color: var(--cream-2); }
.p-add-resident-wrap { margin-top: 10px; }

/* Party dot gets a subtle glow when that party is selected */
.party-row.sel .party-btn .pdot {
  box-shadow: 0 0 8px var(--pc, #64748b);
}

/* Do not visit */
.p-dnv {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-radius: 16px; padding: 16px; cursor: pointer; margin: 18px 0 14px;
  font-family: var(--sans); font-size: 16px; font-weight: 600; color: var(--text-secondary);
  transition: background .15s, border-color .15s, color .15s;
}
.p-dnv-box {
  width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0;
  border: 2px solid var(--text-muted); background: transparent;
  position: relative; transition: background .15s, border-color .15s;
}
.p-dnv--on {
  background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.45); color: #ef4444;
}
.p-dnv--on .p-dnv-box { background: #ef4444; border-color: #ef4444; }
.p-dnv--on .p-dnv-box::after {
  content: ''; position: absolute; left: 7px; top: 3px;
  width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.p-save-btn {
  width: 100%; font-size: 17px; font-weight: 700; padding: 16px;
  border-radius: 16px; margin-bottom: 8px;
}

/* Causes / Literature hidden when disabled by admin */
body.feature-issues-off     #p-causes-section,
body.feature-literature-off #p-literature-section { display: none !important; }
body.feature-issues-off     #p-causes-section + .div,
body.feature-literature-off #p-literature-section + .div { display: none !important; }

.bnav {
  background: linear-gradient(180deg, var(--navy-mid) 0%, var(--navy-dark) 100%);
  border-top: 1px solid var(--navy-border);
  display: flex; z-index: 100; flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bnav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 12px 4px 14px; cursor: pointer; transition: color .15s;
  color: var(--text-muted); font-family: var(--sans); font-size: 11px; font-weight: 600;
  gap: 5px; position: relative;
}
.bnav-item .ni {
  width: 24px; height: 24px; display: block;
  background-color: currentColor;
  -webkit-mask: var(--ni-img) center / 24px 24px no-repeat;
  mask: var(--ni-img) center / 24px 24px no-repeat;
}
.bnav-item.active { color: var(--cream); }
.bnav-item.active::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 34px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--cream-grad); box-shadow: 0 0 10px var(--cream-glow);
}

/* Heroicons v2 (Outline) — stroke baked to #000 so the CSS mask alpha is the
   line shape; element background-color paints it in currentColor. */
.ni-home    { --ni-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.6' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25'/%3E%3C/svg%3E"); }
.ni-profile { --ni-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.6' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z'/%3E%3C/svg%3E"); }
.ni-wallet  { --ni-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.6' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 12a2.25 2.25 0 0 0-2.25-2.25H15a3 3 0 1 1-6 0H5.25A2.25 2.25 0 0 0 3 12m18 0v6a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18v-6m18 0V9M3 12V9m18 0a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 9m18 0V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v3'/%3E%3C/svg%3E"); }
.ni-trophy  { --ni-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.6' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M16.5 18.75h-9m9 0a3 3 0 0 1 3 3h-15a3 3 0 0 1 3-3m9 0v-3.375c0-.621-.503-1.125-1.125-1.125h-.871M7.5 18.75v-3.375c0-.621.504-1.125 1.125-1.125h.872m5.007 0H9.497m5.007 0a7.454 7.454 0 0 1-.982-3.172M9.497 14.25a7.454 7.454 0 0 0 .981-3.172M5.25 4.236c-.982.143-1.954.317-2.916.52A6.003 6.003 0 0 0 7.73 9.728M5.25 4.236V4.5c0 2.108.966 3.99 2.48 5.228M5.25 4.236V2.721C7.456 2.41 9.71 2.25 12 2.25c2.291 0 4.545.16 6.75.47v1.516M7.73 9.728a6.726 6.726 0 0 0 2.748 1.35m8.272-6.842V4.5c0 2.108-.966 3.99-2.48 5.228m2.48-5.492a46.32 46.32 0 0 1 2.916.52 6.003 6.003 0 0 1-5.395 4.972m0 0a6.726 6.726 0 0 1-2.749 1.35m0 0a6.772 6.772 0 0 1-3.044 0'/%3E%3C/svg%3E"); }
.ni-policy  { --ni-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.6' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M4.26 10.147a60.438 60.438 0 0 0-.491 6.347A48.62 48.62 0 0 1 12 20.904a48.62 48.62 0 0 1 8.232-4.41 60.46 60.46 0 0 0-.491-6.347m-15.482 0a50.636 50.636 0 0 0-2.658-.813A59.906 59.906 0 0 1 12 3.493a59.903 59.903 0 0 1 10.399 5.84c-.896.248-1.783.52-2.658.814m-15.482 0A50.717 50.717 0 0 1 12 13.489a50.702 50.702 0 0 1 7.74-3.342M6.75 15a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm0 0v-3.675A55.378 55.378 0 0 1 12 8.443m-7.007 11.55A5.981 5.981 0 0 0 6.75 15.75v-1.5'/%3E%3C/svg%3E"); }
.ni-map     { --ni-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.6' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 6.75V15m6-6v8.25m.503 3.498 4.875-2.437c.381-.19.622-.58.622-1.006V4.82c0-.836-.88-1.38-1.628-1.006l-3.869 1.934c-.317.159-.69.159-1.006 0L9.503 3.252a1.125 1.125 0 0 0-1.006 0L3.622 5.689C3.24 5.88 3 6.27 3 6.695V19.18c0 .836.88 1.38 1.628 1.006l3.869-1.934c.317-.159.69-.159 1.006 0l4.994 2.497c.317.158.69.158 1.006 0Z'/%3E%3C/svg%3E"); }

.stat-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; margin-bottom: 15px; }
.stat-box {
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-radius: 12px; padding: 13px; display: flex; flex-direction: column; gap: 3px;
}
.sv { font-family: var(--mono); font-size: 26px; font-weight: 600; color: var(--amber); }
.sl { font-family: var(--mono); font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }

.moverlay.active { display: flex; animation: mfade .2s ease; }
@keyframes mfade { from{opacity:0} to{opacity:1} }
.modal {
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-radius: 20px 20px 0 0; width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto; padding: 22px;
  animation: mslide .25s ease;
}
@keyframes mslide { from{transform:translateY(100%)} to{transform:translateY(0)} }
.mhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.mtitle { font-family: var(--mono); font-size: 14px; font-weight: 600; }
.mclose {
  width: 31px; height: 31px; background: var(--navy-light); border: 1px solid var(--navy-border);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted); font-size: 17px; transition: all .15s;
}
.mclose:hover { border-color: var(--red); color: var(--red); }

.adm-shell {
  flex-direction: row;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.screen.active .adm-shell {
  display: flex;
}

.adm-sidebar {
  width: 230px; flex-shrink: 0;
  background: var(--navy-mid); border-right: 1px solid var(--navy-border);
  display: flex; flex-direction: column;
  height: 100%; overflow-y: auto;
}
.adm-sidebar-logo {
  padding: 20px 18px 16px;
}
.adm-sidebar-logo .wm { font-family: var(--mono); font-size: 16px; font-weight: 600; color: #ffffff; }
.adm-sidebar-logo .sub { font-family: var(--mono); font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.adm-nav { padding: 12px 10px; flex: 1; }
.adm-nav-section { font-family: var(--mono); font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .12em; padding: 12px 8px 5px; }
.adm-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 9px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  transition: all .15s; margin-bottom: 2px;
}
.adm-nav-item .nicon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.adm-nav-item:hover  { background: var(--navy-light); color: var(--text-primary); }
.adm-nav-item.active { background: var(--navy-dark); color: var(--amber); }
.adm-sidebar-foot {
  padding: 14px 18px; border-top: 1px solid var(--navy-border);
}
.adm-user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px; background: var(--navy-light); border: 1px solid var(--navy-border);
  border-radius: 10px; margin-bottom: 10px;
}
.adm-user-chip .uav {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--amber-dim); color: var(--amber);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.adm-user-chip .uname { font-size: 12px; font-weight: 500; }
.adm-user-chip .urole { font-family: var(--mono); font-size: 10px; color: var(--text-muted); }
.adm-user-chip:hover { background: var(--navy-light); border-radius: 8px; }

.adm-main { flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0; overscroll-behavior: contain; position: relative; }
.adm-header {
  padding: 22px 28px 18px; border-bottom: 2px solid var(--navy-border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; position: sticky; top: 0; z-index: 700;
  background: linear-gradient(135deg, var(--navy-mid) 0%, var(--navy-dark) 100%);
  box-shadow: 0 2px 16px rgba(0,0,0,.45), inset 0 -1px 0 rgba(245,158,11,.12);
}
.adm-header h2 { font-family: var(--mono); font-size: 18px; font-weight: 600; }
.adm-header p  { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }

/* ── Normalise all controls in the header row to a consistent height ── */
.adm-header .fi,
.adm-header select.fi,
.adm-header input.fi,
.adm-header .sinput,
.adm-header .btn,
.adm-header .btn-sm {
  box-sizing: border-box;
  height: 34px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 12px;
  margin-bottom: 0;
  align-self: center;
}
.adm-header .sbar { margin-bottom: 0; }
.adm-header .sinput { padding-left: 34px; padding-right: 10px; }
.adm-header .sbar-icon { font-size: 13px; }
.adm-header .btn-sm { width: auto; padding-left: 14px; padding-right: 14px; }
.adm-body { padding: 24px 28px; overflow-x: hidden; }

.adm-panel { display: none; }
.adm-panel.active { display: block; }

.adm-table { width: 100%; border-collapse: collapse; }
.adm-table th {
  font-family: var(--mono); font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .08em; padding: 10px 14px 10px;
  text-align: left; border-bottom: 1px solid var(--navy-border);
}
.adm-table td {
  padding: 13px 14px; border-bottom: 1px solid var(--navy-border);
  font-size: 13px; vertical-align: middle;
}
.adm-table tr:last-child td { border-bottom: none; }
.adm-table tr:hover td { background: var(--navy-light); }
.adm-card {
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-radius: 14px; padding: 20px 22px;
}
.adm-table-wrap {
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-radius: 13px; overflow-x: auto; overflow-y: hidden; margin-top: 14px;
  -webkit-overflow-scrolling: touch;
}
.adm-table-wrap table { min-width: 600px; }

.adm-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 24px; }
.adm-stat {
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-radius: 12px; padding: 16px 18px;
}
.adm-stat .asv { font-family: var(--mono); font-size: 28px; font-weight: 600; color: var(--amber); }
.adm-stat .asl { font-family: var(--mono); font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 3px; }

.ibtn {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--navy-light); border: 1px solid var(--navy-border);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px; color: var(--text-muted);
  transition: all .15s; vertical-align: middle;
}
.ibtn:hover { border-color: var(--amber); color: var(--amber); }
.ibtn.d:hover { border-color: var(--red); color: var(--red); }

.drag-handle {
  cursor: grab; color: var(--text-muted); font-size: 14px;
  padding: 4px 6px; user-select: none; line-height: 1;
}
.drag-handle:active { cursor: grabbing; }
.adm-table tr.dragging td { opacity: .4; background: var(--navy-mid); }

.rbadge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 20px;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase;
}
.rb-admin   { background: #451a03; color: var(--amber); border: 1px solid var(--amber-dim); }
.rb-branch  { background: var(--purple-dim); color: var(--purple); border: 1px solid #4c1d95; }
.rb-assist  { background: #1e3a2e; color: #6ee7b7; border: 1px solid #065f46; }
.rb-canvas  { background: var(--blue-dim); color: var(--blue); }

.branch-tag {
  display: inline-flex; padding: 2px 7px; border-radius: 10px;
  background: var(--navy-light); border: 1px solid var(--navy-border);
  font-family: var(--mono); font-size: 10px; color: var(--text-muted); margin: 2px;
}

.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-bar .sinput { flex: 1; min-width: 180px; margin-bottom: 0; }

.vr-row { cursor: pointer; }
.vr-row:hover td { background: #1a1500 !important; }

.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid var(--navy-border); border-top-color: var(--amber);
  border-radius: 50%; animation: spin .7s linear infinite;
}
.loading-row { display: flex; align-items: center; gap: 10px; padding: 16px; color: var(--text-muted); font-family: var(--mono); font-size: 12px; }

#toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--green-dim); border: 1px solid var(--green);
  color: var(--green); padding: 11px 18px;
  border-radius: 11px; font-family: var(--mono); font-size: 12px;
  z-index: 999; transition: transform .3s ease; white-space: nowrap; pointer-events: none;
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.err  { background: var(--red-dim); border-color: var(--red); color: var(--red); }

.empty {
  text-align: center; padding: 40px 20px; color: var(--text-muted);
}
.empty .eicon { font-size: 36px; margin-bottom: 10px; opacity: .5; }
.empty p { font-family: var(--mono); font-size: 12px; line-height: 1.7; }

.adm-mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 52px;
  background: var(--navy-dark);
  border-bottom: 1px solid var(--navy-border);
  flex-shrink: 0;
  z-index: 50;
  position: sticky;
  top: 0;
}
.adm-mobile-logo {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--amber);
}
.adm-burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background .15s;
}
.adm-burger:hover { background: var(--navy-light); }
.adm-burger span {
  display: block;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform .25s, opacity .2s, width .2s;
  transform-origin: left center;
}

.adm-shell.menu-open .adm-burger span:nth-child(1) { transform: rotate(45deg) translate(1px, -1px); }
.adm-shell.menu-open .adm-burger span:nth-child(2) { opacity: 0; width: 0; }
.adm-shell.menu-open .adm-burger span:nth-child(3) { transform: rotate(-45deg) translate(1px, 1px); }

.adm-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 299;
}

@media (max-width: 700px) {
  
  .adm-shell { flex-direction: column; }

  .adm-mobile-bar { display: flex; }

  
  .adm-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    z-index: 300;
    flex-direction: column;
    border-right: 1px solid var(--navy-border);
  }
  .adm-shell.menu-open .adm-sidebar {
    transform: translateX(0);
  }
  .adm-shell.menu-open .adm-menu-overlay {
    display: block;
  }

  
  .adm-sidebar-logo { border-right: none; border-bottom: 1px solid var(--navy-border); }
  .adm-nav { flex-direction: column; flex-wrap: nowrap; padding: 12px 10px; gap: 0; }
  .adm-nav-section { display: block; }
  .adm-nav-item { padding: 10px 12px; font-size: 13px; }
  .adm-sidebar-foot { border-left: none; border-top: 1px solid var(--navy-border); }

  
  .adm-main { width: 100%; }

  .adm-stats { grid-template-columns: repeat(2,1fr); }
  .adm-header { padding: 14px 16px 12px; }
  .adm-header p { display: none; }
  .adm-body { padding: 14px 16px; }
}

#screen-routes { position: relative; overflow: hidden; }

.live-beacon-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(34,197,94,.7);
  animation: beaconPulse 2s infinite;
  vertical-align: middle;
  flex-shrink: 0;
}

@keyframes beaconPulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.7); }
  70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

@keyframes beaconPulseAmber {
  0%   { box-shadow: 0 0 0 4px rgba(245,158,11,.4), 0 0 0 8px rgba(245,158,11,.2); }
  70%  { box-shadow: 0 0 0 10px rgba(245,158,11,.05), 0 0 0 18px rgba(245,158,11,0); }
  100% { box-shadow: 0 0 0 4px rgba(245,158,11,.4), 0 0 0 8px rgba(245,158,11,.2); }
}

#hh-map {
  width: 100%; height: 130px;
  border-radius: 12px; overflow: hidden;
  margin-bottom: 14px;
  background: #0d1b2a;
  flex-shrink: 0;
}
#hh-map .leaflet-tile { filter: brightness(.75) saturate(.6) hue-rotate(180deg) invert(1); }
#hh-map .leaflet-control-zoom { display: none; }

#route-map {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: #0d1b2a;
  z-index: 0;
  height: 100%;
}

#route-map .leaflet-tile { }
.route-overlay {
  position: absolute; bottom: 56px; left: 0; right: 0; z-index: 10;
  height: 35vh; max-height: 75vh; min-height: 42px; overflow: hidden;
  background: var(--navy-mid);
  border-top: 1px solid var(--navy-border);
  border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column;
  transition: height .15s;
}
.route-overlay.collapsed { height: 42px !important; }
.route-overlay .route-cards { flex: 1; overflow-y: auto; }
#routes-bnav {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 20;
}
.route-topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  background: var(--navy-mid); border-bottom: 1px solid var(--navy-border);
  height: 56px; min-height: 56px;
}
.route-cards { padding: 8px 14px 80px; display: flex; flex-direction: column; gap: 14px; }
.route-card {
  background: var(--navy-mid); border: 1.5px solid var(--navy-border);
  border-radius: 14px; padding: 14px 16px; cursor: pointer;
  transition: border-color .15s;
}
.route-card:hover { border-color: var(--amber); }
.route-card.active-route { border-color: #60a5fa; background: rgba(96,165,250,0.06); }
.route-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.route-card-name { font-weight: 600; font-size: 14px; flex: 1; }
.route-card-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.route-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.route-status { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px;
  border-radius: 10px; font-family: var(--mono); font-size: 10px; font-weight: 600; }
.rs-available  { background: var(--green-dim);  color: var(--green);  border: 1px solid var(--green);  }
.rs-assigned   { background: var(--blue-dim);   color: var(--blue);   border: 1px solid var(--blue);   }
.rs-inprogress { background: var(--navy-dark);            color: var(--amber);  border: 1px solid var(--amber);  }
.rs-completed  { background: #0f172a;            color: var(--text-muted); border: 1px solid var(--navy-border); }
.route-actions { display: flex; gap: 8px; margin-top: 10px; }

.route-marker {
  background: var(--amber); color: var(--navy); border-radius: 50%;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  border: 2px solid white; box-shadow: 0 2px 6px rgba(0,0,0,.5);
}

.route-adm-status { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 11px; }
.type-route { background: rgba(245,158,11,.15); color: var(--amber); border: 1px solid rgba(245,158,11,.35); border-radius: 5px; font-family: var(--mono); font-size: 10px; padding: 1px 6px; }
.type-area  { background: rgba(99,102,241,.15); color: #a5b4fc; border: 1px solid rgba(99,102,241,.35); border-radius: 5px; font-family: var(--mono); font-size: 10px; padding: 1px 6px; }
.builder-mode-hint { font-family:var(--mono);font-size:11px;color:var(--text-muted);text-align:center;padding:8px 0; }

#screen-route-builder { position: relative; overflow: hidden; z-index: 0; }
#builder-map { position: absolute; inset: 0; z-index: 0; }
.builder-topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  background: var(--navy-dark) !important;
  border-bottom: 1px solid var(--navy-border);
  padding: 0 16px;
}
/* Boundary buttons when inside the topbar (builder screen) */
.builder-bov-btn {
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  height: 34px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  color: rgba(255,255,255,.7);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  flex-shrink: 0;
}
.builder-bov-btn:hover {
  border-color: rgba(255,255,255,.4);
  color: #fff;
  background: rgba(255,255,255,.12);
}
.builder-bov-btn.bov-active {
  background: rgba(245,158,11,.18);
  border-color: var(--amber);
  color: var(--amber);
}
.builder-panel {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 20;
  background: var(--navy-mid); border-top: 1px solid var(--navy-border);
  border-radius: 20px 20px 0 0;
  max-height: 48vh; overflow-y: auto;
  padding: 18px 16px 32px;
}
.wp-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.wp-item {
  display: flex; align-items: center; gap: 9px;
  background: var(--navy-light); border: 1px solid var(--navy-border);
  border-radius: 9px; padding: 8px 10px;
}
.wp-num {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--amber); color: var(--navy);
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.wp-num.wp-start { background: var(--green); }
.wp-num.wp-end   { background: var(--red); }
.wp-coords { flex: 1; font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.wp-remove { cursor: pointer; color: var(--text-muted); font-size: 16px; padding: 2px 4px; transition: color .15s; }
.wp-remove:hover { color: var(--red); }

.leaflet-top { top: 56px; }

#lrv-panel .leaflet-top { top: 56px; }

.lrv-chip {
  padding: 5px 12px; border-radius: 20px; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.7);
  font-family: var(--mono); font-size: 11px; cursor: pointer;
  transition: all .15s; white-space: nowrap; flex-shrink: 0;
}
.lrv-chip.active, .lrv-chip:hover {
  background: var(--amber); border-color: var(--amber); color: var(--navy);
}

.lrv-overlay {
  max-height: 40vh; overflow-y: auto;
  background: var(--navy-mid);
  border-top: 1px solid var(--navy-border);
  border-radius: 20px 20px 0 0;
  padding: 6px 0 0;
  flex-shrink: 0;
}
.lrv-overlay-handle {
  width: 36px; height: 4px; background: var(--navy-border);
  border-radius: 2px; margin: 0 auto;
  pointer-events: none;
  transition: background .15s;
}
.lrv-overlay-handle:hover,
[onmousedown="_overlayResizeStart(event)"]:hover .lrv-overlay-handle {
  background: var(--amber);
}
#lrv-feed-resizer:hover > div {
  background: var(--amber);
  transition: background .15s;
}
#lrv-cards { padding: 0 12px 24px; }
#lrv-cards .route-card { cursor: pointer; }

.boundary-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.bov-btn {
  display: block;
  padding: 5px 10px;
  background: rgba(10,14,26,.82);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  color: rgba(255,255,255,.75);
  font-family: var(--mono);
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  transition: all .15s;
  text-align: left;
}
.bov-btn:hover {
  border-color: rgba(255,255,255,.45);
  color: #fff;
}
.bov-btn.bov-active {
  background: rgba(245,158,11,.18);
  border-color: var(--amber);
  color: var(--amber);
}
.boundary-tooltip {
  background: rgba(10,14,26,.9) !important;
  border: 1px solid rgba(255,255,255,.2) !important;
  color: #fff !important;
  font-family: var(--mono) !important;
  font-size: 11px !important;
  padding: 3px 8px !important;
  border-radius: 5px !important;
  box-shadow: none !important;
}
.boundary-tooltip::before { display: none !important; }

/* ── Policy ───────────────────────────────────────────────────────────────── */
.policy-section-label {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-muted); padding: 18px 0 8px;
}

/* Wide layout for policy + article screens */
#screen-policy .content,
#screen-article .content {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
  width: 100%;
  box-sizing: border-box;
}
@media (min-width: 860px) {
  #screen-policy,
  #screen-article {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  #screen-policy .topbar,
  #screen-article .topbar {
    padding-left: calc(max(16px, (100% - 800px) / 2));
    padding-right: calc(max(16px, (100% - 800px) / 2));
  }
}

.policy-card {
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 10px;
  cursor: pointer; transition: border-color .15s;
  user-select: none; -webkit-user-select: none;
}
.policy-card:active { border-color: var(--amber); background: var(--navy-dark); }
.policy-card-top { display: flex; align-items: flex-start; gap: 10px; }
.policy-card-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.policy-card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.policy-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.policy-tag-pill {
  background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(99,179,237,.2);
  padding: 2px 8px; border-radius: 10px;
  font-family: var(--mono); font-size: 10px; font-weight: 500;
}
.policy-tag-pill.local { background: var(--navy-dark); color: var(--amber); border-color: rgba(245,158,11,.2); }
.policy-fav { font-size: 16px; margin-left: auto; flex-shrink: 0; color: var(--text-muted); }
.policy-fav.active { color: var(--amber); }
.policy-views { font-family: var(--mono); font-size: 10px; color: var(--text-muted); margin-top: 6px; }

/* Policy favourites section */
.policy-fav-section { margin-bottom: 4px; }

/* Article reader */
.article-body {
  padding: 4px 0 24px;
  font-size: 15px; line-height: 1.75;
  max-width: 660px;
  color: var(--text-primary);
}
.article-body h1, .article-body h2, .article-body h3 {
  color: var(--text-primary); font-weight: 700; margin: 20px 0 8px;
}
.article-body h1 { font-size: 20px; }
.article-body h2 { font-size: 17px; color: var(--amber); }
.article-body h3 { font-size: 15px; }
.article-body p { margin: 0 0 12px; }
.article-body ul, .article-body ol { margin: 0 0 12px 20px; }
.article-body li { margin-bottom: 5px; }
.article-body strong { color: var(--text-primary); font-weight: 700; }
.article-body em { color: var(--text-secondary); font-style: italic; }
.article-body hr { border: none; border-top: 1px solid var(--navy-border); margin: 20px 0; }
.article-body blockquote {
  border-left: 3px solid var(--amber); margin: 0 0 12px;
  padding: 8px 12px; background: var(--navy-dark); border-radius: 0 8px 8px 0;
  font-style: italic; color: var(--text-secondary);
}
.article-tags-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }

/* WYSIWYG editor */
.wysiwyg-bar {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 8px;
  background: var(--navy-light); border: 1px solid var(--navy-border);
  border-bottom: none; border-radius: 10px 10px 0 0;
}
.wysiwyg-btn {
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  color: var(--text-secondary); font-size: 13px; font-weight: 600;
  padding: 4px 9px; border-radius: 6px; cursor: pointer;
  font-family: var(--mono); min-width: 30px; text-align: center;
  transition: all .15s; user-select: none;
}
.wysiwyg-btn:hover { border-color: var(--amber); color: var(--amber); }
.wysiwyg-btn.sep { width: 1px; background: var(--navy-border); border: none; padding: 0; margin: 2px 2px; }
.wysiwyg-area {
  width: 100%; min-height: 240px; resize: vertical;
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-radius: 0 0 10px 10px; color: var(--text-primary);
  font-family: 'Courier New', monospace; font-size: 13px; line-height: 1.6;
  padding: 12px; box-sizing: border-box; outline: none;
}
.wysiwyg-area:focus { border-color: var(--amber); }
.wysiwyg-preview {
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-radius: 10px; padding: 14px; margin-top: 8px;
  min-height: 80px;
}
.wysiwyg-tabs { display: flex; gap: 6px; margin-bottom: 6px; }
.wysiwyg-tab {
  font-family: var(--mono); font-size: 11px; padding: 5px 12px;
  border-radius: 8px; cursor: pointer; border: 1px solid var(--navy-border);
  background: var(--navy-light); color: var(--text-muted);
  transition: all .15s; user-select: none;
}
.wysiwyg-tab.active { background: var(--amber); color: var(--navy); border-color: var(--amber); font-weight: 700; }

/* Admin policy panel */
.pol-article-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--navy-border);
  transition: background .15s;
}
.pol-article-row:hover { background: var(--navy-light); }
.pol-article-title { flex: 1; font-size: 13px; font-weight: 500; }
.pol-article-meta { font-family: var(--mono); font-size: 10px; color: var(--text-muted); }

/* Suppress Leaflet's default SVG path focus outline (black bounding box on click) */
.leaflet-interactive:focus { outline: none !important; }
.leaflet-container path.leaflet-interactive:focus { outline: none !important; }

/* ── Custom scrollbars ───────────────────────────────────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--navy-border) transparent;
}
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--navy-border);
  border-radius: 99px;
}
*::-webkit-scrollbar-thumb:hover { background: #3d5070; }
*::-webkit-scrollbar-corner { background: transparent; }



#route-chip-map,
#route-chip-map .leaflet-container { background: var(--navy) !important; }

/* ═══════════════════════════════════════════════════════════════
   CSP CLEAN-UP — v354
   CSS replacements for all inline style= attributes removed from
   body.html, invite.php, and help/*.html
   ═══════════════════════════════════════════════════════════════ */

/* ── Utility ──────────────────────────────────────────────────── */
.is-hidden { display: none !important; }
.btn--full  { width: 100%; padding: 13px; }
.btn--mt12  { margin-top: 12px; }
.btn--mt14  { margin-top: 14px; }
.fg--top    { margin-top: 6px; }
.fg--mb0    { margin-bottom: 0; }
.fg--mb12   { margin-bottom: 12px; }
.fg--mb10   { margin-bottom: 10px; }
.fg--mt14   { margin-top: 14px; }
.label-opt  { color: var(--text-muted); }
.label-required { color: #ef4444; }
.sbar--mb8  { margin-bottom: 8px; }
.sbar--mb12 { margin-bottom: 12px; }
.content--pb { padding-bottom: 80px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── Login screen ─────────────────────────────────────────────── */
#login-error {
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.4);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: #f87171;
  line-height: 1.4;
}

#login-mfa-step { display: none; }

.mfa-header { text-align: center; margin-bottom: 18px; }
.mfa-icon   { font-size: 32px; margin-bottom: 8px; }
.mfa-title  { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.mfa-hint   { font-family: var(--mono); font-size: 12px; color: var(--text-muted); margin-top: 5px; }

.fi--mfa {
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: .15em;
  text-align: center;
}

.mfa-back-wrap { text-align: center; margin-top: 10px; }
.mfa-back-link {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
}

/* ── Home screen ──────────────────────────────────────────────── */
#home-branch-lbl { color: var(--amber); }

.home-trophy {
  position: relative;
  flex-shrink: 0;
  padding-right: 6px;
  display: none;
}

.home-controls {
  display: block;
  margin-bottom: 12px;
}

/* ── Person / Household ───────────────────────────────────────── */
.slabel-sub {
  color: var(--text-muted);
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
}

.slabel--danger { color: #ef4444; }

/* Supporter toggle button */
#p-supporter-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1.5px solid rgba(255,255,255,.15);
  border-radius: 10px;
  background: transparent;
  font-size: 13px;
  color: var(--text-secondary);
}
.supporter-toggle-inner { display: flex; align-items: center; gap: 10px; }
.supporter-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: transparent;
  flex-shrink: 0;
  transition: all .2s;
}

.supporter-fields { margin-top: 10px; }
.supporter-note {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: -4px;
  padding: 0 2px;
}

.delete-section { margin-top: 24px; }
.delete-btn {
  width: 100%;
  background: rgba(239,68,68,.08);
  border: 1.5px solid rgba(239,68,68,.3);
  color: #f87171;
  font-size: 13px;
  padding: 12px 14px;
  border-radius: 10px;
}

.tb-action--mr { margin-right: 6px; }

/* ── Profile screen ───────────────────────────────────────────── */
#profile-role-lbl { color: var(--text-muted); }
#profile-signout-btn { display: none; }

.profile-help-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

#screen-profile { background: var(--navy); }
#screen-profile .content::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5,30,64,.62) 0%, rgba(5,30,64,.86) 38%, var(--navy) 72%),
    url('backdrop.png') center top / cover no-repeat;
}
#screen-profile .content > * { position: relative; z-index: 1; }

/* Profile header is no longer a sticky bar — the Help button scrolls with the
   page as the first item in the content. */
.profile-topbar-inline {
  display: flex; justify-content: flex-end; align-items: center;
  padding-top: env(safe-area-inset-top, 0px);
  min-height: 40px; margin-bottom: 4px;
}

.profile-av-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0 26px;
}

.profile-av-wrap {
  position: relative;
  margin-bottom: 12px;
  cursor: pointer;
}

.profile-av {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--cream-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 24px;
  font-weight: 700;
  color: var(--cream-text);
  overflow: hidden;
}

.profile-av-camera {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--navy-mid);
  border: 2px solid var(--navy-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

#avatar-file-input { display: none; }

.profile-name-disp { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.profile-branch-disp {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 5px;
}

/* Profile cards */
.prof-card {
  background: rgba(10, 42, 82, 0.72);
  border: 1px solid var(--navy-border);
  border-radius: 20px;
  padding: 22px;
  margin-bottom: 18px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.prof-card--mb20 { margin-bottom: 20px; }
.prof-card-label {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 16px;
}

.prof-footer { text-align: center; margin-top: 30px; padding-bottom: 8px; }
.prof-footer-label {
  font-family: var(--sans); font-size: 11px; font-weight: 600; color: var(--text-secondary);
  letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px;
}
.prof-footer-email { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 26px; }
.prof-footer-rb { width: 150px; height: auto; display: block; margin: 0 auto 16px; opacity: .95; }
.prof-footer-promoter {
  font-size: 12px; color: var(--text-muted); line-height: 1.6; max-width: 360px; margin: 0 auto;
}

/* Password strength */
.pw-strength-wrap  { margin-bottom: 12px; }
.pw-strength-track { height: 4px; background: var(--navy-light); border-radius: 2px; overflow: hidden; }
.pw-strength-bar   { height: 100%; width: 0%; border-radius: 2px; transition: width .25s, background .25s; }
.pw-strength-label { font-family: var(--mono); font-size: 10px; margin-top: 5px; }
.pw-strength-checks {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: var(--mono);
  font-size: 10px;
}

/* Location toggle */
.loc-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.loc-info { flex: 1; }
.loc-title { font-size: 14px; font-weight: 500; color: var(--text-primary); margin-bottom: 3px; }
.loc-hint  { font-family: var(--mono); font-size: 10px; color: var(--text-muted); line-height: 1.5; }

.toggle-label  { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; cursor: pointer; }
.toggle-input  { opacity: 0; position: absolute; width: 0; height: 0; }
.toggle-track  { position: absolute; cursor: pointer; inset: 0; border-radius: 24px; background: var(--navy-light); transition: .25s; }
.toggle-thumb  { position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .25s; }

/* Postcode */
.postcode-section { border-top: 1px solid var(--navy-border); padding-top: 14px; margin-top: 4px; }
.postcode-label   { margin-bottom: 6px; }
.fi--upper        { text-transform: uppercase; }
.postcode-status  { font-family: var(--mono); font-size: 10px; margin-top: 5px; }
.postcode-hint    { font-family: var(--mono); font-size: 10px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }

/* MFA + footer */
.mfa-section     { margin-top: 18px; }
.prof-build-footer {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--navy-border);
}

/* ── Route builder ────────────────────────────────────────────── */
.builder-type-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.builder-mode-label { font-family: var(--mono); font-size: 11px; color: var(--text-muted); }

/* ── Article screen ───────────────────────────────────────────── */
.article-meta { color: var(--text-muted); }
.article-fav-btn {
  font-size: 18px;
  background: none;
  border: none;
  padding: 6px 10px;
  cursor: pointer;
}

/* ── Admin sidebar ────────────────────────────────────────────── */
.adm-user-chip { cursor: pointer; }
.adm-signout-btn { width: 100%; margin-top: 8px; }

/* ── Modals ───────────────────────────────────────────────────── */
.modal--narrow { max-width: 420px; }
.modal-hint    { font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-bottom: 16px; }

/* Route type modal */
.route-type-list { display: flex; flex-direction: column; gap: 10px; }
.route-type-btn  { display: flex; align-items: flex-start; gap: 12px; text-align: left; padding: 14px 16px; }
.route-type-icon { font-size: 20px; line-height: 1; }
.route-type-title { font-weight: 700; font-size: 13px; margin-bottom: 3px; }
.route-type-desc { font-family: var(--mono); font-size: 11px; }
.route-type-desc--route { color: var(--amber); opacity: .8; }
.route-type-desc--area  { color: var(--text-muted); opacity: .9; }

/* Suggest modal */
#suggest-branch-wrap,
#suggest-party-wrap { display: none; }

.sentiment-row   { margin-top: 6px; display: flex; gap: 8px; }
.sentiment-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.sentiment-positive { color: var(--green); }
.sentiment-negative { color: var(--red); }

/* ── Route overlay drag handle ────────────────────────────────── */
.route-overlay-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 4px;
  cursor: ns-resize;
  user-select: none;
}
.route-overlay-pill {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.2);
  display: block;
}

/* ── Route footer popup ───────────────────────────────────────── */
.route-footer {
  position: fixed;
  bottom: 56px;
  left: 0;
  right: 0;
  z-index: 3500;
  background: rgba(10,14,26,0.98);
  border-top: 1px solid rgba(255,255,255,.1);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,.6);
  max-height: calc(100dvh - 56px - 8px);
  flex-direction: column;
  overflow: hidden;
}
/* .is-hidden overrides display:none — JS uses .style.display directly after show */

.route-footer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  cursor: ns-resize;
  user-select: none;
  flex-shrink: 0;
}

.rf-beacon {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(245,158,11,.2);
  transition: background .3s, box-shadow .3s;
}
.rf-beacon.is-active {
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16,185,129,.7);
  animation: beaconPulse 2s infinite;
}

.rf-title {
  font-family: var(--mono);
  font-size: 12px;
  color: #fff;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rf-status-chip {
  font-family: var(--mono);
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}

.rcmo-switch-btn {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.15);
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  flex-shrink: 0;
}

.rcmo-info-btn {
  background: rgba(99,102,241,.15);
  border: 1px solid rgba(99,102,241,.35);
  color: #818cf8;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  flex-shrink: 0;
}

.rf-chevron {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  transition: opacity .2s;
}

.route-footer-expanded {
  display: none;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  border-top: 1px solid rgba(255,255,255,.07);
}

.rf-selector {
  display: none;
  padding: 8px 12px 4px;
  flex-shrink: 0;
}

.route-chip-map {
  width: 100%;
  flex: 1;
  min-height: 80px;
  background: var(--navy);
}

.rcmo-info-popup {
  display: none;
  background: var(--navy-dark);
  padding: 14px 16px 20px;
  flex-shrink: 0;
  overflow-y: auto;
  max-height: 50%;
}

.rcmo-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.rcmo-info-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}

.rcmo-info-close {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
  -webkit-tap-highlight-color: transparent;
}

/* ── Organisation Panel ─────────────────────────────────────────────────────── */

.section-card {
  background: var(--card-bg, var(--bg-secondary));
  border: 1px solid var(--navy-border);
  border-radius: 10px;
  overflow: hidden;
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--navy-border);
  background: var(--bg-tertiary, rgba(255,255,255,0.03));
}

.section-card-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Org tree nodes */
.org-node {
  border-bottom: 1px solid var(--navy-border);
}
.org-node:last-child { border-bottom: none; }

.org-node-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  gap: 12px;
  transition: background 0.15s;
}
.org-node-row:hover { background: rgba(255,255,255,0.025); }

.org-node-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.org-node-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.org-node-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Preset picker cards */
.org-preset-card {
  padding: 14px 16px;
  border: 1px solid var(--navy-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.org-preset-card:hover {
  border-color: var(--amber, #e8a020);
  background: rgba(232,160,32,0.06);
}

/* Info / warning box */
.info-box {
  padding: 12px 16px;
  background: rgba(74,158,255,0.08);
  border: 1px solid rgba(74,158,255,0.25);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Restore Britain logo — login screen ──────────────────────────────────── */
.login-rb-logo {
  display: block;
  width: 180px;
  height: auto;
  margin: 0 auto 18px;
  filter: brightness(0) invert(1); /* ensure pure white on dark bg */
}

/* GYF secondary logo — login screen only, below main logo */
.login-gyf-logo {
  display: block;
  width: 52px;
  height: auto;
  margin: 0 auto 18px;
  opacity: 0.75;
  filter: brightness(0) invert(1);
}

/* ── Restore Britain logo — admin sidebar ─────────────────────────────────── */
.adm-rb-logo {
  display: block;
  width: 110px;
  height: auto;
  filter: brightness(0) invert(1);
}

/* ── Restore Britain logo — admin mobile header ───────────────────────────── */
.adm-mobile-rb-logo {
  display: block;
  height: 22px;
  width: auto;
  filter: brightness(0) invert(1);
}

/* ── Nav logo on marketing site ───────────────────────────────────────────── */
.nav-rb-logo {
  display: block;
  height: 24px;
  width: auto;
  filter: brightness(0) invert(1);
}

/* ══════════════════════════════════════════════════════════════════════════════
   CANVASSER UI RESTRICTIONS
   Hidden via CSS only — elements remain in DOM for functionality.
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Canvasser footer nav: Activity, Policy & Badges controlled by feature flags ── */

/* ── Policy / Profile page: hide Location Sharing card ──────────────────── */
.prof-card:has(#prof-share-loc) { display: none !important; }

/* ── Add Person — Issue input pieces (controlled by feature_issues flag) ──── */
body.feature-issues-off #screen-person [data-action="suggest-tag-open"],
body.feature-issues-off #p-national-issues-section,
body.feature-issues-off .pt-search,
body.feature-issues-off [id^="pselected-"],
body.feature-issues-off .pt-section-lbl,
body.feature-issues-off [id^="ptgrid-"],
body.feature-issues-off .ps-label--reason { display: none !important; }

/* ── Hide Wards boundary button ─────────────────────────────────────────── */
[data-btype="ward"] { display: none !important; }

/* ── Canvass mode toggles — in topbar ───────────────────────────────────── */
.home-mode-toggles {
  display: flex;
  flex-direction: row; align-items: stretch;
  gap: 6px; margin-left: auto; flex-shrink: 0;
}
body.feature-flyer-off .home-mode-toggles { display: none !important; }
.canv-mode-seg, .canv-sub-seg {
  display: flex; background: var(--navy-mid);
  border: 1px solid var(--navy-border); border-radius: 14px;
  overflow: hidden; gap: 0; align-items: stretch; padding: 4px;
}
.canv-mode-btn {
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  padding: 10px 14px; cursor: pointer;
  border: none; background: transparent; color: var(--text-muted);
  transition: color .15s; white-space: nowrap; position: relative;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.canv-mode-btn.active {
  background: transparent; color: var(--text-primary);
  font-weight: 700;
}
.canv-mode-btn.active::after {
  content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 28px; height: 3px; border-radius: 3px;
  background: var(--cream-grad); box-shadow: 0 0 8px var(--cream-glow);
}
.canv-mode-btn:hover:not(.active) { color: var(--text-secondary); }

/* ── Home List / Map view ───────────────────────────────────────────────── */
.home-viewseg {
  display: flex; background: var(--navy-mid);
  border: 1px solid var(--navy-border); border-radius: 14px;
  min-height: var(--hdr-h, 48px); box-sizing: border-box;
  padding: 0; margin-bottom: 12px; overflow: hidden;
}
.home-viewseg .canv-mode-btn {
  flex: 1; height: auto; align-self: stretch;
  font-size: 15px; font-weight: 600; padding: 8px 14px;
}
.home-viewseg .canv-mode-btn.active {
  font-weight: 700;
  /* Selected colours per spec, applied to the text + icon only.
     Tint layer sits on top of the white base so the warm fade is visible. */
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3) 40%, rgba(255, 234, 0, 0.3) 100%),
    linear-gradient(0deg, #FFFFFF, #FFFFFF);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.home-viewseg .canv-mode-btn.active .vseg-ico {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3) 40%, rgba(255, 234, 0, 0.3) 100%),
    linear-gradient(0deg, #FFFFFF, #FFFFFF);
}
.home-viewseg .canv-mode-btn.active::after {
  content: ''; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
  width: 30px; height: 3px; border-radius: 3px;
  background: var(--cream-grad); box-shadow: 0 0 8px var(--cream-glow);
}
.vseg-ico {
  width: 17px; height: 17px; display: inline-block; background: currentColor;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: contain; mask-size: contain;
}
.vseg-list { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5'/%3E%3C/svg%3E"); }
.vseg-map  { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 6.75V15m6-6v8.25m.503 3.498 4.875-2.437c.381-.19.622-.58.622-1.006V4.82c0-.836-.88-1.38-1.628-1.006l-3.869 1.934c-.317.159-.69.159-1.006 0L9.503 3.252a1.125 1.125 0 0 0-1.006 0L3.622 5.689C3.24 5.88 3 6.27 3 6.695V19.18c0 .836.88 1.38 1.628 1.006l3.869-1.934c.317-.159.69-.159 1.006 0l4.994 2.497c.317.158.69.158 1.006 0Z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 6.75V15m6-6v8.25m.503 3.498 4.875-2.437c.381-.19.622-.58.622-1.006V4.82c0-.836-.88-1.38-1.628-1.006l-3.869 1.934c-.317.159-.69.159-1.006 0L9.503 3.252a1.125 1.125 0 0 0-1.006 0L3.622 5.689C3.24 5.88 3 6.27 3 6.695V19.18c0 .836.88 1.38 1.628 1.006l3.869-1.934c.317-.159.69-.159 1.006 0l4.994 2.497c.317.158.69.158 1.006 0Z'/%3E%3C/svg%3E"); }
.vseg-street { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8.25 3.75h7.5l1.5 16.5h-10.5l1.5-16.5Z M12 3.75v16.5 M9.75 9h4.5 M9.5 14.25h5'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8.25 3.75h7.5l1.5 16.5h-10.5l1.5-16.5Z M12 3.75v16.5 M9.75 9h4.5 M9.5 14.25h5'/%3E%3C/svg%3E"); }

/* Street view button is only relevant when Flyer Drop is enabled. */
body.feature-flyer-off #home-view-street { display: none !important; }

/* Pull-up route/map footer removed from the home screen */
#route-footer { display: none !important; }

/* Home header bar hidden — content starts at the top of the screen */
#screen-home > .topbar { display: none !important; }
#screen-home #home-content { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }

/* Match home: hide the header on activity, badges, and policy too */
#screen-activity > .topbar,
#screen-badges   > .topbar,
#screen-policy   > .topbar { display: none !important; }
#screen-activity #activity-content,
#screen-badges   #badges-content,
#screen-policy   #policy-content { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }

#home-map { display: none; }

/* Map view: the map fills the screen as a background; controls float over it */
#screen-home.map-active #home-content { position: static; }
#screen-home.map-active #home-map {
  display: block; position: fixed; left: 0; right: 0;
  top: 0; bottom: 0; z-index: 0;
}
#screen-home.map-active #addr-list,
#screen-home.map-active #home-route-chips,
#screen-home.map-active #home-policy-favs,
#screen-home.map-active #home-gps-footer,
#screen-home.map-active .sbar { display: none; }
#screen-home.map-active .home-controls,
#screen-home.map-active .home-viewseg {
  position: relative; z-index: 2;
}
#screen-home.map-active .gps-status,
#screen-home.map-active .home-viewseg {
  background: rgba(10, 42, 82, 0.82);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
/* Street view (list): reuses .addr-item, adds a tick on the right */
.street-item { display: flex; align-items: center; gap: 12px; cursor: pointer;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.street-tick {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--text-muted);
  background: transparent; color: transparent;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  transition: background .15s, border-color .15s, color .15s;
}
.street-item--done .street-tick { background: #10b981; border-color: #10b981; color: #fff; }
.street-item--done { border-color: #10b981; }

.leaflet-container { background: #0b0b0c; font-family: var(--sans); }

/* ── Street view: legend + locate overlays ──────────────────────────────── */
.street-map-legend {
  position: fixed; z-index: 10;
  bottom: 92px; left: 12px;
  background: rgba(10,42,82,0.92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--navy-border); border-radius: 12px;
  padding: 10px 12px;
  font-family: var(--sans); font-size: 11px; color: var(--text-primary);
  pointer-events: none;  /* purely informational — let map gestures pass through */
}
.sml-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.sml-dot { width: 16px; height: 4px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.street-map-ctrl {
  position: fixed; z-index: 10;
  width: 44px; height: 44px; border-radius: 12px;
  top: 76px; right: 16px;
  background: rgba(10,42,82,0.92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--navy-border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.street-map-ctrl:hover { background: rgba(15,51,102,0.95); }
.street-map-ctrl.is-active { background: rgba(59,130,246,.78); border-color: rgba(96,165,250,.8); }
.street-map-ctrl.is-active .smc-ico { background: #fff; }
/* Stacked rows below the locate button (each row = 44 button + 8 gap) */
.street-map-ctrl.mc-row2 { top: 128px; }
.street-map-ctrl.mc-row3 { top: 180px; }
.street-map-ctrl.mc-row4 { top: 232px; }
.smc-ico { width: 22px; height: 22px; background: var(--cream); display: block; }
.smc-locate {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%23000'%3E%3Ccircle cx='12' cy='12' r='3.5'/%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath stroke-linecap='round' d='M12 1.5v3M12 19.5v3M1.5 12h3M19.5 12h3'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%23000'%3E%3Ccircle cx='12' cy='12' r='3.5'/%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath stroke-linecap='round' d='M12 1.5v3M12 19.5v3M1.5 12h3M19.5 12h3'/%3E%3C/svg%3E") center/contain no-repeat;
}
.smc-layers {
  /* Heroicons "map" outline */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 6.75V15m6-6v8.25M9 6.75L2.7 8.6a.75.75 0 0 0-.45.69v11.32c0 .5.51.85.97.66L9 18.75m0 0L15 21m0 0L20.83 18.95A.75.75 0 0 0 21.3 18.25V6.95c0-.5-.5-.85-.97-.66L15 9'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 6.75V15m6-6v8.25M9 6.75L2.7 8.6a.75.75 0 0 0-.45.69v11.32c0 .5.51.85.97.66L9 18.75m0 0L15 21m0 0L20.83 18.95A.75.75 0 0 0 21.3 18.25V6.95c0-.5-.5-.85-.97-.66L15 9'/%3E%3C/svg%3E") center/contain no-repeat;
}
.smc-pin {
  /* Heroicons "map-pin" outline */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.smc-streets {
  /* Three staggered lines suggesting a street network */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%23000'%3E%3Cpath stroke-linecap='round' d='M4 7h10M4 12h16M9 17h11'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%23000'%3E%3Cpath stroke-linecap='round' d='M4 7h10M4 12h16M9 17h11'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Boundary picker dropdown */
.map-boundary-panel {
  position: fixed; z-index: 11; right: 66px; top: 128px;
  width: 280px; max-height: 60vh;
  background: rgba(10,42,82,0.96);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--navy-border); border-radius: 14px;
  padding: 8px; overflow: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
  display: flex; flex-direction: column;
}
.mbp-tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 6px;
  background: rgba(0,0,0,.18); border-radius: 10px; flex-shrink: 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.mbp-tab {
  padding: 6px 10px; border-radius: 7px; cursor: pointer;
  font-family: var(--mono); font-size: 11px; color: var(--text-secondary);
  white-space: nowrap; flex-shrink: 0; user-select: none;
}
.mbp-tab.is-active { background: rgba(59,130,246,.7); color: #fff; }
.mbp-list { flex: 1; overflow-y: auto; padding: 2px 4px 4px; }
.mbp-row {
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--text-primary);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.mbp-row:hover { background: rgba(255,255,255,.05); }
.mbp-row.is-selected { background: rgba(59,130,246,.25); color: #fff; }
.mbp-row-gss { font-family: var(--mono); font-size: 10px; color: var(--text-muted); }
.mbp-empty { padding: 12px; font-size: 12px; color: var(--text-muted); text-align: center; }

.vseg-canvass {
  /* Heroicons "chat-bubble-left-right" outline */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 0 1-.825-.242m9.345-8.334a2.126 2.126 0 0 0-.476-.095 48.64 48.64 0 0 0-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0 0 11.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 0 1-.825-.242m9.345-8.334a2.126 2.126 0 0 0-.476-.095 48.64 48.64 0 0 0-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0 0 11.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155'/%3E%3C/svg%3E");
}
.vseg-flyer {
  /* Heroicons "document-text" outline */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%23000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z'/%3E%3C/svg%3E");
}

/* User-location marker on the map view (avatar or initials) */
.user-loc-marker-wrap { background: transparent !important; border: 0 !important; }
.user-loc-marker {
  width: 40px; height: 40px; box-sizing: border-box;
  border-radius: 50%; background: #fff;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.45), 0 0 0 2px rgba(59,130,246,.55);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

/* ── Flyer drop address item states ─────────────────────────────────────── */
.addr-item.flyered {
  background: rgba(16,185,129,.06);
}
.addr-item.flyered .addr-flyer-tick {
  color: #10b981; font-size: 18px; flex-shrink: 0; line-height: 1;
}
.addr-flyer-tick { color: var(--navy-border); font-size: 18px; flex-shrink: 0; line-height: 1; }

/* ── Street summary item (flyer streets mode) ────────────────────────────── */
.street-item {
  padding: 12px 15px; border-bottom: 1px solid var(--navy-border);
  cursor: pointer; transition: background .1s; display: flex;
  align-items: center; justify-content: space-between; gap: 12px;
}
.street-item:hover { background: rgba(255,255,255,.04); }
.street-item:last-child { border-bottom: none; }
.street-progress {
  width: 60px; height: 5px; background: var(--navy-light);
  border-radius: 3px; overflow: hidden; flex-shrink: 0;
}
.street-progress-fill {
  height: 100%; border-radius: 3px; background: #10b981;
  transition: width .3s;
}
.street-progress-fill.partial { background: #f59e0b; }

/* ── ER badge on address items ───────────────────────────────────────────── */
.er-badge {
  display: inline-block; font-family: var(--mono); font-size: 9px;
  font-weight: 600; padding: 1px 5px; border-radius: 3px;
  background: rgba(96,165,250,.15); color: #60a5fa;
  border: 1px solid rgba(96,165,250,.3); margin-left: 4px;
  vertical-align: middle; letter-spacing: .04em;
}

/* ── Hide Spoke and Moved outcome buttons ───────────────────────────────── */
[data-outcome="spoke"],
[data-outcome="moved"] { display: none !important; }

/* ── Literature Delivered section (controlled by feature_literature flag) ── */
body.feature-literature-off #visit-literature-list,
body.feature-literature-off #visit-literature-list + *,
body.feature-literature-off .fg:has(#visit-literature-list) { display: none !important; }
body.feature-supporter-off #p-supporter-section { display: none !important; }

/* ── Canvas/Flyer mode toggle (controlled by feature_flyer flag) ─────────── */
body.feature-flyer-off #canv-mode-seg { display: none !important; }

/* ── Hide manual Polling Day sub-mode toggle from canvassers ────────────── */
/* (Branch managers can still enforce polling-day mode at the branch level via Branch Settings) */
#sub-btn-vi { display: none !important; }

/* ── Apply to Household and + Visit: white/primary style ────────────────── */
#screen-person .tb-action {
  background: var(--amber); color: var(--navy-dark);
  border: none;
}
#screen-person .tb-action:hover { background: var(--amber-bright); }
#screen-person .tb-action.sec {
  background: var(--amber); color: var(--navy-dark);
  border: none;
}
#screen-person .tb-action.sec:hover { background: var(--amber-bright); }

/* ── Restore Britain logo — canvasser home topbar ───────────────────────────── */
.home-rb-logo {
  display: block;
  height: 28px;
  width: auto;
  filter: brightness(0) invert(1);
}

/* ── Restore Britain simplified level buttons ─────────────────────────────── */
.rb-level-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.rb-level-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 14px; border-radius: 12px;
  border: 1px solid var(--navy-border); background: var(--navy-light);
  color: var(--text-secondary); font-family: var(--sans); font-size: 15px;
  font-weight: 600; cursor: pointer; text-align: center;
  transition: background .15s, border-color .15s, color .15s;
}
.rb-level-btn .rb-lvl-check {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: none; align-items: center; justify-content: center;
  background: var(--blue); position: relative;
}
.rb-level-btn .rb-lvl-check::after {
  content: ''; width: 5px; height: 9px; margin-top: -2px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.rb-level-btn.rb-lvl-sel-pledge,
.rb-level-btn.rb-lvl-sel-maybe {
  background: var(--navy-light); border-color: var(--blue); color: var(--text-primary); font-weight: 700;
}
.rb-level-btn.rb-lvl-sel-pledge .rb-lvl-check,
.rb-level-btn.rb-lvl-sel-maybe .rb-lvl-check { display: flex; }

/* ── Ward Dashboard ─────────────────────────────────────────────────────────── */
.ward-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 16px;
}
@media (max-width: 900px) { .ward-grid { grid-template-columns: 1fr; } }
.ward-card {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  z-index: 0;
  isolation: isolate;
}
.ward-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--navy-border);
  width: 100%;
  box-sizing: border-box;
}
.ward-card-body {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1fr;
  gap: 0;
}
.ward-map-wrap {
  padding: 10px;
  display: flex; align-items: center; justify-content: center;
}
.ward-mini-map { width: 100%; height: 140px; border-radius: 7px; overflow: hidden; position: relative; z-index: 0; }
.ward-chart-wrap {
  padding: 10px;
  display: flex; flex-direction: column; align-items: center;
}

.ward-card-foot {
  padding: 10px 16px 12px;
  border-top: 1px solid var(--navy-border);
}
.ward-foot-bar-track {
  height: 5px; background: var(--navy-border); border-radius: 3px; margin-bottom: 5px;
}
.ward-foot-bar-fill {
  height: 100%; border-radius: 3px; transition: width .4s, background .4s;
}
.ward-foot-label {
  font-family: var(--mono); font-size: 10px; color: var(--text-muted);
}

/* ── Hide Routes navigation for canvassers (managed by branch manager) ──────── */
.bnav-item[data-action="nav-routes"],
#bn-routes,
#screen-routes { display: none !important; }

/* ── Responsive: hide RB logo on narrow screens so toggle gets full width ── */
@media (max-width: 640px) {
  #screen-home .home-rb-logo,
  #screen-home #home-branch-lbl,
  #screen-home #home-trophy { display: none !important; }
  #screen-home .topbar .tb-title { display: none !important; }
  #screen-home .home-mode-toggles {
    margin-left: 0; width: 100%;
    /* Lock the bar to the taller (canvas-mode, 2-line wrap) height so the
       Canvas/Flyer pill doesn't shrink when switching to flyer mode (which
       hides Postal Voters + Polling Day and lets All/Streets fit on one line). */
    min-height: 38px;
  }
  #screen-home .canv-mode-seg,
  #screen-home .canv-sub-seg { min-height: 38px; }
  #screen-home .canv-sub-seg { width: 100%; flex: 1; }
  #screen-home .canv-sub-seg .canv-mode-btn {
    flex: 1; padding: 5px 4px; font-size: 10px; text-align: center;
    white-space: normal; line-height: 1.15;
  }
}

/* ── Feature flag visibility — toggled by JS classes on <body> ───────────── */
body.feature-policy-off .bnav-item[data-action="nav-policy"],
body.feature-policy-off #screen-policy,
body.feature-policy-off #screen-article,
body.feature-policy-off #home-policy-favs { display: none !important; }

body.feature-issues-off [data-feature="issues"],
body.feature-issues-off .issue-tag-section,
body.feature-issues-off .reason-tags-section { display: none !important; }

body.feature-literature-off .lit-checklist,
body.feature-literature-off [data-feature="literature"] { display: none !important; }

body.feature-badges-off .bnav-item[data-action="nav-badges"],
body.feature-badges-off #screen-badges,
body.feature-badges-off .home-trophy { display: none !important; }

body.feature-activity-off .bnav-item[data-action="nav-activity"],
body.feature-activity-off #screen-activity { display: none !important; }
