:root {
  --red: #cc1429; --red-light: #f24d4d; --navy: #0d2454; --navy-light: #294d9e; --gold: #fac233;
  --to-knock: #3b66ed; --talked: #29b86b; --not-home: #fa9924; --muted: #8c94a3;
  --bg: #f2f2f7; --card: #ffffff; --card2: #f7f7fa; --text: #111318; --text2: #6b7280; --line: rgba(0,0,0,.08);
  --glass: rgba(255,255,255,.86); --shadow: 0 6px 24px rgba(0,0,0,.16);
  --red-grad: linear-gradient(135deg, var(--red-light), var(--red));
  --navy-grad: linear-gradient(135deg, var(--navy-light), var(--navy));
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000; --card: #1c1c1e; --card2: #2c2c2e; --text: #f5f5f7; --text2: #a1a1aa; --line: rgba(255,255,255,.1);
    --glass: rgba(28,28,30,.86); --shadow: 0 6px 24px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  --bg: #000; --card: #1c1c1e; --card2: #2c2c2e; --text: #f5f5f7; --text2: #a1a1aa; --line: rgba(255,255,255,.1);
  --glass: rgba(28,28,30,.86); --shadow: 0 6px 24px rgba(0,0,0,.5);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 16px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Segoe UI", system-ui, sans-serif; overscroll-behavior: none; }
body { overflow: hidden; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: var(--text); }
h1, h2, h3 { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--text2); }
.small { font-size: 13px; }

.splash { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: var(--navy-grad); color: #fff; font-weight: 800; font-size: 22px; }
.splash img { width: 88px; height: 88px; border-radius: 22px; }

/* ── Welcome ───────────────────────── */
.welcome { position: fixed; inset: 0; overflow-y: auto; background: var(--navy-grad); color: #fff;
  padding: calc(var(--safe-top) + 32px) 16px calc(var(--safe-bottom) + 24px); }
.welcome-inner { max-width: 420px; margin: 0 auto; display: grid; gap: 20px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { width: 60px; height: 60px; border-radius: 15px; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.brand h1 { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.brand p { margin: 2px 0 0; opacity: .8; font-size: 14px; }
.panel { background: var(--card); color: var(--text); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--card2); border-radius: 12px; padding: 3px; }
.seg button { padding: 9px 4px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text2); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text2); }
.field input, .field textarea { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--navy-light); }
.code-input { font-size: 28px !important; letter-spacing: 10px; text-align: center; font-weight: 800; }
.err { color: var(--red); font-size: 14px; font-weight: 600; }
.note { font-size: 13px; opacity: .85; text-align: center; line-height: 1.45; }
.note a { color: #fff; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px; border-radius: 999px;
  font-weight: 700; font-size: 17px; background: var(--red-grad); color: #fff; box-shadow: 0 4px 12px rgba(204,20,41,.35); transition: transform .12s; }
.btn:active { transform: scale(.97); }
.btn:disabled { background: rgba(140,148,163,.25); color: var(--text2); box-shadow: none; }
.btn.navy { background: var(--navy-grad); box-shadow: 0 4px 12px rgba(13,36,84,.3); }
.btn.plain { background: var(--card2); color: var(--text); box-shadow: none; }
.btn.danger { background: transparent; color: var(--red); box-shadow: none; border: 1.5px solid var(--red); }
.btn.sm { padding: 10px 14px; font-size: 15px; width: auto; }

/* ── Map screen ────────────────────── */
#map { position: fixed; inset: 0; }
.topbar { position: fixed; left: 10px; right: 10px; top: calc(var(--safe-top) + 10px); display: flex; gap: 8px; align-items: center; z-index: 5; }
.glass { background: var(--glass); backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border: 1px solid rgba(255,255,255,.18); box-shadow: var(--shadow); }
.wb-button { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 18px; text-align: left; }
.wb-button .t { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-button .s { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-button .chev { margin-left: auto; color: var(--text2); flex: none; }
.ring { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none; position: relative; }
.ring svg { position: absolute; left: 4px; top: 4px; width: 44px; height: 44px; transform: rotate(-90deg); }
.ring b { font-size: 13px; font-weight: 800; position: relative; }
.icon-btn { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 20px; }
.status-row { position: fixed; top: calc(var(--safe-top) + 72px); left: 10px; right: 10px; z-index: 4; display: grid; gap: 6px; justify-items: start; }
.banner { padding: 8px 12px; border-radius: 14px; font-size: 13px; font-weight: 600; }
.banner.warn { color: #b45309; }
.fabs { position: fixed; right: 12px; bottom: calc(var(--safe-bottom) + 18px); z-index: 4; display: grid; gap: 10px; justify-items: end; transition: bottom .2s; }
.fab { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; }
.shift-pill { padding: 12px 18px; border-radius: 999px; font-weight: 700; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.shift-pill.on { background: var(--talked); color: #fff; border: 0; }
.shift-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.empty-map { position: fixed; left: 16px; right: 16px; bottom: calc(var(--safe-bottom) + 90px); z-index: 4; padding: 18px; border-radius: 22px; display: grid; gap: 10px; max-width: 460px; margin: 0 auto; }

.card-wrap { position: fixed; left: 10px; right: 10px; bottom: calc(var(--safe-bottom) + 10px); z-index: 6; max-width: 520px; margin: 0 auto; }
.hcard > * { min-width: 0; }
.hcard { border-radius: 26px; padding: 16px; display: grid; gap: 12px; animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.hhead { display: flex; gap: 12px; align-items: flex-start; }
.hhead .who { flex: 1; min-width: 0; text-align: left; }
.hhead .name { font-size: 20px; font-weight: 800; line-height: 1.2; }
.hhead .addr { font-size: 14px; color: var(--text2); margin-top: 2px; }
.close { width: 30px; height: 30px; border-radius: 50%; background: rgba(140,148,163,.18); color: var(--text2); font-weight: 800; flex: none; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; gap: 4px; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.actions { display: flex; gap: 10px; align-items: center; }
.actions .btn { flex: 1; white-space: nowrap; font-size: 16px; padding: 14px 10px; min-width: 0; }
.round { width: 46px; height: 46px; border-radius: 50%; background: rgba(140,148,163,.16); display: grid; place-items: center; font-size: 19px; flex: none; }
.lastvisit { font-size: 12px; color: var(--text2); }
.avatars { display: flex; flex: none; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; border: 2px solid var(--card); }
.avatars .avatar + .avatar { margin-left: -12px; }
.talked-banner { display: flex; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(41,184,107,.12); font-size: 13px; }
.talked-banner b { display: block; font-size: 14px; }

.you-dot { width: 22px; height: 22px; position: relative; }
.you-core { position: absolute; inset: 3px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.35); }
.you-cone { position: absolute; left: 50%; bottom: 50%; width: 0; height: 0; margin-left: -14px; border-left: 14px solid transparent; border-right: 14px solid transparent;
  border-bottom: 30px solid rgba(26,115,232,.28); transform-origin: 50% 100%; display: none; }
.mate { width: 32px; height: 32px; border-radius: 50%; background: var(--navy-grad); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center;
  border: 2.5px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3); transition: transform 3.8s linear; }
.mate.stale { opacity: .5; }
.crosshair { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -100%); z-index: 5; font-size: 40px; pointer-events: none; filter: drop-shadow(0 3px 4px rgba(0,0,0,.4)); }
.fixbar { position: fixed; left: 10px; right: 10px; bottom: calc(var(--safe-bottom) + 10px); z-index: 6; padding: 14px; border-radius: 22px; display: grid; gap: 10px; max-width: 520px; margin: 0 auto; }

/* ── Sheets ────────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; top: calc(var(--safe-top) + 12px); z-index: 21; background: var(--bg);
  border-radius: 18px 18px 0 0; display: flex; flex-direction: column; animation: slide .25s cubic-bezier(.2,.8,.2,1); max-width: 640px; margin: 0 auto; }
@keyframes slide { from { transform: translateY(40px); opacity: .4; } }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 16px 10px; }
.sheet-head h2 { font-size: 17px; font-weight: 700; text-align: center; }
.sheet-head .l { justify-self: start; color: var(--navy-light); font-weight: 500; }
.sheet-head .r { justify-self: end; color: var(--navy-light); font-weight: 700; }
@media (prefers-color-scheme: dark) { .sheet-head .l, .sheet-head .r { color: #7ea2ff; } }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 24px; display: flex; flex-direction: column; gap: 20px; -webkit-overflow-scrolling: touch; }
.sheet-body > * { flex-shrink: 0; }
.sheet-foot { padding: 10px 16px calc(var(--safe-bottom) + 10px); background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }

.group { background: var(--card); border-radius: 16px; overflow: hidden; }
.group-title { font-size: 13px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .3px; margin: 0 4px -12px; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; width: 100%; text-align: left; }
.row + .row { border-top: 1px solid var(--line); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; }
.row .s { font-size: 13px; color: var(--text2); }
.row.on { background: rgba(41,77,158,.08); }
.bar { height: 6px; border-radius: 3px; background: rgba(140,148,163,.2); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), #fa7333); }
.badge { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: rgba(140,148,163,.18); color: var(--text2); }

.step { display: grid; gap: 12px; }
.step-title { display: flex; gap: 10px; align-items: center; font-size: 19px; font-weight: 800; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--navy-grad); color: #fff; display: grid; place-items: center; font-size: 14px; flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.answer { padding: 18px 10px; border-radius: 18px; background: var(--card); display: grid; justify-items: center; gap: 8px; font-weight: 700; font-size: 16px;
  border: 2.5px solid transparent; white-space: pre-line; text-align: center; transition: transform .12s; }
.answer:active, .choice:active, .outcome:active { transform: scale(.97); }
.answer .ic { font-size: 30px; }
.outcome { padding: 14px 12px; border-radius: 14px; background: var(--card); display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 15px; border: 2px solid transparent; text-align: left; }
.choice { min-height: 46px; padding: 6px 4px; border-radius: 12px; font-weight: 600; font-size: 15px; text-align: center; }
.person { background: var(--card); border-radius: 20px; padding: 16px; display: grid; gap: 16px; }
.person-head { display: flex; gap: 10px; align-items: center; }
.q { display: grid; gap: 8px; }
.q > .lbl { font-size: 14px; font-weight: 600; color: var(--text2); }
.flowchips { display: flex; flex-wrap: wrap; gap: 8px; }
.flowchips button { padding: 10px 16px; border-radius: 999px; background: var(--card); font-weight: 600; border: 2px solid transparent; }
.flowchips button.on { background: var(--navy-light); color: #fff; }
.script { background: var(--card); border-radius: 18px; padding: 14px 16px; display: grid; gap: 8px; }
.script .head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.script p { margin: 0; white-space: pre-wrap; font-size: 16px; line-height: 1.5; }
.sign-card { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 18px; background: var(--card); border: 2px solid transparent; text-align: left; width: 100%; }
.sign-card.on { border-color: var(--red); background: rgba(204,20,41,.07); }
.sign-card .check { margin-left: auto; font-size: 26px; }
.hint { font-size: 13px; color: var(--text2); display: flex; gap: 6px; }
.flag-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.flag-toggles button { padding: 12px; border-radius: 12px; background: var(--card); font-weight: 600; font-size: 14px; text-align: left; border: 2px solid transparent; }
.flag-toggles button.on { border-color: var(--not-home); background: rgba(250,153,36,.1); }
.flag-toggles button.on.dnk { border-color: var(--red); background: rgba(204,20,41,.08); }
.dnk-warn { background: var(--red); color: #fff; padding: 14px; border-radius: 14px; font-weight: 700; font-size: 15px; }
.voter-line { display: grid; gap: 2px; padding: 12px 16px; }
.voter-line + .voter-line { border-top: 1px solid var(--line); }
.detail-kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.notes-list { display: grid; gap: 10px; padding: 14px 16px; }
.notes-list .n { display: grid; gap: 2px; }

#toasts { position: fixed; top: calc(var(--safe-top) + 80px); left: 0; right: 0; z-index: 40; display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow); border-radius: 20px;
  padding: 12px 18px; display: flex; gap: 12px; align-items: center; animation: pop .35s cubic-bezier(.2,1.4,.4,1); max-width: calc(100% - 32px); }
.toast .e { font-size: 30px; }
.toast b { display: block; }
@keyframes pop { from { transform: scale(.7) translateY(-10px); opacity: 0; } }

.maplibregl-ctrl-attrib { font-size: 10px; }
.maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { bottom: var(--safe-bottom); }

@media (min-width: 900px) {
  .card-wrap { left: 16px; right: auto; width: 420px; margin: 0; }
  .topbar { max-width: 640px; }
}

/* ── Location gate ─────────────────── */
.loc-gate { position: fixed; inset: 0; z-index: 30; background: var(--navy-grad); display: grid; place-items: center; padding: 16px;
  padding-top: calc(var(--safe-top) + 16px); padding-bottom: calc(var(--safe-bottom) + 16px); overflow-y: auto; }
.loc-card { background: var(--card); color: var(--text); border-radius: 24px; padding: 24px 20px; max-width: 420px; width: 100%;
  display: grid; gap: 14px; text-align: center; box-shadow: var(--shadow); }
.loc-card h2 { font-size: 22px; }
.loc-card p { margin: 0; line-height: 1.45; }
.loc-ic { font-size: 46px; }
.loc-steps { text-align: left; margin: 0; padding-left: 22px; display: grid; gap: 6px; line-height: 1.4; }

/* ── Campaign sign-up / billing ────── */
.select { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); color: var(--text); font: inherit; }
.county-list { max-height: 220px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px;
  padding: 10px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); font-size: 14px; }
.county-list label { display: flex; gap: 6px; align-items: center; }
.seg[data-kinds] { display: flex; flex-wrap: wrap; }
.seg[data-kinds] button { flex: 1 1 auto; padding: 9px 10px; }
.plan-box { display: grid; gap: 6px; }
.plan-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px;
  border: 2px solid var(--red); background: rgba(204,20,41,.06); }
.plan-price { font-size: 26px; font-weight: 800; white-space: nowrap; }

/* ── Owner dashboard ───────────────── */
.admin { position: fixed; inset: 0; overflow-y: auto; background: var(--bg); padding: 24px 16px 48px; }
.admin-inner { max-width: 1180px; margin: 0 auto; display: grid; gap: 14px; }
.admin h1 { font-size: 24px; } .admin h2 { font-size: 18px; margin-top: 14px; }
.admin-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.admin-head p { margin: 4px 0 0; }
.admin-actions { display: flex; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--card); border-radius: 14px; padding: 14px 16px; }
.stat-v { font-size: 26px; font-weight: 800; } .stat-l { font-size: 13px; color: var(--text2); font-weight: 600; } .stat-s { font-size: 12px; color: var(--text2); }
.table-wrap { overflow-x: auto; background: var(--card); border-radius: 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--text2); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(140,148,163,.16); }
.pill button { font-weight: 800; color: var(--text2); }
.row-actions { display: grid; gap: 4px; min-width: 150px; }
.select.sm, .sm-input { padding: 7px 10px; border-radius: 10px; font-size: 13px; border: 1px solid var(--line); background: var(--card2); color: var(--text); }
.cov { background: var(--card); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; }
.cov-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cov-row b { min-width: 110px; }
.cov-add { display: flex; gap: 8px; flex-wrap: wrap; }

/* ───────── manager tools (js/manager.js) */
.manage-btn { font-size: 18px; }
.mgr { position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.mgr-inner { max-width: 1100px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px 60px; }
.mgr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mgr-head h1 { margin: 0; font-size: 24px; }
.mgr-head p { margin: 2px 0 0; }
.mgr-tabs { display: flex; gap: 4px; margin: 16px 0; overflow-x: auto; background: var(--card2); border-radius: 12px; padding: 3px; }
.mgr-tabs button { flex: 1 0 auto; border: 0; background: none; padding: 9px 14px; border-radius: 9px; font-weight: 700; color: var(--text2); cursor: pointer; white-space: nowrap; }
.mgr-tabs button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.mgr-body { display: grid; gap: 14px; }
.mgr-body h2 { margin: 10px 0 0; font-size: 18px; }
.mgr-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mgr-toolbar .grow { flex: 1; }
.grow { flex: 1; min-width: 0; }
.guide { background: var(--card); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow); border-left: 4px solid var(--gold); }
.guide ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.card-list { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.wb-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.wb-row:last-child { border-bottom: 0; }
.wb-row .bar { height: 5px; background: var(--card2); border-radius: 3px; margin-top: 8px; overflow: hidden; max-width: 360px; }
.wb-row .bar i { display: block; height: 100%; background: var(--talked); }
.wb-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.danger-text { color: var(--red) !important; }
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
@media (max-width: 820px) { .builder { grid-template-columns: 1fr; } }
.b-form, .b-side { background: var(--card); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.b-side { position: sticky; top: 12px; }
.b-where { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.b-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .b-where, .b-two { grid-template-columns: 1fr; } }
.checklist { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card2); }
.checklist.short { max-height: 160px; }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.check:last-child { border-bottom: 0; }
.check input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--navy-light); }
.check .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); color: var(--text); margin-bottom: 8px; font: inherit; }
.lean-scale { display: flex; gap: 6px; flex-wrap: wrap; }
.lean-scale label { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--card2); font-size: 13px; font-weight: 600; cursor: pointer; }
.dotlean, .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.b-count { text-align: center; }
.b-count .big { font-size: 44px; font-weight: 800; line-height: 1.1; }
.fence-map { height: 260px; border-radius: 14px; overflow: hidden; background: var(--card2); }
.select { padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); color: var(--text); font: inherit; }
.modal-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; }
.modal { background: var(--card); color: var(--text); border-radius: 22px; padding: 22px; max-width: 380px; width: 100%; text-align: center; display: grid; gap: 12px; box-shadow: var(--shadow); }
.modal img, .modal canvas, .modal svg { margin: 0 auto; max-width: 220px; }
.big-code { font-size: 42px; font-weight: 800; letter-spacing: 6px; color: var(--navy-light); }
.settings-form { background: var(--card); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); display: grid; gap: 14px; max-width: 640px; }
.settings-form textarea { min-height: 120px; }
.checklist label { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; font-weight: 500; }
.checklist label:last-child { border-bottom: 0; }
.checklist label input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--navy-light); }
.checklist label .dotlean { margin-left: auto; }
.lean-scale span { padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--card2); color: var(--text2); border: 2px solid transparent; }
.lean-scale span.on { background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); border-color: var(--c); }
.field input[type=range] { padding: 0; border: 0; background: none; accent-color: var(--navy-light); }
.tbl .swatch, td > .swatch { margin-right: 8px; vertical-align: -1px; }

/* ───────── knock together (route planner) */
.route-fab.on { background: var(--navy-grad); color: #fff; box-shadow: 0 0 0 3px rgba(41,77,158,.35); }
.route-bar { position: fixed; left: 12px; right: 74px; bottom: calc(var(--safe-bottom) + 18px); z-index: 4; border-radius: 20px; padding: 12px 14px; display: grid; gap: 8px; max-width: 460px; }
.route-bar.mini { right: auto; left: auto; padding: 7px 12px; display: flex; flex-wrap: wrap; gap: 6px 12px; bottom: auto; top: calc(var(--safe-top) + 72px); right: 10px; max-width: 60vw; border-radius: 14px; }
.fabs.route-on .shift-pill { display: none; }
.route-bar .rb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.route-bar .rb-people { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.route-bar .rb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.route-bar .rp { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.route-bar .rp i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 2px #fff; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.wb-dist { font-size: 12px; font-weight: 700; color: var(--navy-light); white-space: nowrap; }
.leave-btn { color: var(--red) !important; }
/* Checkboxes inside form fields: don't inherit the text-box size (iPhone Safari drew them huge). */
.field input[type=checkbox], .field input[type=radio] { width: 18px; height: 18px; padding: 0; margin: 0; flex: 0 0 auto; border-radius: 4px; accent-color: var(--navy-light); }
.county-list label { font-size: 15px; font-weight: 600; min-width: 0; }

/* Draw walkbooks on the map (computer) */
.mgr-inner.wide { max-width: none; }
.drawbooks { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; height: calc(100vh - 170px); min-height: 520px; }
.db-map { position: relative; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); background: var(--card2); }
.db-map > [data-map] { position: absolute; inset: 0; }
.db-hint { position: absolute; left: 50%; transform: translateX(-50%); top: 12px; z-index: 2; padding: 9px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; max-width: 80%; text-align: center; pointer-events: none; }
.db-box { position: absolute; z-index: 3; border: 2px dashed #111827; background: rgba(17,24,39,.08); pointer-events: none; }
.db-side { overflow-y: auto; display: grid; gap: 12px; align-content: start; }
.db-tools button { font-size: 13px; }
.db-card { background: var(--card); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); display: grid; gap: 10px; }
.db-card h3 { margin: 0; font-size: 16px; }
.db-card .field { gap: 4px; }
.db-card .sm-input { width: 100%; box-sizing: border-box; }
.db-count { font-size: 15px; }
.db-count b { font-size: 26px; }
.db-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.db-actions .btn { width: auto; padding: 9px 14px; font-size: 14px; }
.db-half { display: flex; gap: 10px; align-items: flex-start; }
.db-half .swatch { margin-top: 10px; }
.db-warn { background: rgba(250,194,51,.18); border: 1px solid rgba(250,153,36,.45); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.db-msg { background: rgba(41,184,107,.14); border: 1px solid rgba(41,184,107,.4); border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 600; }
.db-list { display: grid; grid-template-columns: minmax(0, 1fr); max-height: 38vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.db-wb { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.db-wb:last-child { border-bottom: 0; }
.db-wb.on { background: var(--card2); box-shadow: inset 3px 0 0 var(--navy-light); }
.db-wb .grow { flex: 1; min-width: 0; }
.db-wb b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.db-merge { width: 84px; flex: none; }
.db-pick { display: flex; gap: 8px; align-items: center; justify-content: flex-start; width: 100%; }
.db-card .swatch, .db-wb .swatch { margin-right: 6px; vertical-align: -1px; }

.build-modes { max-width: 520px; margin-bottom: 12px; }
.build-modes button { cursor: pointer; }
.build-modes + .mgr-body .drawbooks { height: calc(100vh - 225px); }

/* Desktop: manager tools are the whole site */
.desk-bg { position: fixed; inset: 0; background: var(--bg); }
.mgr.desktop { z-index: 30; }
.mgr-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mgr-head-actions .btn { width: auto; }
.mgr-head-actions .select.sm { max-width: 240px; }
.pill.owner { background: rgba(250,194,51,.25); color: #8a5a00; }
.pill.sign { background: rgba(250,194,51,.18); color: #8a5a00; font-weight: 700; }
@media (prefers-color-scheme: dark) { .pill.owner, .pill.sign { color: #fac233; } }

/* Manager leaderboard */
.lb-range { max-width: 420px; }
.lb-range button { font-size: 13px; padding: 7px 4px; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 14px; padding: 8px 0 4px; }
.podium-col { display: grid; justify-items: center; gap: 6px; width: 130px; text-align: center; font-size: 13px; }
.podium-col b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.podium-bar { width: 100%; border-radius: 14px 14px 6px 6px; background: var(--navy-grad); color: #fff; display: grid; align-content: start; justify-items: center; padding-top: 10px; position: relative; }
.podium-col.first .podium-bar { background: var(--red-grad); }
.podium-bar .n { font-size: 24px; font-weight: 900; line-height: 1; }
.podium-bar .l { font-size: 11px; opacity: .85; font-weight: 600; }
.podium-bar .medal { position: absolute; right: 6px; top: -16px; font-size: 24px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }
.lb-list { display: grid; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.lb-row:last-child { border-bottom: 0; }
.lb-rank { width: 22px; text-align: center; font-weight: 800; color: var(--text2); }
.lb-row .grow { flex: 1; min-width: 0; }
.lb-name { display: flex; align-items: center; gap: 8px; }
.lb-count { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.lb-row .bar { margin-top: 6px; max-width: none; }

/* ── polish pass (Oct 30) ── */
@media (max-width: 600px) {
  .empty-map { right: 78px; }                      /* keep clear of the round buttons on the right */
  .podium { gap: 8px; }
  .podium-col { width: min(130px, 28vw); }
  .podium-col b { max-width: min(130px, 28vw); }
}
/* Route legend sits bottom-left so it never runs into the "No signal" banner up top. */
.route-bar.mini { top: auto; right: auto; left: 12px; bottom: calc(var(--safe-bottom) + 18px); max-width: calc(100vw - 96px); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(127,127,127,.25); border-top-color: var(--red, #cc1429); animation: wm-spin .8s linear infinite; }
@keyframes wm-spin { to { transform: rotate(360deg); } }
.mgr-status { font-weight: 600; }
.mgr-status.ok { color: #1f8f57; }
.mgr-status.warn { color: #c77a10; }
.mgr-status.bad { color: #cc1429; }
@media (max-width: 600px) {
  .tbl .hide-sm { display: none; }
  .tbl td .email { word-break: break-all; font-size: 11px; }
  .tbl .select.sm { min-width: 104px; }
  .mgr-tabs { overflow-x: auto; scrollbar-width: none; }
}
/* Medal sits inside the bar's corner so it never covers the name. */
.podium-bar .medal { top: 6px; right: auto; left: 6px; font-size: 18px; }
@media (max-width: 600px) {
  .tbl [data-remove] { font-size: 0; padding: 6px 10px; }
  .tbl [data-remove]::after { content: "✕"; font-size: 15px; }
  .tbl td, .tbl th { padding-left: 8px; padding-right: 8px; }
}

/* ── Outreach (calls & texts) ── */
.outreach-calling { margin: 6px 0 18px; }
.oc-row { display: flex; gap: 18px; flex-wrap: wrap; }
.oc-big { font-size: 26px; font-weight: 900; letter-spacing: -.02em; line-height: 1.15; }
.oc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ok-text { color: var(--talked); font-weight: 600; }
.empty-card { background: var(--card); border-radius: 18px; padding: 22px; text-align: center; display: grid; gap: 8px; justify-items: center; box-shadow: var(--shadow); }
.tbl .bar { height: 5px; background: var(--card2); border-radius: 3px; overflow: hidden; margin-top: 4px; min-width: 60px; }
.tbl .bar i { display: block; height: 100%; background: var(--red-grad); }
.tbl td.right { text-align: right; white-space: nowrap; }
.row-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
details.archived { margin-top: 18px; }
details.archived summary { cursor: pointer; color: var(--text2); font-weight: 600; }
.oc-contact { display: grid; gap: 6px; margin-bottom: 12px; }
.oc-name { font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.oc-contact .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.oc-contact .chip { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--card2); }
.script-body { padding: 12px 14px; line-height: 1.45; }
.oc-buttons { display: grid; gap: 10px; margin: 14px 0 6px; }
.oc-buttons a.btn { text-decoration: none; text-align: center; }
.oc-foot { display: flex; justify-content: space-between; margin-top: 10px; }
.oc-results { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-btn { border: 1.5px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 9px 14px; font-weight: 700; font-size: 14px; cursor: pointer; }
.pill-btn.on { border-color: var(--red); background: rgba(204,20,41,.1); color: var(--red); }
.plist { max-height: 220px; overflow: auto; display: grid; gap: 4px; background: var(--card2); border-radius: 12px; padding: 10px; }
.outreach-fab { font-size: 20px; }
/* Sheets opened from the manager tools sit above them; on a computer they're a centered dialog. */
.mgr ~ div > .scrim { z-index: 90; }
.mgr ~ div > .sheet { z-index: 91; }
.mgr.desktop ~ div > .sheet { left: 50%; right: auto; transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); top: 5vh; bottom: 5vh; border-radius: 22px; }
.tbl td.right .btn { display: inline-flex; width: auto; }
.outreach-page { min-height: 100vh; background: var(--bg); }
/* the dialer */
.dial-hero { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 18px 4px; }
.dial-btn { font-size: 20px; padding: 16px 40px; border-radius: 999px; background: var(--green, #1f9d55); }
.dial-pulse { font-size: 44px; animation: pulse 1.6s ease-in-out infinite; }
.dial-live { color: var(--green, #1f9d55); font-weight: 700; font-size: 13px; margin-bottom: 6px; }
/* call = green, ending = red */
.ico { width: 1.1em; height: 1.1em; vertical-align: -0.18em; flex: none; }
.btn.call, .dial-btn { background: var(--green, #1f9d55) !important; color: #fff; box-shadow: 0 6px 16px rgba(31,157,85,.25); }
.btn.call:disabled { opacity: .45; }
.btn.hangup { background: transparent; color: var(--red); border: 1.5px solid var(--red); box-shadow: none; width: 100%; max-width: 320px; }
.dial-actions { display: grid; gap: 10px; justify-items: center; margin-top: 6px; }
.dial-actions .btn { width: 100%; max-width: 320px; }
.dial-pulse { color: var(--green, #1f9d55); }
.dial-pulse .ico { width: 44px; height: 44px; }
.outreach-fab { color: var(--green, #1f9d55); }
.outreach-fab .ico { width: 22px; height: 22px; }
/* wrap-up after hanging up */
.dial-badge { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 32px; font-weight: 800; color: #fff; }
.dial-badge.ok { background: var(--green, #1f9d55); }
.dial-badge.warn { background: var(--orange, #f59e0b); }
.dial-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; max-width: 320px; }
.dial-stats > div { background: var(--card2, #f2f3f5); border-radius: 14px; padding: 12px 6px; display: grid; gap: 2px; }
.dial-stats b { font-size: 24px; }
.dial-stats span { font-size: 12px; color: var(--text2, #667); }
.dial-hero .dial-actions { width: 100%; }
/* desktop: campaign at a glance */
.mgr-summary { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 12px 0 4px; }
.mgr-summary > div { background: var(--card); border-radius: 14px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); display: grid; gap: 2px; }
.mgr-summary b { font-size: 24px; font-variant-numeric: tabular-nums; }
.mgr-summary span { font-size: 12px; color: var(--text2); display: grid; }
.mgr-summary em { font-style: normal; font-size: 11px; opacity: .8; }
@media (max-width: 1100px) { .mgr-summary { grid-template-columns: repeat(3, 1fr); } }
/* impact report (prints cleanly on letter paper) */
.report-page { height: 100vh; background: var(--bg, #f4f5f7); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.report { max-width: 980px; margin: 0 auto; padding: 32px 20px 60px; display: grid; gap: 18px; color: var(--text, #111); }
.rp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.rp-kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--red, #c81e2a); }
.rp-head h1 { margin: 4px 0; font-size: 32px; }
.rp-actions { display: flex; gap: 8px; }
.rp-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.rp-tile { background: var(--card, #fff); border-radius: 16px; padding: 16px 18px; display: grid; gap: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.rp-tile b { font-size: 34px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.rp-tile span { font-size: 14px; font-weight: 600; }
.rp-tile em { font-style: normal; font-size: 12px; color: var(--text2, #667); }
.rp-card { background: var(--card, #fff); border-radius: 16px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.rp-card h2 { margin: 0 0 12px; font-size: 17px; }
.rp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rp-list { margin: 0; display: grid; gap: 10px; }
.rp-list div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line, #eee); padding-bottom: 8px; }
.rp-list dt { color: var(--text2, #667); font-size: 14px; } .rp-list dd { margin: 0; font-weight: 600; font-size: 14px; text-align: right; }
.rp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rp-table th { text-align: left; font-size: 12px; color: var(--text2, #667); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line, #e5e7eb); }
.rp-table td { padding: 7px 8px; border-bottom: 1px solid var(--line, #f0f1f3); }
.rp-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.rp-chart { position: relative; }
.rp-chart svg { width: 100%; height: auto; display: block; }
.rp-chart .grid { stroke: var(--line, #e8e9ec); stroke-width: 1; }
.rp-chart .axis { font-size: 11px; fill: var(--text2, #667); }
.rp-chart .mark { fill: var(--navy, #0d2454); }
.rp-chart .hit { fill: transparent; }
.rp-chart .mark, .rp-chart text { pointer-events: none; }
.rp-chart .bar.on .mark { fill: var(--navy-light, #2a4d9e); }
.rp-tip { position: absolute; top: 0; width: 160px; background: var(--card, #fff); border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.12); pointer-events: none; }
.rp-turnout.pending { border: 1.5px dashed var(--line, #d7d9de); box-shadow: none; }
.rp-bars { display: grid; gap: 14px; }
.rp-bar-label { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.rp-bar-track { height: 14px; background: var(--card2, #eef0f3); border-radius: 7px; overflow: hidden; }
.rp-bar-track i { display: block; height: 100%; background: var(--muted, #9aa1ad); border-radius: 7px; }
.rp-bar-track i.strong { background: var(--green, #1f9d55); }
.rp-callout { margin: 14px 0 0; display: grid; gap: 4px; }
.rp-foot { font-size: 12px; color: var(--text2, #667); text-align: center; }
@media (max-width: 700px) { .rp-hero { grid-template-columns: 1fr 1fr; } .rp-two { grid-template-columns: 1fr; } .rp-head h1 { font-size: 26px; } }
@media print {
  .no-print { display: none !important; }
  .report-page { background: #fff; height: auto; overflow: visible; }
  .report { padding: 0; max-width: none; }
  .rp-card, .rp-tile { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.report { grid-template-columns: minmax(0, 1fr); }
.rp-hero > *, .rp-two > * { min-width: 0; }
.rp-card { overflow-x: auto; }
@media (max-width: 700px) {
  .report { padding: 20px 16px 48px; gap: 14px; }
  .rp-tile b { font-size: 28px; }
  .rp-list div { flex-direction: column; gap: 2px; } .rp-list dd { text-align: left; }
  .rp-table { font-size: 13px; } .rp-table th, .rp-table td { padding: 6px 4px; }
  .rp-table .hide-sm { display: none; }
}
/* two-step sign-in code */
.code-wrap { position: fixed; inset: 0; z-index: 9999; background: rgba(10, 20, 45, .55); display: grid; place-items: center; padding: 16px; }
.code-box { background: var(--card, #fff); color: var(--text, #111); border-radius: 18px; padding: 22px; width: 100%; max-width: 380px; display: grid; gap: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.code-box h2 { margin: 0; font-size: 20px; }
.code-box .code-input { font-size: 28px; letter-spacing: .3em; text-align: center; padding: 10px; border-radius: 12px; border: 1.5px solid var(--line, #d7d9de); }

/* ── Status banner (staff notice from /admin) */
.status-banner { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: calc(var(--safe-top) + 10px);
  width: min(560px, calc(100% - 24px)); display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px;
  background: var(--navy); color: #fff; box-shadow: var(--shadow); font-size: 15px; }
.status-banner.problem { background: #8f1020; }
.status-banner .grow { flex: 1; }
.status-banner button { color: #fff; opacity: .8; font-size: 16px; padding: 4px 6px; }

/* ── The dashboard on phones (owners and admins) */
@media (max-width: 600px) {
  .mgr-summary { grid-template-columns: repeat(2, 1fr); }
  .mgr.desktop .mgr-head-actions { width: 100%; }
  .mgr.desktop .mgr-head-actions .btn { flex: 1 1 auto; }
}

/* ── Assistant (dashboard) */
.ai-fab { position: fixed; z-index: 40; right: 20px; bottom: calc(var(--safe-bottom) + 20px); display: flex; align-items: center; gap: 8px;
  padding: 12px 18px 12px 14px; border-radius: 999px; background: var(--navy-grad); color: #fff; font-weight: 700; box-shadow: var(--shadow); }
.ai-fab svg { width: 22px; height: 22px; }
.ai-fab:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.ai-wrap { position: fixed; inset: 0; z-index: 95; }
.ai-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.25); }
.ai-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--bg); display: flex; flex-direction: column;
  box-shadow: -10px 0 40px rgba(0,0,0,.2); padding-bottom: var(--safe-bottom); }
.ai-head { display: flex; align-items: center; justify-content: space-between; padding: calc(var(--safe-top) + 14px) 16px 12px; border-bottom: 1px solid var(--line); font-size: 18px; }
.ai-plan { font-size: 12px; font-weight: 700; color: var(--text2); background: var(--card2); border-radius: 999px; padding: 3px 9px; margin-left: 6px; vertical-align: 2px; }
.ai-x { font-size: 18px; padding: 6px 10px; color: var(--text2); }
.ai-upsell { margin: 12px 16px 0; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: 14px; display: grid; gap: 8px; }
.ai-upsell p { margin: 0; }
.ai-upsell .btn { justify-self: start; width: auto; }
.ai-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ai-msg { max-width: 88%; padding: 10px 13px; border-radius: 16px; font-size: 15px; line-height: 1.45; }
.ai-msg p { margin: 0 0 6px; } .ai-msg p:last-child { margin-bottom: 0; }
.ai-msg ul { margin: 4px 0; padding-left: 20px; }
.ai-msg.me { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 5px; white-space: pre-wrap; }
.ai-msg.bot { align-self: flex-start; background: var(--card); border-bottom-left-radius: 5px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.ai-empty { margin: auto; text-align: center; color: var(--text2); max-width: 280px; }
.ai-typing { display: flex; gap: 5px; }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text2); animation: aiDot 1s infinite ease-in-out; }
.ai-typing i:nth-child(2) { animation-delay: .15s; } .ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aiDot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ai-typing i { animation: none; opacity: .6; } }
.ai-did { margin-top: 8px; font-size: 13px; color: var(--text2); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.ai-did::before { content: "✓"; color: var(--talked); font-weight: 800; }
.ai-did.undone { text-decoration: line-through; opacity: .7; }
.ai-did.undone::before { content: "↶"; color: var(--text2); }
.ai-undo { font-size: 13px; color: var(--text2); text-decoration: underline; text-underline-offset: 2px; opacity: .75; }
.ai-undo:hover, .ai-undo:focus-visible { opacity: 1; color: var(--text); }
.ai-undo-err { color: var(--red); }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 8px; }
.ai-chip { font-size: 13px; padding: 7px 11px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); text-align: left; }
.ai-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 12px; border-top: 1px solid var(--line); background: var(--card); }
.ai-form textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--card2); max-height: 140px; }
.ai-form .btn { width: auto; }
.ai-fab { position: fixed; }
.ai-new { position: absolute; top: 6px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--navy); }
.plan-grp .pill.on { background: rgba(41,184,107,.15); color: var(--talked); margin-left: 6px; }
