:root {
  --or: #f97316;
  --or-d: #c2410c;
  --or-soft: #fff1e6;
  --gr: #0f6b4f;
  --ink: #0f172a;
  --mut: #64748b;
  --line: #e2e8f0;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --panel-h: min(42vh, 360px);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  color: var(--ink);
  background: #0f172a;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.bd-app {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
}
#bdMap {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #f8fafc;
}
.maplibregl-map { font: inherit; }
.maplibregl-ctrl-attrib {
  font-size: 10px !important;
  background: rgba(255,255,255,.75) !important;
}
.bd-user-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3b82f6;
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(59,130,246,.25);
}

.bd-top {
  position: absolute;
  left: 0; right: 0; top: 0;
  z-index: 20;
  padding: calc(10px + var(--safe-t)) 12px 0;
  pointer-events: none;
}
.bd-top > * { pointer-events: auto; }
.bd-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bd-icon-btn {
  width: 44px; height: 44px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15,23,42,.14);
  display: grid;
  place-items: center;
  color: var(--ink);
  flex: none;
  cursor: pointer;
}
.bd-search {
  flex: 1;
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15,23,42,.14);
}
.bd-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
}
.bd-search input::placeholder { color: #94a3b8; }
.bd-cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 2px 4px;
  scrollbar-width: none;
}
.bd-cats::-webkit-scrollbar { display: none; }
.bd-cat {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15,23,42,.10);
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
}
.bd-cat em {
  font-style: normal;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--mut);
}
.bd-cat.is-active {
  background: var(--or-d);
  color: #fff;
  border-color: var(--or-d);
}
.bd-cat.is-active em { background: rgba(255,255,255,.22); color: #fff; }

.bd-fab {
  position: absolute;
  right: 14px;
  bottom: calc(var(--panel-h) + 18px + var(--safe-b));
  z-index: 21;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bd-fab a, .bd-fab button {
  min-width: 46px;
  height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15,23,42,.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
}
.bd-fab .is-primary {
  background: var(--or-d);
  color: #fff;
}

.bd-panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 25;
  height: var(--panel-h);
  background: #fff;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 30px rgba(15,23,42,.16);
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-b);
  transition: height .25s ease;
}
.bd-panel.is-expanded { height: min(78vh, 680px); }
.bd-panel-handle {
  width: 42px; height: 5px;
  margin: 10px auto 6px;
  border-radius: 999px;
  background: #e2e8f0;
  cursor: pointer;
}
.bd-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px 10px;
}
.bd-panel-head h1 {
  font-size: 16px;
  font-weight: 800;
}
.bd-panel-head small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--mut);
  font-weight: 500;
}
.bd-panel-actions {
  display: flex;
  gap: 6px;
}
.bd-chip {
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.bd-chip.is-active { background: var(--or-soft); color: var(--or-d); }
.bd-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 12px 14px;
  -webkit-overflow-scrolling: touch;
}
.bd-empty, .bd-loading {
  padding: 28px 12px;
  text-align: center;
  color: var(--mut);
  font-size: 13.5px;
}
.bd-card {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  margin-bottom: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.bd-card:hover, .bd-card.is-active {
  border-color: #fdba74;
  box-shadow: 0 8px 18px rgba(194,65,12,.12);
}
.bd-card-img {
  width: 84px; height: 84px;
  border-radius: 12px;
  object-fit: cover;
  background: #e2e8f0;
}
.bd-card-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bd-card-cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--or-d);
}
.bd-card-name {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bd-card-addr {
  font-size: 12px;
  color: var(--mut);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bd-card-meta {
  margin-top: auto;
  display: flex;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
}
.bd-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fff7ed;
  color: var(--or-d);
}
.bd-badge.is-green { background: #e8f6ee; color: var(--gr); }

.bd-pin {
  width: 28px;
  height: 28px;
  border: 0;
  padding: 0;
  border-radius: 50% 50% 50% 0;
  background: var(--pin, #c2410c);
  box-shadow: 0 4px 10px rgba(0,0,0,.25), inset 0 0 0 2px #fff;
  transform: rotate(-45deg);
  cursor: pointer;
}
.bd-pin.is-active {
  width: 34px;
  height: 34px;
  box-shadow: 0 0 0 4px rgba(249,115,22,.28), 0 6px 14px rgba(0,0,0,.28), inset 0 0 0 2px #fff;
}
.bd-popup .maplibregl-popup-content {
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(15,23,42,.18);
  min-width: 240px;
  max-width: 300px;
}
.bd-popup .maplibregl-popup-close-button {
  font-size: 18px;
  color: #fff;
  right: 6px;
  top: 4px;
  width: 28px;
  height: 28px;
  z-index: 2;
  text-shadow: 0 1px 3px rgba(0,0,0,.45);
}
.bd-popup .maplibregl-popup-tip { border-top-color: #fff; }
.bd-popup-card { display: grid; }
.bd-popup-media {
  display: block;
  aspect-ratio: 16/9;
  background: #e2e8f0;
  overflow: hidden;
}
.bd-popup-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: none;
}
.bd-popup-body { padding: 12px 14px 14px; }
.bd-popup-cat {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--or-d);
  margin-bottom: 4px;
}
.bd-popup-title {
  display: block;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 4px;
}
.bd-popup-meta { font-size: 12px; color: var(--mut); line-height: 1.4; }
.bd-popup-phone {
  display: inline-block;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #0369a1;
}
.bd-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.bd-popup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  background: #fff7ed;
  color: var(--or-d);
}
.bd-popup-btn.is-primary {
  background: var(--or-d);
  color: #fff;
}
.bd-card-actions { margin-top: 8px; }
.bd-card-link {
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  color: var(--or-d);
}

@media (min-width: 900px) {
  :root { --panel-h: 100%; }
  .bd-panel {
    left: auto;
    right: 0;
    top: 0;
    width: min(420px, 38vw);
    height: 100% !important;
    border-radius: 0;
    box-shadow: -10px 0 30px rgba(15,23,42,.12);
  }
  .bd-panel-handle { display: none; }
  .bd-fab { right: calc(min(420px, 38vw) + 16px); bottom: 24px; }
  .bd-top { right: min(420px, 38vw); }
}
