@import url("/ward-shell.css");
@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@600;700&family=Manrope:wght@400;500;600;700&display=swap");
:root {
  color-scheme: dark;
  --ink: #f8fafc;
  --muted: #94a3b8;
  --faint: #64748b;
  --paper: #0f1115;
  --surface: #16191f;
  --surface-soft: #1c2028;
  --line: #262a33;
  --line-hover: #3d4351;
  --accent: #facc15;
  --positive: #34d399;
  --warning: #fbbf24;
  --negative: #f87171;
  --serif: "Fraunces", "Noto Sans JP", sans-serif;
  --sans: "Manrope", "Noto Sans JP", "Hiragino Sans", sans-serif;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.7;
}
.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
}
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(245, 242, 234, 0.94);
}
.site-header .page-shell {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.08em;
  text-decoration: none;
}
.header-nav {
  display: flex;
  gap: 20px;
}
.header-nav a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}
.breadcrumb {
  padding: 20px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.breadcrumb a {
  color: inherit;
}
.hero {
  padding: 52px 0 34px;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.32;
}
.lede {
  max-width: 820px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 18px;
}
.freshness {
  margin-top: 18px;
  color: var(--faint);
  font-size: 12px;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 8px 0 50px;
}
.kpi {
  min-height: 126px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.kpi-label {
  color: var(--muted);
  font-size: 13.5px;
}
.kpi-value {
  margin-top: 9px;
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.25;
}
.kpi-note {
  margin-top: 8px;
  color: var(--faint);
  font-size: 12.5px;
}
.section {
  margin: 0 0 66px;
}
.section-head {
  max-width: 820px;
  margin-bottom: 22px;
}
.section-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.12em;
}
.section h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
}
.section-copy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15.5px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}
th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}
th:first-child,
td:first-child {
  text-align: left;
}
th {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  background: #11141a;
}
tbody tr:last-child td {
  border-bottom: 0;
}
.count {
  color: var(--faint);
  font-size: 11px;
}
.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.7fr);
  gap: 16px;
}
.map-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.map-toolbar {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.map-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.map-buttons button {
  appearance: none;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}
.map-buttons button:hover {
  border-color: var(--line-hover);
  color: var(--ink);
}
.map-buttons button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #111827;
}
.map-legend {
  color: var(--faint);
  font-size: 12.5px;
}
.ward-map-svg,
.locator-map-svg {
  display: block;
  width: 100%;
  height: auto;
  background: #11141a;
}
.town-shape {
  stroke: #0f1115;
  stroke-width: 1.15;
  vector-effect: non-scaling-stroke;
  transition:
    fill 0.18s,
    opacity 0.18s;
}
.town-shape:hover,
.town-shape:focus {
  opacity: 0.82;
  stroke: var(--accent);
  stroke-width: 1.6;
  outline: none;
}
/* Floating hover popover (one shared element, positioned in JS). */
.map-popover {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  max-width: 240px;
  padding: 8px 11px;
  background: var(--surface);
  border: 1px solid var(--line-hover);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.35;
}
.map-popover[hidden] {
  display: none;
}
.map-popover-name {
  display: block;
  font-size: 13px;
}
.map-popover-value {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.locator-shape {
  fill: #303641;
  stroke: #11141a;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.locator-shape.is-current {
  fill: var(--accent);
  stroke: var(--accent);
  stroke-width: 2;
  paint-order: stroke;
}
/* Other wards are clickable links: cursor + hover highlight. */
.locator-link {
  cursor: pointer;
}
.locator-link .locator-shape {
  transition:
    fill 0.15s,
    stroke 0.15s;
}
.locator-link:hover .locator-shape,
.locator-link:focus-visible .locator-shape {
  fill: var(--line-hover);
  stroke: var(--accent);
  stroke-width: 1.6;
  outline: none;
}
/* Locator map + its overlaid "open in map-viewer" shortcut. */
.locator-map-wrap {
  position: relative;
}
.locator-open-map {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--line-hover);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 12.5px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  transition:
    border-color 0.15s,
    color 0.15s;
}
.locator-open-map:hover {
  border-color: var(--accent);
  color: var(--ink);
}
.locator-open-map-icon {
  width: 15px;
  height: 15px;
  flex: none;
}
.locator-hint {
  color: var(--faint) !important;
  font-size: 12px !important;
}
.locator-copy {
  padding: 18px;
}
.locator-copy h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}
.locator-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

/* Tokyo ward directory: intentionally only boundaries and names, with no
   basemap or choropleth so the selection stays calm and immediate. */
.ward-directory-hero {
  padding-bottom: 40px;
}
.ward-directory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.8fr);
  gap: 18px;
  align-items: start;
}
.ward-directory-map-card,
.ward-directory-list-panel {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.ward-directory-list-panel {
  padding-bottom: 18px;
}
.ward-directory-panel-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.ward-directory-panel-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}
.ward-directory-panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}
.ward-directory-map-svg {
  display: block;
  width: 100%;
  height: auto;
  background: #11141a;
}
.ward-directory-shape {
  fill: #303641;
  stroke: #11141a;
  stroke-width: 1.1;
  vector-effect: non-scaling-stroke;
  transition:
    fill 0.15s,
    stroke 0.15s,
    opacity 0.15s;
}
.ward-directory-map-link {
  cursor: pointer;
  outline: none;
}
.ward-directory-map-link:hover .ward-directory-shape,
.ward-directory-map-link:focus-visible .ward-directory-shape,
.ward-directory-map-link.is-linked .ward-directory-shape {
  fill: color-mix(in srgb, var(--accent) 34%, #303641);
  stroke: var(--accent);
  stroke-width: 2;
  paint-order: stroke;
}
.ward-directory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 18px 18px 0;
}
.ward-directory-item {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  text-decoration: none;
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s,
    transform 0.15s;
}
.ward-directory-item span:first-child {
  min-width: 0;
}
.ward-directory-item span:last-child {
  flex: none;
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}
.ward-directory-item:hover,
.ward-directory-item:focus-visible,
.ward-directory-item.is-linked {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--ink);
  outline: none;
  transform: translateY(-1px);
}
.health-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.health-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.health-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.health-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}
.health-score {
  color: var(--accent);
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1;
}
.health-score small {
  color: var(--faint);
  font-family: var(--sans);
  font-size: 11px;
}
.health-rank {
  margin-top: 6px;
  color: var(--faint);
  font-size: 11px;
  text-align: right;
}
.score-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}
.score-row-head {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
}
.score-track {
  height: 6px;
  margin-top: 5px;
  background: #252a34;
  border-radius: 99px;
  overflow: hidden;
}
.score-track span {
  display: block;
  height: 100%;
  background: var(--positive);
  border-radius: inherit;
}
.signal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 22px;
}
.signal {
  padding: 12px 13px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.signal span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.signal strong {
  display: block;
  margin-top: 4px;
  font-size: 17px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.demo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.demo-item {
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.demo-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.demo-item strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}
.mix-list {
  display: grid;
  gap: 11px;
}
.mix-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 2fr 48px;
  gap: 10px;
  align-items: center;
  font-size: 13.5px;
}
.mix-bar {
  height: 7px;
  background: #252a34;
  border-radius: 99px;
  overflow: hidden;
}
.mix-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.town-name {
  font-weight: 500;
}
.station {
  color: var(--muted);
}
.score-pill {
  display: inline-flex;
  min-width: 36px;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(52, 211, 153, 0.12);
  color: var(--positive);
}
/* Area-character section: a secondary "known for" lede line, a notable-places
   table, and inline chip lists for parks and rail lines. Institutional look:
   ruled table + plain typographic lists, no cards. */
.known-for {
  margin-top: 12px;
  color: var(--ink);
}
.area-subhead {
  margin: 30px 0 14px;
}
.area-subhead h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}
.area-notable {
  min-width: 0;
}
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chip-list li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text-soft);
  font-size: 13.5px;
}
.line-dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex: none;
}
/* Notable-places table + map, side by side. */
.area-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.area-rank {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.area-coverage-figure {
  color: var(--ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
/* This table reads left-to-right (rank, name, type); only the numeric rating
   is right-aligned. Override the global "first col left, rest right" rule. */
.area-notable td,
.area-notable th {
  text-align: left;
}
.area-notable td:last-child,
.area-notable th:last-child {
  text-align: right;
}
.area-notable td:first-child,
.area-notable th:first-child {
  width: 1%;
  white-space: nowrap;
  padding-right: 6px;
}
.area-map-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.places-map-svg {
  display: block;
  width: 100%;
  height: auto;
  background: #11141a;
}
[data-theme="light"] .places-map-svg {
  background: #f1f5f9;
}
.places-map-outline {
  fill: var(--surface-soft);
  stroke: var(--line-hover);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
[data-theme="light"] .places-map-outline {
  fill: #e8edf3;
  stroke: #cbd5e1;
}
.places-map-park {
  fill: var(--positive);
  fill-opacity: 0.55;
  stroke: var(--positive);
  stroke-width: 1;
  stroke-opacity: 0.8;
  vector-effect: non-scaling-stroke;
  transition:
    fill-opacity 0.15s,
    stroke-width 0.15s;
}
/* Highlighted park (hovered from the list, or hovering the shape). */
.places-map-park.is-linked,
.places-map-park:hover {
  fill-opacity: 0.9;
  stroke-width: 2.5;
}
/* Notable-place icon markers: a filled pin, a Lucide glyph, a number badge. */
.places-map-place {
  cursor: default;
}
.places-map-pin {
  fill: var(--accent);
  stroke: #11141a;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
  transition:
    r 0.12s,
    filter 0.12s;
}
.places-map-icon {
  fill: none;
  stroke: #111827;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.places-map-badge circle {
  fill: #111827;
  stroke: var(--accent);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}
.places-map-badge text {
  fill: #fff;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 600;
}
/* Highlighted marker (hovered from the table). */
.places-map-place.is-linked .places-map-pin,
.places-map-place:hover .places-map-pin {
  r: 16;
  filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.9));
}
[data-theme="light"] .places-map-park:not(.is-linked),
[data-theme="light"] .places-map-pin {
  stroke: #fff;
}
/* Linked list highlights. */
.area-place-row.is-linked,
.area-place-row:hover {
  background: var(--accent-soft);
  cursor: default;
}
.area-park-chip {
  cursor: default;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.area-park-chip.is-linked,
.area-park-chip:hover {
  border-color: var(--positive);
  background: rgba(52, 211, 153, 0.12);
  color: var(--ink);
}
.area-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 12.5px;
}
.area-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.area-legend-place,
.area-legend-park {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: none;
}
.area-legend-place {
  background: var(--accent);
}
.area-legend-park {
  background: var(--positive);
}
@media (max-width: 900px) {
  .area-map-layout {
    grid-template-columns: 1fr;
  }
}
.cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.cta-card {
  display: block;
  padding: 27px;
  background: var(--surface);
  border: 1px solid var(--line-hover);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color 0.18s,
    background 0.18s;
}
.cta-card:hover {
  border-color: var(--accent);
  background: var(--surface-soft);
}
.cta-card span {
  display: block;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cta-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}
.method {
  color: var(--muted);
  font-size: 13.5px;
}

/* ── "Deeper analysis" teasers ─────────────────────────────────────────────
   Real labels/structure with every figure withheld (a static redacted
   placeholder, not a number) plus a CTA to the analytics platform. */
.locked-cell {
  display: inline-block;
  width: 40px;
  height: 8px;
  border-radius: 99px;
  /* Static dotted / redacted look: a row of soft dots, no motion. */
  background-image: radial-gradient(
    circle,
    var(--line-hover) 0 40%,
    transparent 45%
  );
  background-size: 8px 8px;
  background-repeat: repeat-x;
  background-position: left center;
  opacity: 0.85;
  vertical-align: middle;
}
.teaser-table-wrap {
  margin-bottom: 22px;
}
.teaser-table-head h3,
.teaser-head h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}
/* The locked scores table reads as "there is data here, unlock it". */
.teaser-locked-table {
  position: relative;
}
.teaser-locked-table td .locked-cell {
  width: 30px;
}
.teaser-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.teaser-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.teaser-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.teaser-rows {
  display: grid;
  gap: 9px;
  margin: 16px 0 18px;
}
.teaser-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--text-soft);
}
.teaser-cta {
  align-self: flex-start;
  margin-top: auto;
  color: var(--accent);
  font-size: 13.5px;
  text-decoration: none;
}
.teaser-cta:hover {
  text-decoration: underline;
}
.teaser-locked-table + .teaser-cta {
  display: inline-block;
  margin-top: 12px;
}
@media (max-width: 900px) {
  .teaser-grid {
    grid-template-columns: 1fr;
  }
}

/* Footer styled after the homepage (fudosansoba.com): a dark panel that is the
   same in both light and dark themes, matching the marketing site. */
.site-footer {
  margin-top: 70px;
  background: #2b2b2f;
  color: #f4f3ef;
  padding: 54px 0 24px;
  border-top: 0;
}
.footer-inner {
  width: min(1200px, calc(100% - 56px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 32px;
}
.footer-brand {
  margin-bottom: 7px;
  color: #ffffff;
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.04em;
}
.footer-tagline {
  color: rgba(244, 243, 239, 0.68);
  font-size: 14px;
}
.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 19px;
}
.footer-col-title {
  margin-bottom: 10px;
  color: rgba(244, 243, 239, 0.48);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.footer-links a {
  display: block;
  margin-bottom: 7px;
  color: rgba(244, 243, 239, 0.82);
  font-size: 14px;
  text-decoration: none;
}
.footer-links a:hover {
  color: #ffffff;
}
.footer-legal {
  width: min(1200px, calc(100% - 56px));
  margin: 38px auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(244, 243, 239, 0.16);
}
.footer-legal .footer-col-title {
  margin-bottom: 11px;
}
.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
}
.footer-legal-links a {
  color: rgba(244, 243, 239, 0.82);
  font-size: 14px;
  text-decoration: none;
}
.footer-legal-links a:hover {
  color: #ffffff;
}
.footer-copy {
  width: min(1200px, calc(100% - 56px));
  margin: 29px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: rgba(244, 243, 239, 0.58);
  font-size: 12.5px;
}

/* The shared shell (ward-shell.css) provides the real .left-rail / .main-area /
   .map-top-bar. This page only needs the content wrapper to stay within the
   viewport: .main-area is a flex column, and without min-width:0 its block
   children grow to their widest content (nowrap tables, the inline map SVG),
   overflowing the screen on narrow devices. */
.ward-page-content {
  width: 100%;
  min-width: 0;
  max-width: 1200px;
  padding-bottom: 1px;
}
.ward-static-main {
  min-width: 0;
}

[data-theme="light"] {
  color-scheme: light;
  --ink: #0f172a;
  --muted: #475569;
  --faint: #64748b;
  --paper: #fff;
  --surface: #fff;
  --surface-soft: #f1f5f9;
  --line: #e2e8f0;
  --line-hover: #cbd5e1;
  --accent: #0284c7;
  --positive: #15803d;
  --negative: #b91c1c;
}
[data-theme="light"] .ward-top-bar {
  background: rgba(255, 255, 255, 0.95);
}
[data-theme="light"] th,
[data-theme="light"] .ward-map-svg,
[data-theme="light"] .locator-map-svg {
  background: #f1f5f9;
}
[data-theme="light"] .town-shape,
[data-theme="light"] .locator-shape {
  stroke: #fff;
}
[data-theme="light"] .locator-shape {
  fill: #cbd5e1;
}
/* Keep the current-ward highlight above the light-theme grey fill (same
   specificity as the rule above, so it must come after it). */
[data-theme="light"] .locator-shape.is-current {
  fill: var(--accent);
  stroke: var(--accent);
}
[data-theme="light"] .ward-directory-map-svg {
  background: #f1f5f9;
}
[data-theme="light"] .ward-directory-shape {
  fill: #cbd5e1;
  stroke: #fff;
}
[data-theme="light"] .ward-directory-map-link:hover .ward-directory-shape,
[data-theme="light"] .ward-directory-map-link:focus-visible .ward-directory-shape,
[data-theme="light"] .ward-directory-map-link.is-linked .ward-directory-shape {
  fill: color-mix(in srgb, var(--accent) 22%, #cbd5e1);
  stroke: var(--accent);
}
[data-theme="light"] .map-buttons button.is-active {
  color: #fff;
}
[data-theme="light"] .score-track,
[data-theme="light"] .mix-bar {
  background: #e2e8f0;
}

@media (max-width: 900px) {
  .page-shell {
    padding: 0 18px;
  }
  .hero {
    padding-top: 36px;
  }
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
  .map-layout,
  .health-grid,
  .two-col,
  .cta,
  .ward-directory-layout {
    grid-template-columns: 1fr;
  }
  .ward-directory-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .demo-grid {
    grid-template-columns: 1fr 1fr;
  }
  .map-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .signal-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .page-shell {
    padding: 0 16px;
  }
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .footer-copy {
    flex-direction: column;
    gap: 6px;
  }
  .ward-directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 470px) {
  .kpi-grid,
  .demo-grid {
    grid-template-columns: 1fr;
  }
  .kpi {
    min-height: auto;
  }
  .hero h1 {
    font-size: 33px;
  }
  .section h2 {
    font-size: 25px;
  }
  .ward-directory-grid {
    grid-template-columns: 1fr;
  }
}

/* Feed the real map-viewer shell its application theme tokens. */
:root {
  --color-bg-base: #0f1115;
  --color-bg-surface: #16191f;
  --color-bg-surface-hover: #1c2028;
  --color-border-subtle: #262a33;
  --color-border-hover: #3d4351;
  --color-text-primary: #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-text-meta: #94a3b8;
  --color-accent: #facc15;
  --bg: var(--color-bg-base);
  --bg-alt: var(--color-bg-surface);
  --text: var(--color-text-primary);
  --text-soft: var(--color-text-secondary);
  --text-faint: var(--color-text-meta);
  --accent-soft: rgba(250, 204, 21, 0.15);
  --accent-deep: #eab308;
}

[data-theme="light"] {
  --color-bg-base: #fff;
  --color-bg-surface: #fff;
  --color-bg-surface-hover: #f1f5f9;
  --color-border-subtle: #e2e8f0;
  --color-border-hover: #cbd5e1;
  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-meta: #64748b;
  --color-accent: #0284c7;
  --bg: var(--color-bg-base);
  --bg-alt: var(--color-bg-surface);
  --text: var(--color-text-primary);
  --text-soft: var(--color-text-secondary);
  --text-faint: var(--color-text-meta);
  --accent-soft: rgba(2, 132, 199, 0.12);
  --accent-deep: #0369a1;
}

/* The shared application shell is viewport-locked; this static report must scroll. */
.ward-static-shell {
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: visible;
}
.ward-static-main {
  overflow: visible;
}
.ward-static-shell .rail-switch-btn,
.ward-static-shell .map-top-bar-city-chip,
.ward-static-shell .rail-settings-btn {
  text-decoration: none;
}
.ward-static-shell .rail-settings-btn:disabled {
  cursor: default;
  opacity: 0.35;
}
/* Our logo links home; the shell renders a plain div. Keep the mark + text row
   inside the link so the shell's .rail-logo flex/gap still applies. */
.ward-static-shell .rail-logo-link {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}
