:root {
  --bg: #e8eaf2;
  --surface: #f8f9fc;
  --surface2: #dfe2ec;
  --border: #c5c9d9;
  --text: #1a1d27;
  --text-dim: #434863;
  --accent: #2d3db0;
  --accent-glow: rgba(45, 61, 176, 0.14);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: #1a1d27; }
body { background: var(--bg); font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; color: var(--text); line-height: 1.6; min-height: 100vh; }

.hero { text-align: center; padding: 60px 20px 40px; background: var(--bg); }
.hero h1, .hero .hero-brand { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1; margin-bottom: 8px; color: #474747; }
.hero h1 .brand-accent, .hero .hero-brand .brand-accent { color: #2d3db0; }
.hero-date { font-size: 1.2rem; font-style: italic; color: var(--text); }
.subpage-breadcrumb { font-size: 0.8rem; color: var(--text-dim); margin-top: 8px; }
.subpage-breadcrumb a { color: var(--accent); text-decoration: none; }
.subpage-breadcrumb a:hover { text-decoration: underline; }

.subpage-main { max-width: 1024px; margin: 0 auto; padding: 32px 20px 48px; }
.subpage-main h1 { font-size: 1.8rem; font-weight: 700; color: var(--text); margin-bottom: 16px; letter-spacing: -0.01em; }
.subpage-main > p { font-size: 0.95rem; line-height: 1.75; color: var(--text-dim); margin-bottom: 14px; max-width: 100%; }
.subpage-main > p a { color: var(--accent); font-weight: 600; text-decoration: none; }
.subpage-main > p a:hover { text-decoration: underline; }
.subpage-cta { display: inline-block; margin-top: 32px; padding: 12px 24px; background: var(--accent); color: #fff; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 0.9rem; transition: opacity 0.2s; }
.subpage-cta:hover { opacity: 0.85; }

footer { background: #1a1d27; }
.footer { text-align: center; padding: 30px 20px; color: #b0b4c8; font-size: 0.75rem; background: #1a1d27; line-height: 1.8; }
.footer strong { color: #d0d4e8; }
.footer a { color: #a0a8ff; text-decoration: none; }
.footer a:hover { opacity: 0.8; }
.footer-nav { margin-bottom: 12px; }
.footer-nav a { color: #a0a8ff; text-decoration: none; font-weight: 600; }
.footer-nav a:hover { opacity: 0.8; }
.footer-bottom { background: #1a1d27; color: #b0b4c8; text-align: center; padding: 24px 20px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 0.78rem; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.footer-bottom a { color: #a0a8ff; text-decoration: none; }
.footer-bottom a:hover { opacity: 0.8; }
.footer-bottom svg { vertical-align: middle; }

@media (max-width: 600px) {
  .subpage-main h1 { font-size: 1.3rem; }
  .subpage-main { padding: 24px 16px 36px; }
  .hero { padding: 30px 16px 24px; }
  .hero h1, .hero .hero-brand { font-size: 1.8rem; }
  .footer { padding: 20px 12px; font-size: 0.68rem; }
  .footer-bottom { padding: 18px 12px; font-size: 0.72rem; gap: 6px; }
}

/* ── Side menu ── */
.menu-toggle { position: fixed; top: 18px; left: 18px; z-index: 1100; width: 48px; height: 48px; border: none; border-radius: 50%; background: var(--surface); box-shadow: 0 2px 12px rgba(0,0,0,0.12); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s, left 0.3s cubic-bezier(0.4, 0, 0.2, 1); padding: 0; }
.menu-toggle:hover { background: var(--surface2); }
.menu-toggle.menu-open { left: 258px; background: transparent; box-shadow: none; }
.menu-toggle .menu-icon, .menu-toggle .close-icon { display: block; width: 20px; height: 20px; }
.menu-toggle .close-icon { display: none; }
.menu-open .menu-icon { display: none; }
.menu-open .close-icon { display: block; }
.menu-overlay { position: fixed; inset: 0; z-index: 1050; background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.menu-overlay.active { opacity: 1; pointer-events: auto; }
.side-menu { position: fixed; top: 0; left: 0; z-index: 1080; width: 320px; max-width: 85vw; height: 100vh; background: var(--surface); box-shadow: 4px 0 24px rgba(0,0,0,0.15); transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; overflow-y: auto; }
.side-menu.open { transform: translateX(0); }
.side-menu-header { padding: 30px 20px 18px; border-bottom: 1px solid var(--border); min-height: 66px; display: flex; align-items: center; }
.side-menu-header .menu-brand { font-size: 1.1rem; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.side-menu-header .menu-brand .brand-accent { color: var(--accent); }
.side-menu-nav { list-style: none; padding: 12px 0; flex: 1; }
.side-menu-nav li a { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: var(--text); text-decoration: none; font-size: 0.92rem; font-weight: 500; transition: background 0.15s, color 0.15s; }
.side-menu-nav li a:hover { background: var(--accent-glow); color: var(--accent); }
.side-menu-nav li a.active { color: var(--accent); font-weight: 600; background: var(--accent-glow); }
.side-menu-nav li a i { width: 20px; text-align: center; font-size: 0.9rem; }
.side-menu-footer { padding: 16px 20px; border-top: 1px solid var(--border); font-size: 0.75rem; color: var(--text-dim); line-height: 1.5; }
.side-menu-footer a { color: var(--accent); text-decoration: none; }
.side-menu-footer a:hover { text-decoration: underline; }

/* Post-election results block */
.results-block { margin: 2rem 0; padding: 1.5rem; background: var(--bg, #fff); border-radius: 12px; border: 1px solid var(--border, #e0e0e0); }
.results-block h2 { margin-top: 0; }
.seats-bar { display: flex; height: 44px; width: 100%; border-radius: 6px; overflow: hidden; border: 1px solid #222; background: #f5f5f5; }
.seats-bar-segment { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 0.85rem; min-width: 2%; text-shadow: 0 1px 2px rgba(0,0,0,0.6); padding: 0 4px; box-sizing: border-box; overflow: hidden; white-space: nowrap; }
.seats-bar-segment[data-governing="true"]::before { content: "\1F451\A0"; }
.below-threshold { margin-top: 0.5rem; font-size: 0.85rem; color: #555; }
.governing-callout { margin-top: 1rem; padding: 0.75rem 1rem; background: #fff9e6; border-left: 4px solid #d4a017; border-radius: 4px; color: #222; }
.governing-callout a { color: #8a5a00; font-weight: 600; }
.results-table-wrap { margin-top: 1rem; overflow-x: auto; }
.results-table { width: 100%; border-collapse: collapse; }
.results-table th, .results-table td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid #e0e0e0; }
.results-table th { background: #f5f5f5; font-weight: 600; }
.result-delta-up   { color: #0a7a2a; font-weight: 600; }
.result-delta-down { color: #a61b1b; font-weight: 600; }
.below-threshold-pill { display: inline-block; padding: 0.1rem 0.45rem; margin-left: 0.3rem; background: #666; color: #fff; border-radius: 999px; font-size: 0.75rem; }

/* Pollster accuracy */
.pollster-accuracy-block { margin: 2rem 0; padding: 1.5rem; background: var(--bg, #fff); border-radius: 12px; border: 1px solid var(--border, #e0e0e0); }
.pollster-accuracy-block h2 { margin-top: 0; }
.pollster-intro { color: #444; font-size: 0.95rem; }
.pollster-bar { display: grid; grid-template-columns: 9rem 1fr 3rem; align-items: center; gap: 0.75rem; margin: 0.35rem 0; }
.pollster-bar-track { background: #eee; height: 16px; border-radius: 3px; overflow: hidden; }
.pollster-bar-fill { height: 100%; background: #295fae; }
.pollster-bar-value { text-align: right; font-variant-numeric: tabular-nums; }
.pollster-empty { color: #666; font-style: italic; }

/* Per-card post-election result badges */
.card-result-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.35rem; font-size: 0.85rem; }
.card-seats-badge   { padding: 0.15rem 0.55rem; background: #22443e; color: #fff; border-radius: 999px; font-weight: 600; }
.card-votes-badge   { padding: 0.15rem 0.55rem; background: #333; color: #fff; border-radius: 999px; }
.card-governing-badge { padding: 0.15rem 0.55rem; background: #d4a017; color: #000; border-radius: 999px; font-weight: 700; }
.card-below-threshold-pill { padding: 0.15rem 0.55rem; background: #666; color: #fff; border-radius: 999px; font-weight: 500; }

/* Phase-2 tee-up — promise scorecard stub on each card */
.promise-stub { margin-top: 1rem; padding: 0.75rem 1rem; background: #f4f4f4; border-left: 4px solid #bbb; border-radius: 4px; color: #555; font-style: italic; font-size: 0.9rem; }
.promise-stub-title { font-weight: 600; font-style: normal; color: #333; margin-bottom: 0.25rem; }
