:root {
  --bg: #0D0D0E;
  --bg-2: #111113;
  --card: #18181A;
  --card-2: #1F1F22;
  --line: #2A2A2E;
  --line-2: #34343A;
  --text: #ECE8E1;
  --muted: #9A968F;
  --dim: #6F6B65;
  --gold: #C9A55C;
  --gold-2: #E2C27E;
  --gold-soft: rgba(201, 165, 92, .13);
  --ok: #4CAF7A;
  --low: #E0A93B;
  --full: #D9534F;
  --flat: #4FA3E0;
  --hostel: #8E7CF0;
  --own: #5BC0BE;
  --s-on_way: #E0A93B;
  --s-arrived: #4FA3E0;
  --s-living: #4CAF7A;
  --s-leaving: #C77DDB;
  --s-left: #7A7772;
  --s-seeking: #E06A5A;
  --panel-w: 400px;
  --radius: 14px;
  --serif: "Noto Serif", Georgia, serif;
  --sans: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 var(--sans);
  display: flex; flex-direction: column; overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg:not(.leaflet-zoom-animated):not(.leaflet-zoom-hide) { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 18px;
  background: linear-gradient(180deg, #121214, var(--bg));
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 0; text-align: left; }
.logo {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: radial-gradient(120% 120% at 0% 0%, rgba(226,194,126,.28), rgba(201,165,92,.08));
  color: var(--gold); border: 1px solid rgba(201,165,92,.35);
  box-shadow: 0 0 24px rgba(201,165,92,.12);
}
.logo svg { width: 22px; height: 22px; stroke: none; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font: 700 20px/1.1 var(--serif); letter-spacing: .2px; }
.brand-name::first-letter { color: var(--gold); }
.sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.stats { display: flex; gap: 8px; margin-left: auto; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 7px 14px; min-width: 104px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  transition: border-color .15s, background .15s, transform .1s;
}
.stat:hover { border-color: var(--line-2); background: var(--card-2); }
.stat:active { transform: scale(.98); }
.stat b { font: 600 20px/1.1 var(--serif); color: var(--gold); }
.stat span { font-size: 11.5px; color: var(--muted); }
.stat.active { border-color: var(--gold); background: var(--gold-soft); }
.stat[data-stat="on_way"] b { color: var(--s-on_way); }
.stat[data-stat="free"] b { color: var(--ok); }
.stat[data-stat="own"] b { color: var(--own); }

.lang { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.lang button { background: transparent; border: 0; padding: 5px 10px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.lang button.active { background: var(--gold); color: #141414; }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 18px 6px; background: var(--bg);
}
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 0 8px 0 12px; height: 38px; flex: 0 1 300px; min-width: 200px;
  color: var(--muted);
}
.search:focus-within { border-color: var(--gold); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; height: 100%; color: var(--text); }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear { background: var(--line); border: 0; width: 22px; height: 22px; border-radius: 50%; color: var(--text); line-height: 1; font-size: 15px; }
.select-wrap { position: relative; }
.select-wrap::after { content: ""; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.select-wrap select {
  appearance: none; -webkit-appearance: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  height: 38px; padding: 0 34px 0 12px; outline: none; min-width: 190px;
}
.select-wrap select:focus { border-color: var(--gold); }
.select-wrap option { background: var(--card); }

.switch { display: flex; align-items: center; gap: 9px; color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 36px; height: 20px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch .thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #cfcac2; transition: transform .15s, background .15s; }
.switch input:checked + .track { background: var(--gold); }
.switch input:checked + .track .thumb { transform: translateX(16px); background: #141414; }
.switch input:focus-visible + .track { outline: 2px solid var(--gold); outline-offset: 2px; }
.switch:hover { color: var(--text); }

.ghost {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 1px solid var(--line); border-radius: 10px; height: 38px; padding: 0 14px; color: var(--muted);
}
.ghost:hover { border-color: var(--gold); color: var(--gold); }

.chips { display: flex; gap: 6px; padding: 4px 18px 10px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 8px 5px 12px; font-size: 12.5px; color: var(--muted);
  transition: border-color .15s, color .15s, background .15s;
}
.chip em { font-style: normal; background: var(--bg); border-radius: 999px; padding: 0 7px; font-size: 11.5px; color: var(--text); min-width: 22px; text-align: center; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.active { border-color: var(--gold); color: var(--text); background: var(--gold-soft); }
.chip.c-on_way .dot { color: var(--s-on_way); } .chip.c-arrived .dot { color: var(--s-arrived); }
.chip.c-living .dot { color: var(--s-living); } .chip.c-leaving .dot { color: var(--s-leaving); }
.chip.c-left .dot { color: var(--s-left); } .chip.c-seeking .dot { color: var(--s-seeking); }
.chip .dot { background: currentColor; }
.chip.c-on_way .dot, .chip.c-arrived .dot, .chip.c-living .dot, .chip.c-leaving .dot, .chip.c-left .dot, .chip.c-seeking .dot { display: inline-block; }

/* ---------- Layout ---------- */
.layout { position: relative; flex: 1; display: flex; min-height: 0; }
.map-wrap { position: relative; flex: 1; min-width: 0; }
#map { position: absolute; inset: 0; background: #151517; z-index: 0; }

.map-tools { position: absolute; top: 88px; left: 10px; z-index: 500; }
.map-tools button {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; color: var(--text);
  box-shadow: var(--shadow);
}
.map-tools button:hover { border-color: var(--gold); color: var(--gold); }

.selbar {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 600;
  display: flex; align-items: center; gap: 12px;
  background: rgba(24,24,26,.96); border: 1px solid var(--gold); border-radius: 14px;
  padding: 8px 8px 8px 10px; box-shadow: var(--shadow); max-width: calc(100% - 120px);
  animation: drop .2s ease;
}
@keyframes drop { from { opacity: 0; transform: translate(-50%, -8px); } }
.selbar-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.selbar-main b { font-weight: 600; }
.selbar-route { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selbar-route b { color: var(--gold); font-weight: 600; }
.x { background: var(--line); border: 0; width: 28px; height: 28px; border-radius: 9px; font-size: 18px; line-height: 1; flex: none; }
.x:hover { background: var(--line-2); }

.legend {
  position: absolute; left: 12px; bottom: 26px; z-index: 500;
  display: flex; align-items: center; gap: 4px;
  background: rgba(24,24,26,.94); border: 1px solid var(--line); border-radius: 12px; padding: 4px;
  box-shadow: var(--shadow);
}
.legend button {
  display: flex; align-items: center; gap: 6px; background: transparent; border: 0; border-radius: 8px;
  padding: 5px 9px; font-size: 12px; color: var(--muted); opacity: .45; transition: opacity .15s, background .15s;
}
.legend button.on { opacity: 1; color: var(--text); }
.legend button:hover { background: var(--card-2); }
.lg { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.lg.wp { background: var(--gold); border-radius: 3px; }
.lg.flat { background: var(--flat); }
.lg.hostel { background: var(--hostel); border-radius: 3px; transform: rotate(45deg) scale(.85); }
.lg-hint { font-size: 11px; color: var(--dim); padding: 0 8px 0 4px; }

/* ---------- Basemap switch ---------- */
.basemap {
  position: absolute; top: 12px; right: 12px; z-index: 550;
  display: flex; gap: 2px; padding: 3px;
  background: rgba(24,24,26,.94); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.basemap button {
  display: flex; align-items: center; gap: 6px; background: transparent; border: 0; border-radius: 9px;
  padding: 6px 10px; font-size: 12px; color: var(--muted);
}
.basemap button svg { width: 14px; height: 14px; }
.basemap button:hover { color: var(--text); }
.basemap button.active { background: var(--gold); color: #141414; }
body[data-base="light"] .leaflet-container { background: #e8e4dc; }
body[data-base="light"] .dist-label, body[data-base="sat"] .dist-label { box-shadow: 0 2px 10px rgba(0,0,0,.35); }

/* ---------- Panel ---------- */
.panel {
  width: var(--panel-w); flex: none; background: var(--bg-2);
  border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0;
}
.panel .handle { display: none; }
.tabs { display: flex; gap: 4px; padding: 10px 12px 8px; border-bottom: 1px solid var(--line); }
.tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  background: transparent; border: 1px solid transparent; border-radius: 10px;
  padding: 8px 6px; color: var(--muted); font-weight: 500; font-size: 13px;
}
.tab em { font-style: normal; font-size: 11px; background: var(--card); border-radius: 999px; padding: 1px 7px; color: var(--muted); }
.tab:hover { color: var(--text); }
.tab.active { background: var(--card); border-color: var(--line); color: var(--text); }
.tab.active em { background: var(--gold); color: #141414; }

.list { overflow-y: auto; padding: 10px 12px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.list::-webkit-scrollbar { width: 8px; }
.list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
.empty { color: var(--muted); text-align: center; padding: 40px 12px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; cursor: pointer; outline: none;
  transition: border-color .15s, background .15s, transform .1s;
}
.card:hover { border-color: var(--line-2); background: var(--card-2); }
.card:active { transform: scale(.995); }
.card.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset, 0 6px 24px rgba(201,165,92,.08); }
.card:focus-visible { border-color: var(--gold); }
.row1 { display: flex; align-items: center; gap: 10px; }
.who { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 3px; align-items: flex-start; }
.name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sub2 { color: var(--muted); font-size: 12px; }
.meta { margin-top: 10px; display: grid; gap: 5px; color: var(--muted); font-size: 12.5px; padding-left: 2px; }
.meta > div { display: flex; gap: 8px; align-items: center; min-width: 0; }
.meta svg { width: 14px; height: 14px; color: var(--dim); }
.meta .val { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mono { font-variant-numeric: tabular-nums; }
.dist { margin-left: auto; color: var(--gold); font-weight: 500; white-space: nowrap; }
.room-tag { color: var(--gold); font-size: 11.5px; background: var(--gold-soft); padding: 1px 7px; border-radius: 6px; white-space: nowrap; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font: 600 13px var(--sans); color: #141414; background: var(--muted);
  box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 3px currentColor;
}
.avatar.sm { width: 32px; height: 32px; font-size: 12px; box-shadow: none; }
.avatar.xs { width: 22px; height: 22px; font-size: 9.5px; box-shadow: none; }
.s-bg-on_way { background: var(--s-on_way); color: var(--s-on_way); }
.s-bg-arrived { background: var(--s-arrived); color: var(--s-arrived); }
.s-bg-living { background: var(--s-living); color: var(--s-living); }
.s-bg-leaving { background: var(--s-leaving); color: var(--s-leaving); }
.s-bg-left { background: var(--s-left); color: var(--s-left); }
.s-bg-seeking { background: var(--s-seeking); color: var(--s-seeking); }
.avatar[class*="s-bg-"] { color: #141414; }
.avatar:not(.sm):not(.xs)[class*="s-bg-"] { box-shadow: 0 0 0 2px var(--card); }

.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--bg); border: 1px solid var(--line); color: var(--gold); text-decoration: none;
}
.icon-btn:hover { border-color: var(--gold); background: var(--gold-soft); }

.badge { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; background: color-mix(in srgb, currentColor 14%, transparent); }
.s-on_way { color: var(--s-on_way); } .s-arrived { color: var(--s-arrived); } .s-living { color: var(--s-living); }
.s-leaving { color: var(--s-leaving); } .s-left { color: var(--s-left); } .s-seeking { color: var(--s-seeking); }

.pin-mini { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; color: #141414; }
.pin-mini svg { width: 18px; height: 18px; }
.pin-mini.wp { background: var(--gold); }
.pin-mini.flat { background: var(--flat); border-radius: 50%; }
.pin-mini.hostel { background: var(--hostel); }
.pin-mini.full { background: var(--full); }
.free-pill, .count-pill { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.free-pill.ok { color: var(--ok); background: rgba(76,175,122,.13); }
.free-pill.low { color: var(--low); background: rgba(224,169,59,.13); }
.free-pill.full { color: var(--full); background: rgba(217,83,79,.13); }
.count-pill { color: var(--gold); background: var(--gold-soft); font-size: 13px; }
.bar { height: 6px; background: var(--bg); border-radius: 999px; margin-top: 11px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.bar i.low { background: var(--low); } .bar i.full { background: var(--full); }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.kpis button { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; }
.kpis button:hover { border-color: var(--gold); }
.kpis b { font: 600 16px var(--serif); }
.kpis span { font-size: 10.5px; color: var(--muted); text-align: center; }

/* ---------- Map markers ---------- */
.pin {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; position: relative;
  color: #141414; border: 2px solid rgba(13,13,14,.9);
  box-shadow: 0 4px 14px rgba(0,0,0,.55); transition: transform .15s;
}
.pin svg { width: 19px; height: 19px; stroke-width: 2; }
.pin:hover { transform: scale(1.08); }
.pin.wp { background: linear-gradient(145deg, var(--gold-2), var(--gold)); border-radius: 11px; }
.pin.flat { background: var(--flat); }
.pin.hostel { background: var(--hostel); border-radius: 11px; }
.pin.flat.low, .pin.hostel.low { box-shadow: 0 0 0 3px rgba(224,169,59,.55), 0 4px 14px rgba(0,0,0,.55); }
.pin.full { background: var(--full); }
.pin .n {
  position: absolute; right: -8px; top: -8px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: #0D0D0E; color: var(--text); border: 1px solid var(--line-2);
  font: 600 11px/18px var(--sans); text-align: center;
}
.pin.wp .n { color: var(--gold); }
.pin.ok .n { color: var(--ok); } .pin.low .n { color: var(--low); } .pin.full .n { color: var(--full); }
.pin.hl { transform: scale(1.18); box-shadow: 0 0 0 4px rgba(255,255,255,.9), 0 0 24px rgba(226,194,126,.6); z-index: 1000; }
.cluster {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(201,165,92,.92); color: #141414; font: 600 13px var(--sans);
  box-shadow: 0 0 0 6px rgba(201,165,92,.2), 0 4px 14px rgba(0,0,0,.5);
}

/* ---------- Leaflet polish ---------- */
.leaflet-container { font-family: var(--sans); background: #151517; }
.dark-tiles { filter: invert(1) hue-rotate(185deg) brightness(.82) contrast(.92) saturate(.35); }
.leaflet-bar { border: 0 !important; box-shadow: var(--shadow) !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-bar a { background: var(--card) !important; color: var(--text) !important; border-color: var(--line) !important; width: 34px !important; height: 34px !important; line-height: 34px !important; }
.leaflet-bar a:hover { color: var(--gold) !important; }
.leaflet-control-attribution { background: rgba(13,13,14,.7) !important; color: var(--dim) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); }
.leaflet-popup-content-wrapper { border-radius: 16px; padding: 0; }
.leaflet-popup-content { margin: 14px 14px 12px; font-size: 13px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); top: 8px; right: 8px; font-size: 20px; }

.pop-h { display: flex; gap: 10px; align-items: flex-start; padding-right: 18px; }
.pop-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #141414; }
.pop-ic.wp { background: var(--gold); } .pop-ic.flat { background: var(--flat); border-radius: 50%; } .pop-ic.hostel { background: var(--hostel); }
.pop h3 { font: 600 15.5px/1.25 var(--serif); margin: 0; }
.pop .addr { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pop .seats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0 4px; }
.pop .seats div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px; text-align: center; }
.pop .seats b { display: block; font: 600 18px var(--serif); }
.pop .seats span { font-size: 10.5px; color: var(--muted); }
.pop .seats .free.ok b { color: var(--ok); } .pop .seats .free.low b { color: var(--low); } .pop .seats .free.full b { color: var(--full); }
.pop h4 { margin: 12px 0 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--gold); font-weight: 600; }
.pop ul { list-style: none; margin: 0; padding: 0; }
.pop ul.people { max-height: 210px; overflow-y: auto; }
.pop .rooms { max-height: 250px; overflow-y: auto; display: grid; gap: 6px; padding-right: 2px; }
.room { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; }
.room.room-full { border-color: rgba(217,83,79,.35); }
.room-h { display: flex; align-items: center; gap: 8px; }
.room-h b { font-weight: 600; font-size: 12.5px; }
.room-h .sm { margin-left: auto; }
.room ul { margin-top: 4px; }
.beds { display: inline-flex; gap: 3px; }
.bed { width: 10px; height: 10px; border-radius: 3px; border: 1px solid #4a4a50; display: inline-block; }
.bed.on { background: var(--gold); border-color: var(--gold); }
.sm { color: var(--muted); font-size: 11.5px; }
.link {
  display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 4px 4px; border-radius: 8px; text-align: left;
}
.link:hover { background: var(--card-2); }
.link:hover .pname { color: var(--gold); }
.link .pname { font-size: 12.5px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link .sm { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--gold-soft); color: var(--gold); border: 1px solid transparent; border-radius: 8px;
  padding: 3px 8px; font-size: 11.5px;
}
.tag svg { width: 12px; height: 12px; }
.tag:hover { border-color: var(--gold); }

.dist-label {
  background: var(--gold); color: #141414; font: 600 12px var(--sans);
  padding: 4px 9px; border-radius: 999px; white-space: nowrap; border: 0; box-shadow: 0 4px 14px rgba(0,0,0,.5);
}
.dist-label::before { display: none; }

/* ---------- Loader ---------- */
.loader { position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center; z-index: 2000; transition: opacity .3s; }
.loader.hide { opacity: 0; pointer-events: none; }
.loader span { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tablet ---------- */
@media (max-width: 1180px) {
  :root { --panel-w: 350px; }
  .stat { min-width: 0; padding: 6px 10px; }
  .lg-hint { display: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .logo { width: 34px; height: 34px; }
  .brand-name { font-size: 17px; }
  .sub { display: none; }
  .lang { margin-left: auto; }
  .stats { order: 3; width: 100%; margin: 0; gap: 6px; }
  .stat { flex: 1; align-items: center; padding: 5px 4px; min-width: 0; }
  .stat b { font-size: 17px; }
  .stat span { font-size: 10px; text-align: center; line-height: 1.2; }

  .toolbar { flex-wrap: nowrap; overflow-x: auto; padding: 8px 12px 4px; scrollbar-width: none; }
  .toolbar::-webkit-scrollbar { display: none; }
  .search { flex: 0 0 170px; min-width: 0; }
  .select-wrap select { min-width: 160px; }
  .ghost { margin-left: 0; flex: none; }
  .chips { padding: 4px 12px 8px; }

  .map-tools { top: 84px; }
  .basemap { top: 84px; right: 8px; flex-direction: column; }
  .basemap button span { display: none; }
  .basemap button { padding: 7px 9px; }
  .selbar { top: 8px; left: 56px; right: 8px; transform: none; max-width: none; animation: none; }
  .selbar-route { white-space: normal; }
  .legend { bottom: 104px; left: 8px; }
  .legend button { padding: 5px 7px; font-size: 11px; }
  .leaflet-bottom.leaflet-right { margin-bottom: 92px; }

  .panel {
    position: absolute; left: 0; right: 0; bottom: 0; width: auto; height: 80%;
    border-left: 0; border-top: 1px solid var(--line); border-radius: 20px 20px 0 0;
    z-index: 900; transform: translateY(calc(100% - 96px)); transition: transform .28s ease;
    box-shadow: 0 -12px 30px rgba(0,0,0,.55); padding-bottom: env(safe-area-inset-bottom);
  }
  .panel.open { transform: translateY(0); }
  .panel .handle { display: block; width: 100%; background: transparent; border: 0; padding: 9px 0 0; }
  .panel .handle span { display: block; margin: 0 auto; width: 44px; height: 5px; border-radius: 3px; background: #48484e; }
  .tabs { padding-top: 6px; }
  .tab { font-size: 12.5px; padding: 8px 4px; }
}

/* own housing */
.own-tag { color: var(--own); background: rgba(91,192,190,.13); padding: 1px 7px; border-radius: 6px; font-size: 11.5px; white-space: nowrap; }
.own-c { color: var(--own); }
.pin.own { background: var(--own); width: 34px; height: 34px; }

/* agency vs own split on workplaces */
.pin .split {
  position: absolute; top: 40px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 2px; padding: 2px; border-radius: 999px;
  background: rgba(13,13,14,.92); border: 1px solid var(--line-2); box-shadow: 0 3px 10px rgba(0,0,0,.5);
  white-space: nowrap; pointer-events: none;
}
.pin .split i { display: inline-flex; align-items: center; gap: 3px; font: 600 11px/1 var(--sans); font-style: normal; padding: 3px 6px 3px 5px; border-radius: 999px; }
.pin .split svg { width: 11px; height: 11px; stroke-width: 2.2; }
.pin .split .ag { color: var(--flat); background: rgba(79,163,224,.14); }
.pin .split .ow { color: var(--own); background: rgba(91,192,190,.14); }
.splitbox { margin: 12px 0 2px; }
.sb-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sb-nums button { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; }
.sb-nums button:hover { border-color: var(--gold); }
.sb-nums b { font: 600 18px var(--serif); }
.sb-nums span { font-size: 10.5px; color: var(--muted); text-align: center; }
.sb-nums .ag b { color: var(--flat); } .sb-nums .ow b { color: var(--own); }
.sb-bar { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: var(--line); margin-top: 8px; }
.sb-bar i { display: block; height: 100%; }
.sb-bar .ag { background: var(--flat); } .sb-bar .ow { background: var(--own); }
.ag-c { color: var(--flat); }
