/* AQIMERYL Neighbourhood Profile Brief — design tokens and components (v4) */
:root {
  --brand: #922554;          /* plum: shared with the PDF template */
  --brand-hover: #7a1e46;
  --brand-wash: #f9eef3;
  --brand-line: #ecd3df;
  --grad: linear-gradient(100deg, #ff1a1a, #fc0164 30%, #c40fd0 60%, #5a00fc);
  --ink: #1b1820;
  --ink-2: #3c3644;
  --muted: #6a6372;
  --line: #e9e5ec;
  --bg: #faf8fb;
  --surface: #fff;
  --ok: #1f7a4d;
  --ok-wash: #e9f6ef;
  --focus: #f3b54a;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px #1b18200a, 0 6px 24px #1b18200d;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
  font-family: var(--sans);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; box-shadow: 0 0 0 5px var(--focus); border-radius: 6px; }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: #ffffffd9; backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.topbar::before { content: ""; display: block; height: 3px; background: var(--grad); }
.topbar-inner { display: flex; align-items: center; gap: 14px; height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.logo img { display: block; width: auto; height: 20px; }
.product { padding-left: 14px; border-left: 1px solid var(--line); color: var(--muted); font-size: .9rem; font-weight: 500; }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a { padding: 7px 12px; border-radius: 999px; color: var(--ink-2); font-size: .9rem; font-weight: 550; text-decoration: none; }
.nav a:hover { background: var(--brand-wash); color: var(--brand); }
.nav a[aria-current=page] { background: var(--brand-wash); color: var(--brand); }

/* ---------- Stepper ---------- */
.stepper { margin: 28px 0 8px; }
.steps { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.steps li { flex: 1; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: .9rem; font-weight: 600; }
.steps li .dot { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); font-size: .8rem; flex: none; }
.steps li[aria-current=step] { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); }
.steps li[aria-current=step] .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.steps li.done { color: var(--ink-2); }
.steps li.done .dot { background: var(--ok-wash); border-color: #bfe3cf; color: var(--ok); font-size: 0; }
.steps li.done .dot::after { content: "✓"; font-size: .85rem; }
.step-compact { display: none; font-size: .9rem; color: var(--muted); }
.step-compact strong { color: var(--ink); }
.progress { display: none; height: 4px; border-radius: 99px; background: var(--line); margin-top: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 33%; background: var(--grad); border-radius: inherit; transition: width .3s ease; }

/* ---------- Type ---------- */
.eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); background: var(--brand-wash); padding: 4px 10px; border-radius: 999px; }
h1 { font-family: var(--serif); font-weight: 650; font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.08; letter-spacing: -.02em; margin-top: 14px; }
.lede { margin-top: 12px; color: var(--muted); font-size: 1.05rem; max-width: 46ch; }
h2 { font-size: 1.05rem; letter-spacing: -.01em; }
.page-head { padding: 22px 0 22px; }
.page-head p { margin-top: 8px; color: var(--muted); max-width: 62ch; }

/* ---------- Cards and layout ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; align-items: start; padding: 22px 0 40px; }
.hero-text { position: sticky; top: 96px; }
.features { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 8px; }
.features li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); font-size: .95rem; }
.features li::before { content: "✓"; flex: none; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; background: var(--brand-wash); color: var(--brand); font-size: .72rem; font-weight: 800; }
.layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; padding-bottom: 40px; }
.layout > aside { position: sticky; top: 96px; }
.form-card { padding: 26px 28px; }
.form-card + .fine-print { margin-top: 12px; }
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.section-title .num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--brand-wash); color: var(--brand); font-size: .78rem; font-weight: 750; }
.form-section + .form-section { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 22px; }

/* ---------- Disclaimer and disclosures ---------- */
.disclaimer-box { border: 1.5px solid var(--brand); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--surface); }
.disclaimer-box h2 { display: flex; align-items: center; gap: 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); }
.disclaimer-box h2::before { content: "!"; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .72rem; }
.disclaimer-box p { margin-top: 6px; font-size: .92rem; color: var(--ink-2); }
.disclosure { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); margin-top: 10px; }
.disclosure summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; font-weight: 600; font-size: .93rem; }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; margin-right: 4px; }
.disclosure[open] summary::after { transform: rotate(-135deg); }
.disclosure .count { margin-left: auto; font-size: .75rem; color: var(--brand); background: var(--brand-wash); border-radius: 99px; padding: 1px 8px; }
.disclosure-body { padding: 0 16px 14px; font-size: .92rem; color: var(--ink-2); }
.disclosure ol, .disclosure ul { margin: 0; padding-left: 20px; }
.disclosure li + li { margin-top: 5px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compare > div { padding: 12px; border-radius: var(--radius-sm); background: var(--bg); }
.compare .tag { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.compare h3 { font-size: .95rem; margin: 2px 0 6px; }
.compare ul { padding-left: 16px; color: var(--muted); font-size: .87rem; }

/* ---------- Forms ---------- */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset + fieldset { margin-top: 20px; }
legend { padding: 0; margin-bottom: 10px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
label { display: block; font-size: .9rem; font-weight: 600; color: var(--ink); min-width: 0; }
small, .hint { display: block; color: var(--muted); font-size: .83rem; font-weight: 450; }
.optional { font-size: .75rem; color: var(--muted); font-weight: 500; margin-left: 4px; }
.required { color: var(--brand); }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; font: inherit; font-size: 1rem; font-weight: 450; color: var(--ink); background: var(--surface); border: 1px solid #d6d0db; border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #b9b0c0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-wash); }
textarea { resize: vertical; min-height: 64px; }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236a6372' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
select:disabled { opacity: .55; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-2 > .full { grid-column: 1 / -1; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-weight: 450; font-size: .92rem; color: var(--ink-2); cursor: pointer; transition: border-color .15s, background .15s; }
.check + .check { margin-top: 8px; }
.check:hover { border-color: var(--brand-line); }
.check:has(input:checked) { border-color: var(--brand); background: var(--brand-wash); }
.check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.id-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 20px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); font-size: .85rem; color: var(--muted); }
.id-line strong { white-space: nowrap; font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--ink); font-weight: 600; }
.badge { font-size: .72rem; font-weight: 650; padding: 2px 8px; border-radius: 99px; background: var(--brand-wash); color: var(--brand); }
.badge.ok { background: var(--ok-wash); color: var(--ok); }

/* Picker and chips */
.picker { display: flex; gap: 10px; align-items: flex-end; }
.picker label { flex: 1; }
.selected { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.selected li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; border-radius: 999px; background: var(--brand-wash); border: 1px solid var(--brand-line); font-size: .88rem; font-weight: 550; color: var(--ink); }
.selected li small { display: inline; font-size: .75rem; color: var(--brand); }
.selected button { width: 24px; height: 24px; padding: 0; border-radius: 50%; display: grid; place-items: center; font-size: 1rem; line-height: 1; background: transparent; color: var(--muted); border: 0; }
.selected button:hover { background: #fff; color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid #d6d0db; border-radius: 999px; font-size: .9rem; font-weight: 550; color: var(--ink-2); cursor: pointer; user-select: none; transition: all .15s; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:hover { border-color: var(--brand); }
.chip:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip:has(input:checked)::before { content: "✓"; font-size: .8rem; }
.chip:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.chip:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--focus); }
.waitlist { margin-top: 12px; font-size: .9rem; }
.waitlist summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.waitlist[open] { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg); }
.waitlist .hint { margin: 6px 0 10px; }

/* ---------- Buttons ---------- */
button { font: inherit; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 650; font-size: .95rem; text-decoration: none; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px #92255433, 0 4px 14px #92255426; }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: #d6d0db; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-lg { padding: 14px 22px; font-size: 1rem; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-link { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 600; font-size: .85rem; text-decoration: underline; text-underline-offset: 2px; }
.btn-link:hover { color: var(--brand-hover); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.status:not(:empty) { margin-top: 10px; font-size: .9rem; font-weight: 550; color: var(--brand); }

/* ---------- Preview ---------- */
.preview { overflow: hidden; }
.preview-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.preview-head span { font-size: .75rem; color: var(--muted); }
.preview-stage { padding: 18px; background: linear-gradient(180deg, var(--brand-wash), #fff); max-height: min(62vh, 560px); overflow: auto; }
.paper { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 18px; box-shadow: 0 8px 24px #1b182014; overflow-wrap: anywhere; }
.paper-brand { color: var(--brand); font-weight: 750; letter-spacing: .1em; font-size: .68rem; }
.paper h3 { font-family: var(--serif); font-size: 1.2rem; margin: 4px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.empty { color: var(--muted); font-size: .88rem; }
dl { margin: 0; }
.js-preview dt { margin-top: 10px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.js-preview dd { margin: 2px 0 0; font-size: .88rem; }
.preview-mobile { display: none; margin-top: 22px; }
.aside-note { margin-top: 12px; font-size: .83rem; color: var(--muted); }

/* ---------- Result ---------- */
.success { display: flex; gap: 16px; align-items: flex-start; padding: 22px 0; }
.success-icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--ok-wash); color: var(--ok); font-size: 1.4rem; font-weight: 800; }
.success h1 { margin-top: 0; font-size: clamp(1.8rem, 4vw, 2.4rem); }
.success p { margin-top: 6px; color: var(--muted); }
.result-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; padding-bottom: 40px; }
.download-card { padding: 24px; }
.ids { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.ids > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); min-width: 0; }
.ids dt { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.ids dd { margin: 3px 0 0; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .8rem; color: var(--ink); overflow-wrap: anywhere; }
.copy { border: 0; background: none; padding: 0 2px; color: var(--brand); font-size: .7rem; font-weight: 650; }
.report-log { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.report-log:empty { display: none; }
.report-log li { display: flex; gap: 8px; align-items: center; font-size: .85rem; color: var(--ink-2); padding: 8px 10px; border-radius: 8px; background: var(--ok-wash); }
.report-log li::before { content: "✓"; color: var(--ok); font-weight: 800; }
.feedback { padding: 22px 24px; margin-top: 16px; }
.feedback label { margin-top: 14px; }
.rating { display: flex; gap: 8px; }
.rating .check { padding: 8px 14px; margin: 0; }
.rating .check + .check { margin-top: 0; }
.cta { padding: 20px; border-radius: var(--radius); background: var(--ink); color: #fff; position: relative; overflow: hidden; }
.cta::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--grad); }
.cta h2 { color: #fff; }
.cta p { margin-top: 6px; color: #d9d3de; font-size: .92rem; }
.cta a { color: #fff; }
.side-stack { display: grid; gap: 16px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 22px 0 32px; color: var(--muted); font-size: .85rem; }
.site-footer .shell { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.fine-print { color: var(--muted); font-size: .85rem; }

/* ---------- Explorer ---------- */
.explore-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; gap: 10px; align-items: end; }
.explore-tools input, .explore-tools select { margin-top: 0; }
.area-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; padding: 20px 22px; margin-top: 18px; }
.area-head h2 { font-family: var(--serif); font-size: 1.6rem; font-weight: 650; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pill { font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.pill.hl { background: var(--brand-wash); border-color: var(--brand-line); color: var(--brand); }
.obs { list-style: none; margin: 0; padding: 6px 22px 18px; display: grid; gap: 10px; }
.obs li { padding-left: 16px; position: relative; font-size: .93rem; color: var(--ink-2); }
.obs li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.block-title { margin: 28px 0 10px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: .9rem; vertical-align: top; }
th { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; background: var(--bg); }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
td.group { background: var(--brand-wash); color: var(--brand); font-weight: 700; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; padding: 7px 14px; }
.bar { height: 5px; margin-top: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.bar.city i { background: #b7aebd; }
.lim { margin: 0; padding: 16px 22px 16px 38px; color: var(--muted); font-size: .88rem; }
.lim li + li { margin-top: 5px; }
.explore-foot { margin: 18px 0 40px; font-size: .82rem; color: var(--muted); }

/* ---------- Privacy ---------- */
.prose { max-width: 720px; padding: 10px 0 48px; }
.prose h2 { margin: 26px 0 6px; }
.prose p, .prose li { color: var(--ink-2); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 22px; padding-top: 10px; }
  .hero-text { position: static; }
  .layout, .result-grid { grid-template-columns: 1fr; }
  .layout > aside { display: none; }
  .preview-mobile { display: block; }
}
@media (max-width: 640px) {
  .shell { width: calc(100% - 32px); }
  .product { display: none; }
  .nav a { padding: 7px 10px; font-size: .85rem; }
  .steps { display: none; }
  .step-compact, .progress { display: block; }
  .stepper { margin-top: 18px; }
  .form-card, .download-card, .feedback { padding: 20px 18px; }
  .grid-2, .compare, .ids { grid-template-columns: 1fr; }
  .explore-tools { grid-template-columns: 1fr; }
  .sticky-actions { position: sticky; bottom: 0; z-index: 5; margin: 22px -18px -20px; padding: 12px 18px; background: #ffffffeb; backdrop-filter: blur(8px); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
  .sticky-actions .btn-primary { flex: 1; }
  .btn-lg { width: 100%; }
}
.nav a { white-space: nowrap; }
@media (max-width: 640px) {
  .topbar-inner { gap: 8px; }
  .logo img { height: 17px; }
  .nav a { padding: 6px 9px; font-size: .8rem; }
}
@media (max-width: 360px) { .logo img { height: 14px; } }

/* ---------- Explorer v5: search, map, tiles, rank strips ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.combo { position: relative; max-width: 620px; }
.combo input { margin-top: 0; padding: 14px 16px 14px 44px; font-size: 1.02rem; border-radius: 999px; box-shadow: var(--shadow);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%236a6372' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='M12.5 12.5L17 17'/%3E%3C/svg%3E") no-repeat 16px center; }
.suggestions { position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px #1b18201f; }
.suggestions li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-weight: 550; }
.suggestions li small { color: var(--muted); }
.suggestions li[aria-selected=true], .suggestions li[role=option]:hover { background: var(--brand-wash); color: var(--brand); }
.suggestions li.none { color: var(--muted); cursor: default; font-weight: 450; }
.explore-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; margin-top: 18px; align-items: stretch; }
.map-card { padding: 16px 18px; display: flex; flex-direction: column; }
.map-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.map-metric { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); font-weight: 600; }
.map-metric select { margin-top: 0; padding: 7px 34px 7px 10px; font-size: .88rem; max-width: 300px; }
.map-wrap { position: relative; margin-top: 10px; }
#map { display: block; width: 100%; height: auto; }
#map path { stroke: #fff; stroke-width: .45; cursor: pointer; transition: opacity .15s; }
#map path:hover { stroke: var(--ink); stroke-width: .9; }
#map path.sel { stroke: var(--ink); stroke-width: 1.6; paint-order: stroke; filter: drop-shadow(0 0 1.5px #fff); }
.tooltip { position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; display: grid; gap: 1px; padding: 8px 10px; background: var(--ink); color: #fff; border-radius: 8px; font-size: .8rem; box-shadow: 0 8px 20px #1b182033; max-width: 240px; }
.tooltip span { color: #ddd6e3; }
.legend { margin-top: 10px; }
.legend-title { display: block; font-size: .75rem; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }
.legend-scale { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.legend-scale span { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--muted); }
.legend-scale i { width: 14px; height: 10px; border-radius: 3px; }
.map-note { margin-top: 8px; font-size: .78rem; }
.area-card { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.area-name { font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 650; line-height: 1.15; margin-top: 8px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); min-width: 0; }
.kpi-label { font-size: .75rem; font-weight: 650; color: var(--muted); }
.kpi-value { font-family: var(--serif); font-size: 1.5rem; font-weight: 650; color: var(--ink); line-height: 1.2; }
.cmp { font-size: .76rem; color: var(--muted); }
.cmp b { color: var(--brand); font-weight: 700; }
.area-cta { margin-top: auto; }
.ranks-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 6px 16px; margin: 28px 0 10px; }
.ranks-head .block-title { margin: 0; }
.rank-key { display: flex; gap: 14px; font-size: .78rem; color: var(--muted); }
.rank-key span { display: inline-flex; align-items: center; gap: 6px; }
.key-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--brand); }
.key-city { width: 2px; height: 12px; background: var(--ink); }
.ranks { padding: 10px 22px 16px; }
.rank-scale, .rank-row { display: grid; grid-template-columns: minmax(150px, 1.4fr) 84px minmax(120px, 2fr) 56px; gap: 14px; align-items: center; }
.rank-scale { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 6px 0 2px; }
.scale-ends { display: flex; justify-content: space-between; }
.rank-group { margin: 14px 0 4px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.rank-row { padding: 7px 0; border-bottom: 1px solid var(--line); }
.rank-label { font-size: .88rem; color: var(--ink-2); }
.rank-value { font-size: .9rem; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.track { position: relative; height: 8px; border-radius: 99px; background: var(--line); }
.track-fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: linear-gradient(90deg, #f7e6ee, #e9b9cf); }
.track .dot { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px #fff, 0 1px 3px #1b182040; }
.city-tick { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.rank-num { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; font-size: .9rem; }
.rank-num small { color: var(--muted); font-weight: 450; font-size: .75rem; }
@media (max-width: 900px) { .explore-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .rank-scale { display: none; }
  .rank-row { grid-template-columns: 1fr auto; gap: 6px 10px; }
  .rank-row .track { grid-column: 1 / -1; order: 3; }
  .rank-row .rank-num { order: 2; }
  .rank-row .rank-value { order: 1; text-align: left; }
  .rank-label { grid-column: 1 / -1; font-weight: 600; }
  .ranks { padding: 6px 16px 14px; }
  .map-metric { width: 100%; } .map-metric select { max-width: none; flex: 1; }
}

/* ---------- Email verification ---------- */
.verify > label { margin-bottom: 0; }
.verify-row { display: flex; gap: 8px; margin-top: 6px; }
.verify-row input { margin-top: 0; flex: 1; min-width: 0; }
.verify-row .btn { flex: none; }
#code { letter-spacing: .3em; font-variant-numeric: tabular-nums; font-weight: 600; }
.verified { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 11px 12px; border-radius: var(--radius-sm); background: var(--ok-wash); color: var(--ok); font-weight: 600; font-size: .95rem; overflow-wrap: anywhere; }
.verified .tick { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--ok); color: #fff; font-size: .8rem; }
.verify small { margin-top: 6px; }
.verify-links { margin-top: 6px; font-size: .85rem; color: var(--muted); }
@media (max-width: 640px) { .verify-row { flex-direction: column; } .verify-row .btn { width: 100%; } }
.cta .btn-light { margin-top: 14px; background: #fff; color: var(--ink); }
.cta .btn-light:hover { background: var(--brand-wash); color: var(--brand); }
.cta .cta-small { margin-top: 10px; font-size: .82rem; }
.area-card #needs-cta { margin-top: -4px; }
