
  /* A resident's profile of one street: who lives here, the four drivers of its score on
     maps, how it has changed, and the score itself. Same tokens as index.html. */
  :root {
    --bg: #f6f5f1; --surface: #ffffff; --ink: #1d1f22; --muted: #646a73; --line: #e3e1da;
    --accent: #1f5f8b; --accent-soft: #e5eef5; --track: #efede7; --map-bg: #f1efe9;
    --sel: #1d1f22; --street: #1f5f8b; --borough: #9aa0a8;
    --b1: #c0392b; --b2: #e8743b; --b3: #e9b949; --b4: #7fb24a; --b5: #1e7b3c;
    --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.04);
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --bg: #141618; --surface: #1c1f22; --ink: #e8e6e1; --muted: #9aa0a8; --line: #2c3035;
      --accent: #7db4dd; --accent-soft: #1f2d38; --track: #262a2e; --map-bg: #191c1f;
      --sel: #f2f0ea; --street: #7db4dd; --borough: #6b7179; --shadow: none;
    }
  }
  * { box-sizing: border-box; }
  body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
  .wrap { max-width: 980px; margin: 0 auto; padding: 20px 16px 56px; display: flex; flex-direction: column; gap: 18px; }
  h1, h2, h3 { text-wrap: balance; margin: 0; } p { margin: 0; }
  a { color: var(--accent); }
  .muted { color: var(--muted); } .small { font-size: 13px; } .num { font-variant-numeric: tabular-nums; }
  .hidden { display: none !important; }
  .crumb { font-size: 13px; color: var(--muted); } .crumb a { color: var(--muted); } .crumb b { color: var(--ink); }

  .card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); min-width: 0; }
  .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; margin: 0 0 4px; }
  .sechead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
  .sechead h2 { font-size: 20px; letter-spacing: -.01em; }
  .sechead p { color: var(--muted); font-size: 14px; max-width: 60ch; }
  .status { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); }
  .status.error { background: color-mix(in srgb, var(--b1) 12%, transparent); color: var(--b1); }

  .hero h1 { font-size: 34px; letter-spacing: -.02em; line-height: 1.1; }
  .hero .where { color: var(--muted); margin-top: 2px; }
  .story { font-size: 16px; max-width: 62ch; margin-top: 12px; }
  .facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
  .fact { font-size: 13px; padding: 4px 10px; border-radius: 99px; background: var(--accent-soft); }
  .note { margin-top: 12px; font-size: 13px; padding: 8px 12px; border-radius: 8px; border: 1px dashed var(--line); color: var(--muted); }
  .scoreline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-size: 14px; }
  .scoreline .n { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
  .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
  .linkish { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; background: none; border: 0; font: inherit; padding: 0; }

  .panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
  .panel { margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
  .panel h3 { font-size: 18px; letter-spacing: -.01em; line-height: 1.3; }
  .panel figcaption p { font-size: 14px; color: var(--muted); margin-top: 4px; }
  .lmap { width: 100%; aspect-ratio: 1 / 1; border-radius: 10px; background: var(--map-bg); z-index: 0; }
  .lmap.osm .leaflet-tile-pane { filter: saturate(.35) opacity(.85); }
  .lmap .leaflet-control-attribution { font-size: 10px; }
  .lmap .lbl { background: rgba(0,0,0,.6); color: #fff; border: 0; box-shadow: none; font-weight: 700; font-size: 12px; padding: 1px 6px; }
  .lmap .lbl::before { display: none; }
  .lmap .lbl.light { background: rgba(255,255,255,.92); color: #1d1f22; }
  .sq-icon { border: 2px solid #fff; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
  .viz { width: 100%; height: auto; display: block; border-radius: 10px; background: var(--map-bg); }
  .key { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
  .key i { display: inline-block; width: 11px; height: 11px; margin-right: 5px; vertical-align: -1px; border-radius: 50%; }
  .key i.sq { border-radius: 2px; }
  .photo-frame { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; max-width: 100%; background: var(--map-bg); }
  .photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .photo-frame .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 6px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
  .photo-frame .cap a { color: #fff; }
  .empty { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 10px; background: var(--map-bg); color: var(--muted); font-size: 13px; padding: 16px; text-align: center; }

  .cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
  .chart { width: 100%; height: auto; display: block; }
  .legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
  .sw { display: inline-block; width: 16px; height: 4px; border-radius: 2px; margin-right: 5px; vertical-align: 3px; }
  .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
  .stat { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
  .stat .k { font-size: 12px; color: var(--muted); } .stat .v { font-size: 20px; font-weight: 700; }
  .stat .v small { font-size: 12px; font-weight: 400; color: var(--muted); }
  table { border-collapse: collapse; width: 100%; font-size: 13px; margin-top: 16px; }
  th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
  th { color: var(--muted); font-weight: 600; } td.r, th.r { text-align: right; }
  .tblwrap { overflow-x: auto; }

  details.score summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
  details.score summary::-webkit-details-marker { display: none; }
  details.score summary .hint { color: var(--accent); font-size: 14px; }
  .drv { display: grid; grid-template-columns: 120px 1fr 40px 90px; gap: 4px 12px; align-items: center; padding: 8px 0; font-size: 14px; }
  .drv .r { text-align: right; } .drv .pts { color: var(--muted); font-size: 13px; text-align: right; }
  .track { height: 10px; background: var(--track); border-radius: 5px; overflow: hidden; }
  .fill { height: 100%; border-radius: 5px; }
  .nearby { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
  .nb { display: flex; justify-content: space-between; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; color: var(--ink); text-decoration: none; }
  .nb:hover { border-color: var(--accent); }
  .nb b { display: inline-flex; gap: 6px; align-items: center; }
  .method { font-size: 13px; color: var(--muted); max-width: 75ch; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  @media (max-width: 760px) {
    .panels, .cols { grid-template-columns: 1fr; }
    .nearby { grid-template-columns: 1fr 1fr; }
    .drv { grid-template-columns: 1fr 40px 80px; } .drv .track { grid-column: 1 / -1; grid-row: 2; }
  }
  @media (max-width: 420px) { .nearby, .stats { grid-template-columns: 1fr; } .hero h1 { font-size: 28px; } }

.credits { margin: 28px auto 0; max-width: 980px; padding: 0 16px 24px; font-size: 12px; line-height: 1.5; color: var(--muted); } .credits a { color: inherit; }
.tile-logo img { display: block; }
