/* IndiaIRL design system: deep navy, marigold, coral, mint and lilac. Dark by default, sky-blue day mode. */
:root {
  --bg: #060a16;
  --side: #0a1022;
  --card: #111a2f;
  --card-2: #16213a;
  --line: rgba(148, 163, 196, 0.14);
  --line-2: rgba(148, 163, 196, 0.28);
  --text: #f2f4fa;
  --muted: #98a3bd;
  --faint: #66728c;
  --marigold: #f5be4f;
  --marigold-ink: #1d1505;
  --marigold-soft: rgba(245, 190, 79, 0.14);
  --coral: #f47c67;
  --coral-soft: rgba(244, 124, 103, 0.15);
  --mint: #9fd3bb;
  --lilac: #c3b4e8;
  --good: #5ccf96;
  --bad: #ff6b6b;
  --glass: rgba(10, 16, 34, 0.86);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --display: 'Bricolage Grotesque', 'Manrope', system-ui, sans-serif;
  --ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: #e8ede7;
  --side: #faf9f4;
  --card: #ffffff;
  --card-2: #f0f2ea;
  --line: rgba(15, 23, 42, 0.09);
  --line-2: rgba(15, 23, 42, 0.18);
  --text: #24382e;
  --muted: #5d7064;
  --marigold: #b65b30;
  --marigold-ink: #ffffff;
  --faint: #8a95ab;
  --marigold-soft: rgba(245, 190, 79, 0.22);
  --coral-soft: rgba(244, 124, 103, 0.14);
  --glass: rgba(255, 255, 255, 0.92);
  --shadow: 0 14px 40px rgba(15, 30, 60, 0.18);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 600 14px/1.45 var(--ui); -webkit-font-smoothing: antialiased; }
/* The page never zooms: no double-tap or pinch zoom of the UI, no text inflation; the map zooms itself. */
html, body { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior: none; }
button, a, input, select, textarea, label, .card { touch-action: manipulation; }
/* Phones zoom into any text field under 16px when it is focused. */
@media (hover: none) and (pointer: coarse) { input, select, textarea { font-size: max(16px, 1em) !important; } }
body { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, .display { font-family: var(--display); letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 30px; font-weight: 800; line-height: 1.05; }
h2 { font-size: 20px; font-weight: 800; }
h3 { font: 800 12px var(--ui); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.accent { color: var(--marigold); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--marigold); outline-offset: 2px; }
.side-body > * { flex-shrink: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 800; letter-spacing: .13em; color: var(--muted); text-transform: uppercase; }
.community-hero { padding: 18px 2px 6px; display: flex; flex-direction: column; gap: 14px; }
.community-hero h1 { font-size: 35px; line-height: 1.08; letter-spacing: -.04em; }
.community-hero p { margin: 0; line-height: 1.7; color: var(--muted); font-size: 13px; }
.explore-hero h1 { font-size: 40px; }
.community-callout { display: flex; flex-direction: row; align-items: center; gap: 12px; text-align: left; background: var(--card-2); }
.community-callout > span:nth-child(2) { flex: 1; }
.community-callout strong,.community-callout small { display: block; }
.community-callout strong { font-size: 14px; margin: 5px 0; }
.community-callout small { font-size: 11px; color: var(--muted); }
.path-icon { width: 38px; height: 38px; background: var(--marigold-soft); border-radius: 12px; display: grid; place-items: center; color: var(--marigold); flex-shrink: 0; }
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-grid button { background: var(--card); border: 1px solid var(--line); border-radius: 15px; padding: 15px; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.role-grid svg { color: var(--marigold); }
.role-grid strong { font-size: 13px; }
.role-grid small { font-size: 11px; color: var(--muted); }
.partner-callout { text-align: left; background: var(--card-2); padding: 22px; border-color: var(--line-2); }
.partner-callout h2 { font-size: 23px; }
.partner-callout p { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.6; }
.partner-callout .row { font-size: 12px; color: var(--marigold); font-weight: 800; }
.chapter-card { border-color: var(--line-2); background: var(--card-2); }
.chapter-card h2 { font-size: 23px; line-height: 1.2; }
.chapter-score { display: flex; gap: 12px; align-items: center; }
.chapter-score b { font: 800 42px var(--display); color: var(--marigold); }
.chapter-score span { max-width: 170px; color: var(--muted); font-size: 12px; }
progress { width: 100%; height: 8px; border: none; border-radius: 8px; overflow: hidden; background: var(--line); accent-color: var(--marigold); }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--marigold); border-radius: 8px; }
.mission-list { display: flex; flex-direction: column; gap: 12px; }
.mission-card h2 { font-size: 17px; }
.mission-card p,.chapter-card p { margin: 0; line-height: 1.6; }
.mission-number { width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 50%; font-size: 12px; color: var(--marigold); flex-shrink: 0; }
.mission-card.complete { border-color: var(--mint); }
.mission-card.complete .mission-number { background: var(--mint); color: #203c2a; }
.participation-paths { display: grid; gap: 8px; }
.path-choice { border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); padding: 12px; display: flex; align-items: center; gap: 10px; text-align: left; }
.path-choice > span:nth-child(2) { flex: 1; }
.path-choice strong,.path-choice small { display: block; }
.path-choice small { font-size: 11px; color: var(--muted); margin-top: 5px; }
.trust-link { display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 16px; background: var(--card-2); }
.trust-link span { flex: 1; }
.trust-link strong,.trust-link small { display: block; }
.trust-link small { font-size: 11px; color: var(--muted); margin-top: 5px; }
.empty-community { align-items: flex-start; padding: 24px; }
.empty-community h2 { font-size: 24px; }
.map-fallback { position: fixed; inset: 0 0 0 400px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px; text-align: center; gap: 15px; background: var(--card-2); }
.partner-brief textarea { min-height: 130px; }
.side-body { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.atlas-links { margin-bottom: 14px; }
.atlas-launch button, .rail-hero { background: linear-gradient(135deg,var(--card-2),var(--card)); }
.rail-hero { border-color: var(--line-2); padding: 20px; }
.rail-hero h1 { font-size: 27px; }
.rail-hero p,.rail-board p,.civic-stops p { margin: 0; }
.rail-row { display: grid; grid-template-columns: 1.6fr 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.rail-row small,.civic-stop small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.civic-stop { display:flex; align-items:center; gap:10px; text-align:left; padding:10px; border:1px solid var(--line); background:var(--card-2); border-radius:12px; }
.civic-stop > span:nth-child(2) { flex:1; }
.visit-pill { position:fixed; top:16px; left:416px; z-index:16; display:flex; align-items:center; gap:9px; background:var(--card); border:1px solid var(--line-2); border-radius:14px; padding:7px 8px 7px 12px; box-shadow:var(--shadow); }
.visit-pill button { display:none; }
.legendpill .platform-note { display:none; }
#map.platform-view ~ .legendpill .near { display:none; }
#map.platform-view ~ .legendpill .platform-note { display:inline; }
@media(max-width:900px) {
  .side.open.map-visit { visibility:hidden; pointer-events:none; }
  .side.open.map-visit ~ .mapzoom { display:flex; bottom:132px; }
  .visit-pill { top:auto; bottom:78px; left:12px; right:12px; }
  .visit-pill span { flex:1; }
  .visit-pill button { display:inline-flex; }
}
@media(max-width:900px) { .map-fallback { inset: 0; padding-bottom: 120px; }.community-hero h1 {font-size: 31px;} .side.open .side-body { padding-bottom: 32px; } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; scroll-behavior:auto!important; transition:none!important; } }

.home-details > summary, details.card > summary { cursor: pointer; font-weight: 800; }
.preview-badge { font-size:10px; padding:4px 7px; }
.home-details > *:not(summary) { margin-top: 14px; }
.neighbour-row { display:flex; align-items:center; gap:8px; min-width:0; }
.neighbour-row img { width:52px; height:52px; flex:none; }
.neighbour-row .grow { flex:1; min-width:0; overflow-wrap:anywhere; }
.mobile-intro { padding:14px 16px; border:1px solid var(--line); border-radius:18px; background:var(--card); box-shadow:var(--shadow); }
.mobile-intro h1 { font-size:23px; line-height:1.12; }
.mobile-intro p { margin:7px 0 0; color:var(--muted); font-size:12px; line-height:1.4; }
.results button { min-width:0; }
.results button small { white-space:normal; text-align:right; }
.search > svg { pointer-events:none; }
@media(max-width:900px) {
  .side.open:not(.map-visit) ~ .mtop { display:none; }
  .side.open { bottom:calc(64px + env(safe-area-inset-bottom)); max-height:calc(100dvh - 76px - env(safe-area-inset-bottom)); }
  .mnav { height:calc(64px + env(safe-area-inset-bottom)); padding-bottom:env(safe-area-inset-bottom); }
  .mbottom { bottom:calc(76px + env(safe-area-inset-bottom)); }
  .side.open .side-body { padding-bottom:calc(32px + env(safe-area-inset-bottom)); }
  .visit-pill { bottom:calc(78px + env(safe-area-inset-bottom)); }
  .modal { max-height:calc(100dvh - 24px - env(safe-area-inset-bottom)); padding:18px; }
  .tabs3 button { min-width:0; font-size:12px; }
}

#map { position: fixed; inset: 0 0 0 400px; }
.maplibregl-ctrl-attrib { font-size: 10px; }
/* Nothing that floats over the map blurs what is behind it: a backdrop blur over a moving WebGL map is
   re-computed every frame and was the largest single cost of panning the country view. */
.maplibregl-popup-content { background: var(--card); color: var(--text); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); border: 1px solid var(--line); font: 700 13px var(--ui); }
.maplibregl-popup-tip { display: none; }
.maplibregl-popup-close-button { color: var(--muted); font-size: 16px; padding: 2px 6px; }
.popsub { color: var(--muted); font-weight: 600; font-size: 12px; }

/* City pills and markers on the map */
.citychip { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); font: 800 12.5px var(--ui); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22); white-space: nowrap; }
.citychip span { color: var(--muted); font-weight: 700; }
.citychip.hot { background: var(--coral); color: #fff; border-color: transparent; }
.citychip.hot span { color: #fff; }
.citychip.gold { background: var(--marigold); color: var(--marigold-ink); border-color: transparent; }
.citychip.gold span { color: var(--marigold-ink); }
#map:not(.z-country) .citychip { display: none; }
.mypin { padding: 6px 12px; border-radius: 12px; background: var(--marigold); color: var(--marigold-ink); font: 800 12.5px var(--ui); box-shadow: 0 8px 24px rgba(245, 190, 79, 0.5); white-space: nowrap; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.billboard { width: 150px; background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); font: 700 12px var(--ui); color: var(--text); cursor: pointer; }
.billboard img { width: 100%; height: 74px; object-fit: cover; display: block; }
.billboard div { padding: 6px 8px; display: flex; gap: 6px; align-items: center; }
.billboard span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
#map:not(.z-street) .billboard { display: none; }
.ad { font: 800 10px var(--ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; font-style: normal; }
.plane { pointer-events: none; filter: drop-shadow(0 3px 4px rgba(10, 20, 40, 0.35)); }

/* Loading screen: drawn by the page itself, faded out once the map is ready. */
#splash { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(circle at 50% 42%, #fff7e6, #f2ece0 70%); color: #2a2620; transition: opacity 0.6s ease, visibility 0.6s; }
:root[data-theme='dark'] #splash { background: radial-gradient(circle at 50% 42%, #18233a, #070c18 70%); color: #f2f5fc; }
#splash.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-mark { width: 96px; height: 96px; border-radius: 28px; display: grid; place-items: center; background: #f5be4f; box-shadow: 0 18px 48px rgba(245, 190, 79, 0.45); animation: splash-rise 1.4s ease-in-out infinite alternate; }
.splash-house, .splash-door { fill: none; stroke: #3b2a10; stroke-width: 3.2; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 160; stroke-dashoffset: 160; animation: splash-draw 1.6s ease forwards; }
.splash-door { animation-delay: 0.7s; }
.splash-light { fill: #fff3c4; opacity: 0; animation: splash-glow 1.2s ease-in-out 1.3s infinite alternate; }
.splash-name { font: 800 30px 'Bricolage Grotesque', system-ui, sans-serif; letter-spacing: -0.02em; }
.splash-name b { color: #e07b39; }
.splash-bar { width: 180px; height: 5px; border-radius: 99px; background: rgba(128, 128, 128, 0.2); overflow: hidden; }
.splash-bar i { display: block; width: 40%; height: 100%; border-radius: 99px; background: #f5be4f; animation: splash-run 1.1s ease-in-out infinite; }
.splash-tip { font: 700 13px 'Manrope', system-ui, sans-serif; opacity: 0.65; }
@keyframes splash-draw { to { stroke-dashoffset: 0; } }
@keyframes splash-glow { from { opacity: 0.2; } to { opacity: 1; } }
@keyframes splash-rise { from { transform: translateY(0); } to { transform: translateY(-6px); } }
@keyframes splash-run { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) { .splash-mark, .splash-bar i, .splash-light { animation: none; } .splash-house, .splash-door { animation: none; stroke-dashoffset: 0; } }
.buildcard { display: flex; flex-direction: column; gap: 6px; }
.buildcard p { margin: 0; font-weight: 600; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.buildcard .btn { align-self: flex-start; }
.linkbtn { align-self: flex-start; border: 0; background: none; padding: 2px 0; color: var(--muted); font: 700 12px var(--ui); text-decoration: underline; cursor: pointer; text-align: left; }
.legendpill .near { display: none; }
body.z-near .legendpill .far { display: none; }
body.z-near .legendpill .near { display: inline; }
/* Pop-ups scroll as a whole; their parts never squash to fit a short window. */
.modal > * { flex-shrink: 0; }

/* Desktop side panel */
.side { position: fixed; z-index: 20; top: 0; left: 0; bottom: 0; width: 400px; display: flex; flex-direction: column; background: var(--side); border-right: 1px solid var(--line); }
.side-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 10px; }
.side-body { flex: 1; overflow: auto; padding: 6px 18px 28px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
.side-head .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.logo { width: 42px; height: 42px; flex: none; border-radius: 13px; border: 0; background: var(--marigold); color: var(--marigold-ink); display: grid; place-items: center; }
.brandname { font: 800 15px var(--ui); letter-spacing: 0.04em; }
.iconbtn { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 13px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.iconbtn.sm { width: 34px; height: 34px; border-radius: 10px; }
.nav { display: flex; gap: 4px; padding: 0 18px 10px; }
.nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; border: 0; border-radius: 12px; background: none; color: var(--muted); font: 800 12px var(--ui); position: relative; }
.nav button.on { color: var(--marigold); background: var(--marigold-soft); }
.nav .dot { position: absolute; top: 5px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }

/* Mobile chrome */
.mtop, .mbottom, .mnav { display: none; }
.search { position: relative; flex: 1; }
.search input { width: 100%; height: 44px; padding: 0 14px 0 40px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); outline: none; font-weight: 700; }
.search input:focus { border-color: var(--marigold); }
.search > svg { position: absolute; left: 13px; top: 13px; color: var(--muted); }
.results { position: absolute; z-index: 30; top: 50px; left: 0; right: 0; background: var(--card); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; max-height: 60vh; overflow: auto; }
.results button { display: flex; width: 100%; text-align: left; gap: 10px; align-items: center; padding: 9px 10px; border: 0; background: none; border-radius: 10px; }
.results button:hover { background: var(--card-2); }
.results small { color: var(--muted); margin-left: auto; font-size: 12px; }

/* Live chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 800; white-space: nowrap; }
.chip .num { font: 800 15px var(--display); font-variant-numeric: tabular-nums; }
.chip small { color: var(--muted); font-weight: 700; font-size: 13px; }
.chip.live b { color: var(--coral); letter-spacing: 0.06em; font-size: 12px; }
.chip.polls { background: var(--coral-soft); border-color: rgba(244, 124, 103, 0.35); color: #ffb4a6; }
:root[data-theme='light'] .chip.polls { color: #b4402c; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 0 rgba(244, 124, 103, 0.7); animation: pulse 1.8s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(244, 124, 103, 0); } 100% { box-shadow: 0 0 0 0 rgba(244, 124, 103, 0); } }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card.tight { padding: 12px 14px; gap: 6px; }
.card.gold { background: var(--marigold); color: var(--marigold-ink); border-color: transparent; }
.card.gold .muted { color: rgba(29, 21, 5, 0.7); }
.card.coral { background: var(--coral-soft); border-color: rgba(244, 124, 103, 0.35); }
.card.warn { background: linear-gradient(135deg, rgba(245, 190, 79, 0.12), transparent); border-color: rgba(245, 190, 79, 0.35); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-title > * { min-width: 0; overflow-wrap: anywhere; }
.card-title > .badge { flex-shrink: 0; }
.chapter-card .btn { height: auto; min-height: 44px; padding: 10px 18px; white-space: normal; text-align: center; overflow-wrap: anywhere; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row .grow { flex: 1; min-width: 0; }
.name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list { display: flex; flex-direction: column; }
.list > * { padding: 10px 0; border-top: 1px solid var(--line); }
.list > *:first-child { border-top: 0; padding-top: 2px; }
.linkish { background: none; border: 0; padding: 0; text-align: left; color: inherit; width: 100%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; min-width: 0; }
.stat .l { font: 800 11px var(--ui); color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.stat .v { font: 800 24px var(--display); font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .s { font-size: 12px; color: var(--muted); font-weight: 700; }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 800 14px var(--display); color: #10182b; background: var(--mint); }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; border: 3px solid var(--marigold); background: #2a2210; color: var(--marigold); }
.partychip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 6px; border-radius: 999px; background: var(--card-2); font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.partychip i { width: 8px; height: 8px; border-radius: 50%; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 800; background: var(--card-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.gold { background: var(--marigold-soft); border-color: rgba(245, 190, 79, 0.4); color: var(--marigold); }
.badge.coral { background: var(--coral-soft); color: var(--coral); border-color: rgba(244, 124, 103, 0.4); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.bar { height: 8px; border-radius: 999px; background: var(--card-2); overflow: hidden; display: flex; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--marigold); }
.seatbar { height: 14px; border-radius: 6px; background: var(--card-2); overflow: hidden; display: flex; position: relative; }
.seatbar > i { height: 100%; }
.seatbar .maj { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); left: 50%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; }
.empty { text-align: center; color: var(--muted); padding: 18px 8px; font-size: 13px; }
.feeditem { display: flex; gap: 12px; align-items: center; }
.feeditem .t { flex: 1; min-width: 0; font-size: 13.5px; }
.feeditem .t b { font-weight: 800; }
.feeditem small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.rank { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 10px; align-items: center; }
.rank .n { font: 800 16px var(--display); color: var(--muted); }
.rank.me { background: var(--marigold-soft); border-radius: 12px; padding-left: 8px; padding-right: 8px; }
.rank.me .n, .rank.me .name { color: var(--marigold); }
.up { color: var(--marigold); font-size: 12px; font-weight: 800; }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--card-2); font-weight: 800; white-space: nowrap; }
.btn:hover { border-color: var(--text); }
.btn.primary { background: var(--marigold); border-color: var(--marigold); color: var(--marigold-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.outline { background: none; border-color: var(--marigold); color: var(--marigold); }
.btn.danger { color: var(--bad); border-color: rgba(255, 107, 107, 0.45); background: none; }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.cta { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px 20px; border: 0; border-radius: 20px; background: var(--marigold); color: var(--marigold-ink); text-align: left; box-shadow: 0 12px 34px rgba(245, 190, 79, 0.35); }
.cta .t { font: 800 21px var(--display); letter-spacing: -0.02em; }
.cta .s { font-size: 13.5px; font-weight: 700; opacity: 0.75; }
.cta .grow { flex: 1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font: 800 11.5px var(--ui); color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.input { height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--card-2); outline: none; width: 100%; font-weight: 700; }
textarea.input { height: 90px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--marigold); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); font-weight: 600; }
.check input { margin-top: 3px; accent-color: var(--marigold); width: 16px; height: 16px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { height: 38px; padding: 0 13px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card-2); font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { border-color: var(--marigold); background: var(--marigold-soft); color: var(--marigold); }
.tabs3 { display: flex; padding: 4px; gap: 4px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.tabs3 button { flex: 1; height: 40px; border: 0; border-radius: 12px; background: none; font-weight: 800; color: var(--muted); }
.tabs3 button.on { background: var(--marigold); color: var(--marigold-ink); }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid transparent; padding: 0; }
.swatch.on { border-color: var(--text); }
.symbolbtn { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; border: 1px solid var(--line-2); background: var(--card-2); }
.symbolbtn.on { border-color: var(--marigold); background: var(--marigold-soft); }
.code { font: 800 22px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; text-align: center; padding: 14px; border-radius: 14px; background: var(--card-2); border: 1px dashed var(--line-2); user-select: all; }
.error { color: var(--bad); font-size: 13px; font-weight: 800; }

/* Candidates and votes */
.cand { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.cand .slogan { color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand .symbol { width: 48px; height: 48px; border-radius: 14px; background: var(--card-2); display: grid; place-items: center; flex: none; }
.cand .pct { font: 800 14px var(--display); white-space: nowrap; }
.countdown { font: 800 46px var(--display); letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.poster { border-radius: 22px; padding: 20px; color: #10182b; position: relative; overflow: hidden; }
.poster h2 { font-size: 30px; }
.poster .shape { position: absolute; right: -20px; top: 10px; width: 150px; height: 150px; opacity: 0.25; }

/* House art */
.houseart { border-radius: 18px; overflow: hidden; background: radial-gradient(circle at 50% 70%, #263457, #0b1122 70%); display: grid; place-items: center; height: 190px; position: relative; }
:root[data-theme='light'] .houseart { background: radial-gradient(circle at 50% 70%, #fff6dc, #cfe6f7 75%); }
.houseart img { width: 170px; height: 170px; image-rendering: auto; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35)); }
.houseart .sparkle { position: absolute; inset: 0; background-image: radial-gradient(2px 2px at 20% 30%, #ffd66b, transparent), radial-gradient(2px 2px at 70% 20%, #fff, transparent), radial-gradient(1.5px 1.5px at 85% 60%, #ffd66b, transparent), radial-gradient(2px 2px at 35% 75%, #ffffffaa, transparent); opacity: 0.8; }
.stylepick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stylepick button { border-radius: 14px; border: 2px solid var(--line); background: var(--card-2); padding: 6px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 800; }
.stylepick button.on { border-color: var(--marigold); color: var(--marigold); }
.stylepick img { width: 64px; height: 64px; }
.houseart.small { height: 140px; }
.houseart.small img { width: 120px; height: 120px; }
.houseart img.r3d { position: absolute; inset: 6px 0 0; width: 100%; height: calc(100% - 6px); object-fit: contain; filter: none; }
.stylepick img.r3d { width: 84px; height: 64px; object-fit: contain; }
.shop { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shop button { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); text-align: left; font-weight: 800; }
.shop button.owned { border-color: rgba(245, 190, 79, 0.5); background: var(--marigold-soft); }
.shop .price { color: var(--marigold); white-space: nowrap; }

/* Modal, toast, tour */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(3, 6, 14, 0.7); display: grid; place-items: center; padding: 16px; animation: fadein 0.2s; }
.modal { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--side); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-head { display: flex; align-items: flex-start; gap: 10px; }
.modal-head .grow { flex: 1; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.step { font: 800 12px var(--ui); letter-spacing: 0.1em; color: var(--marigold); }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--card); border: 1px solid var(--line-2); padding: 11px 16px; border-radius: 14px; box-shadow: var(--shadow); font-weight: 800; max-width: calc(100vw - 32px); animation: fadein 0.2s; }
.toast.bad { border-color: var(--bad); }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } }
.mapzoom { position: fixed; z-index: 15; right: 16px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; }
.mapzoom button { width: 42px; height: 42px; border-radius: 13px; border: 1px solid var(--line); background: var(--card); color: var(--text); display: grid; place-items: center; box-shadow: var(--shadow); }
.mapzoom button.on { color: var(--marigold); border-color: var(--marigold); }
.legendpill { position: fixed; z-index: 15; left: 416px; bottom: 24px; display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--muted); }
.legendpill i { width: 8px; height: 8px; border-radius: 50%; background: var(--marigold); box-shadow: 0 0 8px var(--marigold); }

@media (max-width: 900px) {
  #map { left: 0; }
  .side { display: none; }
  .side.open { display: flex; top: auto; left: 0; right: 0; bottom: 64px; width: auto; height: 74vh; border-radius: 26px 26px 0 0; border: 1px solid var(--line); border-bottom: 0; box-shadow: var(--shadow); animation: slideup 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .side .nav, .side .side-head .brandname, .side .side-head .logo { display: none; }
  @keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
  .mtop { display: flex; flex-direction: column; gap: 10px; position: fixed; z-index: 18; top: 12px; left: 12px; right: 12px; }
  .mtop .row1 { display: flex; gap: 8px; }
  .mtop .chips { flex-wrap: nowrap; overflow: hidden; }
  .mbottom { display: flex; flex-direction: column; gap: 10px; position: fixed; z-index: 18; left: 12px; right: 12px; bottom: 76px; }
  .mnav { display: flex; position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; height: 64px; background: var(--side); border-top: 1px solid var(--line); }
  .mnav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; color: var(--muted); font: 800 11.5px var(--ui); position: relative; }
  .mnav button.on { color: var(--marigold); }
  .mnav .dot { position: absolute; top: 8px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }
  .mapzoom { bottom: 220px; right: 12px; }
  .mapzoom .hide-m { display: none; }
  /* With a page open the sheet covers the lower map: its buttons would sit on top of the page. */
  .side.open ~ .mapzoom { display: none; }
  .side.open.map-visit ~ .mapzoom { display: flex; }
  .legendpill { display: none; }
  h1 { font-size: 26px; }
}

/* A place in numbers: one bar per service; under 50 shows as failing. */
.meters { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.meter { display: grid; grid-template-columns: 92px 1fr 30px; align-items: center; gap: 8px; font-size: 12.5px; }
.meter > i { height: 7px; border-radius: 99px; background: color-mix(in srgb, currentColor 12%, transparent); overflow: hidden; }
.meter > i > b { display: block; height: 100%; border-radius: 99px; background: var(--good, #2f9e6b); }
.meter.low > i > b { background: var(--bad, #e5484d); }
.meter > em { font-style: normal; font-weight: 800; text-align: right; }

@media (max-width: 900px) {
  .side.open { bottom:calc(64px + env(safe-area-inset-bottom)); max-height:calc(100dvh - 76px - env(safe-area-inset-bottom)); }
  .mnav { height:calc(64px + env(safe-area-inset-bottom)); padding-bottom:env(safe-area-inset-bottom); }
  .mbottom { bottom:calc(76px + env(safe-area-inset-bottom)); }
  .visit-pill { bottom:calc(78px + env(safe-area-inset-bottom)); }
  .mtop .chips { flex-wrap:wrap; overflow:visible; }
}

/* Style picker groups: houses, then apartments. */
.stylegroup { margin: 10px 0 4px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; font-size: 10.5px; }

/* Map lenses, tour, photo: a pill of controls over the map. */
.lensbar { position: fixed; z-index: 15; top: 14px; right: 16px; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.lensbar button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 7px 11px; border-radius: 999px; font-weight: 800; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.lensbar button:hover { color: var(--text); }
.lensbar button.on { background: var(--marigold); color: var(--marigold-ink, #1b1300); }
.lensbar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
@media (max-width: 859px) {
  .lensbar { top: auto; bottom: 138px; left: 12px; right: 12px; justify-content: space-between; overflow-x: auto; scrollbar-width: none; }
  .lensbar button { padding: 7px 8px; }
  .lensbar button span { display: none; }
  .lensbar button.on span { display: inline; }
}
.legendpill i.lens-politics { background: linear-gradient(90deg, #ff8a3d, #4c9aff); box-shadow: none; }
.legendpill i.lens-weather { background: linear-gradient(90deg, #7fb8ff, #ffe08a, #ff5a3c); box-shadow: none; }
.legendpill i.lens-economy { background: linear-gradient(90deg, #e5484d, #f0a03c, #2fbf71); box-shadow: none; }
.legendpill i.lens-infra { background: #2f6fd6; box-shadow: none; }
.mapzoom .compass span { display: inline-grid; transition: transform .25s ease; }
/* Something just happened here. */
.ripple { position: relative; width: 12px; height: 12px; pointer-events: none; }
.ripple::before, .ripple::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 30%, transparent); animation: ripple 2.4s ease-out forwards; }
.ripple::after { animation-delay: .45s; }
@keyframes ripple { from { transform: scale(.6); opacity: 1; } to { transform: scale(7); opacity: 0; } }
/* The town whose page is open. */
.focusring { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--marigold); box-shadow: 0 0 0 5px color-mix(in srgb, var(--marigold) 25%, transparent); animation: focusring 1.8s ease-in-out infinite; pointer-events: none; }
@keyframes focusring { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.6); opacity: .5; } }
/* Tour captions. */
.tourcap { position: fixed; z-index: 20; left: 50%; bottom: 76px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; width: max-content; max-width: min(680px, calc(100vw - 24px)); padding: 12px 12px 12px 18px; border-radius: 16px; background: rgba(8, 12, 22, .84); color: #fff; font-weight: 700; line-height: 1.4; box-shadow: 0 10px 40px rgba(0, 0, 0, .35); animation: tourin .5s ease; }
@keyframes tourin { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (min-width: 860px) { .tourcap { left: calc(50% + 200px); } }
@media (prefers-reduced-motion: reduce) { .ripple::before, .ripple::after, .focusring, .tourcap { animation: none; } }

/* Businesses. */
.bizdot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.bizrow { width: 100%; text-align: left; gap: 10px; padding: 8px 0; border: 0; background: none; }
.task { padding: 10px 0; border-top: 1px solid var(--line); }
.task:first-of-type { border-top: 0; }
table.books { width: 100%; border-collapse: collapse; font-size: 12px; }
table.books th, table.books td { padding: 5px 4px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.books th:first-child, table.books td:first-child { text-align: left; }
/* The lens bar never slides under the side panel: it fits the map area, icons only when space is short. */
@media (min-width: 860px) {
  .lensbar { max-width: calc(100vw - 400px - 32px); overflow-x: auto; scrollbar-width: none; }
  .lensbar::-webkit-scrollbar { display: none; }
}
@media (min-width: 860px) and (max-width: 1280px) {
  .lensbar button { padding: 7px 9px; }
  .lensbar button span { display: none; }
  .lensbar button.on span { display: inline; }
}

/* Minimal phone map: the lens bar folds to one pill above the main button; tap it for the choices. */
@media (max-width: 859px) {
  .lensbar { left: 12px; right: auto; max-width: calc(100vw - 24px); justify-content: flex-start; }
  .lensbar:not(.open) button:not(.on), .lensbar:not(.open) .sep { display: none; }
  .lensbar button.on span { display: inline; }
  .lensbar.open { flex-wrap: wrap; border-radius: 18px; gap: 4px; padding: 6px; }
  .lensbar.open button span { display: inline; }
  .lensbar.open .sep { display: none; }
  .lensbar button.on::after { content: '▾'; margin-left: 2px; font-size: 10px; opacity: .7; }
  .lensbar.open button.on::after { content: '▴'; }
}
.lensbar .extra span { display: none; }
@media (max-width: 859px) { .lensbar.open .extra span { display: inline; } }
/* Phones: the lens pill sits beside the Atlas chip and opens downward, clear of the main button. */
@media (max-width: 859px) {
  .lensbar { top: 68px; bottom: auto; right: 12px; left: auto; }
  .lensbar.open { left: 12px; }
}
/* The phone top bar lets taps through its empty space (the lens pill sits in it), and the pill stays on top. */
@media (max-width: 859px) {
  .mtop, .mtop .chips { pointer-events: none; }
  .mtop > *:not(.chips), .mtop .chips > * { pointer-events: auto; }
  .lensbar { z-index: 19; }
}
