/* ============================================================
   Maoni ya Mkenya — Design System v2.0 (Market-Ready)
   Mobile-first. Kenya flag colours + modern premium UI.
   Inter + Plus Jakarta Sans typography.
   ============================================================ */

/* ---------- Google Fonts fallback stack ---------- */

:root {
  /* Maoni palette: periwinkle, sky blue, pale yellow, and amber */
  --ke-black:      #1d2540;
  --ke-ink:        #34415d;
  --ke-red:        #920034;
  --ke-red-deep:   #6e0025;
  --ke-green:      #7591ff;
  --ke-green-2:    #5e7bee;
  --ke-green-deep: #2130c0;
  --ke-white:      #ffffff;
  --ke-gold:       #ffa400;
  --ke-gold-deep:  #b96a00;

  /* Semantic surface */
  --bg:        #f7f9fd;
  --bg-2:      #edf3fc;
  --surface:   #ffffff;
  --surface-2: #f7faff;
  --surface-3: #eef4ff;
  --line:      #d9e4f4;
  --line-2:    #c0d2ed;
  --text:      #1d2540;
  --text-2:    #34415d;
  --muted:     #63728e;
  --muted-2:   #8a98b0;

  /* Status */
  --ok:     #4059c8;
  --warn:   #b87000;
  --danger: #920034;
  --info:   #324fbb;

  /* Radius */
  --r-xs: 5px;
  --r-s:  8px;
  --r:    12px;
  --r-l:  16px;
  --r-xl: 20px;

  /* Shadow */
  --sh-xs: 0 1px 2px rgba(16,20,24,.04), 0 1px 4px rgba(16,20,24,.06);
  --sh-s:  0 2px 6px rgba(16,20,24,.06), 0 1px 3px rgba(16,20,24,.08);
  --sh:    0 6px 20px rgba(16,20,24,.09), 0 2px 6px rgba(16,20,24,.06);
  --sh-l:  0 16px 48px rgba(16,20,24,.14), 0 4px 12px rgba(16,20,24,.08);
  --sh-xl: 0 28px 72px rgba(16,20,24,.18), 0 8px 24px rgba(16,20,24,.1);

  /* Layout */
  --header-h: 64px;
  --maxw:     1140px;

  /* Transitions */
  --t-fast: .12s ease;
  --t:      .22s ease;
  --t-slow: .4s cubic-bezier(.22,1,.36,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  padding-top: var(--header-h);
  padding-bottom: 80px; /* space for mobile bottom nav */
  min-height: 100vh;
}

img { max-width: 100%; display: block; object-fit: cover; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }

.hidden { display: none !important; }

/* ---------- Header ---------- */
#app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(220, 232, 226, .7);
  box-shadow: 0 1px 0 rgba(16,20,24,.04), 0 2px 12px rgba(16,20,24,.06);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  text-decoration: none;
}

.brand-mark {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--ke-black) 0%, var(--ke-green) 100%);
  display: grid;
  place-items: center;
  box-shadow: var(--sh-s), inset 0 1px 0 rgba(255,255,255,.12);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  flex-shrink: 0;
}

.brand-mark-sm {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--ke-black), var(--ke-green));
}

.brand:hover .brand-mark {
  transform: scale(1.06) rotate(-2deg);
  box-shadow: var(--sh);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text strong {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--ke-black);
  letter-spacing: -.01em;
}

.brand-text small {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: 1px;
}

/* Desktop nav */
.top-nav { display: none; gap: 2px; }

.top-nav a {
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  transition: background var(--t-fast), color var(--t-fast);
}

.top-nav a:hover {
  background: var(--surface-3);
  color: var(--text);
}

.top-nav a.active {
  background: rgba(117, 145, 255, .1);
  color: var(--ke-green);
}

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 16px;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

.icon-btn:hover {
  background: var(--surface-3);
  border-color: var(--line-2);
  transform: scale(1.05);
}

.badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--ke-red);
  color: #fff;
  border-radius: 999px;
  font-size: 10px; font-weight: 800;
  display: grid; place-items: center;
  border: 2px solid #fff;
  animation: badge-pop .3s cubic-bezier(.34,1.56,.64,1);
}

@keyframes badge-pop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

/* Role switch */
.role-switch {
  display: none;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.role-switch button {
  border: 0; background: none;
  font-size: 12px; font-weight: 700;
  color: var(--muted);
  padding: 6px 11px; border-radius: 999px;
  transition: all var(--t-fast);
}

.role-switch button.active {
  background: var(--ke-black);
  color: #fff;
  box-shadow: var(--sh-xs);
}

/* Session strip */
.session-strip {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 6px 16px 10px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
}

.session-strip .pill {
  background: rgba(117, 145, 255, .1);
  color: var(--ke-green);
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 700;
  font-size: 11.5px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .005em;
  background: var(--ke-green);
  color: #fff;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--t-fast);
  border-radius: inherit;
}

.btn:hover::after { background: rgba(255,255,255,.1); }

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh);
}

.btn:active { transform: translateY(0); box-shadow: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--ke-green-2), var(--ke-green-deep));
  box-shadow: 0 4px 14px rgba(117, 145, 255,.32);
}

.btn-primary:hover {
  box-shadow: 0 8px 24px rgba(117, 145, 255,.4);
}

.btn-red {
  background: linear-gradient(135deg, var(--ke-red), var(--ke-red-deep));
  box-shadow: 0 4px 14px rgba(200,16,46,.28);
}

.btn-dark {
  background: linear-gradient(135deg, #1b2228, var(--ke-black));
  box-shadow: 0 4px 14px rgba(16,20,24,.24);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--line);
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--line-2);
}

.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 12.5px; }
.btn-xs { padding: 5px 10px; font-size: 11.5px; }
.btn[disabled] { opacity: .5; pointer-events: none; cursor: not-allowed; }

/* ---------- Layout ---------- */
.view {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 14px 36px;
  animation: view-enter .3s cubic-bezier(.22,1,.36,1);
}

@keyframes view-enter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.section { margin-bottom: 32px; }

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.section-head h2 { font-size: 18px; margin: 0; font-weight: 800; letter-spacing: -.02em; }
.section-head p  { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ke-green);
  display: block;
  margin-bottom: 4px;
}

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-s);
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh);
  border-color: var(--line-2);
}

.card-pad { padding: 16px; }
.card-head { padding: 16px 16px 0; }
.card-title { font-size: 15px; font-weight: 700; margin: 0 0 4px; line-height: 1.4; letter-spacing: -.01em; }
.card-desc { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  color: #fff;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(150deg, rgba(33, 48, 192,.96), rgba(16,20,24,.94));
  box-shadow: var(--sh-xl);
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: .4;
  transition: opacity .6s ease;
  will-change: opacity;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(33, 48, 192,.85) 0%,
    rgba(33, 48, 192,.4) 50%,
    rgba(16,20,24,.3) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 28px 22px;
  max-width: 680px;
  width: 100%;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 14px;
  backdrop-filter: blur(8px);
}

.hero h1 {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  font-size: 26px;
  line-height: 1.2;
  margin: 0 0 10px;
  font-weight: 900;
  letter-spacing: -.02em;
}

.hero p { font-size: 14px; color: rgba(255,255,255,.8); margin: 0 0 20px; line-height: 1.6; }

.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 20px;
}

.hero-stat {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--r-s);
  padding: 10px 12px;
  backdrop-filter: blur(8px);
}

.hero-stat strong {
  display: block;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.hero-stat span {
  font-size: 10px;
  color: rgba(255,255,255,.7);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}

/* Hero trending ticker */
.hero-ticker {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 2;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.24);
  border-radius: var(--r-s);
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  display: none;
}

/* ---------- Sector chips ---------- */
.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--t-fast);
  cursor: pointer;
}

.chip:hover { border-color: var(--ke-green); color: var(--ke-green); background: rgba(117, 145, 255,.05); }
.chip.active { background: var(--ke-black); border-color: var(--ke-black); color: #fff; }

/* ---------- Poll card ---------- */
.poll-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.poll-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 0;
  flex-wrap: wrap;
}

/* Tags */
.tag {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(117, 145, 255,.1);
  color: var(--ke-green);
  white-space: nowrap;
}

.tag.live {
  background: rgba(200,16,46,.08);
  color: var(--ke-red);
}

.tag.live::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ke-red);
  margin-right: 5px;
  animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .3; transform: scale(.9); }
}

.tag.closed { background: rgba(107,122,118,.12); color: var(--muted); }
.tag.sponsored { background: rgba(255, 164, 0,.16); color: var(--ke-gold-deep); }
.tag.ok { background: rgba(117, 145, 255,.1); color: var(--ke-green); }
.tag.danger { background: rgba(200,16,46,.1); color: var(--ke-red); }
.tag.info { background: rgba(22,104,168,.1); color: var(--info); }
.tag.warn { background: rgba(201,138,21,.12); color: var(--warn); }

.poll-body { padding: 10px 16px 4px; }

.poll-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--muted);
  padding: 10px 16px;
  border-top: 1px dashed var(--line);
  margin-top: 10px;
  flex-wrap: wrap;
}

.poll-foot {
  padding: 0 16px 16px;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---------- Option voting ---------- */
.options { display: grid; gap: 10px; padding: 14px 16px 4px; }

.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-s);
  padding: 13px 14px;
  background: var(--surface);
  text-align: left;
  overflow: hidden;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  cursor: pointer;
}

.option:hover {
  border-color: var(--ke-green);
  transform: translateX(3px);
  box-shadow: var(--sh-xs);
}

.option.selected {
  border-color: var(--ke-green);
  background: rgba(117, 145, 255,.05);
}

.option .radio {
  width: 20px; height: 20px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  display: grid; place-items: center;
  transition: border-color var(--t-fast);
}

.option.selected .radio { border-color: var(--ke-green); }

.option.selected .radio::after {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ke-green);
  animation: radio-fill .15s ease;
}

@keyframes radio-fill {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.option-label { font-size: 14px; font-weight: 600; position: relative; z-index: 1; }
.option-pct { margin-left: auto; color: var(--muted); font-weight: 700; font-size: 13px; position: relative; z-index: 1; }

.option .fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: rgba(117, 145, 255,.08);
  z-index: 0;
  transition: width .6s cubic-bezier(.22,1,.36,1);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
}

.option.locked { cursor: default; }
.option.locked:hover { border-color: var(--line); transform: none; box-shadow: none; }

/* ---------- Result bars ---------- */
.bar-row { margin-bottom: 14px; }

.bar-row:last-child { margin-bottom: 0; }

.bar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  margin-bottom: 7px;
}

.bar-top strong { font-weight: 700; }

.bar-track {
  height: 11px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ke-green), var(--ke-green-2));
  transition: width .7s cubic-bezier(.22,1,.36,1);
}

.bar-fill.lead {
  background: linear-gradient(90deg, var(--ke-black), var(--ke-green));
}

/* ---------- Stat tiles ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  box-shadow: var(--sh-xs);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.stat:hover { transform: translateY(-2px); box-shadow: var(--sh-s); }

.stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.stat strong { display: block; font-size: 26px; margin-top: 6px; letter-spacing: -.03em; font-weight: 800; }
.stat small { font-size: 11.5px; color: var(--ok); font-weight: 700; margin-top: 2px; display: block; }
.stat small.down { color: var(--danger); }
.stat small.neutral { color: var(--muted); }

/* ---------- Notice / alert ---------- */
.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-radius: var(--r-s);
  padding: 14px 15px;
  font-size: 13px;
  border: 1px solid;
  line-height: 1.5;
}

.notice .ic { font-size: 18px; line-height: 1.2; flex-shrink: 0; margin-top: 1px; }
.notice strong { display: block; margin-bottom: 3px; font-size: 13.5px; }
.notice.info   { background: rgba(22,104,168,.06); border-color: rgba(22,104,168,.2); color: #0f4e7a; }
.notice.warn   { background: rgba(201,138,21,.07); border-color: rgba(201,138,21,.28); color: #7a520a; }
.notice.ok     { background: rgba(117, 145, 255,.06); border-color: rgba(117, 145, 255,.2); color: #30469f; }
.notice.danger { background: rgba(200,16,46,.06); border-color: rgba(200,16,46,.22); color: #7a0b1c; }

/* ---------- Ad cards ---------- */
.ad-card {
  border: 1.5px solid rgba(255, 164, 0,.35);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--sh-s);
  transition: transform var(--t), box-shadow var(--t);
}

.ad-card:hover { transform: translateY(-2px); box-shadow: var(--sh); }

.ad-media {
  height: 140px;
  background: var(--ke-green-deep);
  background-size: cover;
  background-position: center;
  position: relative;
}

.ad-media .ad-flag {
  position: absolute;
  top: 8px; left: 8px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .07em;
  background: rgba(16,20,24,.72);
  color: #fff;
  border-radius: var(--r-xs);
  padding: 3px 8px;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

.ad-body { padding: 13px 15px; }
.ad-body h4 { margin: 0 0 4px; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.ad-body p  { margin: 0 0 11px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* ---------- Chat / Support ---------- */
.chat-wrap {
  display: flex;
  flex-direction: column;
  height: 62vh;
  min-height: 440px;
  border-radius: var(--r);
  overflow: hidden;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ke-black), var(--ke-green));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
  box-shadow: var(--sh-s);
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface-2);
  scroll-behavior: smooth;
}

.msg {
  max-width: 85%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: var(--sh-xs);
  animation: msg-in .22s ease;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.msg.bot {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

.msg.me {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--ke-green), var(--ke-green-deep));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg.blocked {
  align-self: flex-end;
  background: rgba(200,16,46,.08);
  color: var(--ke-red-deep);
  border: 1px solid rgba(200,16,46,.25);
  border-bottom-right-radius: 4px;
}

.msg .msg-time {
  display: block;
  font-size: 10px;
  opacity: .65;
  margin-top: 5px;
}

.chat-input {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.chat-input input {
  flex: 1;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 14px;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.chat-input input:focus {
  outline: none;
  border-color: var(--ke-green);
  box-shadow: 0 0 0 3px rgba(117, 145, 255,.12);
}

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 7px;
  color: var(--text-2);
  letter-spacing: .01em;
}

.input,
select.input,
textarea.input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--r-s);
  padding: 12px 14px;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.input:focus,
select.input:focus,
textarea.input:focus {
  outline: none;
  border-color: var(--ke-green);
  box-shadow: 0 0 0 3px rgba(117, 145, 255,.12);
}

textarea.input { min-height: 96px; resize: vertical; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.form-row { display: grid; gap: 0; }

/* Auth */
.auth-shell { max-width: 440px; margin: 8px auto; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.auth-switch a { color: var(--ke-green); font-weight: 700; }

/* Divider */
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.divider-text {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin: 18px 0;
}
.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- Lists ---------- */
.list { display: grid; gap: 8px; }

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}

.list-row:hover { border-color: var(--line-2); transform: translateX(2px); box-shadow: var(--sh-xs); }

.list-row .lr-ic {
  width: 36px; height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-3);
  font-size: 16px;
}

.list-row .lr-main { flex: 1; min-width: 0; }
.list-row .lr-main strong { display: block; font-size: 13.5px; font-weight: 700; }
.list-row .lr-main span  { font-size: 12px; color: var(--muted); display: block; margin-top: 2px; line-height: 1.4; }
.list-row.unread { border-left: 3px solid var(--ke-green); padding-left: 11px; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tabs button {
  border: 0;
  background: none;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 2.5px solid transparent;
  white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
  cursor: pointer;
}

.tabs button.active  { color: var(--ke-green); border-bottom-color: var(--ke-green); }
.tabs button:hover:not(.active) { color: var(--text); }

/* ---------- Table ---------- */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background: var(--surface);
  box-shadow: var(--sh-xs);
}

table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 480px; }
th, td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--line); }
th { background: var(--surface-2); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 800; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: var(--surface-2); }
td a { color: var(--ke-green); font-weight: 600; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 45;
  display: flex;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 16px rgba(16,20,24,.07);
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 2px 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .02em;
  transition: color var(--t-fast), transform var(--t-fast);
}

.bottom-nav a span { font-size: 18px; line-height: 1; }
.bottom-nav a.active { color: var(--ke-green); }
.bottom-nav a:active { transform: scale(.92); }

/* ---------- Footer ---------- */
#app-footer {
  background: var(--ke-black);
  color: #b0c0bb;
  margin-top: 16px;
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px 16px 28px;
  display: grid;
  gap: 24px;
}

.footer-brand .footer-logo {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.footer-brand strong { color: #fff; font-size: 15px; font-weight: 800; }
.footer-brand p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; max-width: 260px; }

.footer-col h4 { color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 12px; }
.footer-col a  { display: block; font-size: 13px; margin-bottom: 8px; transition: color var(--t-fast); }
.footer-col a:hover { color: #fff; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); }
.footer-bottom-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-bottom p { margin: 0; font-size: 11.5px; color: #7f8f8a; }
.footer-bottom strong { color: #b0c0bb; }

.footer-badges { display: flex; flex-wrap: wrap; gap: 8px; }

.footer-badge {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #b0c0bb;
}

/* ---------- Toast ---------- */
.toast-root {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: 96px;
  z-index: 90;
  display: grid;
  gap: 8px;
  width: calc(100% - 28px);
  max-width: 420px;
}

.toast {
  background: var(--ke-black);
  color: #fff;
  border-radius: var(--r-s);
  padding: 13px 16px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--sh-xl);
  animation: toast-rise .3s cubic-bezier(.22,1,.36,1);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.45;
  border: 1px solid rgba(255,255,255,.08);
}

.toast.ok { background: linear-gradient(135deg, var(--ke-green), var(--ke-green-deep)); border-color: rgba(255,255,255,.12); }
.toast.danger { background: linear-gradient(135deg, var(--ke-red), var(--ke-red-deep)); }

@keyframes toast-rise {
  from { opacity: 0; transform: translateY(16px) scale(.95); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16,20,24,.55);
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 16px;
  backdrop-filter: blur(4px);
  animation: backdrop-in .2s ease;
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--surface);
  border-radius: var(--r-l);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--sh-xl);
  animation: modal-in .28s cubic-bezier(.22,1,.36,1);
  border: 1px solid var(--line);
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(.96) translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.modal-head {
  padding: 18px 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.modal-head h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.modal-body { padding: 16px 18px; }
.modal-foot { padding: 0 18px 18px; display: flex; gap: 10px; }

.x-btn {
  border: 0;
  background: var(--surface-3);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 16px;
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: background var(--t-fast), color var(--t-fast);
  flex-shrink: 0;
}

.x-btn:hover { background: var(--line); color: var(--text); }

/* ---------- Page transition ---------- */
.page-transition {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--ke-green-deep), var(--ke-black));
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}

/* ---------- Utilities ---------- */
.muted   { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.small   { font-size: 12.5px; }
.xs      { font-size: 11px; }
.bold    { font-weight: 700; }
.mt-4    { margin-top: 4px; }
.mt-8    { margin-top: 8px; }
.mt-12   { margin-top: 12px; }
.mt-16   { margin-top: 16px; }
.mt-24   { margin-top: 24px; }
.mb-0    { margin-bottom: 0; }
.mb-8    { margin-bottom: 8px; }
.flex    { display: flex; }
.between { justify-content: space-between; }
.center  { align-items: center; }
.gap-6   { gap: 6px; }
.gap-8   { gap: 8px; }
.gap-12  { gap: 12px; }
.wrap    { flex-wrap: wrap; }
.right   { text-align: right; }
.text-center { text-align: center; }

/* Scroll area */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .hero { min-height: 360px; }
  .hero h1 { font-size: 32px; }
  .hero-ticker { display: block; }
}

@media (min-width: 720px) {
  body { padding-bottom: 0; }
  #mobile-nav { display: none; }
  #app-footer { margin-top: 40px; }
  .top-nav { display: flex; }
  .role-switch { display: flex; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .hero h1 { font-size: 38px; }
  .hero-content { padding: 36px 36px; max-width: 700px; }
  .view { padding: 26px 20px 40px; }
  .form-row.two { grid-template-columns: 1fr 1fr; gap: 12px; }
  .footer-inner { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
  .toast-root { bottom: 24px; }
}

@media (min-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .hero { min-height: 440px; }
  .hero h1 { font-size: 44px; }
}

/* ---------- Poll Images & Candidate Showcase ---------- */
.poll-cover {
  width: 100%;
  height: 154px;
  object-fit: cover;
  border-radius: var(--r) var(--r) 0 0;
  display: block;
  background: var(--surface-3);
  position: relative;
}

.poll-cover-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--r) var(--r) 0 0;
}

.poll-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(16,20,24,.75) 0%, rgba(16,20,24,0) 65%);
  pointer-events: none;
}

.cand-avatar-stack {
  display: flex;
  align-items: center;
  padding: 0 4px;
}

.cand-avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  margin-left: -10px;
  object-fit: cover;
  box-shadow: var(--sh-xs);
  background: var(--surface-2);
  transition: transform var(--t-fast);
}

.cand-avatar-sm:first-child { margin-left: 0; }
.cand-avatar-sm:hover { transform: translateY(-2px) scale(1.12); z-index: 2; }

.cand-avatar-more {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  margin-left: -10px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: var(--sh-xs);
}

.cand-preview-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 2px;
}

.cand-preview-label {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}

/* Candidate Grid (For photo-based voting) */
.cand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  padding: 16px;
}

.cand-card {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all var(--t);
  box-shadow: var(--sh-xs);
  text-align: center;
}

.cand-card:hover {
  border-color: var(--ke-green);
  transform: translateY(-3px);
  box-shadow: var(--sh);
}

.cand-card.selected {
  border-color: var(--ke-green);
  box-shadow: 0 0 0 3px rgba(117, 145, 255,.25), var(--sh-s);
  background: rgba(117, 145, 255,.02);
}

.cand-card-photo-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--surface-3);
  position: relative;
  overflow: hidden;
}

.cand-card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.cand-card:hover .cand-card-photo {
  transform: scale(1.05);
}

.cand-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(16,20,24,.75);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 8px;
}

.cand-card-select-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  border: 2px solid var(--line-2);
  display: grid;
  place-items: center;
  transition: all var(--t-fast);
  color: transparent;
  font-size: 14px;
  font-weight: 900;
}

.cand-card.selected .cand-card-select-badge {
  background: var(--ke-green);
  border-color: var(--ke-green);
  color: #fff;
}

.cand-card-body {
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cand-card-name {
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 4px;
  line-height: 1.3;
  color: var(--text);
}

.cand-card-role {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.cand-card-pct {
  margin-top: auto;
  font-size: 15px;
  font-weight: 800;
  color: var(--ke-green);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.cand-card-bar {
  height: 6px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.cand-card-bar-fill {
  height: 100%;
  background: var(--ke-green);
  border-radius: 999px;
  transition: width .6s ease;
}

/* Image in regular option rows */
.option-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--line-2);
  box-shadow: var(--sh-xs);
  background: var(--surface-3);
  z-index: 1;
}

.option-text-group {
  display: flex;
  flex-direction: column;
  z-index: 1;
  text-align: left;
}

.option-sub {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 1px;
}

.bar-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--line);
  margin-right: 8px;
  vertical-align: middle;
  background: var(--surface-3);
}

/* Image upload inputs in modal */
.img-upload-box {
  border: 2px dashed var(--line-2);
  border-radius: var(--r-s);
  padding: 14px;
  text-align: center;
  background: var(--surface-2);
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
}

.img-upload-box:hover {
  border-color: var(--ke-green);
  background: rgba(117, 145, 255,.04);
}

.img-upload-preview {
  max-height: 130px;
  width: 100%;
  object-fit: cover;
  border-radius: var(--r-xs);
  margin-top: 8px;
  display: none;
}

.opt-builder-item {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  padding: 12px;
  display: grid;
  gap: 8px;
  position: relative;
}

.opt-builder-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.opt-thumb-preview {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  object-fit: cover;
  background: var(--surface);
  flex-shrink: 0;
}

.upload-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast);
}

.upload-pill-btn:hover {
  border-color: var(--ke-green);
  color: var(--ke-green);
}

/* ---------- Focus styles (accessibility) ---------- */
:focus-visible {
  outline: 2.5px solid var(--ke-green);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Print styles ---------- */
@media print {
  #app-header, #mobile-nav, .toast-root, .modal-root { display: none; }
  body { padding: 0; }
}


/* Bright, civic-first finish */
body { background: var(--bg); }
#app-header { background: rgba(255,255,255,.94); border-bottom-color: rgba(117,145,255,.18); }
.hero {
  min-height: 390px;
  background: linear-gradient(135deg, rgba(33,48,192,.95), rgba(29,37,64,.92));
  box-shadow: 0 18px 48px rgba(33,48,192,.18);
}
.hero-media { opacity: .58; }
.hero::before {
  background: linear-gradient(90deg, rgba(33,48,192,.82) 0%, rgba(33,48,192,.55) 54%, rgba(29,37,64,.18) 100%);
}
.btn-primary {
  color: var(--ke-black);
  background: linear-gradient(135deg, var(--ke-gold), #ffc247);
  box-shadow: 0 4px 14px rgba(255,164,0,.28);
}
.btn-primary:hover { box-shadow: 0 8px 24px rgba(255,164,0,.34); }
.chip.active { background: var(--ke-green); border-color: var(--ke-green); color: var(--ke-black); }
.poll-card { border-color: rgba(117,145,255,.18); }
.poll-card:hover { border-color: var(--ke-green); }
.card, .ad-card, .stat { box-shadow: 0 3px 14px rgba(33,48,192,.045); }
.card:hover, .ad-card:hover { box-shadow: 0 9px 26px rgba(33,48,192,.1); }
.bottom-nav a.active { color: var(--ke-green-deep); }
@media (max-width: 639px) {
  .hero { min-height: 430px; border-radius: var(--r-l); }
  .hero-content { padding: 24px 18px; }
  .hero h1 { max-width: 14ch; }
  .hero-stats { gap: 6px; }
  .hero-stat { padding: 9px 8px; }
}


/* ============================================================
   v3 — "Sky, sun, amber" upgrade
   The three palette bands (sky / butter / amber) are the identity:
   they stack in the hero, stripe the ballot cards, and tint surfaces.
   ============================================================ */
:root {
  --sky:        #bddfff;
  --sky-2:      #dcedff;
  --sky-3:      #eef6ff;
  --butter:     #fff2a6;
  --butter-2:   #fff9d6;
  --amber:      #ffa400;
  --amber-deep: #c97d00;
  --ink:        #14233f;
  --ink-2:      #2c3d5e;
  --wine:       #920034;

  --bg:        #f6faff;
  --bg-2:      var(--sky-3);
  --surface-2: var(--sky-3);
  --surface-3: var(--sky-2);
  --line:      #d3e4f7;
  --line-2:    #b4cfec;
  --text:      var(--ink);
  --text-2:    var(--ink-2);
  --muted:     #566783;

  --ke-black: var(--ink);
  --ke-green: #1f4f9a;
  --ke-green-2: #2a63b8;
  --ke-green-deep: #14396f;
  --ke-gold: var(--amber);
  --ok: #1f4f9a;

  --font-display: 'Bricolage Grotesque', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Figtree', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --ring: 0 0 0 3px rgba(255,164,0,.45);

  --sh-s: 0 1px 0 rgba(20,35,63,.04), 0 6px 16px -8px rgba(20,35,63,.18);
  --sh:   0 2px 0 rgba(20,35,63,.04), 0 18px 34px -16px rgba(20,35,63,.28);
}

body { font-family: var(--font-body); background: var(--bg); color: var(--ink); }
h1, h2, h3, h4, .brand-text strong, .card-title, .hero-stat strong, .footer-col h4 {
  font-family: var(--font-display);
}
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 10px; }

/* ---------- Header ---------- */
#app-header {
  background: rgba(246,250,255,.9);
  border-bottom: 0;
  box-shadow: none;
}
#app-header::after {            /* three-band rule under the header */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: linear-gradient(to right,
    var(--sky) 0 33.33%, var(--butter) 33.33% 66.66%, var(--amber) 66.66% 100%);
}
.brand-mark {
  background: var(--sky); box-shadow: none; border-radius: 11px; overflow: hidden;
  width: 38px; height: 38px; display: block; padding: 0;
}
.brand-mark-sm { width: 30px; height: 30px; border-radius: 9px; background: none; }
.mark-bands { display: flex; flex-direction: column; width: 100%; height: 100%; }
.mark-bands i { flex: 1; display: block; }
.mark-bands i:nth-child(1) { background: var(--sky); }
.mark-bands i:nth-child(2) { background: var(--butter); }
.mark-bands i:nth-child(3) { background: var(--amber); }
.footer-logo .brand-mark-sm {
  background: linear-gradient(var(--sky) 0 33.3%, var(--butter) 33.3% 66.6%, var(--amber) 66.6%);
}
.brand-text strong { font-weight: 800; letter-spacing: -.02em; font-size: 17px; color: var(--ink); }
.brand-text small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.top-nav a { border-radius: 999px; font-weight: 600; color: var(--ink-2); }
.top-nav a:hover { background: var(--sky-2); color: var(--ink); }
.top-nav a.active { background: var(--butter); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--amber); }
.icon-btn { border-radius: 50%; border-color: var(--line-2); background: #fff; }
.role-switch button.active { background: var(--ink); color: #fff; }

/* ---------- Buttons ---------- */
.btn { border-radius: 999px; font-weight: 700; letter-spacing: 0; }
.btn-primary { background: var(--amber); color: var(--ink); border-color: var(--amber); box-shadow: 0 2px 0 var(--amber-deep); }
.btn-primary:hover { background: #ffb21f; box-shadow: 0 4px 0 var(--amber-deep); transform: translateY(-1px); }
.btn-primary:active { box-shadow: 0 0 0 var(--amber-deep); transform: translateY(2px); }
.btn-ink { background: var(--ink); color: #fff; border: 1px solid var(--ink); }
.btn-ink:hover { background: #1d3358; }
.btn-ghost { background: #fff; border: 1.5px solid var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: var(--sky-2); border-color: var(--ink-2); }
.btn-lg { padding: 14px 24px; font-size: 15px; }

/* ---------- Section heads ---------- */
.section { margin-bottom: 52px; }
.section-head h2 { font-size: clamp(22px, 3.4vw, 30px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.section-head p { font-size: 14.5px; color: var(--muted); }

/* ---------- Hero ---------- */
.hero {
  display: block; min-height: 0; padding: 0; color: var(--ink);
  background: var(--sky); border-radius: 28px; box-shadow: none; overflow: hidden;
}
.hero::before { display: none; }
.hero-sky {
  display: grid; gap: 28px; padding: 36px 24px 0;
  grid-template-columns: 1fr; align-items: end;
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px;
  font-size: 13.5px; font-weight: 700; color: var(--ink);
  background: rgba(255,255,255,.7); padding: 7px 13px; border-radius: 999px;
}
.dot-live { width: 9px; height: 9px; border-radius: 50%; background: var(--wine); box-shadow: 0 0 0 0 rgba(146,0,52,.5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(146,0,52,0); } 100% { box-shadow: 0 0 0 0 rgba(146,0,52,0); } }
.hero h1 {
  font-family: var(--font-display); font-size: clamp(40px, 8.4vw, 76px);
  line-height: .98; letter-spacing: -.045em; font-weight: 800; margin: 0 0 18px; color: var(--ink);
}
.hero .hero-lede { font-size: clamp(15px, 2vw, 17.5px); line-height: 1.55; color: var(--ink-2); max-width: 46ch; margin: 0 0 24px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-bottom: 8px; }

.hero-arch { position: relative; align-self: end; max-width: 420px; width: 100%; margin: 0 auto; }
.hero-arch-img {
  aspect-ratio: 4 / 4.4; width: 100%;
  background-size: cover; background-position: 58% 50%;
  border-radius: 999px 999px 0 0;
  border: 6px solid var(--sky-3); border-bottom: 0;
}
.hero-badge {
  position: absolute; left: -6px; bottom: 22px; max-width: 78%;
  background: var(--butter); color: var(--ink); border-radius: 16px 16px 16px 4px;
  padding: 11px 14px; box-shadow: var(--sh); display: block; transition: transform var(--t);
}
.hero-badge:hover { transform: translateY(-2px); }
.hero-badge span { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 2px; }
.hero-badge strong { font-size: 13.5px; line-height: 1.3; font-weight: 700; display: block; }

.hero-band { width: 100%; }
.hero-band-sun {
  background: var(--butter); padding: 20px 24px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.hero-band-amber { background: var(--amber); height: 14px; }
.hero-stats { display: none; }
.hero-stat { background: none; border: 0; padding: 0; backdrop-filter: none; min-width: 0; }
.hero-stat strong { display: block; font-size: clamp(22px, 4.6vw, 40px); font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--ink); }
.hero-stat span { display: block; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-transform: none; letter-spacing: 0; }

@media (min-width: 860px) {
  .hero-sky { grid-template-columns: 1.15fr .85fr; gap: 40px; padding: 56px 56px 0; }
  .hero-band-sun { padding: 26px 56px; }
  .hero-arch { margin: 0 0 0 auto; }
}

/* ---------- Ballot cards ---------- */
.card { border-radius: 22px; border: 1.5px solid var(--line); box-shadow: none; background: #fff; }
.card:hover { box-shadow: var(--sh); border-color: var(--line-2); transform: none; }
.poll-card { position: relative; overflow: hidden; }
.band-stripe {
  height: 8px; width: 100%;
  background: linear-gradient(to right, var(--sky) 0 33.33%, var(--butter) 33.33% 66.66%, var(--amber) 66.66% 100%);
}
.poll-card.is-closed .band-stripe { background: var(--line-2); }
.poll-cover-wrap { margin: 0; }
.poll-top { padding: 16px 20px 0; gap: 6px; }
.poll-body { padding: 12px 20px 6px; }
.poll-card .card-title { font-size: clamp(18px, 2.4vw, 21px); font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
.poll-card .card-desc { font-size: 14px; margin-top: 6px; }
.tag { border-radius: 6px; font-weight: 600; text-transform: none; letter-spacing: 0; background: var(--sky-2); color: var(--ink-2); font-size: 12px; padding: 4px 9px; }
.tag.live { background: var(--wine); color: #fff; }
.tag.live::before { background: #fff; }
.tag.closed { background: var(--line); color: var(--muted); }
.tag.sponsored { background: var(--butter); color: var(--ink); }
.cand-preview-strip { margin: 6px 20px 0; padding: 10px 12px; background: var(--sky-3); border-radius: 14px; }
.cand-avatar-sm { border: 2px solid #fff; }
.cand-preview-label { color: var(--ink-2); font-weight: 600; }
.poll-meta {
  margin: 14px 20px 0; padding: 12px 0 0; gap: 14px; color: var(--muted); font-size: 13px;
  border-top: 2px dotted var(--line-2);       /* ballot tear-line */
}
.poll-meta strong { color: var(--ink); font-weight: 800; }
.voted-flag { background: var(--butter); color: var(--ink); font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.poll-foot { padding: 14px 20px 20px; gap: 8px; border: 0; }

/* ---------- Sector tiles ---------- */
.sector-tile {
  display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 2px; align-items: center;
  padding: 16px 18px; border-radius: 20px; background: var(--sky-2); border: 1.5px solid transparent;
  transition: background var(--t), border-color var(--t);
}
.sector-tile:nth-child(3n+2) { background: var(--butter-2); }
.sector-tile:nth-child(3n) { background: #ffe9bd; }
.sector-tile:hover { border-color: var(--ink); }
.sector-ic { grid-row: 1 / 3; width: 46px; height: 46px; border-radius: 14px; background: #fff; display: grid; place-items: center; font-size: 23px; }
.sector-tile strong { font-family: var(--font-display); font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.sector-count { font-size: 12.5px; color: var(--ink-2); }
.sector-count b { font-weight: 800; }

/* ---------- Ads, notices, chips ---------- */
.ad-card { border-radius: 22px; border: 1.5px solid var(--line); background: #fff; }
.ad-card:hover { transform: none; box-shadow: var(--sh); }
.ad-flag { background: var(--ink); text-transform: none; letter-spacing: 0; border-radius: 6px; }
.notice { border-radius: 20px; padding: 18px 20px; border-width: 0; }
.notice.info { background: var(--sky); color: var(--ink); }
.notice.warn { background: var(--butter); color: var(--ink); }
.notice strong { font-family: var(--font-display); font-size: 16px; }
.chip { border-radius: 999px; background: #fff; border: 1.5px solid var(--line-2); font-weight: 600; color: var(--ink-2); }
.chip:hover { background: var(--sky-2); color: var(--ink); border-color: var(--ink-2); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.input, select, textarea { border-radius: 14px; border: 1.5px solid var(--line-2); }

/* ---------- Footer ---------- */
#app-footer { background: var(--ink); color: #b9c8e0; margin-top: 24px; position: relative; padding-top: 10px; }
#app-footer::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 10px;
  background: linear-gradient(to right, var(--sky) 0 33.33%, var(--butter) 33.33% 66.66%, var(--amber) 66.66% 100%);
}
.footer-col h4 { text-transform: none; letter-spacing: -.01em; font-size: 15px; color: var(--butter); }
.footer-col a:hover { color: var(--sky); }
.footer-badge { border-radius: 999px; }
.footer-badge-brand { color: var(--amber); border-color: rgba(255,164,0,.45); font-weight: 800; }

/* ---------- Mobile bottom nav ---------- */
.bottom-nav a.active { color: var(--ink); }
.bottom-nav a.active span { background: var(--butter); border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--amber); }

@media (prefers-reduced-motion: reduce) {
  .dot-live { animation: none; }
  * { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

.hero p.hero-kicker { color: var(--ink); margin: 0 0 18px; font-size: 13.5px; line-height: 1.2; }
