/* =============================================================================
   AreaWise — Settlement Decision Page prototype (Sprint 6.4 — final UI)
   Visual direction: Apple / Linear / Perplexity — calm, whitespace-led, no grids.
   ============================================================================= */

:root {
  /* ── Brand tokens (canonical — COLOUR_SYSTEM.md / landing.css) ── */
  --bg: #F6F7F4;
  --surface: #FFFFFF;
  --navy: #10233D;
  --ink: #0B1C30;
  --muted: #475467;
  --subtle: #667085;
  --green: #0D9F4B;
  --green-strong: #0B7A3C;
  --green-soft: #E8F5EE;
  --amber: #946200;
  --amber-soft: #FBF4E4;
  --star: #D97706;
  --line: #E5E9E6;
  --line-strong: #D3DAD5;
  --red: #BA1A1A;

  /* Legacy aliases — resolve existing rules to the canonical tokens above. */
  --text: var(--ink);
  --text-soft: var(--muted);
  --border: var(--line);
  --border-strong: var(--line-strong);
  --accent: var(--green);
  --accent-ink: #ffffff;
  --accent-hover: var(--green-strong);
  --positive: var(--green);
  --positive-bg: var(--green-soft);
  --explore: var(--green-strong);
  --amber-ink: var(--amber);
  --amber-bg: var(--amber-soft);
  --amber-border: var(--star);
  --consider-bg: var(--amber-soft);
  --consider-ink: var(--amber);
  --consider-border: #E8CF9A;

  /* Layout */
  --radius: 16px;
  --radius-sm: 9px;
  --maxw: 1200px;
  --content: 760px;
  --shadow-sm: 0 1px 2px rgba(16, 35, 61, 0.04);
  --shadow-md: 0 8px 24px rgba(16, 35, 61, 0.08);
  --ease: cubic-bezier(.22,.61,.36,1);

  /* Type — Inter body/UI + Fraunces headings (TYPOGRAPHY.md) */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
}

/* Self-hosted variable fonts (no CDN dependency — deterministic + private) */
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── skip link ─────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--text);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 50;
}
.skip-link:focus { left: 0; }

/* ── header ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 0 4%; height: 68px;
}
.brand { display: inline-flex; align-items: center; }
.brand img { height: 27px; width: auto; }
.site-nav { display: flex; gap: 35px; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.prototype-tag {
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: #92400e; background: #fef3c7; padding: .25rem .55rem; border-radius: 999px;
}

/* Unified header search (R4) — autocomplete replaces the plain .site-search form */
.header-search {
  position: relative; width: 290px; height: 38px;
  display: flex; align-items: center; gap: 7px; padding: 0 12px;
  background: #f7f8f9; border: 1px solid #e3e7ea; border-radius: 10px;
  flex: 0 1 290px;
}
.header-search:focus-within { background: #fff; border-color: #b8c7c0; box-shadow: 0 0 0 3px rgba(31,111,78,.08); }
.header-search-icon { color: var(--muted); font-size: 17px; line-height: 1; flex: 0 0 auto; }
.header-search input {
  width: 100%; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 13px; color: inherit;
}
.header-search input::placeholder { color: #8c969f; }
.header-search .suggestions {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-md); z-index: 120; display: none;
}
.header-search .suggestions.open { display: block; }
.suggestion {
  display: block; width: 100%; border: 0; border-bottom: 1px solid var(--line);
  background: #fff; text-align: left; padding: 10px 14px; cursor: pointer; font: inherit;
}
.suggestion:hover, .suggestion:focus-visible { background: var(--green-soft); outline: none; }
.suggestion strong, .suggestion small { display: block; }
.suggestion strong { color: var(--ink); font-size: .92rem; }
.suggestion small { color: var(--muted); font-size: .8rem; }
.suggestion-empty { padding: 12px 14px; color: var(--muted); font-size: .9rem; line-height: 1.45; background: #fff; }
@media (max-width: 800px) {
  .header-search { width: auto; flex: 1 1 auto; min-width: 0; }
}

/* ── layout ─────────────────────────────────────────────────────────────── */
main { display: block; }

.breadcrumb { margin: .5rem 0 0; color: var(--muted); font-size: .9rem; }

/* ── hero ───────────────────────────────────────────────────────────────── */
.hero { margin: 1.5rem 0 0; }

.hero h1 { margin: 0; font-family: var(--font-display); color: var(--navy); font-size: clamp(2.4rem, 6vw, 3.4rem); font-weight: 650; letter-spacing: -.02em; line-height: 1.08; }

.place-county { margin: .4rem 0 0; font-family: var(--font); font-size: 1rem; font-weight: 500; color: var(--muted); letter-spacing: .01em; }

.tier-badge {
  display: inline-block; margin: .9rem 0 .6rem;
  font-size: .82rem; font-weight: 600; color: #166534; background: var(--positive-bg);
  padding: .3rem .7rem; border-radius: 999px; letter-spacing: .01em;
}

.hero-headline {
  margin: 0 0 1.6rem; font-size: clamp(1.2rem, 2.4vw, 1.4rem);
  font-weight: 600; line-height: 1.4; letter-spacing: -.01em; color: var(--text-soft);
  max-width: 60ch;
}

.hero-group { margin-bottom: 1.4rem; }
.group-label {
  margin: 0 0 .6rem; font-size: .78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted);
}

/* semantic pills (best suited for + things to consider) */
.tag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.tag {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: .42rem .85rem; font-size: .95rem; color: var(--text);
}
.tag--consider { background: var(--consider-bg); border-color: var(--consider-border); color: var(--consider-ink); }

.cta-primary {
  appearance: none; border: 0; cursor: pointer;
  background: var(--green-strong); color: var(--accent-ink);
  font: inherit; font-size: 1.05rem; font-weight: 600;
  padding: .85rem 1.75rem; border-radius: var(--radius-sm);
  transition: background .18s var(--ease), transform .18s var(--ease);
  text-decoration: none; display: inline-flex; align-items: center; gap: .5rem;
}
.cta-primary:hover { background: var(--accent-hover); }
.cta-primary:focus-visible { outline: 3px solid rgba(13,159,75,.45); outline-offset: 2px; }
.cta-primary[aria-pressed="true"] { background: var(--green-strong); }

/* CTAs while the area destination is still resolving — clear disabled state. */
.cta-primary[aria-disabled="true"],
.nextstep-card[aria-disabled="true"] { opacity: .55; pointer-events: none; cursor: not-allowed; }

/* ── sections ───────────────────────────────────────────────────────────── */
.section h2 { font-family: var(--font-display); color: var(--navy); font-size: 1.35rem; font-weight: 640; letter-spacing: -.01em; margin: 0 0 1.25rem; }

/* ── full-bleed alternating section bands ────────────────────────────────── */
.band {
  background: var(--band-bg, transparent);
  padding: 0 2rem 3rem;
}
.band-inner { max-width: var(--content); margin: 0 auto; }
.band--white { --band-bg: #FFFFFF; }
.band--grey { --band-bg: #F6F7F4; }
.band--similar { --band-bg: #F6F7F4; }
.band--nextstep { --band-bg: #FFFFFF; }
main:has(#transport-section:not([hidden])) .band--similar { --band-bg: #FFFFFF; }
main:has(#transport-section:not([hidden])) .band--nextstep { --band-bg: #F6F7F4; }

.error-banner { max-width: var(--content); margin: 0 auto 1rem; padding: 0 1.25rem; }

/* ── section 2 · reasons ────────────────────────────────────────────────── */
.reason-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.reason-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem 1.4rem; box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.reason-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.reason-card h3 { margin: 0 0 .4rem; font-family: var(--font-display); color: var(--navy); font-size: 1.02rem; font-weight: 640; }
.reason-card h3::before { content: "✓ "; color: var(--positive); font-weight: 700; }
.reason-card p { margin: 0 0 .5rem; color: var(--text-soft); font-size: .95rem; }
.reason-card .evidence { margin: .5rem 0 0; padding-top: .6rem; border-top: 1px solid var(--border); font-size: .82rem; color: var(--muted); }
.reason-card .evidence::before { content: "Evidence · "; font-weight: 600; }

/* ── section 3 · snapshot (5 cards) ─────────────────────────────────────── */
.snapshot-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.snap-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: .6rem;
}
.snap-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.snap-summary { font-size: 1rem; font-weight: 600; }
.snap-summary--solo { color: var(--text); font-weight: 600; }

.dots { display: inline-flex; gap: .3rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.dot.filled { background: var(--positive); }

/* ── section 4 · accordion ──────────────────────────────────────────────── */
.accordion { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.accordion-item + .accordion-item { border-top: 1px solid var(--border); }
.accordion-item h3 { margin: 0; }
.accordion-btn {
  appearance: none; border: 0; background: none; cursor: pointer;
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  font: inherit; font-size: 1.02rem; font-weight: 600; text-align: left;
  padding: 1.1rem 1.4rem; color: var(--text);
}
.accordion-btn:hover { background: #fafafa; }
.accordion-btn:focus-visible { outline: 3px solid rgba(13,159,75,.45); outline-offset: -3px; }
.acc-icon { color: var(--muted); font-size: 1.3rem; line-height: 1; transition: transform .18s var(--ease); }
.accordion-btn[aria-expanded="true"] .acc-icon { transform: rotate(45deg); }

.accordion-panel { padding: 0 1.4rem 1.25rem; }
.accordion-panel[hidden] { display: none; }
.detail-summary { margin: 0 0 .9rem; color: var(--text-soft); font-size: .95rem; }
.detail-summary--placeholder { color: var(--muted); font-style: italic; }
.detail-list { list-style: none; margin: 0 0 .9rem; padding: 0; display: grid; gap: .4rem; }
.detail-list li { padding-left: 1.2rem; position: relative; color: var(--text-soft); font-size: .95rem; }
.detail-list li::before { content: "—"; position: absolute; left: 0; color: var(--muted); }
.accordion-panel .evidence { margin: 0; font-size: .82rem; color: var(--muted); }
.accordion-panel .evidence::before { content: "Evidence · "; font-weight: 600; }

/* ── section 5 · similar places ─────────────────────────────────────────── */
.similar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.similar-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem 1.4rem; box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.similar-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.similar-card h3 { margin: 0 0 .8rem; font-size: 1.05rem; font-weight: 650; }
.similar-card dl { margin: 0; display: grid; gap: .55rem; }
.similar-card dt { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .1rem; }
.similar-card dd { margin: 0; font-size: .92rem; color: var(--text-soft); }

/* ── section 6 · compare entry ──────────────────────────────────────────── */
.compare-entry {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.4rem; color: var(--text); text-decoration: none; font-weight: 600;
  box-shadow: var(--shadow-sm); transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.compare-entry:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.compare-entry span { color: var(--accent); }

/* ── section 7 · next step ──────────────────────────────────────────────── */
.nextstep-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.nextstep-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.15rem 1.3rem; color: var(--text); text-decoration: none; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow-sm); transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.nextstep-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.nextstep-card span { color: var(--muted); }
.nextstep-card--primary { background: var(--green-strong); border-color: var(--green-strong); color: var(--accent-ink); }
.nextstep-card--primary span { color: var(--accent-ink); }

/* ── footer ─────────────────────────────────────────────────────────────── */
.site-footer { background: var(--navy); color: #c6d0dc; padding: 40px 0; margin-top: 4rem; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 2rem; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.footer-inner img { height: 27px; width: auto; opacity: 0.95; }
.footer-meta { margin: 0; font-size: 0.8125rem; color: #8ea0b5; }
.footer-version { font-size: 0.7rem; color: #8ea0b5; text-align: right; padding: 2px 20px 12px; }

.footer-social { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; color: #c6d0dc; border-radius: 8px; }
.footer-social:hover { color: #ffffff; background: rgba(255,255,255,0.08); }
.footer-social svg { display: block; }

/* ── Sprint 10 additions ───────────────────────────────────────────────── */
[hidden] { display: none !important; }

.confidence { margin: 1rem 0 1.4rem; color: var(--muted); font-size: .92rem; }

/* header search (removes the landing dead-end) */
.site-search { margin-left: auto; }
.site-search input[type="search"] {
  font: inherit; font-size: .92rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: .5rem .9rem; width: 15rem; max-width: 100%;
}
.site-search input[type="search"]:focus-visible { outline: 3px solid rgba(13,159,75,.45); outline-offset: 1px; }

/* clickable school links in the detail accordion */
.detail-list li a.school-link { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.detail-list li a.school-link:hover { color: var(--accent); text-decoration: underline; }
.detail-list li a.school-link::after { content: " \2197"; color: var(--muted); font-size: .8rem; }

@media (max-width: 440px) {
  .site-search { width: 100%; }
  .site-search input[type="search"] { width: 100%; }
}

/* ── focus visible ──────────────────────────────────────────────────────── */
a:focus-visible, button:focus-visible { outline: 3px solid rgba(13,159,75,.45); outline-offset: 2px; }

/* ── reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .reason-grid, .similar-grid, .nextstep-grid { grid-template-columns: 1fr; }
  .snapshot-grid { grid-template-columns: repeat(2, 1fr); }
  .header-inner { padding: .7rem 1.25rem; }
  .band { padding: 0 1.25rem 3rem; }
  .site-nav { gap: 1rem; }
}

@media (max-width: 440px) {
  .snapshot-grid { grid-template-columns: 1fr; }
  .site-nav { display: none; }
  .hero h1 { font-size: 2.2rem; }
}

/* ── Area Summary (Product Build Sprint 1) ──────────────────────────────── */
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .25rem; }

.cta-secondary {
  appearance: none; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); cursor: pointer; font: inherit; font-size: 1.05rem; font-weight: 600;
  padding: .85rem 1.75rem; border-radius: var(--radius-sm);
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.cta-secondary:hover { background: #fafafa; border-color: var(--muted); }
.cta-secondary[aria-pressed="true"] { color: var(--positive); border-color: var(--positive); }

.crumb-sep { margin: 0 .4rem; color: var(--muted); }
.crumb-current { color: var(--text-soft); font-weight: 500; }

/* module grid — 6 live cards */
.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

.module-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem 1.4rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: .55rem;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.module-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.module-head { display: flex; align-items: center; gap: .6rem; }
.module-icon { display: inline-flex; color: var(--positive); flex: 0 0 auto; }
.module-name { font-size: 1.02rem; font-weight: 650; letter-spacing: -.01em; }
.module-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .7rem; font-weight: 600; padding: .22rem .55rem; border-radius: 999px;
  margin-left: auto; letter-spacing: .03em; text-transform: uppercase;
}
.module-badge svg { flex: 0 0 auto; }
.module-badge--official { color: #087a3c; background: var(--positive-bg); border: 1px solid var(--positive); }
.module-badge--preview { color: var(--amber-ink); background: var(--amber-bg); border: 1px solid var(--amber-border); }
.module-badge--coming_soon { color: var(--muted); background: #f4f4f5; border: 1px solid var(--border); }

.module-stat {
  margin: 0; font-size: 1.05rem; font-weight: 650; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.module-insight { margin: 0; color: var(--muted); font-size: .92rem; }
.module-explore {
  margin-top: auto;
  display: inline-flex; align-items: center; gap: .45rem;
  min-height: 44px; padding: 0 1.1rem;
  color: var(--green-strong); background: var(--surface);
  border: 1px solid var(--green); border-radius: 10px;
  font-weight: 650; font-size: .95rem; line-height: 1;
  white-space: nowrap; text-decoration: none;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.module-explore:hover { background: var(--green-soft); border-color: var(--green-strong); text-decoration: none; }
.module-explore:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.module-explore-arrow { color: inherit; transition: transform .15s var(--ease); }
.module-explore:hover .module-explore-arrow { transform: translateX(3px); }

.module-ai {
  margin: .4rem 0 0; padding: .5rem .7rem; border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); color: var(--muted); font-size: .82rem;
}

/* Trust footer — Data Trust & Confidence Layer */
.module-source { margin: .3rem 0 0; font-size: .76rem; color: var(--muted); }
.module-coverage { margin: .12rem 0 0; font-size: .76rem; color: var(--muted); }
.module-limitations { margin: .3rem 0 0; font-size: .78rem; color: var(--amber-ink); }

/* coming soon — dimmed ~55% */
.module-card--coming_soon { opacity: .55; }
.module-card--coming_soon:hover { transform: none; box-shadow: var(--shadow-sm); }

/* Progressive loading (UX-001) */
.module-loading-note { margin: 0; color: var(--muted); font-size: .95rem; }
.module-card--loading { opacity: .72; }
.module-card--loading:hover { transform: none; box-shadow: var(--shadow-sm); }
.module-stat--loading { color: var(--muted); animation: aw-pulse 1.4s ease-in-out infinite; }
@keyframes aw-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

/* Loading ellipsis (R2) — lightweight CSS three-dot indicator */
.loading-dots { display: inline-block; }
.loading-dots::after {
  content: '...';
  display: inline-block; width: 0; overflow: hidden; vertical-align: bottom;
  animation: aw-dots 1.4s steps(4, end) infinite;
}
@keyframes aw-dots { to { width: 1.5ch; } }
@media (prefers-reduced-motion: reduce) {
  .loading-dots::after { animation: none; width: 1.5ch; }
}

/* ── Loading states — reassuring, green, no mascot ─────────────────────────── */
.hero-loading {
  display: flex; flex-direction: column; align-items: flex-start; gap: .4rem;
  margin: 1.25rem 0 0;
}
.aw-spinner {
  width: 26px; height: 26px;
  border: 3px solid var(--green-soft);
  border-top-color: var(--green);
  border-radius: 50%;
  margin-bottom: .4rem;
  animation: aw-spin .8s linear infinite;
}
@keyframes aw-spin { to { transform: rotate(360deg); } }
.hero-loading-title {
  margin: 0; font-size: 1.2rem; font-weight: 600;
  color: var(--ink); letter-spacing: -.01em; line-height: 1.3;
}
.hero-loading-support { margin: 0; font-size: .98rem; color: var(--muted); max-width: 52ch; }

.dot-loader {
  display: inline-flex; align-items: center; gap: 4px;
  margin-right: .55rem; vertical-align: middle;
}
.dot-loader span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  animation: aw-dot-bounce 1.2s ease-in-out infinite;
}
.dot-loader span:nth-child(2) { animation-delay: .15s; }
.dot-loader span:nth-child(3) { animation-delay: .3s; }
@keyframes aw-dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .35; }
  30% { transform: translateY(-4px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .aw-spinner { animation: none; }
  .dot-loader span { animation: none; opacity: .75; transform: none; }
}

.coming-soon { margin-top: 1.5rem; }
.coming-soon-label {
  margin: 0 0 .8rem; font-size: .78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted);
}
.coming-soon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

@media (max-width: 820px) {
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .coming-soon-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 440px) {
  .module-grid { grid-template-columns: 1fr; }
  .coming-soon-grid { grid-template-columns: 1fr; }
}


/* ── Recommendation (ALS-002) ─────────────────────────────────────────────── */
.stars { display: inline-block; font-size: .92rem; letter-spacing: 2px; line-height: 1; margin: 0 0 .35rem; }
.stars .star { color: #cdd3d8; }
.stars .star--on { color: var(--star); }
.rec-confidence { margin: 0 0 4px; color: var(--muted); font-size: .9375rem; }
.rec-label { margin: 1.25rem 0 .6rem; font-size: 1.0625rem; font-weight: 600; color: var(--ink); }
.reason-card--consider h3::before { content: "\25B3 "; color: var(--amber); }
.reason-card--consider { border-left: 3px solid var(--amber-border); }
.reason-card--neutral h3::before { content: "\2022 "; color: var(--muted); }
.reason-card .who-benefits { margin: .5rem 0 0; font-size: .85rem; color: var(--green-strong); font-weight: 500; }
.reason-card .who-benefits::before { content: "Best suited to: "; font-weight: 400; color: var(--muted); }

/* ── Transport (ALS-003.1 — Enhanced Transport Experience) ──────────────── */
.why-list { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .3rem; }
.why-list li { padding-left: 1.1rem; position: relative; color: var(--text-soft); font-size: .92rem; }
.why-list li::before { content: "\2022"; position: absolute; left: 0; color: var(--green-strong); }

.transport-summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
}
.transport-mode {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.2rem;
  display: flex; flex-direction: column; gap: .5rem; box-shadow: var(--shadow-sm);
}
.tm-icon { font-size: 1.5rem; line-height: 1; }
.tm-body { display: flex; flex-direction: column; gap: .15rem; }
.tm-label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tm-value { font-size: 1rem; font-weight: 650; color: var(--text); }

.transport-subhead { margin: 1.6rem 0 .8rem; font-size: 1.02rem; font-weight: 600; color: var(--navy); }
.route-list { display: flex; flex-direction: column; gap: .6rem; }
.route-chip {
  appearance: none; border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius-sm); padding: .8rem 1rem; cursor: pointer;
  display: flex; align-items: center; gap: .8rem; text-align: left;
  font: inherit; color: var(--text); min-height: 44px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.route-chip:hover { border-color: var(--green); box-shadow: var(--shadow-sm); }
.route-chip:focus-visible { outline: 3px solid rgba(13,159,75,.45); outline-offset: 2px; }
.route-chip-num { font-weight: 700; font-size: 1.05rem; color: var(--green-strong); min-width: 2.4rem; font-variant-numeric: tabular-nums; }
.route-chip-sub { flex: 1; color: var(--text-soft); }
.route-chip-op { color: var(--muted); font-size: .85rem; }
.route-more {
  appearance: none; border: 1px dashed var(--border-strong); background: none;
  border-radius: var(--radius-sm); padding: .7rem 1rem; cursor: pointer;
  font: inherit; color: var(--green-strong); font-weight: 600; min-height: 44px;
}
.route-more:hover { background: var(--green-soft); }
.route-more:focus-visible { outline: 3px solid rgba(13,159,75,.45); outline-offset: 2px; }

.stop-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
.stop-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow-sm);
}
.stop-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .35rem; }
.stop-icon { font-size: 1.1rem; }
.stop-name { font-weight: 650; color: var(--text); }
.stop-card p { margin: .2rem 0 0; font-size: .9rem; color: var(--text-soft); }
.stop-dist { color: var(--muted); font-size: .82rem; }
.stop-routes { font-weight: 500; color: var(--text); }
.stop-operator { color: var(--muted); }
.stop-dest { color: var(--green-strong); }

.route-popup {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(16, 35, 61, 0.4);
  display: flex; align-items: center; justify-content: center; padding: 1.25rem;
}
.route-popup[hidden] { display: none; }
.route-popup-inner {
  background: var(--surface); border-radius: var(--radius);
  max-width: 26rem; width: 100%; padding: 1.5rem;
  box-shadow: var(--shadow-md); max-height: 80vh; overflow-y: auto;
}
.route-popup-title { margin: 0 0 .6rem; font-family: var(--font-display); color: var(--navy); font-size: 1.2rem; }
.route-popup-op { margin: 0 0 .8rem; color: var(--text-soft); }
.route-popup-label { margin: .8rem 0 .4rem; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.route-popup-dests { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.route-popup-dests li { padding-left: 1rem; position: relative; color: var(--text-soft); }
.route-popup-dests li::before { content: "\2022"; position: absolute; left: 0; color: var(--green-strong); }
.route-popup-serves { margin: 1rem 0; font-weight: 600; color: var(--text); }
.route-popup-close {
  appearance: none; border: 0; cursor: pointer;
  background: var(--green-strong); color: #fff;
  font: inherit; font-weight: 600; padding: .7rem 1.2rem; border-radius: var(--radius-sm);
  min-height: 44px;
}

@media (max-width: 820px) {
  .transport-summary { grid-template-columns: repeat(2, 1fr); }
  .stop-list { grid-template-columns: 1fr; }
}
@media (max-width: 440px) {
  .transport-summary { grid-template-columns: 1fr; }
  .route-list { flex-direction: row; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: .5rem; padding-bottom: .4rem; }
  .route-chip { flex: 0 0 auto; min-width: 3.4rem; justify-content: center; padding: .7rem .9rem; }
  .route-chip-sub, .route-chip-op { display: none; }
  .route-more { flex: 0 0 auto; }
}

/* ── Recommendation-section loading state (v0.9.7) ──────────────────────── */
.rec-loading { margin: 0 0 .4rem; }
.rec-loading-primary { margin: 0; font-size: 1.0625rem; font-weight: 500; color: var(--text-soft); }
.rec-loading-support { margin: .3rem 0 0; font-size: .92rem; color: var(--muted); }
.rec-unavailable { margin: 0 0 .5rem; font-size: 1.0625rem; color: var(--text-soft); }

/* ── ALS-003.2 · Human-first recommendation language ─────────────────────── */
.rec-verdict {
  margin: 0 0 .5rem; font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 600; color: var(--ink);
}
.rec-why {
  margin: 0 0 .4rem; font-size: 1.0625rem; line-height: 1.6; color: var(--text-soft);
}
.suited-why { list-style: none; margin: .7rem 0 0; padding: 0; font-size: .92rem; color: var(--muted); }
.suited-why li { margin: .3rem 0; }
.suited-why strong { color: var(--ink); font-weight: 600; }

.evidence-chain { margin: .7rem 0 0; font-size: .84rem; color: var(--muted); }
.evidence-chain summary {
  cursor: pointer; font-weight: 600; color: var(--green-strong);
  min-height: 44px; display: inline-flex; align-items: center; -webkit-tap-highlight-color: transparent;
}
.evidence-chain summary:focus-visible { outline: 2px solid var(--green-strong); outline-offset: 2px; border-radius: 4px; }
.evidence-chain-path { margin: .4rem 0 0; color: var(--muted); line-height: 1.5; }

.trust-indicators {
  margin: 1.5rem 0 0; padding: .8rem 1rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.trust-indicators summary {
  cursor: pointer; font-weight: 600; color: var(--muted); font-size: .9375rem;
  min-height: 44px; display: flex; align-items: center; -webkit-tap-highlight-color: transparent;
}
.trust-indicators summary:focus-visible { outline: 2px solid var(--green-strong); outline-offset: 2px; border-radius: 4px; }
.trust-list { list-style: none; margin: .7rem 0 0; padding: 0; font-size: .875rem; color: var(--muted); }
.trust-list li { margin: .3rem 0; }

/* ── ALS-003.3 · Loading, empty states & resilience ─────────────────────── */
.skeleton-lines { margin: .6rem 0 0; display: grid; gap: .4rem; }
.skeleton-bar {
  display: block; height: 12px; border-radius: 4px;
  background: linear-gradient(90deg, #eceef1 25%, #f6f8fa 50%, #eceef1 75%);
  background-size: 200% 100%;
  animation: aw-skeleton 1.4s ease-in-out infinite;
  width: 80%;
}
.skeleton-bar--long { width: 100%; }
.skeleton-bar--short { width: 55%; }
@keyframes aw-skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.module-card--loading { min-height: 200px; }

.built-using { margin: 0 0 .6rem; font-size: .9375rem; color: var(--muted); line-height: 1.55; }

.error-retry {
  appearance: none; border: 0; cursor: pointer;
  background: var(--green-strong); color: #fff;
  font: inherit; font-weight: 600; padding: .6rem 1.1rem; border-radius: var(--radius-sm);
  margin-left: .8rem; min-height: 44px;
}
.error-retry:focus-visible { outline: 2px solid var(--green-strong); outline-offset: 2px; }

.dev-diagnostics {
  margin: 2rem 0 0; padding: .8rem 1rem;
  border: 1px dashed var(--border-strong); border-radius: var(--radius); background: #fffbe6;
}
.dev-diagnostics summary {
  cursor: pointer; font-weight: 600; color: var(--muted); font-size: .875rem;
  min-height: 44px; display: flex; align-items: center; -webkit-tap-highlight-color: transparent;
}
.dev-diagnostics summary:focus-visible { outline: 2px solid var(--green-strong); outline-offset: 2px; border-radius: 4px; }
.dev-list { list-style: none; margin: .6rem 0 0; padding: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; color: var(--muted); }
.dev-list li { margin: .25rem 0; }
@media(max-width:800px){.brand-logo{height:28px;width:auto}}
