/* Dark mode only - no light theme by design. */
:root {
  --bg: #08090b;
  --panel: #0e1013;
  --panel-2: #14171b;
  --line: #23262c;
  --line-soft: #191c21;
  --text: #e8e6e3;
  --muted: #9a968f;
  --dim: #635f59;
  --accent: #4ea1ff;
  --accent-dim: #1d3557;
  --good: #4fbf8b;
  --warn: #cfa76a;
  --bad: #d95f5f;
  --remote: #22d68a;
  --hybrid: #37b6ff;
  --onsite: #4d7cff;
  --home: #e05a9a;
  --radius: 10px;
  --shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 18px;
  background: linear-gradient(180deg, #101215, #0b0d0f);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  background: rgba(224, 90, 154, 0.1);
  border: 1px solid rgba(224, 90, 154, 0.3);
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 9px;
}
.logo svg { display: block; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45)); }
.brand h1 { margin: 0; font-size: 17px; font-weight: 680; letter-spacing: 0.3px; }

.controls { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field span { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--dim); }
.field input,
.field select {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  min-width: 210px;
  outline: none;
}
.field.short input, .field.short select { min-width: 112px; }
.field.mid input { min-width: 160px; width: 160px; }
.field.tiny-field input { min-width: 88px; width: 88px; }
.field select { cursor: pointer; }
.field input:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(78, 161, 255, 0.18);
}

.btn {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: #1c2025; border-color: #333840; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04121e; }
.btn.primary:hover { background: #6bb2ff; }
.btn.tiny { padding: 4px 9px; font-size: 11.5px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* A class rule with display: flex would otherwise outrank [hidden]. */
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.layout { flex: 1 1 auto; display: flex; min-height: 0; }
.mapwrap { position: relative; flex: 1 1 auto; min-width: 0; }
#map { position: absolute; inset: 0; background: var(--bg); }

.dark-tiles {
  filter: grayscale(1) invert(1) brightness(0.78) contrast(1.15);
}

.home-wrap {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(8, 9, 11, 0.9);
  border: 2px solid #ff3d95;
  box-shadow: 0 0 0 3px rgba(255, 61, 149, 0.28),
              0 0 16px rgba(255, 61, 149, 0.55),
              0 2px 8px rgba(0, 0, 0, 0.8);
  cursor: grab;
  transition: transform 0.12s ease;
}
.home-wrap:hover { transform: scale(1.08); }
.home-pin { display: block; }

/* While it is being held. */
.home-wrap.unlocked {
  cursor: grabbing;
  border-color: #ffffff;
  animation: homepulse 1.1s ease-in-out infinite;
}
@keyframes homepulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(255, 61, 149, 0.3), 0 0 16px rgba(255, 61, 149, 0.6);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 61, 149, 0.16), 0 0 26px rgba(255, 61, 149, 0.9);
  }
}

/* Label sitting on the max-radius ring. */
.radius-label {
  background: rgba(8, 9, 11, 0.94) !important;
  border: 1px solid rgba(224, 90, 154, 0.55) !important;
  color: #f0a3c8 !important;
  font-size: 10.5px !important;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 2px 7px !important;
  border-radius: 5px !important;
  box-shadow: none !important;
}
.radius-label::before { display: none !important; }

/* Freeway shields: interstates blue, state routes green, like the real signs. */
.shield {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #ffffff;
  white-space: nowrap;
  border: 1.5px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}
.shield.interstate { background: #123a8a; }
.shield.state { background: #1d6b3a; }
/* Total drive time at the end of the route. */
.route-total {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  background: rgba(8, 9, 11, 0.94);
  border: 1.5px solid var(--accent);
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}
.route-total small {
  display: block;
  font-size: 9px;
  font-weight: 500;
  color: var(--muted);
  margin-top: -1px;
}

.shield small {
  font-size: 9px;
  font-weight: 600;
  opacity: 0.85;
  margin-left: 4px;
}

/* Hover label naming the employer at a pin. */
.pin-tip {
  background: rgba(8, 9, 11, 0.96) !important;
  border: 1px solid var(--line) !important;
  color: var(--text) !important;
  font-size: 11.5px !important;
  padding: 5px 9px !important;
  border-radius: 7px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6) !important;
  white-space: nowrap;
}
.pin-tip b { font-weight: 650; }
.pin-tip .tip-sub { display: block; color: var(--muted); font-size: 10.5px; margin-top: 1px; }
.pin-tip::before { border-top-color: var(--line) !important; }

/* ---------- sidebar ---------- */
.sidebar {
  flex: 0 0 420px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-left: 1px solid var(--line);
  min-height: 0;
  /* Otherwise a long unbreakable token widens the column past 420px. */
  min-width: 0;
}

.card, .card * { overflow-wrap: anywhere; }

.filters {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
}

.search {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
}
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(78, 161, 255, 0.18); }

.filter-row { display: flex; gap: 14px; flex-wrap: wrap; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.chk input { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }

/* A labelled dropdown sized to sit in a filter row. */
.pickone { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.pickone select {
  background: var(--panel-2, #16181d);
  color: var(--text, #e8eaed);
  border: 1px solid var(--line, #2b313c);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12.5px;
  cursor: pointer;
}
.pickone select:focus { outline: none; border-color: var(--accent, #4ea1ff); }

.slider { display: flex; flex-direction: column; gap: 3px; }
.slider-head { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--dim); }
.slider-head b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.slider input[type="range"] { width: 100%; accent-color: var(--accent); cursor: pointer; }

.sortrow { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
.sortrow select {
  flex: 1;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 12.5px;
  outline: none;
  cursor: pointer;
}

/* ---------- job cards ---------- */
/* The scrollbar is always reserved, so the column never shifts as the list length changes. */
.joblist {
  flex: 1 1 auto;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  padding: 10px 12px 24px;
}
.joblist::-webkit-scrollbar { width: 10px; }
.joblist::-webkit-scrollbar-thumb { background: #242830; border-radius: 6px; border: 2px solid var(--panel); }

.card {
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 11px 12px;
  margin-bottom: 9px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.08s;
}
.card:hover { border-color: #3a3f48; background: #181b20; }
.card.active { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(78, 161, 255, 0.4); }

.card.applied {
  border-left: 3px solid var(--good);
  background: linear-gradient(90deg, rgba(34, 214, 138, 0.07), var(--panel-2) 60%);
}
.applied-badge,
.closed-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.7px;
  padding: 1px 5px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: 1px;
}
.applied-badge { background: var(--good); color: #04140d; }
.closed-badge { background: var(--muted, #8a93a6); color: #0b0e14; }
.closed-note {
  font-size: 11px;
  color: var(--muted, #8a93a6);
  margin: 2px 0 4px;
}
.btn.applied-on {
  background: rgba(34, 214, 138, 0.14);
  border-color: rgba(34, 214, 138, 0.5);
  color: var(--good);
}
.btn.applied-on:hover { background: rgba(34, 214, 138, 0.24); }

.card.flash { animation: cardflash 1.2s ease-out; }
@keyframes cardflash {
  0%   { box-shadow: 0 0 0 2px var(--accent), 0 0 18px rgba(78, 161, 255, 0.5); }
  100% { box-shadow: 0 0 0 1px rgba(78, 161, 255, 0.4); }
}

/* ---------- stacked map pins ---------- */
.pin-count {
  color: #06101c;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}
.pin.stacked {
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-title { font-size: 13.5px; font-weight: 620; line-height: 1.35; margin: 0; }
.card-company { font-size: 12px; color: var(--muted); margin: 2px 0 0; }

.score {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid;
}
.score.hi { color: var(--good); background: rgba(53, 211, 154, 0.1); border-color: rgba(53, 211, 154, 0.35); }
.score.mid { color: var(--warn); background: rgba(242, 193, 78, 0.1); border-color: rgba(242, 193, 78, 0.32); }
.score.lo { color: var(--bad); background: rgba(239, 95, 107, 0.09); border-color: rgba(239, 95, 107, 0.3); }

.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.tag {
  font-size: 11px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2.5px 7px;
  border-radius: 6px;
  background: #1a1d22;
  border: 1px solid #282c33;
  color: var(--muted);
  white-space: nowrap;
}
.tag.remote { color: var(--remote); border-color: rgba(53, 211, 154, 0.35); background: rgba(53, 211, 154, 0.08); }
.tag.hybrid { color: var(--hybrid); border-color: rgba(242, 193, 78, 0.35); background: rgba(242, 193, 78, 0.08); }
.tag.onsite { color: var(--onsite); border-color: rgba(122, 162, 247, 0.32); background: rgba(122, 162, 247, 0.08); }
.tag.pay { color: var(--good); border-color: rgba(53, 211, 154, 0.3); }
.tag.paylow { color: var(--bad); border-color: rgba(239, 95, 107, 0.3); }

.card-detail { margin-top: 10px; padding-top: 10px; border-top: 1px solid #22262c; display: none; }
.card.open .card-detail { display: block; }

.bars { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.bar { display: grid; grid-template-columns: 62px 1fr 30px; align-items: center; gap: 8px; font-size: 11px; color: var(--dim); }
/* Spans, so they need display: block for width and height to apply. */
.bar .track {
  display: block;
  height: 5px;
  background: #1a1d22;
  border-radius: 3px;
  overflow: hidden;
}
.bar .fill {
  display: block;
  height: 100%;
  min-width: 2px;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.25s ease;
}
.bar .fill.hi { background: #22d68a; }
.bar .fill.mid { background: #f0b34a; }
.bar .fill.lo { background: #ff6b6b; }
.bar .val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.skills { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.skill { font-size: 10.5px; padding: 2px 6px; border-radius: 5px; background: rgba(78, 161, 255, 0.12); color: #9ccbff; border: 1px solid rgba(78, 161, 255, 0.26); }

.commute-box {
  background: #141619;
  border: 1px solid #242830;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 12px;
}
.commute-box .big { font-size: 15px; font-weight: 660; color: var(--text); }
.commute-box .leave { color: var(--warn); font-weight: 600; }
.commute-box .prov { font-size: 10.5px; color: var(--dim); margin-top: 3px; }

.desc { font-size: 12px; color: var(--muted); line-height: 1.55; max-height: 130px; overflow-y: auto; margin-bottom: 10px; }

.linkstate { font-size: 11px; margin-bottom: 8px; letter-spacing: 0.2px; }
.linkstate.live { color: var(--good); }
.linkstate.gone { color: var(--bad); }
.linkstate.unknown { color: var(--warn); }

.card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.card-actions a.btn { text-decoration: none; display: inline-block; }

.empty { text-align: center; color: var(--dim); padding: 40px 20px; font-size: 13px; }

.more-sentinel {
  text-align: center;
  color: var(--dim);
  font-size: 11.5px;
  padding: 10px 0 16px;
  letter-spacing: 0.3px;
}

.tag.pending { color: var(--dim); border-style: dashed; }
.tag.loc { max-width: 260px; }

/* ---------- one address at a time ---------- */
.spot-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  background: #101820;
  font-size: 12px;
}
.spot-text { flex: 1; min-width: 0; color: var(--text); }

.heart-field span { color: #ff8a8a; }
.heart-field input { border-color: #6b2222; }
.heart-field input:focus {
  border-color: #ff1a1a;
  box-shadow: 0 0 0 3px rgba(255, 26, 26, 0.18);
}

/* ---------- apply list ---------- */
.card-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }

.cart-btn { position: relative; }
.cart-btn.has { border-color: #6a4a9c; color: #c9a9ff; }
.cart-btn.on { background: #4c2a7a; border-color: #8a63d2; color: #ecdcff; }
.cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 5px;
  border-radius: 9px;
  background: #2a2f38;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cart-btn.has .cart-count { background: #8a63d2; color: #16081f; }

.cart-panel {
  position: fixed;
  top: 68px;
  right: 12px;
  bottom: 12px;
  width: 420px;
  max-width: calc(100vw - 24px);
  z-index: 900;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid #6a4a9c;
  border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.cart-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #1b1424;
  font-size: 13px;
}
.cart-summary { color: var(--muted); font-size: 11.5px; margin-left: auto; }
.cart-close {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.cart-close:hover { color: var(--text); }

.cart-body { flex: 1; overflow-y: auto; padding: 10px 12px; }
.cart-empty { color: var(--dim); font-size: 12px; padding: 24px 4px; text-align: center; }

.cart-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  margin-bottom: 7px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid #8a63d2;
  border-radius: 8px;
  background: var(--panel-2);
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}
.cart-row:hover { background: #1c2025; border-color: #8a63d2; }
.cart-row:hover .cart-text b { text-decoration: underline; }
.cart-row .score { width: 32px; height: 32px; font-size: 12px; }
.cart-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cart-text b { font-size: 12.5px; font-weight: 620; }
.cart-sub { color: var(--muted); font-size: 11px; }
.cart-err { color: var(--bad); font-size: 10.5px; margin-top: 2px; }

.cart-state {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid;
}
.cart-state.queued { color: #c9a9ff; border-color: #6a4a9c; background: rgba(138, 99, 210, 0.12); }
.cart-state.applying { color: var(--warn); border-color: rgba(242, 193, 78, 0.45); background: rgba(242, 193, 78, 0.1); }
.cart-state.applied { color: var(--good); border-color: rgba(34, 214, 138, 0.45); background: rgba(34, 214, 138, 0.1); }
.cart-state.failed { color: var(--bad); border-color: rgba(239, 95, 107, 0.45); background: rgba(239, 95, 107, 0.1); }

/* Still on the list, but the board no longer carries the posting. */
.cart-row.retired { opacity: 0.85; }
.cart-row.applied { border-left-color: var(--good); }
.cart-row.failed { border-left-color: var(--bad); }
.cart-row.applying { border-left-color: var(--warn); }

.cart-drop {
  flex: 0 0 auto;
  background: none;
  border: 0;
  color: var(--dim);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.cart-drop:hover { color: var(--bad); }

.cart-find {
  flex: 0 0 auto;
  background: none;
  border: 0;
  color: var(--dim);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.cart-find:hover { color: var(--accent); }

.cart-mark {
  flex: 0 0 auto;
  background: none;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 3px 5px;
}
.cart-mark:hover { color: var(--good); border-color: var(--good); }
.cart-mark.done {
  color: var(--good);
  border-color: rgba(34, 214, 138, 0.45);
  background: rgba(34, 214, 138, 0.12);
}
.cart-mark.done:hover { color: var(--muted); border-color: var(--line); background: none; }

/* ---------- the heart ---------- */
.heart-wrap {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(8, 9, 11, 0.9);
  border: 2px solid #ff1a1a;
  box-shadow: 0 0 0 3px rgba(255, 26, 26, 0.28),
              0 0 16px rgba(255, 26, 26, 0.55),
              0 2px 8px rgba(0, 0, 0, 0.8);
  cursor: grab;
  transition: transform 0.12s ease;
}
.heart-wrap:hover { transform: scale(1.08); }
.heart-pin { display: block; }

/* While it is being held. */
.heart-wrap.unlocked {
  cursor: grabbing;
  border-color: #ffffff;
  animation: heartpulse 1.1s ease-in-out infinite;
}
@keyframes heartpulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(255, 26, 26, 0.3), 0 0 16px rgba(255, 26, 26, 0.6);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 26, 26, 0.16), 0 0 26px rgba(255, 26, 26, 0.9);
  }
}

/* Sized and shaped to match the melon control it sits under. */
.leaflet-bar.heart-toggle a,
.leaflet-touch .heart-toggle a {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  font-size: 24px;
  line-height: 1;
  text-decoration: none;
  background: var(--panel-2, #16181d);
  color: #ff6b6b;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
.heart-toggle a:hover { background: #23262d; }

.heart-toggle.on a {
  background: #ff1a1a;
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.heart-toggle.on a:hover { background: #ff4040; }

.heart-total {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(8, 9, 11, 0.94);
  border: 1px solid #ff1a1a;
  color: #ffd2d2;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

/* ---------- map popups ---------- */
.leaflet-popup-content-wrapper {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow);
}
.leaflet-popup-tip { background: var(--panel-2); border: 1px solid var(--line); }
.leaflet-popup-content { margin: 10px 12px; font-size: 12.5px; }
.leaflet-popup-content b { font-size: 13px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-control-zoom a {
  background: var(--panel-2) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}
.leaflet-control-attribution {
  background: rgba(13, 17, 26, 0.8) !important;
  color: var(--dim) !important;
}
.leaflet-control-attribution a { color: var(--muted) !important; }

/* Transparent click target around the dot - see pin() in app.js. */
.pin-hit {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
}

.pin {
  border-radius: 50%;
  border: 2px solid #08090b;
  box-shadow: 0 0 0 2px currentColor, 0 0 10px currentColor, 0 2px 6px rgba(0, 0, 0, 0.85);
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 22px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 9px;
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
  max-width: 70vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 1000px) {
  .layout { flex-direction: column; }
  .sidebar { flex: 1 1 auto; border-left: none; border-top: 1px solid var(--line); }
  .mapwrap { flex: 0 0 45vh; }
}

/* ---------------- crime and housing overlays ---------------- */

.crime-legend,
.house-legend {
  background: rgba(18, 21, 27, 0.92);
  border: 1px solid #2b313c;
  border-radius: 8px;
  padding: 10px 12px;
  max-width: 268px;
  font-size: 11px;
  line-height: 1.45;
  color: #c9d1da;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.crime-legend strong,
.house-legend strong { color: #e8edf3; font-size: 11.5px; }

.crime-ramp,
.house-ramp {
  display: flex;
  margin: 7px 0 3px;
  border-radius: 3px;
  overflow: hidden;
  height: 9px;
}

.crime-ramp span,
.house-ramp span { flex: 1; }

.crime-scale,
.house-scale {
  display: flex;
  justify-content: space-between;
  color: #8a94a2;
  font-size: 10px;
}

.crime-note,
.house-note {
  color: #98a2b0;
  margin-top: 5px;
}

.crime-pop,
.house-pop { font-size: 12px; line-height: 1.5; }
.crime-pop strong,
.house-pop strong { display: block; margin-bottom: 3px; font-size: 13px; }
.crime-pop .crime-note,
.house-pop .house-note { margin-top: 4px; }

/* Doubled selectors beat Leaflet's ".leaflet-touch .leaflet-bar a" (30px). */
.leaflet-bar.crime-toggle a,
.leaflet-touch .crime-toggle a {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  font-size: 24px;
  line-height: 1;
  text-decoration: none;
}

.crime-toggle a {
  background: var(--panel-2, #16181d);
  color: var(--text, #e8eaed);
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
.crime-toggle a:hover { background: #23262d; }

.crime-toggle.on a {
  background: var(--accent, #4ea1ff);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.crime-toggle.on a:hover { background: #6bb2ff; }

.crime-toggle.busy a { cursor: progress; }
.crime-toggle.busy .crime-toggle-icon { animation: crime-pulse 0.7s ease-in-out infinite; }

@keyframes crime-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ---------------- routing indicator ---------------- */
.route-busy {
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(18, 21, 27, 0.94);
  border: 1px solid #2b313c;
  border-radius: 999px;
  padding: 6px 13px 6px 11px;
  font-size: 11.5px;
  color: #c9d1da;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}
.route-busy.on { display: flex; }

.route-busy-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid rgba(78, 161, 255, 0.3);
  border-top-color: var(--accent, #4ea1ff);
  animation: route-spin 0.7s linear infinite;
}

@keyframes route-spin {
  to { transform: rotate(360deg); }
}

/* The legend dot, matching the complex pins on the map. */
.house-key {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #39d0c8;
  border: 1px solid #0b1016;
  vertical-align: -1px;
  margin-right: 3px;
}

/* ---------------- layer switches ---------------- */
.leaflet-bar.jobs-toggle a,
.leaflet-bar.housing-toggle a,
.leaflet-touch .jobs-toggle a,
.leaflet-touch .housing-toggle a {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  font-size: 24px;
  line-height: 1;
  text-decoration: none;
  background: var(--panel-2, #16181d);
  color: var(--text, #e8eaed);
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

.jobs-toggle a:hover,
.housing-toggle a:hover { background: #23262d; }

.jobs-toggle.on a,
.housing-toggle.on a {
  background: var(--accent, #4ea1ff);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.jobs-toggle.on a:hover,
.housing-toggle.on a:hover { background: #6bb2ff; }

.housing-toggle.busy a { cursor: progress; }
.housing-toggle.busy .toggle-icon {
  animation: crime-pulse 0.7s ease-in-out infinite;
}

/* ---------- multi-select filters (job type / industry) ---------- */

/* Checkboxes in a popover, since <select multiple> cannot show "2 selected". */
.picks { gap: 8px; }

.multi { position: relative; flex: 1 1 0; min-width: 0; }

.multi-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 22px 6px 10px;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.multi-btn:hover { border-color: #3a3f4a; }
.multi.active .multi-btn { border-color: var(--accent); }

/* The caret is drawn on the wrapper so it doesn't move with the label. */
.multi::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 21px;
  border: 4px solid transparent;
  border-top-color: var(--dim);
  pointer-events: none;
}

.multi-cap { font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--dim); }
.multi-val {
  font-size: 12.5px;
  color: var(--text);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-menu {
  position: absolute;
  z-index: 900;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 210px;
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}
.multi-menu .chk { white-space: nowrap; }

/* Purple, because green means match score. */
.btn.tiny.apply-to { border-color: #6a4a9c; color: #c9a9ff; }
.btn.tiny.apply-to:hover { background: #2b1d47; border-color: #8a63d2; }
.btn.tiny.apply-to.on { background: #4c2a7a; border-color: #8a63d2; color: #ecdcff; }
.btn.tiny.apply-to.on:hover { background: #5c3591; }

.card.queued { box-shadow: inset 3px 0 0 #8a63d2; }

/* The whole Arrive by field opens the time picker, so it has to look clickable. */
.field:has(#arriveInput), #arriveInput { cursor: pointer; }

/* The native clear button only paints on hover; #searchClear replaces it. */
.search::-webkit-search-cancel-button,
.search::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }

.searchwrap { position: relative; display: flex; }
.searchwrap .search { padding-right: 34px; }

.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #2b3038;
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.search-clear:hover { background: #3a4048; }
