/* YYC Near Me: a restrained, accessible Calgary civic utility */
:root {
  --paper: #f7f5f0;
  --paper-deep: #efede7;
  --surface: #ffffff;
  --ink: #1b1b19;
  --ink-soft: #343632;
  --muted: #60635e;
  --faint: #858780;
  --line: #d8d3ca;
  --line-strong: #aaa79f;
  --civic: #1f4e79;
  --civic-dark: #123a5d;
  --civic-soft: #eaf1f6;
  --road: #a95519;
  --road-soft: #f7ebe1;
  --traffic: #a53a32;
  --traffic-soft: #f7e9e7;
  --development: #287262;
  --development-soft: #e8f2ef;
  --notice: #67538e;
  --notice-soft: #efebf5;
  --success: #296448;
  --success-soft: #e7f1eb;
  --warning: #775016;
  --warning-soft: #f8f0dd;
  --danger: #982b29;
  --danger-soft: #f8e9e8;
  --focus: #0878a5;
  --topbar-height: 60px;
  --mobile-nav-height: 64px;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 9999;
  padding: 10px 14px;
  border: 1px solid var(--surface);
  border-radius: 3px;
  background: var(--civic-dark);
  color: white;
  text-decoration: none;
  font-weight: 700;
}
.skip-link:focus { top: 12px; }

.offline-banner {
  position: relative;
  z-index: 1100;
  padding: 9px 16px;
  border-bottom: 1px solid #d6bb7c;
  background: var(--warning-soft);
  color: var(--warning);
  text-align: center;
  font-size: .82rem;
  font-weight: 650;
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 24px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 245, 240, .98);
}

.brand {
  justify-self: start;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  color: var(--ink);
  text-decoration: none;
}
.brand::before { content: ""; width: 4px; height: 22px; background: var(--civic); }
.brand-mark { display: none; }
.brand strong { display: inline; font-size: .98rem; font-weight: 780; letter-spacing: -.02em; line-height: 1.2; }
.brand small {
  display: inline;
  margin-left: 10px;
  padding-left: 11px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: .7rem;
  letter-spacing: .035em;
}

.desktop-nav { display: flex; align-items: stretch; gap: 24px; }
.nav-link {
  position: relative;
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 680;
  cursor: pointer;
}
.nav-link::after { content: ""; position: absolute; inset: auto 0 -1px; height: 2px; background: transparent; }
.nav-link:hover { color: var(--ink); }
.nav-link.is-active { color: var(--civic-dark); }
.nav-link.is-active::after { background: var(--civic); }

.header-actions { justify-self: end; align-self: center; display: flex; align-items: center; gap: 10px; }
.unofficial-label {
  color: var(--muted);
  font-size: .65rem;
  font-weight: 760;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* Shared controls */
.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  text-decoration: none;
  font-size: .86rem;
  font-weight: 720;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.button:disabled { opacity: .48; cursor: not-allowed; }
.button-primary { border-color: var(--civic); background: var(--civic); color: white; }
.button-primary:hover { border-color: var(--civic-dark); background: var(--civic-dark); }
.button-secondary { border-color: var(--line-strong); background: transparent; color: var(--ink); }
.button-secondary:hover { border-color: var(--civic); color: var(--civic-dark); }
.button-quiet { border-color: var(--line); color: var(--civic-dark); }
.button-quiet:hover { background: var(--civic-soft); }
.button-danger { margin-top: 8px; border-color: #d8aaa6; color: var(--danger); }
.button-danger:hover { background: var(--danger-soft); }
.button-small { min-height: 40px; padding: 0 12px; font-size: .76rem; }

.eyebrow {
  margin: 0 0 9px;
  color: var(--civic);
  font-size: .68rem;
  font-weight: 780;
  letter-spacing: .13em;
  text-transform: uppercase;
}

/* Onboarding */
.onboarding {
  min-height: calc(100svh - var(--topbar-height));
  display: grid;
  align-content: start;
  padding: clamp(76px, 10vh, 110px) 32px 28px;
}
.onboarding-shell {
  width: min(1160px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
  align-items: center;
  gap: clamp(64px, 9vw, 132px);
}
.hero-copy { max-width: 690px; }
.hero-copy h1 {
  max-width: 680px;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(3.1rem, 5.6vw, 4.8rem);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.hero-lede {
  max-width: 620px;
  margin: 25px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
  line-height: 1.58;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 31px; }
.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 34px 0 0;
  padding: 17px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  color: var(--muted);
  font-size: .78rem;
}
.trust-list li { display: flex; align-items: center; gap: 8px; }
.trust-icon { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--development); }

.onboarding-guide { padding: 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.guide-kicker {
  margin: 0;
  padding: 15px 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .66rem;
  font-weight: 780;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.onboarding-guide ol { margin: 0; padding: 0; list-style: none; }
.onboarding-guide li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 13px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.onboarding-guide li > span { padding-top: 2px; color: var(--civic); font-size: .68rem; font-weight: 780; letter-spacing: .08em; }
.onboarding-guide strong { display: block; color: var(--ink); font-size: .9rem; }
.onboarding-guide li p { margin: 5px 0 0; color: var(--muted); font-size: .77rem; line-height: 1.48; }
.guide-source { display: grid; gap: 4px; margin: 0; padding: 16px 0 18px; }
.guide-source strong { font-size: .75rem; }
.guide-source span { color: var(--muted); font-size: .72rem; line-height: 1.4; }
.onboarding-footnote { width: min(1160px, 100%); margin: 52px auto 0; color: var(--faint); font-size: .7rem; line-height: 1.45; }

/* Nearby workspace */
.workspace {
  height: calc(100dvh - var(--topbar-height));
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(500px, 46%) minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.feed-panel {
  position: relative;
  z-index: 3;
  overflow-y: auto;
  padding: 0 30px 52px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  scrollbar-gutter: stable;
}
.feed-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 27px 0 15px;
}
.feed-header h1 { margin: 0; color: var(--ink); font-size: 1.75rem; line-height: 1.15; letter-spacing: -.035em; }
.place-context { margin: 7px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.4; }
.place-change-button { align-self: center; flex: 0 0 auto; padding: 0 2px; }
.place-change-button svg { width: 15px; height: 15px; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface); cursor: pointer; }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.refresh-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: .7rem;
}
.refresh-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.text-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--civic);
  text-decoration: none;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
}
.text-button:hover { border-bottom-color: currentColor; }
.text-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.text-button.is-spinning svg { animation: rotate 900ms linear infinite; }

.source-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 17px;
  padding: 12px 14px;
  border-left: 3px solid #a46b16;
  background: var(--warning-soft);
  color: var(--warning);
}
.source-warning strong { font-size: .78rem; }
.source-warning p { margin: 4px 0 0; font-size: .72rem; line-height: 1.45; }

.summary-block {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 14px;
  align-items: center;
  margin: 0;
  padding: 22px 0 20px;
  border-bottom: 1px solid var(--line);
}
.summary-number { min-width: 40px; margin: 0; color: var(--civic-dark); font-size: 2rem; font-weight: 740; line-height: 1; letter-spacing: -.045em; }
.summary-block h2 { margin: 0; color: var(--ink-soft); font-size: .84rem; font-weight: 650; line-height: 1.3; }
.summary-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 18px; padding-top: 12px; }
.summary-chip { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .69rem; font-weight: 620; }
.summary-chip i { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }

.filter-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 23px;
  padding: 12px 0 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
  min-height: 42px;
  margin-bottom: -1px;
  padding: 0 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 690;
  white-space: nowrap;
  cursor: pointer;
}
.filter-chip:hover { color: var(--ink); }
.filter-chip.is-active { border-bottom-color: var(--civic); color: var(--civic-dark); }

.feed-list { display: grid; }
.update-card {
  position: relative;
  padding: 20px 2px 19px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  transition: background 120ms ease;
}
.update-card::before { content: ""; position: absolute; left: -30px; top: 20px; width: 3px; height: 26px; background: var(--category-color, var(--civic)); }
.update-card:hover { background: #fbfaf7; }
.update-card.is-selected { background: var(--civic-soft); }
.card-topline { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.mini-badge {
  width: max-content;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0;
  color: var(--category-ink, var(--civic));
  font-size: .64rem;
  font-weight: 790;
  letter-spacing: .075em;
  line-height: 1;
  text-transform: uppercase;
}
.mini-badge::before { content: ""; width: 7px; height: 7px; margin-right: 7px; background: var(--category-color, var(--civic)); }
.card-distance { color: var(--faint); font-size: .69rem; font-weight: 620; white-space: nowrap; }
.update-card h3 { margin: 10px 0 0; color: var(--ink); font-size: 1.02rem; line-height: 1.36; letter-spacing: -.012em; }
.card-description { display: -webkit-box; margin: 7px 0 0; overflow: hidden; color: var(--muted); font-size: .78rem; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.card-details { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 0; margin-top: 11px; color: var(--faint); font-size: .67rem; }
.card-details span { display: inline-flex; align-items: center; }
.card-details span + span::before { content: "·"; margin: 0 8px; color: var(--line-strong); }
.card-actions { display: flex; align-items: center; gap: 20px; margin-top: 10px; }
.card-actions button, .card-actions a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--civic);
  text-decoration: none;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
}
.card-actions button:hover, .card-actions a:hover { border-bottom-color: currentColor; }
.card-actions a::after { content: "↗"; margin-left: 5px; font-size: .75rem; }

.category-construction { --category-color: var(--road); --category-soft: var(--road-soft); --category-ink: var(--road); }
.category-traffic { --category-color: var(--traffic); --category-soft: var(--traffic-soft); --category-ink: var(--traffic); }
.category-development { --category-color: var(--development); --category-soft: var(--development-soft); --category-ink: var(--development); }
.category-landuse { --category-color: var(--civic); --category-soft: var(--civic-soft); --category-ink: var(--civic); }
.category-notice { --category-color: var(--notice); --category-soft: var(--notice-soft); --category-ink: var(--notice); }

.loading-list > p { margin: 16px 0 12px; color: var(--muted); font-size: .77rem; }
.skeleton-card { height: 160px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, transparent 0%, var(--paper) 48%, transparent 100%); background-size: 230% 100%; animation: shimmer 1.35s infinite linear; }
.empty-state { margin: 22px 0; padding: 34px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; }
.empty-icon { display: none; }
.empty-state h2 { margin: 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.empty-state p { max-width: 390px; margin: 8px 0 16px; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.results-limit { margin: 18px 0 0; padding: 14px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .74rem; line-height: 1.5; }

/* Map */
.map-panel { position: relative; min-width: 0; background: #e2e7e3; }
#map { width: 100%; height: 100%; min-height: 560px; z-index: 1; }
.map-fallback { position: absolute; inset: 50% auto auto 50%; z-index: 2; transform: translate(-50%, -50%); padding: 22px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); text-align: center; }
.map-fallback p { margin: 7px 0 0; color: var(--muted); font-size: .78rem; }
.map-legend {
  position: absolute;
  z-index: 500;
  top: 14px;
  right: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 12px;
  max-width: 430px;
  padding: 9px 10px;
  border: 1px solid rgba(170, 167, 159, .82);
  border-radius: 3px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 2px 6px rgba(27, 27, 25, .08);
}
.map-legend span { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: .65rem; font-weight: 680; }
.legend-dot { width: 18px; height: 18px; display: grid; place-items: center; background: var(--category-color); color: white; font-style: normal; font-size: .56rem; font-weight: 800; }
.map-disclaimer { position: absolute; z-index: 500; left: 14px; bottom: 14px; max-width: 410px; margin: 0; padding: 8px 10px; border: 1px solid rgba(170, 167, 159, .82); border-radius: 3px; background: rgba(255, 255, 255, .96); color: var(--muted); font-size: .65rem; line-height: 1.4; }

.civic-marker { position: relative; border: 0 !important; background: transparent !important; }
.civic-marker span { position: relative; z-index: 2; width: 30px; height: 30px; display: grid; place-items: center; border: 2px solid white; border-radius: 50%; background: var(--category-color, var(--civic)); color: white; box-shadow: 0 2px 7px rgba(27, 27, 25, .3); font-size: .66rem; font-weight: 800; }
.civic-marker::after { content: ""; position: absolute; z-index: 1; left: 11px; top: 25px; width: 8px; height: 8px; transform: rotate(45deg); background: var(--category-color, var(--civic)); }
.leaflet-popup-content-wrapper { border-radius: 4px; box-shadow: 0 8px 24px rgba(27, 27, 25, .18); }
.leaflet-popup-content { margin: 15px 16px 16px; }
.map-popup h3 { margin: 9px 0 0; color: var(--ink); font: 720 .92rem/1.38 var(--font-ui); }
.map-popup p { margin: 7px 0 0; color: var(--muted); font: .74rem/1.45 var(--font-ui); }
.map-popup .map-popup-meta { color: var(--faint); font-size: .67rem; }
.map-popup-link { display: inline-flex; margin-top: 11px; color: var(--civic); font-size: .72rem; font-weight: 720; text-underline-offset: 3px; }
.leaflet-control-attribution { color: #363b39 !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--civic-dark) !important; }

/* Places and About */
.page-view { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 56px 0 86px; }
.page-header { display: flex; align-items: end; justify-content: space-between; gap: 32px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.page-header.compact { align-items: start; }
.page-header h1 { margin: 0; color: var(--ink); font-family: var(--font-display); font-size: clamp(2.35rem, 4vw, 3.45rem); font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.page-header p:not(.eyebrow) { max-width: 650px; margin: 14px 0 0; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.watchlist-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); margin-top: 30px; }
.watch-card { position: relative; min-width: 0; padding: 21px 22px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; }
.watch-card:first-child { border-left: 1px solid var(--line); }
.watch-card.is-active { box-shadow: inset 0 3px 0 var(--civic); background: var(--surface); }
.watch-card .active-tag { position: absolute; top: 20px; right: 20px; color: var(--civic); font-size: .62rem; font-weight: 790; letter-spacing: .08em; text-transform: uppercase; }
.watch-card h2 { margin: 0; padding-right: 60px; color: var(--ink); font-size: 1.05rem; }
.watch-card .watch-area { margin: 7px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.4; }
.watch-meta { display: flex; flex-wrap: wrap; gap: 5px 0; margin: 17px 0; color: var(--faint); font-size: .67rem; }
.watch-meta span + span::before { content: "·"; margin: 0 8px; color: var(--line-strong); }
.watch-actions { display: flex; align-items: center; gap: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.watch-actions button { min-height: 42px; padding: 0; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--civic); font-size: .72rem; font-weight: 700; cursor: pointer; }
.watch-actions button:hover { border-bottom-color: currentColor; }
.watch-actions .remove-place { margin-left: auto; color: var(--danger); }
.coming-soon-card { display: grid; grid-template-columns: 92px 1fr; gap: 24px; align-items: start; margin-top: 34px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.coming-soon-mark { color: var(--civic); font-size: .65rem; font-weight: 780; letter-spacing: .11em; text-transform: uppercase; }
.coming-soon-card h2 { margin: 0; font-size: .98rem; }
.coming-soon-card p { max-width: 660px; margin: 6px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }

.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 30px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.about-grid .source-card { grid-column: 1 / -1; min-height: auto; }
.info-card { min-height: 250px; padding: 22px 24px 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.info-number { color: var(--civic); font-size: .65rem; font-weight: 790; letter-spacing: .1em; }
.info-card h2 { margin: 28px 0 0; color: var(--ink); font-size: 1.08rem; }
.info-card p { color: var(--muted); font-size: .8rem; line-height: 1.58; }
.feedback-card .button { margin-top: 8px; }
.info-card .inline-link, .source-card a { color: var(--civic); font-weight: 700; text-underline-offset: 3px; }
.source-card ul { columns: 2; column-gap: 36px; margin: 15px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: .77rem; }
.source-card li { margin-bottom: 10px; break-inside: avoid; }
.legal-footer { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--faint); font-size: .68rem; line-height: 1.5; }
.legal-footer p { margin: 5px 0; }
.legal-footer a { color: var(--civic); }

/* Place dialog */
.place-dialog { width: min(600px, calc(100vw - 28px)); max-height: min(860px, calc(100dvh - 28px)); margin: auto; padding: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); box-shadow: 0 18px 55px rgba(27, 27, 25, .24); }
.place-dialog::backdrop { background: rgba(24, 28, 31, .58); }
.place-dialog form { max-height: min(860px, calc(100dvh - 28px)); padding: 25px 26px; overflow-y: auto; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; color: var(--ink); font-size: 1.42rem; letter-spacing: -.03em; }
.dialog-close { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: var(--muted); font-size: 1.45rem; line-height: 1; cursor: pointer; }
.dialog-close:hover { border-color: var(--ink); color: var(--ink); }
.field-label { display: block; margin: 17px 0 7px; color: var(--ink-soft); font-size: .74rem; font-weight: 720; }
.text-input { width: 100%; height: 48px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface); color: var(--ink); }
.text-input::placeholder { color: var(--faint); }
.text-input:hover { border-color: var(--ink-soft); }
.text-input:focus { border-color: var(--focus); outline: 3px solid rgba(8, 120, 165, .16); }
.field-help { margin: 6px 0 0; color: var(--faint); font-size: .67rem; line-height: 1.42; }
.address-combobox { position: relative; }
.input-status { position: absolute; right: 12px; top: 15px; color: var(--faint); font-size: .67rem; pointer-events: none; }
.suggestion-list { position: absolute; z-index: 20; inset: calc(100% + 4px) 0 auto; max-height: 235px; margin: 0; padding: 4px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface); box-shadow: 0 8px 22px rgba(27, 27, 25, .14); list-style: none; }
.suggestion-list li + li { border-top: 1px solid var(--line); }
.suggestion-list button { width: 100%; min-height: 44px; padding: 8px; border: 0; background: transparent; color: var(--ink-soft); text-align: left; font-size: .76rem; cursor: pointer; }
.suggestion-list button:hover, .suggestion-list button[aria-selected="true"] { background: var(--civic-soft); color: var(--civic-dark); }
.location-button { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 11px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--paper); color: var(--civic); font-size: .74rem; font-weight: 700; cursor: pointer; }
.location-button:hover { border-color: var(--civic); background: var(--civic-soft); }
.location-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.location-button:disabled { opacity: .55; cursor: wait; }
.selected-address { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 11px; padding: 11px 12px; border-left: 3px solid var(--success); background: var(--success-soft); }
.selected-address > span { color: var(--success); font-size: .8rem; font-weight: 800; }
.selected-address strong { display: block; color: var(--success); font-size: .73rem; }
.selected-address p { margin: 3px 0 0; color: var(--ink-soft); font-size: .68rem; }
.form-section { min-width: 0; margin: 22px 0 0; padding: 0; border: 0; }
.form-section legend { margin-bottom: 9px; color: var(--ink-soft); font-size: .75rem; font-weight: 720; }
.segmented-control { display: grid; grid-template-columns: repeat(3, 1fr); }
.segmented-control label { position: relative; }
.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-control span { min-height: 44px; display: grid; place-items: center; margin-right: -1px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); font-size: .73rem; font-weight: 690; cursor: pointer; }
.segmented-control input:checked + span { position: relative; z-index: 1; border-color: var(--civic); background: var(--civic); color: white; }
.segmented-control input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
.topic-options { display: grid; border-top: 1px solid var(--line); }
.topic-options label { position: relative; }
.topic-options input { position: absolute; opacity: 0; pointer-events: none; }
.topic-options label > span { min-height: 66px; display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 11px; align-items: center; padding: 11px 7px; border-bottom: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.topic-options input:checked + span { box-shadow: inset 3px 0 0 var(--civic); background: var(--civic-soft); }
.topic-options input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
.topic-options b { align-self: end; font-size: .75rem; }
.topic-options small { align-self: start; color: var(--muted); font-size: .66rem; line-height: 1.35; }
.topic-icon { grid-row: 1 / 3; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid currentColor; background: transparent; font-style: normal; font-size: .62rem; font-weight: 800; }
.road-icon { color: var(--road); }
.development-icon { color: var(--development); }
.notice-icon { color: var(--notice); }
.privacy-note { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 20px; padding: 11px 12px; border-left: 3px solid var(--civic); background: var(--paper); }
.privacy-note svg { width: 19px; height: 19px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.privacy-note p { margin: 0; color: var(--muted); font-size: .67rem; line-height: 1.48; }
.form-error { margin: 12px 0 0; padding: 9px 10px; border-left: 3px solid var(--danger); background: var(--danger-soft); color: var(--danger); font-size: .7rem; }
.dialog-actions { position: sticky; bottom: -25px; display: flex; justify-content: flex-end; gap: 8px; margin: 22px -26px -25px; padding: 15px 26px calc(15px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }

.toast-region { position: fixed; z-index: 2000; right: 18px; bottom: 18px; display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: 360px; padding: 12px 14px; border: 1px solid #101a21; border-radius: 3px; background: #192a36; color: white; box-shadow: 0 8px 24px rgba(27, 27, 25, .2); font-size: .75rem; line-height: 1.42; animation: toast-in 180ms ease-out; }
.noscript-message { margin: 20px; padding: 18px; border-left: 3px solid #a46b16; background: var(--warning-soft); color: var(--warning); }
.mobile-nav { display: none; }

@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1080px) {
  .topbar { padding: 0 20px; }
  .brand small { display: none; }
  .workspace { grid-template-columns: minmax(440px, 44%) minmax(0, 1fr); }
  .onboarding-shell { gap: 64px; }
  .watchlist-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .watch-card:nth-child(odd) { border-left: 1px solid var(--line); }
}

@media (max-width: 820px) {
  :root { --topbar-height: 56px; }
  body.has-mobile-nav { padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom)); }
  .topbar { height: var(--topbar-height); grid-template-columns: 1fr auto; padding: 0 16px; background: var(--paper); }
  .brand::before { width: 3px; height: 20px; }
  .brand strong { font-size: .93rem; }
  .brand small, .unofficial-label, .desktop-nav { display: none; }
  .header-actions { grid-column: 2; }
  .header-actions .button { min-height: 38px; }

  .onboarding { min-height: auto; align-content: start; padding: 45px 20px 32px; }
  .onboarding-shell { width: min(680px, 100%); grid-template-columns: 1fr; gap: 48px; }
  .hero-copy { max-width: none; }
  .hero-copy h1 { max-width: 570px; font-size: clamp(2.75rem, 11vw, 4.1rem); }
  .hero-lede { max-width: 570px; font-size: 1rem; }
  .onboarding-guide { width: 100%; }
  .onboarding-footnote { width: min(680px, 100%); margin-top: 34px; }

  .workspace { height: calc(100dvh - var(--topbar-height) - var(--mobile-nav-height) - env(safe-area-inset-bottom)); min-height: 500px; display: block; }
  .feed-panel { height: 100%; padding: 0 16px 34px; border-right: 0; }
  .feed-header { padding: 20px 0 12px; }
  .feed-header h1 { font-size: 1.48rem; }
  .place-change-button { min-height: 40px; }
  .refresh-row { padding-bottom: 11px; }
  .summary-block { padding: 18px 0 17px; }
  .filter-bar { margin: 0 -16px; padding-left: 16px; padding-right: 16px; gap: 21px; }
  .update-card::before { left: -16px; }
  .update-card h3 { font-size: .98rem; }
  .map-panel { height: 100%; }
  #map { min-height: 100%; }
  .workspace[data-mobile-view="nearby"] .map-panel { display: none; }
  .workspace[data-mobile-view="map"] .feed-panel { display: none; }
  .map-legend { top: 10px; right: 10px; max-width: calc(100% - 20px); }
  .map-disclaimer { left: 10px; right: 58px; bottom: 10px; max-width: none; }

  .mobile-nav {
    position: fixed;
    z-index: 950;
    inset: auto 0 0;
    height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 0 6px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: var(--surface);
  }
  .mobile-nav button { position: relative; min-width: 0; display: grid; place-items: center; align-content: center; gap: 3px; border: 0; background: transparent; color: var(--muted); font-size: .6rem; font-weight: 680; cursor: pointer; }
  .mobile-nav button::before { content: ""; position: absolute; inset: -1px 26% auto; height: 2px; background: transparent; }
  .mobile-nav button.is-active { color: var(--civic); }
  .mobile-nav button.is-active::before { background: var(--civic); }
  .mobile-nav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }

  .page-view { width: min(100% - 32px, 700px); padding: 38px 0 52px; }
  .page-header { align-items: flex-start; }
  .page-header h1 { font-size: 2.55rem; }
  .page-header p:not(.eyebrow) { font-size: .84rem; }
  .watchlist-grid, .about-grid { grid-template-columns: 1fr; }
  .watch-card, .watch-card:nth-child(odd) { border-left: 1px solid var(--line); }
  .about-grid .source-card { grid-column: auto; }
  .info-card { min-height: 0; }
  .source-card ul { columns: 1; }
  .toast-region { left: 14px; right: 14px; bottom: calc(var(--mobile-nav-height) + 12px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
}

@media (max-width: 560px) {
  .header-actions .button { display: none; }
  .hero-copy h1 { font-size: clamp(2.65rem, 13vw, 3.45rem); }
  .hero-lede { line-height: 1.55; }
  .hero-actions { display: grid; }
  .hero-actions .button { width: 100%; }
  .trust-list { display: grid; gap: 9px; }
  .onboarding-guide li { padding: 16px 0; }

  .feed-header { gap: 12px; }
  .feed-header .eyebrow { margin-bottom: 6px; }
  .place-change-button { font-size: 0; }
  .place-change-button svg { width: 19px; height: 19px; }
  .refresh-row { align-items: flex-start; }
  .refresh-actions { gap: 10px; }
  .summary-number { font-size: 1.85rem; }
  .summary-chips { gap: 6px 14px; }
  .card-actions { gap: 18px; }

  .page-header { display: grid; }
  .page-header .button { width: 100%; }
  .page-header h1 { font-size: 2.35rem; }
  .coming-soon-card { grid-template-columns: 1fr; gap: 8px; }

  .place-dialog { width: 100vw; max-height: 94dvh; margin: auto 0 0; border-width: 1px 0 0; border-radius: 14px 14px 0 0; }
  .place-dialog form { max-height: 94dvh; padding: 21px 17px; }
  .dialog-actions { bottom: -21px; margin: 20px -17px -21px; padding: 13px 17px calc(13px + env(safe-area-inset-bottom)); }
  .dialog-actions .button { flex: 1; padding: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (forced-colors: active) {
  .mini-badge, .filter-chip, .legend-dot, .topic-icon, .civic-marker span { border: 1px solid CanvasText; }
  .update-card::before { width: 6px; }
}
