/* ============================================================
   Barri Match — editorial atlas / Mediterranean modernism
   ============================================================ */
:root{
  --ink:        #1b1512;
  --ink-2:      #241c16;
  --ink-soft:   #2c231c;
  --cream:      #f4ece0;
  --cream-2:    #efe4d3;
  --muted:      #a99c87;
  --muted-2:    #7d7263;
  --line:       rgba(244,236,224,.12);
  --line-2:     rgba(244,236,224,.07);

  --terracotta: #d9532c;
  --gold:       #e7a83a;
  --teal:       #2f8f93;
  --sea:        #1f6f78;
  --olive:      #8a9b6e;
  --senyera-r:  #da291c;
  --senyera-y:  #ffcd00;

  --shadow:     0 18px 50px -12px rgba(26,16,8,.55), 0 4px 14px -6px rgba(26,16,8,.4);
  --shadow-sm:  0 8px 22px -10px rgba(26,16,8,.5);

  --r:   18px;
  --r-sm: 11px;

  --serif: "Fraunces", Georgia, serif;
  --sans:  "Hanken Grotesk", system-ui, sans-serif;
  --mono:  "Spline Sans Mono", ui-monospace, monospace;
}

*{ box-sizing:border-box; }
html,body{ height:100%; margin:0; }
body{
  font-family:var(--sans);
  color:var(--cream);
  background:#e9e0cf;
  overflow:hidden;
  -webkit-font-smoothing:antialiased;
}

#map{ position:fixed; inset:0; }

/* base map tint via canvas backdrop (warm bone) */
.maplibregl-map{ background:#f1e8d6; }
.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-bottom-left{ z-index:1; }
.maplibregl-ctrl-attrib{ font-family:var(--sans); font-size:10px; background:rgba(244,236,224,.7); }
/* satellite toggle — rides in the corner stack with the zoom buttons */
.sat-ctrl button{ display:flex; align-items:center; justify-content:center; }
.sat-ctrl svg{ width:17px; height:17px; color:#4a4338; }
.sat-ctrl button.is-on{ background:var(--senyera-y); }
.sat-ctrl button.is-on svg{ color:#1b1512; }

/* ---------- senyera brand mark ---------- */
.senyera{
  width:20px; height:34px; border-radius:3px; flex:none;
  background:
    repeating-linear-gradient(180deg,
      var(--senyera-y) 0 3.6px, var(--senyera-r) 3.6px 7.2px);
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);
}

/* ===================== LEFT RAIL (header + menu + results, one piece) ===================== */
:root{ --rail-w:580px; --menu-w:250px; }

.rail{
  position:fixed; top:0; left:0; bottom:0; z-index:6;
  width:var(--rail-w); max-width:100vw;
  display:flex; flex-direction:column; color:var(--cream);
  background:linear-gradient(168deg, rgba(44,35,28,.97), rgba(23,17,13,.98));
  border-right:1px solid var(--line); box-shadow:var(--shadow);
  backdrop-filter:blur(10px); overflow:hidden;
  animation:slide-l .9s .05s cubic-bezier(.2,.9,.2,1) both;
}
.rail > *{ position:relative; z-index:1; }

.railhead{
  flex:none; padding:14px 16px 13px; border-bottom:1px solid var(--line);
  background:rgba(0,0,0,.16); display:flex; flex-direction:column; gap:11px;
  position:relative; z-index:5;   /* keep the search dropdown above the two columns below */
}
.railhead-top{ display:flex; align-items:center; justify-content:space-between; gap:14px; }
.railhead-row{ display:flex; align-items:center; gap:11px; }

.brand{ display:flex; align-items:center; gap:12px; flex:none; }
.brand-text h1{
  font-family:var(--serif); font-weight:900; font-size:22px; line-height:.92;
  margin:0; letter-spacing:-.01em; font-optical-sizing:auto;
}
.brand-text p{
  margin:2px 0 0; font-size:11px; color:var(--muted);
  font-style:italic; font-family:var(--serif); font-weight:400;
}
.topbar-meta{
  display:flex; align-items:center; gap:8px; font-size:11px;
  color:var(--muted); font-family:var(--mono); white-space:nowrap; flex:none;
}
.topbar-meta .dot{ width:7px; height:7px; border-radius:50%; background:var(--teal);
  box-shadow:0 0 0 3px rgba(47,143,147,.25); animation:pulse 2.6s infinite; }

/* the two columns under the header */
.railbody{ flex:1; min-height:0; display:flex; }
.menu{
  flex:none; width:var(--menu-w); min-height:0;
  display:flex; flex-direction:column; border-right:1px solid var(--line);
}
.menu-head{ flex:none; box-sizing:border-box; height:46px; padding:12px 14px 7px; display:flex; flex-direction:column; gap:2px; justify-content:flex-end; overflow:hidden; }
.menu-h{ font-family:var(--mono); font-size:10px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); }
.menu-hint{ font-size:10.5px; color:var(--muted-2); }
.results{ flex:1; min-width:0; min-height:0; display:flex; flex-direction:column; }

/* ===================== PANEL TEXTURE ===================== */
.panel-grain{
  position:absolute; inset:0; pointer-events:none; opacity:.5; mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}
/* results column flexes so the inner .tab-body (rank / detail) scrolls */
#results-streets:not(.is-hidden){ display:flex; flex-direction:column; flex:1; min-height:0; }

.panel-head{ padding:18px 20px 12px; }
.panel-head h2{
  font-family:var(--serif); font-weight:600; font-size:21px; margin:0;
  letter-spacing:-.01em;
}
.panel-head h2 em{ color:var(--gold); font-style:italic; }
.hint{ margin:6px 0 0; font-size:12px; color:var(--muted); line-height:1.45; }

/* ---------- presets ---------- */
.presets{ display:flex; flex-wrap:wrap; gap:7px; padding:4px 20px 14px; }
.preset{
  font-family:var(--sans); font-size:11.5px; font-weight:600; color:var(--cream-2);
  background:rgba(244,236,224,.06); border:1px solid var(--line);
  padding:6px 11px; border-radius:999px; cursor:pointer; transition:.18s;
}
.preset:hover{ background:rgba(231,168,58,.16); border-color:rgba(231,168,58,.4); }
.preset.is-active{ background:var(--gold); color:#241c16; border-color:var(--gold); }

/* ---------- sliders ---------- */
.sliders{ padding:2px 20px 8px; overflow-y:auto; }
.slider-row{ padding:13px 0; border-top:1px solid var(--line-2); }
.slider-row:first-child{ border-top:none; }
.slider-head{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.s-label{ font-size:13.5px; font-weight:600; letter-spacing:.005em; }
.s-weight{
  font-family:var(--mono); font-size:10.5px; color:var(--muted);
  text-transform:uppercase; letter-spacing:.06em;
}
.s-head-right{ display:inline-flex; align-items:center; gap:8px; flex:none; }
/* gear on the incidents slider → opens the same incident-type filter as the Streets cards */
.s-gear{ flex:none; width:20px; height:20px; border-radius:6px; padding:0;
  display:inline-flex; align-items:center; justify-content:center; cursor:pointer;
  font-size:12px; line-height:1; color:var(--gold); background:rgba(244,236,224,.08);
  border:1px solid var(--line); transition:.15s; }
.s-gear:hover{ background:rgba(231,168,58,.22); border-color:rgba(231,168,58,.5); color:var(--cream); }
.s-sub{ font-size:10.5px; color:var(--muted-2); margin-top:7px; font-family:var(--mono); }

input[type=range]{
  -webkit-appearance:none; appearance:none; width:100%; height:22px;
  background:transparent; margin:9px 0 0; cursor:pointer;
}
input[type=range]::-webkit-slider-runnable-track{
  height:5px; border-radius:99px;
  background:linear-gradient(90deg,var(--gold) var(--fill,33%), rgba(244,236,224,.13) var(--fill,33%));
}
input[type=range]::-moz-range-track{ height:5px; border-radius:99px; background:rgba(244,236,224,.13); }
input[type=range]::-moz-range-progress{ height:5px; border-radius:99px; background:var(--gold); }
input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none; width:17px; height:17px; border-radius:50%;
  background:var(--cream); border:3px solid var(--terracotta);
  margin-top:-6px; box-shadow:0 2px 6px rgba(0,0,0,.4); transition:transform .12s;
}
input[type=range]::-webkit-slider-thumb:hover{ transform:scale(1.18); }
input[type=range]::-moz-range-thumb{
  width:15px; height:15px; border-radius:50%; background:var(--cream);
  border:3px solid var(--terracotta); box-shadow:0 2px 6px rgba(0,0,0,.4);
}

.panel-foot{
  margin-top:auto; display:flex; align-items:center; justify-content:space-between;
  padding:12px 20px; border-top:1px solid var(--line); background:rgba(0,0,0,.16);
}
.foot-note{ font-size:10px; color:var(--muted-2); font-family:var(--mono); }
.btn-ghost{
  font-family:var(--sans); font-size:12px; font-weight:600; color:var(--cream);
  background:none; border:1px solid var(--line); padding:6px 14px; border-radius:99px;
  cursor:pointer; transition:.18s;
}
.btn-ghost:hover{ border-color:var(--terracotta); color:var(--terracotta); }

/* ===================== RESULTS ===================== */
.tabs{ display:flex; gap:2px; padding:14px 16px 0; }
.tab{
  flex:1; font-family:var(--sans); font-size:12.5px; font-weight:600; color:var(--muted);
  background:none; border:none; border-bottom:2px solid transparent;
  padding:8px 4px 11px; cursor:pointer; transition:.18s;
}
.tab.is-active{ color:var(--cream); border-color:var(--gold); }
.tab-body{ padding:10px 16px 18px; overflow-y:auto; flex:1; min-height:0; }
.is-hidden{ display:none; }

/* ranking list */
.rank-head{ display:flex; justify-content:space-between; align-items:baseline; gap:8px;
  padding:2px 2px 6px; font-family:var(--mono); font-size:10.5px; text-transform:uppercase;
  letter-spacing:.07em; color:var(--muted); }
.rank-head .rh-metric{ font-weight:600; font-size:12px; letter-spacing:.01em; text-transform:none; }
.rank-item{
  display:grid; grid-template-columns:26px 1fr auto; align-items:center; gap:11px;
  padding:11px 11px; margin:6px 0; border-radius:var(--r-sm); cursor:pointer;
  background:rgba(244,236,224,.04); border:1px solid transparent; transition:.16s;
  animation:rise .5s both;
}
.rank-item:hover{ background:rgba(244,236,224,.09); border-color:var(--line); transform:translateX(-2px); }
.rank-item.is-sel{ border-color:var(--gold); background:rgba(231,168,58,.12); }
.rank-no{ font-family:var(--serif); font-weight:900; font-size:18px; color:var(--gold); text-align:center; }
.rank-main .rn{ font-size:14.5px; font-weight:600; line-height:1.2; }
.rank-main .rd{ font-size:11.5px; color:var(--muted); font-family:var(--mono); margin-top:2px; }
.rank-fit{ text-align:right; }
.rank-fit .pct{ font-family:var(--mono); font-size:17px; font-weight:500; color:var(--cream); }
.rank-fit .rank-raw{ font-family:var(--mono); font-size:11px; color:var(--muted); margin-top:1px; }
.rank-item .rank-sub{ grid-column:1/-1; font-family:var(--mono); font-size:10.5px; color:var(--muted);
  text-align:left; margin-top:8px; padding-top:8px; border-top:1px solid var(--line-2); }

/* ---- "Your formula" combined ranking ----
   Flat by design: the board has no card chrome of its own (the chips and tier
   drop-zones are the only boxes), and formula mode widens the whole rail. */
body.mix-wide{ --rail-w:720px; }
.rail{ transition:width .22s ease; }
.rh-right{ display:flex; align-items:center; gap:8px; }
.mix-pill{ font-family:var(--mono); font-size:10.5px; letter-spacing:.05em; text-transform:uppercase; color:#13201a;
  background:#3fae73; border:1px solid #2f8f5b; border-radius:99px; padding:3px 10px; cursor:pointer; transition:.15s;
  font-weight:600; box-shadow:0 0 0 3px rgba(63,174,115,.18); }
.mix-pill:hover{ background:#54c688; box-shadow:0 0 0 4px rgba(63,174,115,.3); }
.mix-board{ margin:2px 0 14px; }
.mix-bhead{ display:flex; justify-content:space-between; align-items:center; font-family:var(--mono); font-size:11px;
  text-transform:uppercase; letter-spacing:.07em; color:var(--gold); margin-bottom:8px; }
.mix-title{ display:inline-flex; align-items:center; gap:7px; }
#mix-info{ width:17px; height:17px; border-radius:50%; display:grid; place-items:center; padding:0;
  background:rgba(231,168,58,.1); border:1px solid rgba(231,168,58,.6); color:var(--gold);
  font-family:var(--serif); font-style:italic; font-size:11.5px; line-height:1; cursor:pointer; }
#mix-info:hover{ background:rgba(231,168,58,.25); }
.mix-actions{ display:flex; gap:4px; }
.mix-actions button{ font-family:var(--mono); font-size:10px; text-transform:uppercase; letter-spacing:.04em;
  color:var(--muted); background:none; border:1px solid transparent; border-radius:99px; padding:3px 8px; cursor:pointer; }
.mix-actions button:hover{ color:var(--cream); border-color:var(--line); }
/* tiers wear one GREEN intensity scale — vivid (top priority) fading to faint (nice-to-have),
   full coloured borders so even first-time users read three separate importance shelves */
.mix-tier{
  border:1.5px solid var(--tc); border-left:5px solid var(--tc);
  background:linear-gradient(90deg, var(--tbg1), var(--tbg2));
  border-radius:10px; padding:8px 9px 9px; margin:8px 0; transition:.15s; }
.mix-tier[data-tier="0"]{ --tc:#4db36b;                --tl:#8adfa4; --tbg1:rgba(77,179,107,.18); --tbg2:rgba(77,179,107,.04); }
.mix-tier[data-tier="1"]{ --tc:rgba(77,179,107,.5);    --tl:#a9c7b1; --tbg1:rgba(77,179,107,.08); --tbg2:rgba(77,179,107,.02); }
.mix-tier[data-tier="2"]{ --tc:rgba(77,179,107,.22);   --tl:rgba(169,199,177,.62); --tbg1:rgba(77,179,107,.03); --tbg2:rgba(77,179,107,0); }
.mix-tier.is-over{ border-color:#7be09c; background:rgba(77,179,107,.24); }
.mt-label{ display:flex; justify-content:space-between; align-items:center; font-family:var(--mono);
  font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; margin:0 1px 8px; color:var(--tl); }
.mt-label .mt-w{ font-size:9.5px; font-weight:700; letter-spacing:.05em; border:1px solid currentColor;
  border-radius:99px; padding:1.5px 8px; opacity:.9; }
.mix-tier[data-tier="0"] .mt-w{ background:#4db36b; border-color:#4db36b; color:#171310; opacity:1; }
.mt-chips{ display:flex; flex-wrap:wrap; gap:6px; min-height:22px; }
.mt-empty{ font-size:11.5px; color:rgba(244,236,224,.32); font-style:italic; padding:4px 5px; }
.mix-chip{ display:flex; align-items:center; gap:8px; flex:1 1 46%; min-width:150px;
  background:rgba(0,0,0,.22); border:1px solid rgba(244,236,224,.14); border-left:3px solid var(--mc);
  border-radius:8px; padding:6px 8px; cursor:grab; user-select:none; transition:border-color .12s; }
.mix-chip:hover{ border-color:var(--mc); }
.mix-chip:active{ cursor:grabbing; }
.mc-ico{ flex:none; width:26px; height:26px; display:grid; place-items:center; }
.mc-ico img{ width:24px; height:24px; pointer-events:none; }
.mc-body{ flex:1; min-width:0; display:flex; flex-direction:column; gap:1px; }
.mc-name{ display:block; font-size:13px; font-weight:600; line-height:1.25; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mc-swing{ display:block; font-family:var(--mono); font-size:11.5px; color:var(--muted); }
.mc-acts{ flex:none; display:flex; gap:4px; }
.mc-acts button{ width:19px; height:19px; display:grid; place-items:center; background:rgba(0,0,0,.3);
  border:1px solid rgba(244,236,224,.28); border-radius:5px; color:var(--cream); font-size:11px; line-height:1; cursor:pointer; padding:0; }
.mc-flip:hover{ color:var(--gold); border-color:var(--gold); }
.mc-x:hover{ color:#e06a50; border-color:#e06a50; }
.bar--mix{ display:flex; }
.bar--mix i{ border-radius:0; }
.bar--mix i:first-child{ border-radius:99px 0 0 99px; }
.bar--mix i:last-child{ border-radius:0 99px 99px 0; }
.rank-item.in-band{ box-shadow:inset 2.5px 0 0 rgba(231,168,58,.38); }
.rk-range{ font-size:12px; letter-spacing:-.03em; }
.mix-why{ font-family:var(--mono); font-size:10px; color:var(--muted); background:none; border:none;
  cursor:pointer; padding:4px 0 0; display:block; margin-left:auto; }
.mix-why:hover{ color:var(--gold); }
.mix-audit{ grid-column:1 / -1; margin-top:8px; border-top:1px dashed rgba(244,236,224,.16); padding-top:8px; cursor:default; }
.ma-row{ display:grid; grid-template-columns:1fr 64px 48px 46px 36px; gap:7px; align-items:baseline;
  font-family:var(--mono); font-size:11px; color:var(--cream); padding:2.5px 0; }
.ma-row span:nth-child(n+2){ text-align:right; }
.ma-head{ color:var(--muted); text-transform:uppercase; font-size:9.5px; letter-spacing:.05em; }
.ma-name{ display:flex; align-items:center; gap:6px; font-family:var(--sans); font-size:12px;
  overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.ma-dot{ width:8px; height:8px; border-radius:50%; flex:none; }
.ma-nodata{ opacity:.45; }
.ma-total{ border-top:1px solid rgba(244,236,224,.22); margin-top:4px; padding-top:5px; font-weight:600; }
.ma-note{ font-size:10px; color:var(--muted); margin-top:6px; line-height:1.45; font-style:italic; font-family:var(--serif); }
/* formula explainer modal body */
.modal-prose{ overflow:auto; padding:4px 18px 18px; font-size:13px; line-height:1.6; color:var(--cream); }
.modal-prose h4{ font-family:var(--mono); font-size:10.5px; text-transform:uppercase; letter-spacing:.07em;
  color:var(--gold); margin:14px 0 4px; }
.modal-prose p{ margin:0 0 6px; }
.modal-prose b{ color:var(--cream); }
.rank-fit .bar{ width:58px; height:5px; border-radius:99px; background:rgba(244,236,224,.12); margin-top:4px; margin-left:auto; overflow:hidden; }
.rank-fit .bar i{ display:block; height:100%; border-radius:99px; }

.empty-note{ font-size:12.5px; color:var(--muted); line-height:1.5; padding:14px 6px; font-style:italic; font-family:var(--serif); }

/* detail */
.detail-empty{ font-size:12.5px; color:var(--muted); font-style:italic; font-family:var(--serif); padding:18px 6px; line-height:1.5; }
/* "← back" from a clicked dot to the street/zone detail underneath it */
.detail-back{
  display:inline-flex; align-items:center; gap:7px; max-width:100%;
  margin:2px 0 13px; padding:6px 13px 6px 10px; border-radius:99px; cursor:pointer;
  background:rgba(244,236,224,.06); border:1px solid var(--line); color:var(--muted);
  font-family:var(--mono); font-size:11px; letter-spacing:.04em; text-transform:uppercase;
  transition:border-color .16s, color .16s, background .16s;
}
.detail-back:hover{ border-color:var(--gold); color:var(--gold); background:rgba(231,168,58,.1); }
.detail-back .db-ar{ font-size:14px; line-height:1; flex:none; }
.detail-back .db-tx{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* the "← back" + "◎ Explore spot" buttons share one row above a clicked-stop card */
.detail-nav{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:0 0 11px; }
.detail-nav .detail-back{ margin:0; min-width:0; }
.detail-explore .db-ar{ font-size:13px; }
/* the header (nav + name/lines/badges + catchment slider) stays pinned while the body scrolls */
#streets-detail{ padding-top:0; }
.detail-sticky{ position:sticky; top:0; z-index:6; background:var(--ink-2);
  margin:0 -16px; padding:12px 16px 12px;
  box-shadow:0 8px 11px -7px rgba(0,0,0,.5); }
.detail-sticky .d-head{ padding-bottom:0; border-bottom:0; }   /* the sticky block's own shadow separates it */
.detail-sticky .radius-ctl{ margin-top:11px; }
.d-head{ padding:4px 2px 14px; border-bottom:1px solid var(--line); }
.d-name{ font-family:var(--serif); font-weight:600; font-size:23px; line-height:1.05; letter-spacing:-.01em; }
.d-dist{ font-size:11px; color:var(--muted); font-family:var(--mono); margin-top:4px; text-transform:uppercase; letter-spacing:.05em; }
/* key/value rows under a dot card's headline (e.g. a swimming pool's address · centre · phone) */
.d-meta{ margin-top:13px; display:flex; flex-direction:column; gap:8px; }
.d-meta > div{ font-size:12.5px; color:var(--cream-2); line-height:1.35; }
.d-meta > div > span{ display:block; font-family:var(--mono); font-size:9px; text-transform:uppercase;
  letter-spacing:.07em; color:var(--muted-2); margin-bottom:2px; }
.d-meta a{ color:var(--gold); text-decoration:none; }
.d-meta a:hover{ text-decoration:underline; }
.d-fit{ display:flex; align-items:baseline; gap:8px; margin-top:13px; }
.d-fit .big{ font-family:var(--serif); font-weight:900; font-size:38px; line-height:1; }
.d-fit .lab{ font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.08em; font-family:var(--mono); }
.d-metrics{ padding:14px 0 4px; }
.metric{ margin:13px 0; }
.metric-top{ display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.metric-name{ font-size:12.5px; font-weight:600; }
.metric-val{ font-family:var(--mono); font-size:12px; color:var(--gold); }
.metric-val small{ color:var(--muted); font-size:10px; }
.metric-track{ height:6px; border-radius:99px; background:rgba(244,236,224,.1); margin-top:6px; overflow:hidden; }
.metric-track i{ display:block; height:100%; border-radius:99px; transition:width .5s cubic-bezier(.2,.9,.2,1); }
.metric-sub{ font-size:10px; color:var(--muted-2); font-family:var(--mono); margin-top:4px; }
.metric.nodata .metric-val{ color:var(--muted-2); }

/* ===================== LEGEND ===================== */
@keyframes fade{ from{ opacity:0; } }
.legend-row{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.legend-label{ font-size:11.5px; font-weight:600; text-transform:uppercase; letter-spacing:.07em; color:var(--cream-2); }
.legend-scale{ display:flex; align-items:center; gap:7px; font-size:10px; color:var(--muted); font-family:var(--mono); }
.legend-scale .grad{
  width:118px; height:9px; border-radius:99px;
  background:linear-gradient(90deg,#3a4c52,#5f7a6c,#bda468,#e7a83a,#d9532c);
}
.legend-toggle{ display:flex; align-items:center; gap:8px; margin-top:11px; font-size:11.5px; color:var(--cream-2); cursor:pointer; }
.legend-toggle input{ accent-color:var(--teal); width:14px; height:14px; }
.legend-attr{ margin:10px 0 0; font-size:9.5px; color:var(--muted-2); font-family:var(--mono); line-height:1.4; }

/* ===================== TOOLTIP ===================== */
.tooltip{
  position:fixed; z-index:20; pointer-events:none; opacity:0; transform:translate(-50%,-130%);
  padding:7px 12px; border-radius:10px; transition:opacity .12s;
  background:var(--ink); border:1px solid var(--line); box-shadow:var(--shadow-sm);
  font-size:12px; white-space:nowrap;
}
.tooltip.show{ opacity:1; }
.tooltip b{ font-family:var(--serif); font-weight:600; font-size:13px; }
.tooltip .tt-fit{ font-family:var(--mono); color:var(--gold); margin-left:8px; }
/* long type lists (schools): own line under the name, wrapping instead of truncating */
.tooltip .tt-wrap{ display:block; margin-left:0; margin-top:3px; white-space:normal; max-width:300px; line-height:1.5; }

/* ===================== VEIL ===================== */
.veil{ position:fixed; inset:0; z-index:50; display:grid; place-items:center;
  background:#1b1512; transition:opacity .6s, visibility .6s; }
.veil.hide{ opacity:0; visibility:hidden; }
.veil-mark{ display:flex; flex-direction:column; align-items:center; gap:16px; }
.veil-mark .senyera{ width:30px; height:50px; animation:pulse 1.6s infinite; }
.veil-mark p{ font-family:var(--serif); font-style:italic; color:var(--muted); font-size:15px; }

/* ===================== ANIMATIONS ===================== */
@keyframes drop{ from{ opacity:0; transform:translateX(-50%) translateY(-18px); } }
@keyframes slide-l{ from{ opacity:0; transform:translateX(-26px); } }
@keyframes slide-r{ from{ opacity:0; transform:translateX(26px); } }
@keyframes rise{ from{ opacity:0; transform:translateY(14px); } }
@keyframes pulse{ 0%,100%{ opacity:1; } 50%{ opacity:.45; } }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 920px){
  :root{ --rail-w:100vw; --menu-w:42%; }
  .rail{ width:100vw; top:auto; bottom:0; max-height:56vh;
    border-right:none; border-top:1px solid var(--line); border-radius:var(--r) var(--r) 0 0; }
  .railhead-row{ flex-wrap:wrap; }
  .globalsearch{ flex-basis:100%; }   /* search wraps to its own row */
  .topbar-meta{ display:none; }
}

/* mode containers fill the panel so footers stick */
.ctl{ display:flex; flex-direction:column; flex:1; min-height:0; }
.ctl.is-hidden{ display:none; }

/* ===================== STREETS: metric selector ===================== */
.metric-select{ display:flex; flex-direction:column; gap:4px; padding:4px 14px 10px; }
.msel{ display:flex; align-items:center; gap:10px; text-align:left; cursor:pointer;
  font-family:var(--sans); font-size:12.5px; font-weight:600; color:var(--cream-2);
  background:rgba(244,236,224,.04); border:1px solid transparent; border-radius:10px; padding:9px 11px; transition:.15s; }
.msel:hover{ background:rgba(244,236,224,.09); }
.msel.is-active{ border-color:var(--gold); background:rgba(231,168,58,.1); }
.msel .swatch{ width:11px; height:11px; border-radius:3px; flex:none; }
.msel small{ display:block; font-family:var(--mono); font-size:9.5px; color:var(--muted-2); font-weight:400; margin-top:1px; }

/* street search */
.street-search{ padding:6px 14px 10px; margin-top:auto; }
#street-q{ width:100%; font-family:var(--sans); font-size:13px; color:var(--cream);
  background:rgba(244,236,224,.06); border:1px solid var(--line); border-radius:10px; padding:9px 12px; outline:none; }
#street-q:focus{ border-color:var(--gold); }
#street-results{ max-height:172px; overflow-y:auto; margin-top:6px; }
.street-hit{ display:grid; grid-template-columns:1fr auto; gap:8px; align-items:center;
  padding:8px 10px; border-radius:9px; cursor:pointer; font-size:12.5px; }
.street-hit:hover{ background:rgba(244,236,224,.08); }
.street-hit .sh-meta{ font-family:var(--mono); font-size:10px; color:var(--muted); }
.street-hit .sh-li{ font-family:var(--mono); font-size:11px; }

.dotchk{ display:flex; align-items:center; gap:7px; font-size:12px; color:var(--cream-2); cursor:pointer; }
.dotchk input{ accent-color:var(--teal); }

/* category key + stacked mix bar (reuses .metric styles) */
.catkey{ display:flex; flex-wrap:wrap; gap:9px; margin-top:9px; }
.catkey span{ display:flex; align-items:center; gap:5px; font-size:10.5px; color:var(--muted); font-family:var(--mono); }
.catkey i{ width:9px; height:9px; border-radius:50%; }
.mixbar{ display:flex; height:13px; border-radius:99px; overflow:hidden; margin:8px 0 4px; background:rgba(244,236,224,.1); }
.mixbar i{ height:100%; }
.bigstat{ display:flex; gap:18px; margin:14px 0 6px; }
.bigstat .bs{ display:flex; flex-direction:column; }
.bigstat .bs b{ font-family:var(--serif); font-weight:900; font-size:26px; line-height:1; }
.bigstat .bs span{ font-size:9.5px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; font-family:var(--mono); margin-top:3px; }
/* searched-street noise readout (street vs city vs barri) */
.snr-head{ display:flex; justify-content:space-between; gap:8px; margin:16px 0 7px;
  font-family:var(--mono); font-size:9.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
.snr{ display:grid; grid-template-columns:1fr auto 34px 34px; gap:8px; align-items:baseline;
  padding:6px 6px; border-top:1px solid var(--line-2); }
.snr:first-of-type{ border-top:none; }
.snr.is-on{ background:rgba(231,168,58,.1); border-radius:7px; }
.snr-l{ font-size:12.5px; color:var(--cream); }
.snr-v{ font-family:var(--mono); font-size:13px; color:var(--cream); text-align:right; }
.snr-v small{ color:var(--muted); font-size:9px; }
.snr-d{ font-family:var(--mono); font-size:11px; text-align:right; color:var(--muted-2); }
.snr-d .up{ color:var(--terracotta); } .snr-d .down{ color:var(--teal); }

/* ===================== STREETS: per-location metric grid ===================== */
.d-chips{ display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; }
.chip{ font-family:var(--mono); font-size:10px; letter-spacing:.03em; color:var(--muted);
  background:rgba(244,236,224,.06); border:1px solid var(--line); border-radius:999px; padding:4px 10px; }
.chip--teal{ color:var(--teal); border-color:rgba(47,143,147,.4); background:rgba(47,143,147,.1); }
.chip--gold{ color:var(--gold); border-color:rgba(231,168,58,.4); background:rgba(231,168,58,.1); }

/* address catchment-radius slider */
.radius-ctl{ margin:15px 0 2px; padding:11px 13px; border-radius:var(--r-sm);
  background:rgba(231,168,58,.07); border:1px solid rgba(231,168,58,.22); }
.radius-top{ display:flex; align-items:baseline; justify-content:space-between; gap:8px;
  font-family:var(--mono); font-size:9.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
.radius-top b{ font-family:var(--serif); font-size:15px; font-weight:900; color:var(--gold); letter-spacing:0; }
.radius-hint{ text-transform:none; letter-spacing:0; color:var(--muted-2); }
.radius-ctl input[type=range]{ margin:8px 0 0; }

.metric-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:7px; margin:14px 0 4px; }
.metric-grid--in{ margin:0; }
/* "Shops" group — the street's locals (occupied categories + vacant), each shown as a share of all premises */
/* negative side margins (= padding) so the inner tiles stay the SAME size as the main grid,
   while the border/title frame them as a distinct group */
.shops-card{ margin:16px -10px 8px; padding:12px 10px 11px; border:1px solid rgba(231,168,58,.32); border-radius:14px;
  background:rgba(231,168,58,.045); box-shadow:0 8px 20px -12px rgba(0,0,0,.55); }
.shops-head{ display:flex; align-items:baseline; justify-content:space-between; gap:8px;
  padding:0 2px 10px; margin-bottom:11px; border-bottom:1px solid rgba(231,168,58,.22); }
.sc-title{ font-family:var(--serif); font-weight:700; font-size:17.5px; color:var(--gold); letter-spacing:.005em; }
.sc-sub{ font-family:var(--mono); font-size:10px; color:var(--muted); }
.chip-grp{ display:inline-flex; align-items:center; gap:4px; }
.infodot{ display:inline-flex; align-items:center; justify-content:center; width:14px; height:14px; padding:0;
  border-radius:50%; border:1px solid currentColor; background:none; color:var(--teal); opacity:.75;
  font:italic 700 8.5px/1 var(--mono); cursor:pointer; transition:.15s; }
.infodot:hover{ opacity:1; background:rgba(47,143,147,.16); }
.info-note{ margin-top:10px; font-size:11px; line-height:1.5; color:var(--cream-2);
  background:rgba(244,236,224,.05); border:1px solid var(--line-2); border-radius:9px; padding:9px 11px; }
.info-note b{ color:var(--gold); font-weight:600; }
.mtile{ position:relative; display:flex; flex-direction:column; align-items:flex-start; min-width:0;
  padding:10px 10px 9px; border-radius:11px; cursor:pointer;
  background:rgba(244,236,224,.04); border:1px solid var(--line-2); transition:.16s;
  animation:rise .45s both; }
.mtile:hover{ background:rgba(244,236,224,.07); border-color:var(--line);
  border-color:color-mix(in srgb, var(--gl) 42%, var(--line)); }
/* selected (its map layer is shown) — glow in the layer's own colour */
.mtile.is-on{ border-color:var(--gl); background:rgba(244,236,224,.06);
  box-shadow:0 0 0 1px var(--gl), 0 0 14px -4px var(--gl); }
.mtile.is-on::after{ content:""; position:absolute; top:9px; right:9px; width:6px; height:6px; border-radius:50%;
  background:var(--gl); box-shadow:0 0 6px var(--gl); }
.mt-gear{ position:absolute; top:7px; right:7px; width:21px; height:21px; border-radius:6px; z-index:2;
  display:flex; align-items:center; justify-content:center; font-size:11px; line-height:1; color:var(--gold);
  background:rgba(27,21,18,.55); border:1px solid var(--line); cursor:pointer; transition:.15s; }
.mt-gear:hover{ background:rgba(231,168,58,.25); border-color:rgba(231,168,58,.55); color:var(--cream); }
.mtile:has(.mt-gear).is-on::after{ display:none; }   /* gear occupies the corner; glow border already signals "on" */
/* icon lives in a small tinted chip (tile accent --gl) so it reads instantly */
.mt-ic{ display:inline-flex; align-items:center; justify-content:center; width:27px; height:27px; flex:none;
  margin-bottom:8px; border-radius:8px; color:var(--gl);
  background:rgba(244,236,224,.05); background:color-mix(in srgb, var(--gl) 16%, transparent);
  border:1px solid var(--line-2); border-color:color-mix(in srgb, var(--gl) 30%, transparent); }
.mt-ic svg{ width:16px; height:16px; display:block; }
/* value + inline percentage (the % rendered after the number, in the tile's accent colour) */
.mt-valrow{ display:flex; align-items:baseline; gap:5px; min-width:0; max-width:100%; }
.mt-val{ font-family:var(--serif); font-weight:900; font-size:21px; line-height:1; color:var(--cream); }
.mt-val small{ font-family:var(--mono); font-weight:400; font-size:9px; color:var(--muted); }
.mt-pct{ font-family:var(--mono); font-weight:500; font-size:12px; line-height:1; color:var(--gl); }
.mt-wait{ color:var(--muted-2); }
.mt-lab{ font-size:11px; font-weight:600; color:var(--cream-2); line-height:1.15; margin-top:5px; }
.mt-sub{ font-family:var(--mono); font-size:9.5px; color:var(--muted); line-height:1.25; margin-top:2px;
  max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* "Tourists" group — flats + hotels, plus how this street ranks (percentile) vs its barri & the city.
   Same framed-section shell as .shops-card, tinted with the tourist-flat purple. */
.tour-card{ margin:16px -10px 8px; padding:12px 10px 11px; border-radius:14px;
  border:1px solid color-mix(in srgb, #8a4fb3 38%, transparent); background:rgba(138,79,179,.05);
  box-shadow:0 8px 20px -12px rgba(0,0,0,.55); }
.tour-head{ border-bottom-color:rgba(138,79,179,.26); }
.tour-head .sc-title{ color:#bb93dc; }
.tour-tiles{ grid-template-columns:repeat(2,1fr); }
.tour-bars{ margin-top:13px; display:flex; flex-direction:column; gap:12px; }
.tour-metric{ display:flex; flex-direction:column; gap:5px; }
.tm-head{ display:flex; align-items:baseline; justify-content:space-between; gap:8px; }
.tm-lab2{ font-size:11.5px; font-weight:600; color:var(--cream-2); }
.tm-meta{ font-family:var(--mono); font-size:9px; color:var(--muted); }
.tm-row{ display:flex; align-items:center; gap:8px; }
.tm-cmp{ flex:none; width:66px; font-family:var(--mono); font-size:9.5px; color:var(--muted);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tm-track{ position:relative; flex:1; height:6px; border-radius:99px; background:rgba(244,236,224,.1); }
.tm-track i{ display:block; height:100%; border-radius:99px; transition:width .55s cubic-bezier(.2,.9,.2,1); }
/* tick marking the Barcelona average (location quotient = 1×) on each track */
.tm-track .tm-tick{ position:absolute; top:-2px; bottom:-2px; width:1.5px; transform:translateX(-50%);
  background:rgba(244,236,224,.5); border-radius:2px; }
.tm-pct{ flex:none; width:34px; text-align:right; font-family:var(--mono); font-size:10px; color:var(--cream-2); }
.tour-foot{ margin-top:11px; font-family:var(--mono); font-size:9px; color:var(--muted); line-height:1.5; }
.tour-foot b{ color:var(--cream-2); font-weight:500; }
/* inline glyph mirroring the on-track tick, used in the caption legend */
.tm-tickk{ display:inline-block; width:1.5px; height:8px; vertical-align:-1px; margin:0 1px;
  background:rgba(244,236,224,.6); border-radius:2px; }

/* "Transport" group — bus / metro+FGC / train. Same framed shell as the other
   group cards, tinted transit-blue. Defined after .tour-card so it overrides it. */
.transport-card{ border:1px solid color-mix(in srgb,#1f6feb 36%,transparent); background:rgba(31,111,235,.05); }
.transport-head{ border-bottom-color:rgba(31,111,235,.24); }
.transport-head .sc-title{ color:#86b4f7; }

/* line badges — the routes serving a stop, at a glance. Metro lines wear their
   official colour (passed inline); bus lines stay neutral. */
.line-chips{ display:inline-flex; flex-wrap:wrap; gap:3px; vertical-align:middle; }
.lchip{ font-family:var(--mono); font-style:normal; font-weight:700; font-size:9.5px; line-height:1;
  padding:2px 4px; border-radius:4px; color:var(--cream-2);
  background:rgba(244,236,224,.08); border:1px solid var(--line); white-space:nowrap; }
.lchip--more{ font-weight:500; color:var(--muted); background:none; }
/* lines block + amenity note in the per-stop detail card */
.tlines{ margin-top:13px; }
.tlines-h{ font-family:var(--mono); font-size:9.5px; text-transform:uppercase; letter-spacing:.06em;
  color:var(--muted); margin-bottom:7px; }
.tlines-row{ display:flex; flex-wrap:wrap; gap:5px; }
.tlines .lchip{ font-size:11.5px; padding:3px 7px; border-radius:6px; }
.tl-note{ margin-top:11px; display:flex; align-items:center; gap:7px;
  font-family:var(--mono); font-size:10.5px; color:var(--cream-2); }
.tl-ic{ display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; flex:none;
  border-radius:5px; background:rgba(244,236,224,.07); border:1px solid var(--line-2); font-size:10px; }

/* line chips that double as a filter (click to isolate one line) */
.lfilt{ cursor:pointer; font:inherit; line-height:1; -webkit-appearance:none; appearance:none;
  transition:opacity .12s ease, background .12s ease, color .12s ease; }
.lfilt.is-dim{ opacity:.45; }
.lfilt:hover{ opacity:1; filter:brightness(1.12); }

/* ordered stop list for the clicked stop's line(s) — fills the detail panel */
.line-stops{ margin-top:6px; }
.ls-line{ margin-top:18px; }
.ls-head{ display:flex; align-items:center; gap:8px; margin-bottom:10px;
  border-top:1px solid var(--line); padding-top:14px; }
.ls-head .lchip{ font-size:11.5px; padding:3px 7px; border-radius:6px; }
.ls-count{ font-family:var(--mono); font-size:9.5px; text-transform:uppercase; letter-spacing:.07em; color:var(--muted); }
.ls-list{ list-style:none; margin:0; padding:0 5px 0 5px; position:relative; }
.ls-stop{ position:relative; display:flex; align-items:center; gap:10px; padding:4px 0 4px 16px;
  font-family:var(--sans); font-size:12.5px; color:var(--cream-2); cursor:pointer; line-height:1.3; }
.ls-stop::before{ content:""; position:absolute; left:3px; top:0; bottom:0; width:2px;   /* the running line */
  background:color-mix(in srgb, var(--ls-col) 55%, transparent); }
.ls-stop:first-child::before{ top:50%; }
.ls-stop:last-child::before{ bottom:50%; }
.ls-dot{ position:absolute; left:-1px; top:50%; transform:translateY(-50%); width:9px; height:9px; flex:none;
  border-radius:50%; box-shadow:0 0 0 2px var(--panel,#241c17); z-index:1; }
.ls-nm{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ls-stop:hover .ls-nm{ color:#fff; }
/* the stop you're on: tinted pill row, a bigger solid-ring dot, and a "you are here" tag */
.ls-stop.is-here{ background:color-mix(in srgb,var(--ls-col) 22%,transparent); border-radius:9px;
  padding:7px 9px 7px 16px; margin:3px 0;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ls-col) 55%,transparent); }
.ls-stop.is-here .ls-nm{ font-weight:800; color:#fff; font-size:13.5px; letter-spacing:.005em; }
.ls-stop.is-here .ls-dot{ width:15px; height:15px; left:-4px;
  box-shadow:0 0 0 2.5px var(--panel,#241c17),0 0 0 5px var(--ls-col); }
.ls-here{ margin-left:auto; flex:none; font-family:var(--mono); font-size:8px; font-weight:700;
  text-transform:uppercase; letter-spacing:.09em; color:#fff; background:var(--ls-col);
  padding:3px 7px; border-radius:99px; white-space:nowrap; }

/* per-premise business timeline */
.tl-loading{ font-size:11.5px; color:var(--muted-2); font-style:italic; font-family:var(--serif); margin-top:12px; }
.tl-head{ display:flex; justify-content:space-between; align-items:baseline; gap:8px; margin:16px 0 8px;
  font-family:var(--mono); font-size:9.5px; text-transform:uppercase; letter-spacing:.07em; color:var(--muted); }
.tl-head .tl-ch{ color:var(--gold); text-transform:none; letter-spacing:0; font-size:11px; white-space:nowrap; }
.tl-row{ display:grid; grid-template-columns:40px 1fr; gap:10px; align-items:baseline;
  padding:6px 0; border-top:1px solid var(--line-2); }
.tl-row:first-of-type{ border-top:none; }
.tl-yr{ font-family:var(--mono); font-size:11px; color:var(--gold); }
.tl-lab{ font-size:12.5px; color:var(--cream); line-height:1.25; }
.tl-lab.tl-vac{ color:var(--muted-2); font-style:italic; }

.d-badges{ display:flex; flex-wrap:wrap; gap:6px; margin-top:11px; }
.d-badges span{ font-family:var(--mono); font-size:9px; text-transform:uppercase; letter-spacing:.05em;
  color:var(--cream-2); background:rgba(244,236,224,.08); border:1px solid var(--line); border-radius:999px; padding:3px 9px; }
.delta{ font-family:var(--mono); font-size:12px; }
.delta.up{ color:var(--terracotta); }
.delta.down{ color:var(--teal); }

#legend-streets .legend-grad{ width:118px; height:9px; border-radius:99px; }
#legend-streets.is-hidden{ display:none; }

/* noise time-of-day selector (shown in the legend when Noise is active) */
.noise-metrics{ display:flex; gap:5px; margin-top:10px; }
.nm-btn{ font-family:var(--sans); font-size:10.5px; font-weight:600; color:var(--cream-2);
  background:rgba(244,236,224,.06); border:1px solid var(--line); border-radius:999px;
  padding:4px 10px; cursor:pointer; transition:.15s; }
.nm-btn:hover{ border-color:var(--gold); color:var(--gold); }
.nm-btn.is-on{ background:var(--gold); color:var(--ink); border-color:var(--gold); }

/* ===================== GLOBAL SEARCH (under banner) ===================== */
.globalsearch{ position:relative; flex:1 1 230px; min-width:120px; }
#global-q{ width:100%; font-family:var(--sans); font-size:13px; color:var(--cream);
  background:rgba(244,236,224,.07); border:1px solid var(--line);
  border-radius:999px; padding:9px 16px; outline:none; }
#global-q:focus{ border-color:var(--gold); background:rgba(244,236,224,.1); }
#global-q::placeholder{ color:var(--muted-2); }
#global-results{ position:absolute; top:calc(100% + 9px); left:0; right:0; z-index:10;
  background:rgba(27,21,18,.97); backdrop-filter:blur(12px);
  border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); overflow:hidden; display:none; padding:5px; }
#global-results.show{ display:block; }

/* ----- mini search bars (layer filter · neighbourhood finder) ----- */
.minisearch{ position:relative; margin:2px 7px 4px; flex:0 0 auto; }
.minisearch input{ width:100%; font-family:var(--sans); font-size:12px; color:var(--cream);
  background:rgba(244,236,224,.06); border:1px solid var(--line);
  border-radius:999px; padding:6px 26px 6px 12px; outline:none; transition:.15s; }
.minisearch input:focus{ border-color:var(--gold); background:rgba(244,236,224,.09); }
.minisearch input::placeholder{ color:var(--muted-2); }
.minisearch .ms-x{ position:absolute; right:6px; top:50%; transform:translateY(-50%);
  width:18px; height:18px; line-height:16px; border-radius:50%; border:none; cursor:pointer;
  font-size:13px; color:var(--ink); background:var(--gold); padding:0; }
.ms-rank{ margin:0 0 8px; }
.ms-note{ font-family:var(--sans); font-size:11.5px; color:var(--muted); padding:4px 10px 8px; }
/* head + neighbourhood finder stay pinned while the ranking scrolls; sized so this
   input lines up exactly with the "Filter layers…" input (menu-head 46px + 2px margin) */
#streets-rank{ padding-top:0; }
.menu .minisearch{ margin-top:12px; }   /* both columns lead with their search bar, same offset */
.rank-sticky{ position:sticky; top:0; z-index:7; background:var(--ink-2);
  margin:0 -16px 8px; padding:12px 16px 8px;
  box-shadow:0 8px 11px -7px rgba(0,0,0,.5); }
.rank-sticky .rank-head{ align-items:center; padding:9px 2px 0; }
.rank-sticky .ms-rank{ margin:0; }
/* autocomplete suggestions under the neighbourhood finder */
.ms-sugg{ position:absolute; top:calc(100% + 6px); left:0; right:0; z-index:12;
  background:rgba(27,21,18,.97); backdrop-filter:blur(12px);
  border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow);
  display:none; padding:4px; max-height:250px; overflow-y:auto; }
.ms-sugg.show{ display:block; }
.ms-sugg .sg-item{ display:flex; justify-content:space-between; align-items:baseline; gap:10px;
  padding:7px 10px; border-radius:8px; cursor:pointer; font-size:12.5px; color:var(--cream); }
.ms-sugg .sg-item:hover{ background:rgba(231,168,58,.14); }
.ms-sugg .sg-d{ font-family:var(--mono); font-size:10px; color:var(--muted); flex:none; }

/* ===================== LAYER CARDS (multi-select) ===================== */
.layer-cards{ display:flex; flex-direction:column; gap:4px; padding:5px 7px 8px; overflow-y:auto; flex:1; min-height:0; }

/* scroll without a visible scrollbar (reclaims the wasted gutter) */
.layer-cards, .tab-body, .sliders, .modal-list, #global-results, #street-results{
  scrollbar-width:none; -ms-overflow-style:none;
}
.layer-cards::-webkit-scrollbar, .tab-body::-webkit-scrollbar, .sliders::-webkit-scrollbar,
.modal-list::-webkit-scrollbar, #global-results::-webkit-scrollbar, #street-results::-webkit-scrollbar{
  width:0; height:0; display:none;
}
/* thematic section header between card groups (and the ★ Favourites strip) */
.lc-group{ display:flex; align-items:baseline; justify-content:space-between; gap:8px;
  padding:10px 4px 4px; margin-top:3px; border-bottom:1px solid var(--line);
  font-family:var(--mono); font-size:9.5px; font-weight:700; letter-spacing:.09em; text-transform:uppercase;
  color:var(--muted-2); }
.lc-group:first-child{ margin-top:0; }
.lc-group-n{ font-weight:600; letter-spacing:0; opacity:.55; }
.lc-group.is-fav{ color:var(--gold); border-bottom-color:rgba(231,168,58,.4); }
.lc-group.is-fav .lc-group-n{ color:var(--gold); opacity:.75; }
.lcard{ display:flex; align-items:center; gap:8px; text-align:left; cursor:pointer; font-family:var(--sans);
  background:rgba(244,236,224,.04); border:1px solid transparent; border-radius:9px; padding:7px 9px; transition:.15s; }
.lcard.is-soon{ opacity:.5; cursor:default; }
.lcard.is-soon:hover{ background:rgba(244,236,224,.04); }
.lcard.is-soon .lc-check{ opacity:1; color:var(--muted-2); font-size:8.5px; font-weight:600;
  font-family:var(--mono); text-transform:uppercase; letter-spacing:.06em; }
.lcard:hover{ background:rgba(244,236,224,.09); }
.lcard.is-on{ border-color:var(--gold); background:rgba(231,168,58,.1); }
.lcard .lc-emoji{ flex:none; display:flex; align-items:center; justify-content:center; }
.lcard .lc-emoji img{ width:30px; height:30px; display:block; }
.lc-txt{ flex:1; font-size:12.5px; font-weight:600; color:var(--cream); }
.lc-txt small{ display:block; font-family:var(--mono); font-size:9.5px; color:var(--muted-2); font-weight:400; margin-top:1px; }
.lc-check{ opacity:0; color:var(--gold); font-weight:700; transition:.15s; }
.lcard.is-on .lc-check{ opacity:1; }

/* right rail of a card: ♥ + data-vintage chip on top, ✓ (+ incidents ⚙) in the bottom corner */
.lc-side{ flex:none; align-self:stretch; display:flex; flex-direction:column;
  align-items:flex-end; justify-content:space-between; gap:4px; }
.lc-top{ display:inline-flex; align-items:center; gap:6px; }
/* ♥ favourite toggle — sits in the top-right corner; faint until hovered, rose when on */
.lc-fav{ cursor:pointer; font-size:14px; line-height:1; color:var(--muted-2); opacity:.4;
  transition:transform .15s, color .15s, opacity .15s; -webkit-user-select:none; user-select:none; }
.lcard:hover .lc-fav{ opacity:.7; }
.lc-fav:hover{ opacity:1; color:#ff7a93; transform:scale(1.18); }
.lc-fav.on{ opacity:1; color:#ff5e7e; text-shadow:0 0 8px rgba(255,94,126,.55); }
.lc-fav.on:hover{ color:#ff8099; }
.lc-corner{ display:inline-flex; align-items:center; gap:7px; }
.lc-yr{ display:inline-flex; align-items:center; gap:3px; cursor:pointer; line-height:1;
  font-family:var(--mono); font-size:9.5px; letter-spacing:.02em; font-weight:600;
  color:var(--gold); padding:2.5px 5px; border-radius:999px;
  background:rgba(231,168,58,.13); border:1px solid rgba(231,168,58,.4);
  box-shadow:0 0 7px rgba(231,168,58,.28); transition:.15s; }
.lc-yr:hover{ color:#ffd98a; border-color:rgba(231,168,58,.85);
  background:rgba(231,168,58,.24); box-shadow:0 0 11px rgba(231,168,58,.55); }
.lc-i{ font-style:normal; width:12px; height:12px; border-radius:50%; border:1px solid currentColor;
  display:inline-flex; align-items:center; justify-content:center; font-size:8.5px; font-weight:700; }

/* gear → opens the incident-type filter (only when that layer is on) */
.lc-gear{ flex:none; width:23px; height:23px; border-radius:7px; display:none;
  align-items:center; justify-content:center; cursor:pointer; font-size:13px; line-height:1;
  color:var(--gold); background:rgba(244,236,224,.08); border:1px solid var(--line); transition:.15s; }
.lcard.is-on .lc-gear{ display:inline-flex; }
.lc-gear:hover{ background:rgba(231,168,58,.22); border-color:rgba(231,168,58,.5); }

/* ===================== MODAL (incident-type filter) ===================== */
.modal-veil{ position:fixed; inset:0; z-index:60; display:none; place-items:center;
  background:rgba(15,11,8,.62); backdrop-filter:blur(3px); animation:fade .2s both; }
.modal-veil.show{ display:grid; }
.modal{ width:min(440px, calc(100vw - 32px)); max-height:min(78vh, 660px);
  display:flex; flex-direction:column; color:var(--cream);
  background:linear-gradient(168deg, rgba(44,35,28,.98), rgba(23,17,13,.99));
  border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow); overflow:hidden; }
.modal-head{ padding:16px 20px 12px; border-bottom:1px solid var(--line);
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.modal-head h3{ font-family:var(--serif); font-weight:600; font-size:18px; margin:0; }
.modal-x{ flex:none; background:none; border:none; color:var(--muted); font-size:24px; line-height:.8; cursor:pointer; padding:0 2px; }
.modal-x:hover{ color:var(--cream); }
.modal-search{ padding:10px 18px; border-bottom:1px solid var(--line-2); }
#inc-search{ width:100%; font-family:var(--sans); font-size:12.5px; color:var(--cream);
  background:rgba(244,236,224,.06); border:1px solid var(--line); border-radius:9px; padding:8px 12px; outline:none; }
#inc-search:focus{ border-color:var(--gold); }
#inc-search::placeholder{ color:var(--muted-2); }
.modal-tools{ display:flex; align-items:center; gap:8px; padding:10px 20px; border-bottom:1px solid var(--line-2); }
.modal-tools button{ font-family:var(--sans); font-size:11.5px; font-weight:600; color:var(--cream-2);
  background:rgba(244,236,224,.06); border:1px solid var(--line); padding:5px 13px; border-radius:999px; cursor:pointer; transition:.15s; }
.modal-tools button:hover{ border-color:var(--gold); color:var(--gold); }
.modal-list{ overflow-y:auto; padding:8px 12px 14px; }
.inc-row{ display:flex; align-items:center; gap:10px; padding:7px 9px; border-radius:8px; cursor:pointer; }
.inc-row:hover{ background:rgba(244,236,224,.06); }
.inc-row input{ accent-color:var(--terracotta); width:15px; height:15px; flex:none; cursor:pointer; }
.inc-row span{ font-size:12.5px; color:var(--cream-2); }
.inc-row .inc-c{ margin-left:auto; font-family:var(--mono); font-size:10.5px; color:var(--muted); }
.sch-grp{ margin:10px 9px 4px; font-family:var(--mono); font-size:10px; letter-spacing:.12em;
  text-transform:uppercase; color:var(--muted); }
.sch-grp:first-child{ margin-top:4px; }

/* ===================== AFFORDABILITY: budget filter ===================== */
.budget-bar{ display:flex; flex-wrap:wrap; align-items:center; gap:7px 10px; margin:2px 2px 10px; padding:9px 11px;
  background:rgba(176,67,107,.08); border:1px solid rgba(176,67,107,.28); border-radius:var(--r-sm); }
.bq-wrap{ display:inline-flex; align-items:center; gap:3px; background:rgba(244,236,224,.06);
  border:1px solid var(--line); border-radius:9px; padding:5px 9px; }
.bq-cur{ font-family:var(--mono); font-size:13px; color:var(--muted); }
#budget-q{ width:62px; font-family:var(--mono); font-size:14px; font-weight:500; color:var(--cream);
  background:none; border:none; outline:none; -moz-appearance:textfield; }
#budget-q::-webkit-outer-spin-button, #budget-q::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
#budget-q::placeholder{ color:var(--muted-2); }
.bq-unit{ font-family:var(--mono); font-size:11px; color:var(--muted); }
.bq-x{ background:none; border:none; color:var(--muted); font-size:16px; line-height:.7; cursor:pointer; padding:0 1px 0 3px; }
.bq-x:hover{ color:var(--terracotta); }
.bq-hint{ font-family:var(--sans); font-size:11px; color:var(--muted); flex:1 1 100%; }
.budget-tag{ display:block; font-family:var(--mono); font-size:10px; font-weight:600; margin-bottom:2px; }
.bt-in{ color:#54c688; }
.bt-over{ color:var(--terracotta); }
.bt-ok{ color:var(--gold); }
.bt-warn{ color:#e0813a; }
.rd-flag, .cmp-flag{ color:#c98a5a; font-style:italic; }

/* ===================== COMMUTE reachability ===================== */
.commute-panel{ margin:6px 2px 8px; padding:9px 11px; background:rgba(47,143,147,.09);
  border:1px solid rgba(47,143,147,.30); border-radius:var(--r-sm); display:flex; flex-direction:column; gap:7px; }
.cm-row{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.cm-lab{ font-family:var(--mono); font-size:10px; letter-spacing:.08em; text-transform:uppercase; color:var(--teal); }
.cm-modes{ display:inline-flex; gap:4px; margin-left:auto; }
.cm-mode{ font-family:var(--sans); font-size:11px; font-weight:600; color:var(--cream-2); background:rgba(244,236,224,.06);
  border:1px solid var(--line); border-radius:99px; padding:4px 11px; cursor:pointer; transition:.15s; }
.cm-mode:hover{ border-color:var(--teal); color:var(--teal); }
.cm-mode.is-on{ background:var(--teal); color:#0c1a1a; border-color:var(--teal); }
#cm-mins{ flex:1; min-width:80px; accent-color:var(--teal); }
.cm-mins{ font-family:var(--mono); font-size:11px; color:var(--cream-2); min-width:44px; }
.cm-set{ font-family:var(--sans); font-size:11px; font-weight:600; color:#0c1a1a; background:var(--teal);
  border:1px solid var(--teal); border-radius:99px; padding:4px 11px; cursor:pointer; transition:.15s; }
.cm-set:hover{ background:#37a3a8; box-shadow:0 0 0 3px rgba(47,143,147,.22); }
.cm-clear{ background:none; border:none; color:var(--muted); font-size:11px; cursor:pointer; text-decoration:underline; }
.cm-clear:hover{ color:var(--terracotta); }
.cm-sum{ font-family:var(--sans); font-size:11.5px; color:var(--cream-2); line-height:1.4; }
.cm-sum b{ color:var(--cream); }
.cm-err{ color:var(--terracotta); }
.cm-filter{ display:flex; align-items:center; gap:7px; font-size:11.5px; color:var(--cream-2); cursor:pointer; }
.cm-filter input{ accent-color:var(--teal); width:14px; height:14px; }
.cm-key{ display:flex; align-items:center; gap:8px; }
.cm-key input{ flex:1; min-width:0; font-family:var(--sans); font-size:11px; color:var(--cream);
  background:rgba(244,236,224,.06); border:1px solid var(--line); border-radius:8px; padding:6px 9px; outline:none; }
.cm-key input:focus{ border-color:var(--teal); }
.cm-key a{ font-family:var(--mono); font-size:10.5px; color:var(--teal); white-space:nowrap; }
.cm-reach{ color:var(--teal); font-style:normal; }
.st-cmp-row{ display:flex; gap:8px; margin-top:10px; }
.st-cmp-add{ font-family:var(--sans); font-size:11.5px; font-weight:600; color:var(--cream-2);
  background:rgba(244,236,224,.06); border:1px solid var(--line); border-radius:99px; padding:5px 13px; cursor:pointer; transition:.15s; }
.st-cmp-add:hover{ border-color:var(--teal); color:var(--teal); }
.st-cmp-add.is-on{ background:#3fae73; color:#0c1a1a; border-color:#2f8f5b; }
.st-cmp-add.shake{ animation:cmpshake .42s; }
.cmpa-rad{ display:flex; align-items:center; gap:10px; margin:2px 2px 12px; padding:8px 11px;
  background:rgba(47,143,147,.09); border:1px solid rgba(47,143,147,.28); border-radius:var(--r-sm); }
.cmpa-rad span{ font-family:var(--mono); font-size:11px; color:var(--cream-2); white-space:nowrap; }
.cmpa-rad b{ color:var(--teal); }
#cmpa-r{ flex:1; accent-color:var(--teal); }

/* ===================== COMPARE: select + tray ===================== */
.rank-item{ position:relative; }
.cmp-add{ position:absolute; top:6px; right:7px; z-index:2; width:19px; height:19px; border-radius:50%; padding:0;
  display:grid; place-items:center; font-family:var(--sans); font-size:13px; font-weight:700; line-height:1;
  color:var(--muted-2); background:rgba(244,236,224,.06); border:1px solid var(--line); cursor:pointer; opacity:.45; transition:.14s; }
.rank-item:hover .cmp-add{ opacity:1; }
.cmp-add:hover{ color:var(--gold); border-color:var(--gold); background:rgba(231,168,58,.16); transform:scale(1.12); }
.cmp-add.is-on{ opacity:1; color:#13201a; background:#3fae73; border-color:#2f8f5b; font-weight:800; }
.cmp-add.shake{ animation:cmpshake .42s; }
@keyframes cmpshake{ 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-3px)} 40%,80%{transform:translateX(3px)} }
.cmp-tray{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:6px 2px 8px; padding:8px 9px;
  background:rgba(231,168,58,.07); border:1px solid rgba(231,168,58,.22); border-radius:var(--r-sm); }
.cmp-chips{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; flex:1; }
.cmp-lab{ font-family:var(--mono); font-size:10px; letter-spacing:.08em; text-transform:uppercase; color:var(--gold); }
.cmp-chip{ display:inline-flex; align-items:center; gap:4px; font-size:11.5px; color:var(--cream-2);
  background:rgba(244,236,224,.07); border:1px solid var(--line); border-radius:99px; padding:3px 5px 3px 10px; }
.cmp-chip button{ background:none; border:none; color:var(--muted); font-size:11px; line-height:.8; cursor:pointer; padding:0 2px; }
.cmp-chip button:hover{ color:var(--terracotta); }
.cmp-go{ font-family:var(--mono); font-size:10.5px; letter-spacing:.04em; text-transform:uppercase; font-weight:600;
  color:#13201a; background:var(--gold); border:1px solid var(--gold); border-radius:99px; padding:5px 12px; cursor:pointer; transition:.15s; }
.cmp-go:hover:not(:disabled){ background:#f0b94e; box-shadow:0 0 0 3px rgba(231,168,58,.22); }
.cmp-go:disabled{ opacity:.4; cursor:not-allowed; background:transparent; color:var(--muted); }

/* ===================== COMPARE: side-by-side table ===================== */
.modal-wide{ width:min(860px, calc(100vw - 28px)); }
.cmp-grid{ display:grid; grid-template-columns:minmax(104px,1.15fr) repeat(var(--cols,2), minmax(82px,1fr)); }
.cmp-corner{ position:sticky; top:0; background:rgba(28,21,16,.99); }
.cmp-col{ padding:8px 8px 10px; text-align:center; border-bottom:1px solid var(--line);
  position:sticky; top:0; background:linear-gradient(168deg, rgba(42,33,26,.99), rgba(28,21,16,.99)); }
.cmp-col .cc-name{ display:block; font-family:var(--serif); font-weight:600; font-size:13.5px; color:var(--cream); line-height:1.15; }
.cmp-col small{ font-family:var(--mono); font-size:9.5px; color:var(--muted); }
.cmp-grouphead{ grid-column:1/-1; font-family:var(--mono); font-size:10px; letter-spacing:.12em; text-transform:uppercase;
  color:var(--gold); padding:12px 6px 5px; }
.cmp-metric{ display:flex; align-items:center; gap:7px; font-size:11.5px; color:var(--cream-2);
  padding:8px 4px 8px 2px; border-bottom:1px solid var(--line-2); }
.cmp-dot{ width:8px; height:8px; border-radius:50%; flex:none; }
.cmp-cell{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px;
  padding:8px 6px; border-bottom:1px solid var(--line-2); border-left:1px solid var(--line-2); }
.cmp-cell .cc-val{ font-family:var(--mono); font-size:12.5px; color:var(--cream); }
.cmp-cell .cc-bar{ width:100%; max-width:60px; height:4px; border-radius:99px; background:rgba(244,236,224,.1); overflow:hidden; }
.cmp-cell .cc-bar i{ display:block; height:100%; border-radius:99px; }
.cmp-cell.is-best{ background:rgba(231,168,58,.13); }
.cmp-cell.is-best .cc-val{ color:var(--gold); font-weight:600; }
.cmp-cell.is-best .cc-val::after{ content:" ◆"; font-size:8px; vertical-align:middle; }
.cmp-foot{ font-family:var(--sans); font-size:11px; color:var(--muted); padding:11px 4px 2px; line-height:1.45; }

