/* ReginaCRE Data (data.reginacre.com): shared styles. Version 2026-11-22f */
:root {
  --ink: #1C2A31; --muted: #56666E; --faint: #898781; --bg: #EEF1EE; --panel: #FCFCFB; --line: #D5DBD7;
  --accent: #2A6482; --accent-ink: #FFFFFF; --up: #006300; --down: #A0352A;
  --grid: #E1E0D9; --axis: #C3C2B7; --ref: #898781;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --w-other: #a3a29b;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #F0EFEC; --muted: #C3C2B7; --faint: #898781; --bg: #0D0D0D; --panel: #1A1A19; --line: #33332F;
    --accent: #7DB5D2; --accent-ink: #10181C; --up: #0ca30c; --down: #F0968A;
    --grid: #2C2C2A; --axis: #383835; --ref: #898781;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
    --w-other: #6b6a65;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #F0EFEC; --muted: #C3C2B7; --faint: #898781; --bg: #0D0D0D; --panel: #1A1A19; --line: #33332F;
  --accent: #7DB5D2; --accent-ink: #10181C; --up: #0ca30c; --down: #F0968A;
  --grid: #2C2C2A; --axis: #383835; --ref: #898781;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
  --w-other: #6b6a65;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 72rem; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 .5rem; font-weight: 800; text-wrap: balance; }
h2 { font-size: 1.08rem; margin: 0 0 .2rem; text-wrap: balance; }
.sub { color: var(--muted); font-size: .88rem; margin: 0; }

.masthead { background: var(--panel); border-bottom: 1px solid var(--line); }
.masthead .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; padding-top: .7rem; padding-bottom: .7rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand small { color: var(--muted); font-size: .8rem; }
.asof { margin: 0 0 .3rem; color: var(--muted); font-size: .85rem; }
.sections { display: flex; gap: 4px; }
.sections a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem; padding: .35rem .75rem; border-radius: 6px; }
.sections a:hover { color: var(--ink); background: var(--bg); }
.sections a[aria-current="page"] { color: var(--accent); background: var(--bg); box-shadow: inset 0 -2px 0 var(--accent); }

main { padding-top: 1.6rem; padding-bottom: 2rem; display: grid; gap: 1.1rem; }
.intro .lede { font-size: 1.08rem; margin: 0; }
.lede b { font-variant-numeric: tabular-nums; }
.up { color: var(--up); font-weight: 600; } .down { color: var(--down); font-weight: 600; }

.filters { position: sticky; top: 0; z-index: 1000; background: var(--bg); padding: .6rem 0; border-bottom: 1px solid var(--line); display: grid; gap: .5rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px 4px 8px; font-size: .84rem; cursor: pointer; background: var(--panel); color: var(--ink); user-select: none; min-height: 32px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip .sw { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; }
.chip.off { opacity: .5; } .chip.off .sw { background: transparent !important; box-shadow: inset 0 0 0 1.5px var(--faint); }
.chip:focus-within { outline: 3px solid var(--accent); outline-offset: 1px; }
.chip.loading { opacity: .7; cursor: progress; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; }
.switch { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .2rem .5rem; font-size: .88rem; cursor: pointer; }
.switch input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.switch em { color: var(--muted); font-style: normal; font-size: .8rem; }
button.ghost { font: inherit; font-size: .84rem; padding: .35rem .8rem; border-radius: 6px; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--accent); font-weight: 600; min-height: 32px; }
button.ghost:hover { border-color: var(--accent); }
button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: .8rem; }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr 1fr; gap: .6rem; } .tile { padding: .7rem .75rem; } .tile .lab, .tile .cmp { font-size: .78rem; } }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .9rem 1rem; min-width: 0; }
.tile .lab { color: var(--muted); font-size: .84rem; }
.tile .big { font-size: 1.9rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; margin: .2rem 0; letter-spacing: -0.01em; }
.tile .cmp { font-size: .84rem; color: var(--muted); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.1rem 1.1rem; min-width: 0; }
.card-head { margin-bottom: .7rem; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 1.1rem; }
.controls { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: .7rem; }
.controls label { font-size: .86rem; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
select { font: inherit; font-size: .9rem; padding: .3rem .5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); min-height: 32px; }

.map { height: min(70vh, 600px); min-height: 360px; border-radius: 6px; border: 1px solid var(--line); background: var(--grid); z-index: 0; }
.map-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-top: .6rem; }
.leaflet-container { font: inherit; }
.leaflet-popup-content { font-size: .86rem; line-height: 1.4; margin: 10px 12px; }
.leaflet-popup-content b { display: block; font-size: .95rem; }
.leaflet-popup-content .m { color: #56666E; }
.map-legend { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: .75rem; line-height: 1.3; }
.map-legend svg { display: block; }
.map-legend text { fill: var(--muted); font-size: 10px; }
.map-legend circle { fill: none; stroke: var(--muted); }

.chart { position: relative; min-height: 220px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.axis text, .lbl { fill: var(--muted); font-size: 11px; font-family: inherit; }
.lbl.strong { fill: var(--ink); }
.chart text { pointer-events: none; }
.axis path, .axis line { stroke: var(--axis); }
.grid line { stroke: var(--grid); } .grid path { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: var(--muted); margin-top: .5rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
.empty { color: var(--muted); font-size: .9rem; padding: 2rem 0; text-align: center; }

.tip { position: fixed; pointer-events: none; background: var(--panel); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 4px 16px rgba(0,0,0,.18); border-radius: 6px; padding: 8px 10px; font-size: .82rem; max-width: 280px; z-index: 2000; line-height: 1.35; }
.tip b { display: block; } .tip .m { color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .86rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
td.n, th.n { text-align: right; white-space: nowrap; }
td.addr { min-width: 11rem; }
td:first-child { white-space: nowrap; }

.notes p { font-size: .9rem; color: var(--muted); margin: .5rem 0; }
.notes b { color: var(--ink); }
.foot { padding-top: .5rem; padding-bottom: 2rem; font-size: .82rem; color: var(--muted); }
.foot p { margin: .3rem 0; }
.ver { white-space: nowrap; }
.err { color: var(--down); }

@media (max-width: 560px) {
  .tile .big { font-size: 1.6rem; }
  .card { padding: .8rem .8rem 1rem; }
  .map { height: 62vh; }
  .filters { position: static; }
  /* tables become one small card per row */
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: .5rem 0; }
  td { border: none; padding: .1rem 0; text-align: left !important; white-space: normal !important; display: flex; gap: .6rem; }
  td::before { content: attr(data-label); color: var(--muted); flex: 0 0 7.5rem; font-size: .8rem; padding-top: .05rem; }
  td.first { font-weight: 600; } td.first::before { display: none; }
  td.empty::before { display: none; }
}
@media (forced-colors: active) { .chip .sw, .legend i { forced-color-adjust: none; } }

/* front page cards */
.hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 1.1rem; }
.hub-card { display: flex; flex-direction: column; gap: .9rem; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.3rem 1.4rem 1.1rem; text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.hub-card:hover { border-color: var(--accent); box-shadow: 0 6px 22px rgba(0,0,0,.08); transform: translateY(-1px); }
.hub-top { display: flex; align-items: center; gap: .85rem; }
.hub-icon { flex: none; width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.hub-top h2 { font-size: 1.2rem; margin: 0; line-height: 1.2; }
.hub-sub { display: block; color: var(--muted); font-size: .9rem; }
.hub-arrow { margin-left: auto; color: var(--accent); font-size: 1.3rem; transition: transform .15s; }
.hub-card:hover .hub-arrow { transform: translateX(3px); }
.hub-num { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; }
.hub-num b { font-size: 2.3rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.hub-num span { color: var(--muted); font-size: .95rem; }
.hub-chips { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; min-height: 1.6rem; }
.chip-t { display: inline-flex; align-items: center; font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.chip-t.up { color: var(--up); } .chip-t.down { color: var(--down); }
.hub-foot { margin: auto 0 0; padding-top: .7rem; border-top: 1px solid var(--line); font-size: .8rem; color: var(--faint); }

/* housing page */
.panels.two-up { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 1rem; }
.panel h3, #zone-tables h3 { font-size: .95rem; margin: 0 0 .3rem; display: flex; align-items: center; gap: 6px; }
#zone-tables h3 { margin-top: 1rem; }
.city-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 4px; vertical-align: 0; }
.section-title { font-size: 1.4rem; margin: 1rem 0 0; }
.section-sub { margin-top: -.6rem; }
.tip .sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 5px; }
.cmhc { font-style: italic; }
