/* ============================================================
   Nearside — premium locality-intelligence UI
   Cool-coastal identity with dark-mode support, animated mesh
   gradient hero, glassmorphic panels, and micro-animations.
   Brand reds are chrome only; data uses a calibrated
   green/amber/brick traffic-light distinct from brand red.
   ============================================================ */

/* CSS @property for smooth conic-gradient score ring animation */
@property --pct {
  syntax: '<number>';
  inherits: false;
  initial-value: 0;
}

:root {
  /* ---- surfaces ---- */
  --paper:      #edf2f4;
  --paper-2:    #e2e8ec;
  --card:       #ffffff;
  --card-glass: rgba(255,255,255,.72);

  /* ---- ink (Space Indigo family) ---- */
  --ink:        #2b2d42;
  --ink-2:      #555a70;
  --ink-3:      #6b7488;   /* darkened for WCAG-AA on light surfaces */
  --line:       #dbe1e8;
  --line-2:     #c8d0da;

  /* ---- brand accent ---- */
  --brand:        #2b2d42;
  --brand-accent: #ef233c;
  --brand-deep:   #d90429;
  --teal:       #ef233c;
  --teal-deep:  #d90429;
  --signal:     #d90429;

  /* ---- data-signal track (AA-tuned on light surfaces, hue preserved) ---- */
  --g-green:  #1C8555;
  --g-yellow: #A76608;
  --g-orange: #BC5913;
  --g-red:    #C0392B;
  --g-grey:   #6b7488;

  --shadow-sm: 0 1px 2px rgba(43,45,66,.05);
  --shadow:    0 2px 8px rgba(43,45,66,.06), 0 12px 32px rgba(43,45,66,.07);
  --shadow-lg: 0 24px 60px rgba(43,45,66,.18);
  --shadow-card: 0 1px 3px rgba(43,45,66,.04), 0 10px 28px -10px rgba(43,45,66,.10);
  --shadow-hover: 0 4px 8px rgba(43,45,66,.06), 0 20px 44px -12px rgba(43,45,66,.18);

  --radius:     20px;
  --radius-sm:  12px;
  --radius-lg:  24px;
  --radius-pill:100px;

  --sp-1: 8px; --sp-2: 12px; --sp-3: 16px; --sp-4: 24px; --sp-5: 32px; --sp-6: 48px;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  --transition-fast: .15s ease;
  --transition-med:  .3s cubic-bezier(.22,.61,.36,1);
}

/* Dark mode — opt-in only via toggle (.dark class on html) */
.dark {
  --paper:      #08090e;
  --paper-2:    #101320;
  --card:       #0f1219;
  --card-glass: rgba(15,18,25,.80);
  --ink:        #e8eaf0;
  --ink-2:      #9ea3b8;
  --ink-3:      #5c6380;
  --line:       #1c2035;
  --line-2:     #282d45;
  --brand:      #e8eaf0;
  --g-green:  #2ecc71;
  --g-yellow: #f0b429;
  --g-orange: #f39c12;
  --g-red:    #e74c3c;
  --g-grey:   #5c6380;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.35);
  --shadow:    0 2px 10px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.3);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.6);
  --shadow-card: 0 1px 3px rgba(0,0,0,.3), 0 10px 28px -10px rgba(0,0,0,.45);
  --shadow-hover: 0 4px 8px rgba(0,0,0,.35), 0 20px 44px -12px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; width: 100%;
  /* clip (not hidden) kills any horizontal scroll on mobile WITHOUT breaking the
     sticky top bar — see responsive-hardening block at the end of this file */
  overflow-x: clip;
}
/* media never exceeds its container (prevents overflow on small screens) */
img, svg, video, canvas { max-width: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--transition-med), color var(--transition-med);
}

/* animated mesh gradient blobs — ambient hero background */
.hero-mesh {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  opacity: .55;
}
.hero-mesh .blob {
  position: absolute; border-radius: 50%; filter: blur(90px);
  will-change: transform; animation-timing-function: ease-in-out; animation-iteration-count: infinite;
}
.hero-mesh .blob-1 {
  width: 520px; height: 520px; top: -12%; right: -6%;
  background: radial-gradient(circle, rgba(239,35,60,.18), transparent 70%);
  animation: float1 18s infinite;
}
.hero-mesh .blob-2 {
  width: 440px; height: 440px; bottom: -8%; left: -4%;
  background: radial-gradient(circle, rgba(43,45,66,.12), transparent 70%);
  animation: float2 22s infinite;
}
.hero-mesh .blob-3 {
  width: 360px; height: 360px; top: 30%; left: 40%;
  background: radial-gradient(circle, rgba(141,153,174,.10), transparent 70%);
  animation: float3 25s infinite;
}
@keyframes float1 {
  0%,100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(-40px,60px) scale(1.08); }
  66% { transform: translate(30px,-30px) scale(.95); }
}
@keyframes float2 {
  0%,100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(50px,-40px) scale(1.05); }
  66% { transform: translate(-30px,50px) scale(.92); }
}
@keyframes float3 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-60px,-40px) scale(1.12); }
}

/* subtle grain overlay for organic texture */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .35;
  background-image:
    radial-gradient(120% 120% at 88% -10%, rgba(141,153,174,.12), transparent 46%),
    radial-gradient(90% 90% at 5% 108%, rgba(239,35,60,.04), transparent 42%);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

.wrap { position: relative; z-index: 1; max-width: 1400px; margin: 0 auto; padding: 0 40px; }
@media (max-width: 700px){ .wrap { padding: 0 20px; } }

a { color: var(--brand-deep); }

/* ---------- eyebrow / labels ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-3);
}

/* ============================================================ Top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--card-glass);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  transition: background var(--transition-med), border-color var(--transition-med);
}
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 62px; }
.brand {
  font-family: var(--font-display);
  font-weight: 700; font-size: 20px; letter-spacing: -.02em;
  color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 9px; cursor: pointer;
  transition: color var(--transition-fast);
}
/* survey-benchmark mark: indigo ring + red azimuth notch */
.brand .mark {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--brand); position: relative; display: inline-block;
  transition: border-color var(--transition-fast);
}
.brand .mark::after {
  content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--brand);
  transition: background var(--transition-fast);
}
.brand .mark::before {
  content: ""; position: absolute; top: -4px; left: 50%; width: 2px; height: 7px;
  background: var(--brand-accent); transform: translateX(-50%); border-radius: 2px;
}
.topbar-spacer { flex: 1; }

.nav-toggle { display: none; background: none; border: none; font-size: 20px; color: var(--ink); cursor: pointer; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-family: var(--font-body); font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  text-decoration: none; padding: 8px 12px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; gap: 7px;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
  position: relative;
}
.nav-link::after {
  content: ""; position: absolute; bottom: 2px; left: 12px; right: 12px; height: 2px;
  background: var(--brand-accent); border-radius: 1px;
  transform: scaleX(0); transition: transform .25s cubic-bezier(.22,.61,.36,1);
}
.nav-link:hover { background: var(--paper-2); color: var(--ink); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.active { color: var(--brand-deep); background: rgba(239,35,60,.08); }
.nav-link.active::after { transform: scaleX(1); }
.nav-link i { font-size: 12px; }

/* dark mode toggle */
.theme-toggle {
  background: none; border: 1px solid var(--line); border-radius: var(--radius-sm);
  width: 34px; height: 34px; cursor: pointer; color: var(--ink-2); font-size: 14px;
  display: grid; place-items: center; transition: all var(--transition-fast);
}
.theme-toggle:hover { border-color: var(--ink-3); color: var(--ink); background: var(--paper-2); }

@media (max-width: 780px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 62px; right: 0; left: 0;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 12px 20px 16px;
    background: var(--card); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 12px; font-size: 15px; }
  .nav-link::after { display: none; }
  #navAuth { margin-top: 6px; justify-content: center; }
}

/* ---------- buttons ---------- */
.btn {
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 9px 15px; border-radius: var(--radius-sm); cursor: pointer;
  transition: transform .12s cubic-bezier(.34,1.56,.64,1), background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  text-decoration: none; display: inline-flex; align-items: center; gap: 7px; box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: var(--ink-3); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(239,35,60,.25); }
.btn-primary {
  background: linear-gradient(180deg, var(--brand-accent), var(--brand-deep));
  border-color: var(--brand-deep); color: #fff; box-shadow: 0 2px 14px rgba(239,35,60,.30);
}
.btn-primary:hover { filter: brightness(1.08); border-color: var(--brand-deep); box-shadow: 0 4px 20px rgba(239,35,60,.35); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--paper-2); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================ Hero / search */
.hero { padding: 84px 0 44px; text-align: center; max-width: 900px; margin: 0 auto; }
.hero-eyebrow { margin-bottom: 18px; }
.hero h1 {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(36px, 6vw, 66px);
  line-height: 1.02; letter-spacing: -.03em; margin: 0 auto 16px; max-width: 15ch;
  text-wrap: balance;
}
.hero h1 .u {
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-deep));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  position: relative;
}
.hero .sub { font-size: 18px; color: var(--ink-2); max-width: 56ch; margin: 0 auto 34px; text-wrap: balance; }

.searchbox { position: relative; max-width: 640px; margin: 0 auto; }
.searchbox .field {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1.5px solid var(--line-2); border-radius: 14px;
  padding: 6px 6px 6px 16px; box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.searchbox .field:focus-within {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 4px rgba(239,35,60,.10), 0 8px 32px rgba(239,35,60,.08), var(--shadow);
  transform: translateY(-1px);
}
.searchbox i.fa-location-dot { color: var(--ink-3); }
.searchbox input {
  flex: 1; border: none; outline: none; font-size: 16px; font-family: var(--font-body);
  background: transparent; color: var(--ink); padding: 11px 0;
}
.searchbox input::placeholder { color: var(--ink-3); }

.ac-list {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 30;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); overflow: hidden; text-align: left; display: none;
  animation: acIn .18s ease;
}
@keyframes acIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.ac-item { padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--paper-2); display: flex; gap: 11px; align-items: center; transition: background var(--transition-fast); }
.ac-item:last-child { border-bottom: none; }
.ac-item .pin { color: var(--ink-3); width: 15px; text-align: center; flex: none; }
.ac-item:hover, .ac-item.active { background: var(--paper-2); box-shadow: inset 3px 0 0 var(--brand-accent); }
.ac-item .main { font-weight: 600; font-size: 14px; }
.ac-item .main mark { background: rgba(239,35,60,.14); color: inherit; border-radius: 3px; padding: 0 2px; }
.ac-item .sec { font-size: 12px; color: var(--ink-3); }
.ac-note { padding: 12px 16px; font-size: 13px; color: var(--ink-3); }
.ac-note i { margin-right: 7px; }
.ac-spin { display: inline-block; width: 13px; height: 13px; border: 2px solid var(--line); border-top-color: var(--brand-accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }

.example-chips { margin-top: 22px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.chip {
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 7px 14px; cursor: pointer;
  background: var(--card); transition: all .2s cubic-bezier(.22,.61,.36,1); box-shadow: var(--shadow-sm);
}
.chip:hover { border-color: var(--brand-accent); color: var(--brand-deep); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(239,35,60,.12); }

.usecue { margin-top: 14px; font-size: 13px; color: var(--ink-3); }
.usecue button { background: none; border: none; color: var(--brand-deep); cursor: pointer; font: inherit; text-decoration: underline; }

/* honest-by-design note strip */
.honesty {
  margin: 60px auto 0; max-width: 900px; display: grid; grid-template-columns: repeat(3,1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm);
}
.honesty > div { background: var(--card); padding: 22px; transition: background var(--transition-fast); }
.honesty > div:hover { background: var(--paper-2); }
.honesty h4 { font-family: var(--font-display); margin: 0 0 5px; font-size: 15px; }
.honesty p { margin: 0; font-size: 13px; color: var(--ink-2); }
@media (max-width: 620px){ .honesty { grid-template-columns: 1fr; } }

/* ============================================================ Loading */
.loader { text-align: center; padding: 90px 0; display: none; }
.loader-card {
  max-width: 420px; margin: 0 auto; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 40px 32px; box-shadow: var(--shadow);
}
.loader .ring {
  width: 48px; height: 48px; border: 3px solid var(--line); border-top-color: var(--brand-accent);
  border-radius: 50%; margin: 0 auto 20px; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader p { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); letter-spacing: .05em; }
.loader-steps { display: flex; flex-direction: column; gap: 8px; text-align: left; margin-top: 20px; }
.loader-step {
  display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-3);
  padding: 6px 0; transition: color .3s;
}
.loader-step.active { color: var(--ink); font-weight: 600; }
.loader-step.done { color: var(--g-green); }
.loader-step i { width: 16px; text-align: center; }
.loader-bar {
  margin-top: 16px; height: 4px; background: var(--paper-2); border-radius: 2px; overflow: hidden;
}
.loader-bar-fill {
  height: 100%; width: 0%; border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-accent), var(--brand-deep));
  transition: width .6s cubic-bezier(.22,.61,.36,1);
}

/* ============================================================ Dashboard */
.dash { display: none; padding: 34px 0 90px; }

.dash-head {
  display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center;
  padding-bottom: 26px; border-bottom: 1px solid var(--line); margin-bottom: 26px;
}
.dash-head .addr .eyebrow { margin-bottom: 8px; }
.dash-head .addr h2 { font-family: var(--font-display); font-size: clamp(22px,3vw,32px); margin: 0; letter-spacing: -.02em; text-wrap: balance; }
.dash-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: -8px 0 22px; }
@media (max-width: 620px){ .dash-head { grid-template-columns: 1fr; } .dash-actions { margin-top: 4px; } }

/* survey-stamp score seal — animated conic progress ring with glow */
.seal { display: flex; align-items: center; gap: 18px; }
.seal .ring {
  --pct: 0; --seal-color: var(--g-green);
  width: 140px; height: 140px; border-radius: 50%; position: relative; flex: none;
  background: conic-gradient(var(--seal-color) calc(var(--pct) * 1%), var(--paper-2) 0);
  display: grid; place-items: center;
  transition: --pct .9s cubic-bezier(.22,.61,.36,1), background .9s cubic-bezier(.22,.61,.36,1);
  box-shadow: var(--shadow), 0 0 30px -5px var(--seal-color);
}
.seal .ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--card); }
/* dashed tick marks for surveyor instrument feel */
.seal .ring::after {
  content: ""; position: absolute; inset: 4px; border-radius: 50%;
  border: 1.5px dashed var(--line); opacity: .4;
}
.seal .num { position: relative; font-family: var(--font-mono); font-weight: 700; font-size: 44px; line-height: 1; }
.seal .meta { text-align: left; }
.seal .band { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.seal .of { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: .1em; margin-top: 2px; }

/* 12-col dashboard grid */
.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--sp-4); align-items: stretch; }
.col-12 { grid-column: span 12; }
.col-7  { grid-column: span 7; }
.col-5  { grid-column: span 5; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }
@media (max-width: 1040px){
  .dash-grid { grid-template-columns: repeat(6, 1fr); }
  .col-7, .col-5, .col-4 { grid-column: span 6; }
}
@media (max-width: 680px){
  .dash-grid { grid-template-columns: 1fr; }
  .col-12, .col-7, .col-5, .col-4 { grid-column: span 1; }
}

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-4);
  box-shadow: var(--shadow-card);
  transition: transform .2s cubic-bezier(.22,.61,.36,1), box-shadow .2s, border-color .2s;
}
.panel:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--line-2);
}
.panel > .eyebrow { display: block; margin-bottom: 14px; }
.panel h3 { font-family: var(--font-display); font-size: 17px; margin: 0 0 12px; letter-spacing: -.01em; }
/* feature (bento) tiles read larger + lift on hover */
.proscons, .col-7 { border-radius: var(--radius-lg); }

/* ---- pros / cons ---- */
.proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
@media (max-width: 680px){ .proscons { grid-template-columns: 1fr; gap: 18px; } }
.pc-col .eyebrow { display: block; margin-bottom: 12px; }
.pc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.pc-item {
  --c: var(--g-grey);
  display: flex; gap: 11px; align-items: flex-start; font-size: 14px; color: var(--ink);
  border-left: 3px solid var(--c); background: var(--paper); border-radius: 8px; padding: 10px 13px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.pc-item:hover { transform: translateX(3px); box-shadow: var(--shadow-sm); }
.pc-item i { color: var(--c); margin-top: 2px; flex: none; }
.pc-item.sev-good { --c: var(--g-green); }
.pc-item.sev-warn { --c: var(--g-yellow); }
.pc-item.sev-bad  { --c: var(--g-red); }
.pc-empty { font-size: 13px; color: var(--ink-3); font-style: italic; }

/* the living legend — 10-category grid */
.legend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
@media (max-width: 480px){ .legend-grid { grid-template-columns: 1fr; } }
.tile {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 15px; cursor: pointer;
  display: flex; gap: 12px; align-items: flex-start; position: relative; background: var(--card);
  transition: border-color .2s, transform .2s cubic-bezier(.22,.61,.36,1), box-shadow .2s;
}
.tile:hover { border-color: var(--ink-3); transform: translateY(-3px) scale(1.01); box-shadow: var(--shadow-hover); }
.tile .dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; flex: none; box-shadow: 0 0 0 3px rgba(43,45,66,.05); transition: box-shadow .2s; }
.tile:hover .dot { box-shadow: 0 0 0 4px rgba(43,45,66,.08), 0 0 8px currentColor; }
.tile .body { flex: 1; min-width: 0; }
.tile .name { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.tile .name i { color: var(--ink-3); width: 15px; text-align: center; }
.tile .near { font-size: 12px; color: var(--ink-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .time { font-family: var(--font-mono); font-size: 12px; margin-top: 6px; font-weight: 600; }
.tile .conf { position: absolute; top: 10px; right: 12px; font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; color: var(--ink-3); text-transform: uppercase; }

/* keyboard focus visibility across interactive surfaces (accessibility) */
.chip:focus-visible, .tile:focus-visible, .map-pin:focus-visible, .drill-row:focus-visible,
.locard:focus-visible, .ac-item:focus-visible, .preset:focus-visible, .seg button:focus-visible,
.nav-link:focus-visible, .theme-toggle:focus-visible, .map-ctrl button:focus-visible {
  outline: none; box-shadow: 0 0 0 3px rgba(239,35,60,.30); border-radius: 8px;
}
.map-pin:focus-visible { border-radius: 50%; }

/* dot + text colour classes (data-signal track) */
.c-green{background:var(--g-green)} .c-yellow{background:var(--g-yellow)} .c-orange{background:var(--g-orange)} .c-red{background:var(--g-red)} .c-grey{background:var(--g-grey)}
.t-green{color:var(--g-green)} .t-yellow{color:var(--g-yellow)} .t-orange{color:var(--g-orange)} .t-red{color:var(--g-red)} .t-grey{color:var(--g-grey)}

/* ---- interactive map (zoom + pan) ---- */
.mapwrap { position: relative; border-radius: var(--radius); border: 1px solid var(--line); line-height: 0; overflow: hidden; touch-action: none; aspect-ratio: 40 / 21; max-height: 640px; }
.map-view { position: absolute; inset: 0; will-change: transform; cursor: grab; }
.map-view:active { cursor: grabbing; }
.map-img { width: 100%; height: 100%; display: block; object-fit: cover; }
.map-shimmer { position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  background-size: 200% 100%; animation: shimmer 1.1s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.map-pins { position: absolute; inset: 0; pointer-events: none; }
.map-ctrl { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 6; }
.map-ctrl button {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: rgba(255,255,255,.92); backdrop-filter: blur(6px); font-size: 17px; line-height: 1;
  cursor: pointer; box-shadow: var(--shadow-sm); color: var(--ink); display: grid; place-items: center;
}
.map-ctrl button:hover { border-color: var(--ink-3); }
.map-pin {
  position: absolute; transform: translate(-50%, -100%); pointer-events: auto; cursor: pointer;
  width: 26px; height: 26px; border: none; background: transparent; padding: 0;
  display: grid; place-items: center; transition: transform .12s ease; filter: drop-shadow(0 2px 3px rgba(43,45,66,.35));
}
.map-pin::after { content: ""; position: absolute; inset: 0; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--pin, var(--g-grey)); border: 2px solid #fff; }
.map-pin i { position: relative; z-index: 1; color: #fff; font-size: 10px; }
.map-pin:hover { transform: translate(-50%, -100%) scale(1.18); z-index: 5; }
.map-pin--home { width: 30px; height: 30px; }
.map-pin--home::after { border-radius: 50%; background: var(--brand); }
.map-pin--home i { font-size: 12px; }
.pin-green{--pin:var(--g-green)} .pin-yellow{--pin:var(--g-yellow)} .pin-orange{--pin:var(--g-orange)} .pin-red{--pin:var(--g-red)} .pin-grey{--pin:var(--g-grey)}
.pin-groceries{--pin:#1E8E5A} .pin-healthcare{--pin:#C0392B} .pin-transit{--pin:#6C4BB0} .pin-schools{--pin:#E06A17} .pin-dining{--pin:#C77A0A}
.pin-safety{--pin:#2b2d42} .pin-shopping{--pin:#8a5a2b} .pin-parks{--pin:#2e7d32} .pin-pharmacies{--pin:#c2185b} .pin-gyms{--pin:#00838f}

.maplegend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.maplegend span { display: inline-flex; align-items: center; gap: 7px; }
.maplegend .sw { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.map-cap { font-size: 11.5px; color: var(--ink-3); margin-top: 9px; }
.map-cap .rl { display: inline-block; width: 16px; height: 3px; background: var(--brand-accent); border-radius: 2px; vertical-align: middle; margin-right: 5px; }

/* place card (shared: map popover + drilldown) */
.pcard { font-size: 13px; }
.pcard .nm { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.pcard .ty { font-size: 11px; color: var(--ink-3); text-transform: capitalize; margin-bottom: 8px; }
.pcard .stars { color: var(--g-yellow); letter-spacing: 1px; }
.pcard .rrow { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 12px; margin-bottom: 6px; }
.pcard .open { color: var(--g-green); font-weight: 600; } .pcard .shut { color: var(--g-red); font-weight: 600; }
.pcard .meta { font-size: 12px; color: var(--ink-2); }
.pcard .rev { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 8px; font-size: 12px; color: var(--ink-2); }
.pcard a { font-size: 12px; }
.pcard .load { color: var(--ink-3); font-size: 12px; }

/* stat rows (proxies) */
.statrow { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.statrow:last-child { border-bottom: none; }
.statrow .k { color: var(--ink-2); }
.statrow .v { font-family: var(--font-mono); font-weight: 600; }
.proxy-note { font-size: 11.5px; color: var(--ink-3); margin-top: 10px; font-style: italic; }
.badge-proxy {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
  background: var(--paper-2); color: var(--ink-2); padding: 2px 7px; border-radius: var(--radius-pill); margin-left: 8px;
}

/* chart */
.chartwrap { position: relative; width: 100%; }

/* essentials */
.ess { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.ess .item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; min-width: 0; }
.ess .item .ess-head { display: flex; align-items: center; gap: 6px; }
.ess .item .ess-head .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ess .item .lbl { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.ess .item .lbl i { margin-right: 3px; }
.ess .item .nm { font-weight: 600; font-size: 13.5px; margin: 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ess .item .tm { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.ess .item .dist { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* reweight sliders */
.reweight .row { display: grid; grid-template-columns: 150px 1fr 44px; gap: 12px; align-items: center; margin-bottom: 11px; }
.reweight label { font-size: 12.5px; }
.reweight input[type=range] { width: 100%; accent-color: var(--brand-accent); }
.reweight .val { font-family: var(--font-mono); font-size: 12px; text-align: right; color: var(--ink-2); }
@media (max-width: 520px){
  /* stack label above the slider so narrow screens don't squeeze the track */
  .reweight .row { grid-template-columns: 1fr 44px; grid-template-areas: "label val" "slider slider"; row-gap: 4px; }
  .reweight .row label { grid-area: label; }
  .reweight .row .val { grid-area: val; }
  .reweight .row input[type=range] { grid-area: slider; }
}
.reweight-actions { display: flex; gap: 8px; margin-top: 12px; }

/* commute */
.commute-modes { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 12px; }
.commute-modes .m { text-align: center; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 8px; }
.commute-modes .m i { color: var(--ink-3); font-size: 18px; }
.commute-modes .m .t { font-family: var(--font-mono); font-weight: 700; font-size: 20px; margin-top: 6px; }
.commute-modes .m .d { font-size: 11px; color: var(--ink-3); }
.commute-modes .m .ctx { font-size: 10px; font-weight: 600; margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }
.commute-modes .m .traffic-badge {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--g-orange); background: color-mix(in srgb, var(--g-orange) 12%, transparent);
  padding: 2px 7px; border-radius: var(--radius-pill);
}

/* ============================================================ Modal */
.modal-back {
  position: fixed; inset: 0; z-index: 100; background: rgba(43,45,66,.45); backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal { background: var(--card); border-radius: 16px; width: 100%; max-width: 440px; padding: 28px; box-shadow: var(--shadow-lg); max-height: 88vh; overflow-y: auto; }
.modal h3 { font-family: var(--font-display); margin: 0 0 4px; font-size: 22px; }
.modal .msub { color: var(--ink-2); font-size: 14px; margin-bottom: 20px; }
.modal label { display: block; font-size: 12px; font-weight: 600; margin: 12px 0 5px; color: var(--ink-2); }
.modal input { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-family: var(--font-body); outline: none; }
.modal input:focus { border-color: var(--brand-accent); }
.modal .err { color: var(--brand-deep); font-size: 13px; margin-top: 12px; min-height: 18px; }
.modal .switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--ink-2); }
.modal .switch button { background: none; border: none; color: var(--brand-deep); cursor: pointer; font: inherit; text-decoration: underline; }
.modal .x { float: right; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--ink-3); margin: -8px -8px 0 0; }

/* drawer for saved/history/compare + drilldown */
.drawer-list { display: flex; flex-direction: column; gap: 8px; }
.drawer-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 13px; font-size: 13.5px;
}
.drawer-item.clickable { cursor: pointer; flex-wrap: wrap; }
.drawer-item.clickable:hover { border-color: var(--ink-3); }
.drawer-item .go { cursor: pointer; }
.drawer-item .go:hover { color: var(--brand-deep); }
.drawer-item .pd-slot { flex-basis: 100%; display: none; }

/* compare table */
.cmp { width: 100%; border-collapse: collapse; font-size: 13px; }
.cmp th, .cmp td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.cmp th { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.cmp td.num { font-family: var(--font-mono); font-weight: 600; }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: var(--radius-pill); font-size: 14px;
  opacity: 0; transition: all .25s; z-index: 200; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 30px 0; font-size: 12.5px; color: var(--ink-3); text-align: center; margin-top: 40px; }
.footer .attrib { font-family: var(--font-mono); }

.hidden { display: none !important; }

/* ============================================================ v2 pages & components */
.pageview { display: none; padding: 34px 0 90px; }
.load { color: var(--ink-3); font-size: 13px; font-family: var(--font-mono); padding: 8px 0; }
.backlink {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; margin-bottom: 20px;
}
.backlink:hover { color: var(--brand-deep); }

/* legend inline drill (replaces the drawer) */
.legend-drill { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.legend-drill .drill-head { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.drill-row {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 13px; margin-bottom: 7px; cursor: pointer; text-align: left; font: inherit; color: var(--ink);
  transition: border-color .15s, transform .12s;
}
.drill-row:hover { border-color: var(--ink-3); transform: translateX(2px); }
.dr-name { font-weight: 600; font-size: 13.5px; display: flex; flex-direction: column; }
.dr-type { font-size: 11px; color: var(--ink-3); text-transform: capitalize; font-weight: 400; margin-top: 2px; }
.dr-tm { font-family: var(--font-mono); font-size: 12px; color: var(--brand-deep); white-space: nowrap; }
.dr-tm i { color: var(--ink-3); margin-left: 6px; font-size: 10px; }
.tile.active { border-color: var(--brand-accent); box-shadow: 0 0 0 2px rgba(239,35,60,.12); }

/* place-details page */
.place-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.place-hero h2 { font-family: var(--font-display); font-size: clamp(24px,3.5vw,36px); margin: 6px 0 8px; letter-spacing: -.02em; }
.place-rrow { font-size: 15px; color: var(--ink-2); }
.place-rrow .stars { color: var(--g-yellow); letter-spacing: 1px; }
.place-rrow .open { color: var(--g-green); font-weight: 600; } .place-rrow .shut { color: var(--g-red); font-weight: 600; }
.place-walk { text-align: center; flex: none; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 20px; }
.place-walk .pw-val { font-family: var(--font-mono); font-weight: 700; font-size: 26px; color: var(--brand-deep); }
.place-walk .pw-lbl { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.hours { list-style: none; margin: 0 0 8px; padding: 0; font-size: 13.5px; color: var(--ink-2); }
.hours li { padding: 4px 0; border-bottom: 1px dashed var(--line); font-family: var(--font-mono); font-size: 12.5px; }
.rev { border-top: 1px solid var(--line); padding: 12px 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.rev-h { margin-bottom: 5px; } .rev-h .stars { color: var(--g-yellow); }
.pc-links { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; align-items: flex-start; }

/* card grid (saved / history) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-4); }
.locard {
  display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-card); cursor: pointer;
  text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.locard:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--ink-3); }
.locard-score { flex: none; width: 44px; height: 44px; border-radius: 12px; color: #fff; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 17px; }
.locard-body { min-width: 0; flex: 1; }
.locard-addr { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.locard-date { font-size: 12px; color: var(--ink-3); font-family: var(--font-mono); margin-top: 3px; }
.locard-del { flex: none; background: none; border: none; color: var(--ink-3); cursor: pointer; padding: 6px; border-radius: 8px; }
.locard-del:hover { color: var(--g-red); background: var(--paper-2); }

/* settings / account */
.acct-name { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.acct-email { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.worklet { margin-top: 14px; position: relative; }
.inline-field { display: flex; gap: 8px; align-items: center; }
.inline-field input {
  flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 14px; background: var(--card); color: var(--ink); outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.inline-field input:focus { border-color: var(--brand-accent); box-shadow: 0 0 0 3px rgba(239,35,60,.10); }
.acct-details { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.acct-details > summary {
  cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2);
  display: flex; align-items: center; gap: 8px; list-style: none;
}
.acct-details > summary::-webkit-details-marker { display: none; }
.acct-details > summary:hover { color: var(--ink); }
.acct-details[open] > summary { color: var(--ink); margin-bottom: 4px; }
.acct-details input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 14px; background: var(--card); color: var(--ink); outline: none;
}
.acct-details input:focus { border-color: var(--brand-accent); box-shadow: 0 0 0 3px rgba(239,35,60,.10); }
.acct-details label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }

/* priorities preview seal (smaller) */
#prioPreviewWrap .ring { width: 96px; height: 96px; }
#prioPreviewWrap .num { font-size: 30px; }

/* icon chip for section eyebrows */
.ico-chip { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--paper-2); margin-right: 6px; font-size: 11px; }

@media (pointer: coarse) { .map-pin { width: 32px; height: 32px; } .map-pin i { font-size: 12px; } }

/* ============================================================ v2.1 components */
/* commute + from-home */
.commute-wrap { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 700px){ .commute-wrap { grid-template-columns: 1fr; } }
.commute-block h3 { font-family: var(--font-display); font-size: 16px; margin: 0 0 10px; }
.fromhome { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.fromhome .fh-num { font-family: var(--font-mono); font-weight: 700; font-size: 24px; color: var(--brand-deep); }
.fromhome .fh-lbl { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.nudge { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(180deg, #fff, var(--paper)); border: 1px dashed var(--line-2); }
.nudge b { font-family: var(--font-display); }

/* neighbourhood context block */
.context-block { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.ctx-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.ctx-factor { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--ink-2); }

/* inline drill detail */
.drill-item { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; overflow: hidden; background: var(--card); }
.drill-item.open { border-color: var(--ink-3); }
.drill-row { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: transparent; border: none; padding: 12px 14px; cursor: pointer; text-align: left; font: inherit; color: var(--ink); }
.drill-row:hover { background: var(--paper); }
.drill-item.open .dr-tm .fa-chevron-down { transform: rotate(180deg); }
.dr-name { font-weight: 600; font-size: 13.5px; display: flex; flex-direction: column; min-width: 0; }
.dr-type { font-size: 11px; color: var(--ink-3); text-transform: capitalize; font-weight: 400; margin-top: 2px; }
.dr-tm { font-family: var(--font-mono); font-size: 12px; color: var(--brand-deep); white-space: nowrap; }
.dr-tm i { color: var(--ink-3); margin-left: 6px; font-size: 10px; transition: transform .15s; }
.drill-detail { padding: 0 14px 14px; }
.pd-inline .pd-rrow { font-size: 13.5px; color: var(--ink-2); margin-bottom: 6px; }
.pd-inline .stars { color: var(--g-yellow); letter-spacing: 1px; }
.pd-inline .open { color: var(--g-green); font-weight: 600; } .pd-inline .shut { color: var(--g-red); font-weight: 600; }
.pd-hours { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.pd-links { display: flex; gap: 14px; margin: 8px 0; font-size: 13px; }
.pd-inline .rev { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.pd-inline .rev-h { margin-bottom: 3px; } .pd-inline .rev-h .stars { font-size: 11px; }

/* settings / life-profile */
.settings-intro { color: var(--ink-2); font-size: 15px; max-width: 70ch; margin: -8px 0 22px; }
.pfield { margin-bottom: 18px; }
.pfield > label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.pf-current { font-size: 13.5px; color: var(--g-green); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.pf-current i { color: var(--g-green); }
.pf-clear { background: none; border: none; color: var(--ink-3); text-decoration: underline; cursor: pointer; font-size: 12px; }
.pf-search { max-width: none; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: none; background: var(--card); padding: 9px 14px; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink-2); border-right: 1px solid var(--line); display: inline-flex; align-items: center; gap: 6px; }
.seg button:last-child { border-right: none; }
.seg button.active { background: var(--brand-accent); color: #fff; }
.pfield input[type=range] { width: 100%; accent-color: var(--brand-accent); }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.preset { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-pill); padding: 8px 16px; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink-2); transition: all .15s; }
.preset:hover { border-color: var(--ink-3); }
.preset.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.toggle-row { display: flex; gap: 24px; flex-wrap: wrap; }
.tog { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.tog input { accent-color: var(--brand-accent); width: 16px; height: 16px; }

/* ============================================================ Map header */
.map-panel { padding: var(--sp-4) var(--sp-4) 0; }
.map-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.map-header h3 {
  font-family: var(--font-display); font-size: 20px; font-weight: 700;
  margin: 0; display: flex; align-items: center; gap: 10px; letter-spacing: -.01em;
}
.map-header h3 i { color: var(--brand-accent); font-size: 18px; }
.map-hints {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
}
.map-hints span {
  font-size: 13px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500;
}
.map-hints span i { color: var(--ink-3); font-size: 11px; opacity: .7; }
@media (max-width: 680px) {
  .map-header { flex-direction: column; gap: 8px; }
  .map-hints { gap: 10px; }
  .map-hints span { font-size: 12px; }
}

/* ============================================================ Motion */
[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity .6s cubic-bezier(.22,.61,.36,1), transform .6s cubic-bezier(.22,.61,.36,1); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* map pin bounce-in */
@keyframes pinBounce {
  0% { transform: translate(-50%, -100%) scale(0); opacity: 0; }
  60% { transform: translate(-50%, -100%) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -100%) scale(1); }
}
.map-pin { animation: pinBounce .35s cubic-bezier(.22,.61,.36,1) both; }

/* stat row hover highlight */
.statrow { transition: background var(--transition-fast), padding-left var(--transition-fast); }
.statrow:hover { background: var(--paper-2); padding-left: 6px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .hero-mesh { display: none; }
  .map-pin { animation: none; }
}

/* ============================================================ Responsive hardening
   Goal: zero horizontal scroll and comfortable layout on real phones (320–430px).
   The overflow-x:clip guard is on html/body (top of file). Below we make every
   multi-column region collapse gracefully and let flex/grid children shrink. */

/* flex/grid children must be allowed to shrink below their content size, else long
   words / nowrap text push the layout wider than the screen */
.tile, .ess .item, .drill-item, .drill-row, .dr-name, .locard, .locard-body,
.commute-modes .m, .pc-item, .statrow, .m, .item { min-width: 0; }
.pc-item span, .dr-name, .locard-addr { overflow-wrap: anywhere; }

/* the ambient hero blobs are decorative — make sure they can never drive scroll */
.hero-mesh { max-width: 100%; }

@media (max-width: 560px) {
  /* commute: 3 fixed columns get cramped — let them reflow */
  .commute-modes { grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); }
  /* nearest-essentials / transit: single column reads better than squeezed cards */
  .ess { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .wrap { padding: 0 14px; }
  .hero { padding: 52px 0 32px; }
  .dash, .pageview { padding: 22px 0 64px; }
  /* shrink the score seal so the header row never overflows on narrow phones */
  .seal { gap: 12px; }
  .seal .ring { width: 104px; height: 104px; }
  .seal .num { font-size: 30px; }
  .seal .band { font-size: 16px; }
  .dash-head .addr h2 { font-size: 22px; }
  /* tap targets + inputs comfortable on small screens */
  .btn { padding: 10px 14px; }
  .searchbox .field { flex-wrap: wrap; }
  .searchbox .field .btn-primary { width: 100%; justify-content: center; }
}
