@layer mtb-map {
  .mtb-map-shell {
    position: relative;
    display: block;
    isolation: isolate;
  background: #0f1218;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 12px 20px rgba(0,0,0,0.28);
  overflow: hidden;
  min-height: 520px;
  --mtb-glow: rgba(0,229,255,0.18);
  }

  .mtb-map-canvas {
    min-height: 520px;
    height: 100%;
    width: 100%;
    display: block;
    position: relative;
    z-index: 1;
  }

  .mtb-map-status {
    display: none !important;
  }
  .mtb-map-status.error { border-color: #f87171; color: #fecaca; }
  .mtb-map-status.ok { border-color: #34d399; color: #d1fae5; }

  /* Rail */
  .mtb-map-rail {
    position: sticky;
    top: 0;
    left: auto;
    transform: none;
    background: rgba(17,20,28,0.72);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    gap: 10px;
    z-index: 130;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    pointer-events: auto;
  }
  .mtb-rail-btn {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.15);
    background: linear-gradient(145deg, rgba(22,28,38,0.9), rgba(12,16,22,0.9));
    color: #f1f5f9;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.28);
    font-weight: 700;
    font-size: 14px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  }
  .mtb-rail-btn:hover { transform: scale(1.06); border-color: rgba(255,255,255,0.35); box-shadow:0 12px 24px rgba(0,0,0,0.32); }
  .mtb-rail-btn.is-active { border-color:rgba(255,255,255,0.4); box-shadow:0 12px 24px rgba(0,0,0,0.32); }

  /* Sidebar */
  .mtb-panel-map-sidebar {
    position: absolute;
    left: 12px;
    top: 12px;
    bottom: 12px;
    width: min(460px, 86vw);
    max-height: calc(100% - 24px);
    display: grid;
    grid-template-columns: 60px minmax(280px, 1fr);
    gap: 14px;
    padding: 18px 16px 16px 18px;
    background: linear-gradient(180deg, rgba(15,18,26,0.96), rgba(10,12,18,0.92));
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 22px 42px rgba(0,0,0,0.45);
    backdrop-filter: var(--mtb-blur);
    z-index: 120;
    pointer-events: auto;
    overflow: hidden;
    resize: horizontal;
    min-width: 320px;
    max-width: none;
    transition: transform 0.22s ease, opacity 0.22s ease, width 0.22s ease, padding 0.22s ease;
  }
  .mtb-panel-map-sidebar.has-detail {
    grid-template-columns: 60px minmax(300px, 1fr) minmax(300px, 1fr);
    width: min(1080px, 94vw);
    min-width: 820px;
  }
  .mtb-panel-map-sidebar__empty {
    padding: 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: #e5e7eb;
    text-align: center;
  }
  .mtb-sidebar-rail { position: relative; align-self: start; }
  .mtb-sidebar-detail {
    background: rgba(17,20,28,0.7);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 12px 14px;
    display: grid;
    gap: 10px;
    overflow: hidden;
    position: relative;
  }
  .mtb-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
  }
  .mtb-detail-title {
    font-size: 16px;
    font-weight: 700;
    color: #f8fafc;
    margin-top: 4px;
  }
  .mtb-detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  .mtb-detail-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .mtb-detail-stat {
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
  }
  .mtb-detail-stat span {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .mtb-detail-stat strong {
    display: block;
    font-size: 13px;
    color: #e5e7eb;
    margin-top: 4px;
  }
  .mtb-sidebar-detail.is-empty,
  .mtb-sidebar-detail.is-closed { display: none; }
  .mtb-sidebar-detail .detail-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.32);
    color: #e5e7eb;
    cursor: pointer;
  }
  .mtb-sidebar-detail {
    background: rgba(17,20,28,0.6);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 12px 14px;
    display: grid;
    gap: 10px;
    overflow: hidden;
  }
  .mtb-sidebar-header {
    position: sticky;
    top: 0;
    z-index: 3;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 6px 0 12px;
    background: linear-gradient(180deg, rgba(12,16,24,0.98), rgba(12,16,24,0.6));
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .mtb-sidebar-header .mtb-sidebar-meta {
    grid-column: 1 / -1;
    font-size: 12px;
    color: #9ca3af;
  }
  .mtb-sidebar-title {
    font-size: 19px;
    font-weight: 700;
    color: #e5e7eb;
  }
  .mtb-status-chip {
    padding: 6px 10px;
    border-radius: 12px;
    background: rgba(16,185,129,0.14);
    border: 1px solid rgba(16,185,129,0.35);
    color: #a7f3d0;
    font-size: 12px;
  }
  .mtb-header-actions {
    display: flex;
    gap: 6px;
  }
  .mtb-header-actions .mtb-rail-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    box-shadow: none;
  }
  .mtb-sidebar-section {
    display: grid;
    gap: var(--mtb-space-3);
    padding: 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
  }
  .mtb-panel-map-sidebar .mtb-sidebar-section:first-of-type { margin-top: 0; }

  .mtb-header-actions .mtb-rail-btn[data-rail="collapse"] { display: none; }

  .mtb-sidebar-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 6px;
    scrollbar-gutter: stable;
  }
  .mtb-top-band {
    display: grid;
    gap: 10px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
    padding-bottom: 6px;
    border-radius: 16px;
  }
  .mtb-list-stack {
    display: grid;
    gap: 10px;
    flex: 1 1 auto;
    min-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
    padding-bottom: 6px;
    position: relative;
  }
  .mtb-sidebar-scroll::-webkit-scrollbar { width: 10px; }
  .mtb-sidebar-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); border-radius: 10px; }
  .mtb-sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16); border-radius: 10px; border: 2px solid rgba(255,255,255,0.05); }
  .mtb-sidebar-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }
  .mtb-section-title {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
  }
  .mtb-filters-form {
    display: grid;
    gap: 12px;
  }
  .mtb-filters-form .mtb-pill {
    background: rgba(12, 16, 24, 0.8);
    border: 1px solid rgba(255,255,255,0.12);
  }
  .mtb-filter-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 8px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
  }
  .mtb-filter-chip {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0,229,255,0.12);
    border: 1px solid rgba(0,229,255,0.3);
    color: #c9f7ff;
    font-size: 11px;
    font-weight: 600;
  }
  .mtb-filter-empty {
    color: #94a3b8;
    font-size: 12px;
  }
  .mtb-filter-clear {
    margin-left: auto;
    padding: 6px 10px;
    font-size: 11px;
  }
  .mtb-select-chips {
    width: 100%;
    min-height: 140px;
    background: rgba(9, 12, 18, 0.92);
    color: #e5e7eb;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 8px;
  }
  .mtb-select-chips option {
    padding: 6px 8px;
    border-radius: 8px;
  }
  .mtb-select-chips option:checked {
    background: rgba(0,229,255,0.22);
    color: #eafcff;
  }
  .mtb-inline-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .mtb-pill-input input[type="search"] {
    width: 100%;
    background: rgba(9, 12, 18, 0.92);
    color: #e9eef7;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 10px 12px;
  }
  .mtb-map-list {
    display: grid;
    gap: 10px;
    padding-right: 4px;
    min-height: 0;
  }
  .mtb-map-list.is-loading {
    position: relative;
    min-height: 180px;
  }
  .mtb-map-list.is-loading::before {
    content: 'Loading routes…';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 12px;
    color: #94a3b8;
    background: rgba(10,12,18,0.65);
    border-radius: 14px;
    z-index: 1;
  }
  .mtb-map-list.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255,255,255,0.02), rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    transform: translateX(-100%);
    animation: mtb-shimmer 1.4s infinite;
    border-radius: 14px;
    z-index: 0;
  }
  .mtb-list-empty {
    padding: 14px;
    border-radius: 14px;
    background: rgba(12,16,24,0.75);
    border: 1px solid rgba(255,255,255,0.1);
    color: #e5e7eb;
    display: grid;
    gap: 10px;
    text-align: center;
  }
  @keyframes mtb-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
  }
  .mtb-card-route {
    background: rgba(18, 22, 32, 0.94);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.22);
    color: #e9eef7;
    transition: border-color 0.15s ease, box-shadow 0.2s ease, transform 0.15s ease;
  }
  .mtb-card-route.is-active {
    border-color: rgba(56,189,248,0.7);
    box-shadow: 0 14px 26px rgba(0,180,255,0.25);
    transform: translateY(-1px);
  }
  .mtb-card-route.is-hover {
    border-color: rgba(248,113,113,0.7);
  }
  .mtb-card-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    color: #38bdf8;
  }
  .mtb-card-route .mtb-popup__title {
    color: #f8fafc;
    font-weight: 700;
    margin-bottom: 4px;
  }
  .mtb-card-route .mtb-popup__stats {
    color: #b6c2d3;
  }
  .mtb-card-route .mtb-popup__excerpt {
    color: #94a3b8;
  }
  .mtb-panel-map-sidebar__section {
    display: grid;
    gap: var(--mtb-space-3);
  }
  .mtb-pill-row {
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    overflow-x:auto;
    padding-bottom:4px;
  }
  .pill-filter {
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:8px 10px;
    background:rgba(255,255,255,0.04);
    border:1px solid rgba(255,255,255,0.08);
    border-radius:12px;
    cursor:pointer;
    font-size:13px;
  }
  .pill-filter input { accent-color:#00E5FF; }
  .mtb-slider { display:grid; gap:6px; }
  .mtb-slider-row { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
  .mtb-slider-row input[type="range"] {
    width: 100%;
    accent-color: #00E5FF;
  }
  .mtb-toggle-row { display:flex; flex-wrap:wrap; gap:10px; }
  .pill-toggle {
    padding:8px 10px;
    border-radius:12px;
    background:rgba(255,255,255,0.04);
    border:1px solid rgba(255,255,255,0.08);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
  }
  .pill-toggle input { transform: scale(1.05); }
  .mtb-search-pill { position:relative; display:grid; gap:6px; }
  .mtb-search-pill > span {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
  }
  .mtb-search-pill .pill-clear { position:absolute; right:10px; top:50%; transform:translateY(-50%); background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.12); border-radius:50%; width:24px; height:24px; color:#e5e7eb; cursor:pointer; }
  .mtb-suggestion-list { position:absolute; left:0; right:0; top:100%; margin-top:6px; background:rgba(15,19,28,0.95); border:1px solid rgba(255,255,255,0.08); border-radius:12px; box-shadow:0 12px 28px rgba(0,0,0,0.35); max-height:220px; overflow:auto; display:none; z-index:120; }
  .mtb-suggestion-list.show { display:block; }
  .mtb-suggestion-list button { width:100%; text-align:left; padding:10px 12px; background:transparent; border:none; color:#e5e7eb; cursor:pointer; }
  .mtb-suggestion-list button:hover { background:rgba(0,229,255,0.08); }
  .mtb-hero { display:grid; gap:6px; margin-bottom:10px; }
  .mtb-hero-title { font-size:28px; font-weight:700; color:#f8fafc; }
  .mtb-hero-sub { color:#cbd5e1; font-size:14px; }
  .mtb-hero-pills { display:flex; gap:8px; flex-wrap:wrap; }
  .mtb-hero-pill { padding:10px 14px; border-radius:14px; background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1); color:#e5e7eb; cursor:pointer; }
  .mtb-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 4px;
  }
  .mtb-list-stack .mtb-tabs {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(11, 14, 20, 0.92);
    border-color: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
  }
  .mtb-tabs .tab-btn {
    flex: 1 1 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 8px 10px;
    color: #e2e8f0;
    text-align: center;
    font-weight: 600;
  }
  .mtb-tabs .tab-btn.is-active {
    border-color: rgba(0,229,255,0.55);
    color: #00E5FF;
    box-shadow: 0 6px 14px rgba(0,229,255,0.2);
    background: rgba(0,229,255,0.1);
  }
  .mtb-route-card {
    background: rgba(18,22,30,0.9);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius:14px;
    padding:12px;
    display:grid;
    grid-template-columns:72px 1fr;
    gap:12px;
    align-items:center;
    transition:border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 96px;
  }
  .mtb-route-card:hover { border-color:#00E5FF; box-shadow:0 10px 20px rgba(0,229,255,0.16); }
  .mtb-route-thumb {
    width:72px;
    height:64px;
    border-radius:12px;
    background: radial-gradient(circle at top, rgba(0,229,255,0.14), rgba(15,19,26,0.92));
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
    overflow: hidden;
  }
  .mtb-route-thumb::after {
    content:'';
    position:absolute;
    inset:0;
    background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.55));
  }
  .mtb-route-card .mtb-popup__title {
    font-size: 15px;
    line-height: 1.3;
  }
  .mtb-route-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: #d8e0ee;
    font-size: 11px;
    font-weight: 600;
  }
  .mtb-route-actions {
    align-items: center;
  }
  .mtb-route-actions .mtb-btn {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 10px;
  }
  .mtb-elev-chart { width:100%; height:140px; margin-top:10px; }
  .mtb-elev-panel {
    background: rgba(5, 8, 15, 0.75);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.25);
  }
  .mtb-metrics { display:flex; gap:8px; flex-wrap:wrap; margin-top:6px; }
  .mtb-metric-chip {
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:8px 10px;
    border-radius:12px;
    background: rgba(255,255,255,0.04);
    border:1px solid rgba(255,255,255,0.08);
    font-size:12px;
    color:#E5E7EB;
  }
  .mtb-route-line.is-selected { filter: drop-shadow(0 0 6px rgba(0,229,255,0.7)); stroke-dasharray: 10 6; animation: mtb-dash 1.6s linear infinite; }
  .mtb-route-line.is-heat {
    mix-blend-mode: screen;
    filter: drop-shadow(0 0 3px rgba(255,199,102,0.7)) drop-shadow(0 0 10px rgba(255,153,51,0.45));
  }
  .mtb-route-line.is-heat-glow {
    mix-blend-mode: screen;
    filter: blur(1.4px);
  }
  @keyframes mtb-dash { to { stroke-dashoffset: -32; } }
  .mtb-route-meta { display:flex; gap:8px; flex-wrap:wrap; font-size:12px; color:#cbd5e1; }
  .mtb-route-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:6px; }
  .mtb-panel-map-sidebar form {
    display: grid;
    gap: var(--mtb-space-3);
  }
  .mtb-panel-map-sidebar label {
    display: block;
    color: var(--mtb-text-strong);
    font-size: var(--mtb-fs-sm);
  }
  .mtb-panel-map-sidebar select,
  .mtb-panel-map-sidebar input {
    width: 100%;
    background: #161a24;
    color: #e9eef7;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 11px 12px;
  }
  .mtb-panel-map-sidebar .mtb-pill {
    background: #1b202c;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 12px 12px;
    display: block;
  }

  /* Popups */
  .mtb-popup {
    color: #e5e7eb;
    font-size: var(--mtb-fs-sm);
    min-width: 220px;
    max-width: 320px;
    background: rgba(8,10,14,0.95);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: none;
    backdrop-filter: blur(10px);
    padding: 8px 10px;
  }
  .mtb-popup__title {
    font-weight: 700;
    font-size: var(--mtb-fs-md);
    margin-bottom: 4px;
  }
  .mtb-popup__stats {
    color: #e5e7eb;
    margin-bottom: 6px;
  }
  .mtb-popup__excerpt {
    color: var(--mtb-text-muted);
    margin-bottom: 6px;
  }
  .mtb-popup__media {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    width: 100%;
    display: block;
  }
  .mtb-popup__media-wrap {
    border-radius: 12px;
    overflow: hidden;
    background: rgba(8,10,14,0.7);
    border: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 8px;
  }
  .mtb-popup__media img {
    width: 100%;
    display: block;
  }
  .mtb-popup__carousel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(6,9,14,0.6);
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .mtb-popup__nav {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(10,14,20,0.9);
    color: #e5e7eb;
    cursor: pointer;
  }
  .mtb-popup__count {
    font-size: 12px;
    color: #cbd5f5;
  }
  .mtb-popup__actions {
    display: grid;
    gap: 6px;
    margin: 6px 0 4px;
  }
  .mtb-popup__action {
    display: block;
    background: #0c121d;
    color: #e5e7eb;
    border: 1px solid rgba(255,255,255,0.12);
    padding: 7px 10px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    font-size: 12px;
  }
  .mtb-popup__action:hover {
    background: #0a0f18;
    color: #f8fafc;
  }
  .mtb-popup__status {
    font-size: 12px;
    color: rgba(226,232,240,0.7);
    min-height: 16px;
  }
  .mtb-popup__gallery {
    margin-top: 6px;
    display: block;
    width: 100%;
    background: #0c121d;
    color: #e5e7eb;
    border: 1px solid rgba(255,255,255,0.12);
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
  }
  .mtb-popup__gallery:hover {
    background: #0a0f18;
  }
  .mtb-popup-btn {
    margin-top:6px;
    display:inline-block;
    background: #0c121d;
    color: #e5e7eb;
    border: 1px solid rgba(255,255,255,0.12);
    padding: 8px 12px;
    border-radius: 10px;
    box-shadow: none;
  }
  .mtb-popup-btn:hover { background:#0a0f18; color:#f8fafc; }

  .mtb-detail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 6px;
    align-items: center;
  }
  .mtb-detail-thumb {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    overflow: hidden;
    padding: 0;
    background: rgba(12,18,29,0.7);
    cursor: pointer;
  }
  .mtb-detail-thumb img {
    width: 100%;
    height: 64px;
    object-fit: cover;
    display: block;
  }
  .mtb-detail-more {
    border: 1px dashed rgba(255,255,255,0.2);
    border-radius: 10px;
    color: rgba(226,232,240,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 64px;
    font-size: 12px;
  }
  .mtb-route-meta-count {
    background: rgba(15,23,42,0.5);
    border: 1px solid rgba(56,189,248,0.5);
    color: #e2e8f0;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
  }

  /* Override Leaflet popup chrome */
  .leaflet-popup-content-wrapper {
    background: transparent !important;
    color: #e5e7eb !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .leaflet-popup-content {
    margin: 0 !important;
    padding: 0 !important;
  }
  .leaflet-popup-content-wrapper.mtb-popup-hover,
  .mtb-popup-hover .leaflet-popup-content-wrapper {
    box-shadow: none !important;
    border: none !important;
  }
  .leaflet-popup-tip-container,
  .leaflet-popup-tip {
    display: none !important;
  }
  .leaflet-popup-content {
    margin: 8px 10px !important;
    color: #e5e7eb !important;
  }
  .leaflet-popup-close-button {
    color: #e5e7eb !important;
    opacity: 0.8 !important;
  }
  .leaflet-popup-close-button:hover {
    opacity: 1 !important;
  }

  /* Sidebar search/input glass */
  .mtb-panel-map-sidebar .mtb-pill-input {
    background: rgba(17,20,28,0.85);
    border: 1px solid rgba(255,255,255,0.08);
    color: #e5e7eb;
  }
  .mtb-panel-map-sidebar .mtb-pill-input input {
    background: transparent;
    color: #e5e7eb;
  }
  .mtb-panel-map-sidebar .mtb-pill-input input::placeholder {
    color: rgba(229,231,235,0.55);
  }
  .mtb-panel-map-sidebar .mtb-pill-input .pill-clear {
    background: rgba(255,255,255,0.08);
    color: #e5e7eb;
  }

  /* Cluster visuals */
  .mtb-cluster {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    transition: transform 0.15s ease, filter 0.15s ease;
  }
  .mtb-cluster__inner {
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(9,14,24,0.95), rgba(36,46,64,0.92));
    border: 1px solid rgba(255,255,255,0.28);
    color: #f8fafc;
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(0,229,255,0.25), 0 10px 22px rgba(0,0,0,0.55);
  }
  .mtb-cluster:hover { transform: scale(1.06); filter: drop-shadow(0 0 10px rgba(0,229,255,0.55)); }

  .mtb-marker-dot .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--mtb-accent-teal-a);
    border: 2px solid #fff;
    box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.15);
  }

  /* Marker icon shells */
  .mtb-marker-icon {
    background: rgba(15,23,42,0.82);
    backdrop-filter: blur(8px) saturate(130%);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    border-image: none;
    box-shadow: 0 8px 18px rgba(0,0,0,0.35);
    display:flex;
    align-items:center;
    justify-content:center;
    color:#E5E7EB;
    width:34px;
    height:34px;
    transform: translate(-50%,-50%);
    transition: transform 0.15s ease, filter 0.15s ease;
  }
  .mtb-marker-icon:hover { transform: translate(-50%,-50%) scale(1.1); filter: drop-shadow(0 0 6px rgba(0,229,255,0.6)); }
  .mtb-marker-icon.photo { padding:0; overflow:hidden; }
  .mtb-marker-icon.photo img { width:100%; height:100%; object-fit:cover; border-radius:10px; }
  .mtb-marker-icon .icon-glyph { font-size:16px; }

  /* Lightbox */
  .mtb-lightbox { position:fixed; inset:0; display:none; z-index:9999; }
  .mtb-lightbox.is-open { display:block; }
  .mtb-lightbox__backdrop { position:absolute; inset:0; background:rgba(0,0,0,0.55); backdrop-filter:blur(4px); }
  .mtb-lightbox__content { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); background:#0b0f16; border:1px solid rgba(255,255,255,0.08); border-radius:14px; box-shadow:0 18px 40px rgba(0,0,0,0.5); padding:12px; max-width:90vw; max-height:90vh; display:grid; gap:8px; }
  .mtb-lightbox__content img { max-width:80vw; max-height:70vh; border-radius:10px; object-fit:contain; }
  .mtb-lightbox__caption { color:#E5E7EB; font-size:14px; }
  .mtb-lightbox__close { position:absolute; top:8px; right:8px; background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.12); color:#E5E7EB; border-radius:50%; width:28px; height:28px; cursor:pointer; }
  .mtb-lightbox__nav { position:absolute; top:50%; transform:translateY(-50%); background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.12); color:#E5E7EB; border-radius:999px; padding:6px 10px; cursor:pointer; font-size:12px; }
  .mtb-lightbox__prev { left:10px; }
  .mtb-lightbox__next { right:10px; }
  .mtb-lightbox__thumbs { display:flex; gap:6px; overflow-x:auto; padding:2px; }
  .mtb-lightbox__thumb { border:1px solid rgba(255,255,255,0.12); background:transparent; padding:0; border-radius:6px; cursor:pointer; width:56px; height:38px; display:flex; align-items:center; justify-content:center; }
  .mtb-lightbox__thumb img { width:100%; height:100%; object-fit:cover; border-radius:5px; }
  .mtb-lightbox__thumb.is-active { border-color:#38bdf8; box-shadow:0 0 0 1px rgba(56,189,248,0.5); }

  .mtb-map-dock {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 14px;
    display: none;
    grid-auto-flow: column;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(10,12,18,0.9);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 12px 24px rgba(0,0,0,0.38);
    backdrop-filter: blur(10px);
    z-index: 160;
  }
  .mtb-map-dock button {
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(19,23,32,0.9);
    color: #e5e7eb;
    padding: 0 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
  }
  @media (min-width: 961px) {
    .mtb-map-dock { display: none !important; }
  }

  .leaflet-container {
    background: #0b1016;
  }
  .leaflet-control-zoom {
    position: absolute;
    right: 12px;
    left: auto;
    top: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 26px rgba(0,0,0,0.35);
    background: linear-gradient(145deg, rgba(15,19,28,0.82), rgba(34,41,56,0.78));
    backdrop-filter: blur(10px);
    z-index: 1200;
  }
  .leaflet-control-zoom a {
    color: #e5e7eb;
    background: rgba(255,255,255,0.04);
    border: none;
    width: 44px;
    height: 44px;
    line-height: 40px;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.12);
  }
  .leaflet-control-zoom a:hover {
    background: rgba(255,255,255,0.12);
  }
  .leaflet-control-zoom a:first-child { box-shadow: inset 0 -1px 0 rgba(0,0,0,0.18); }
  .leaflet-control-zoom a:last-child { box-shadow: none; }

  .mtb-sidebar-toggle {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 150;
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(17,20,28,0.8);
    color: #e5e7eb;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(0,0,0,0.32);
  }
  .mtb-map-shell.mtb-collapsed .mtb-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Collapsed */
  .mtb-map-shell.mtb-collapsed .mtb-panel-map-sidebar {
    transform: none;
    opacity: 1;
    pointer-events: auto;
    grid-template-columns: 60px;
    width: 82px;
    min-width: 82px;
    max-width: 82px;
    padding: 10px;
    resize: none;
  }
  .mtb-map-shell.mtb-collapsed .mtb-sidebar-scroll,
  .mtb-map-shell.mtb-collapsed .mtb-sidebar-detail {
    display: none;
  }
  .mtb-map-shell.mtb-collapsed .mtb-map-rail {
    position: relative;
    left: 0;
    top: 0;
  }
  .mtb-route-line.is-fallback {
    stroke-dasharray: 8 6;
    opacity: 0.6;
  }

  /* Mobile */
  @media (max-width: 960px) {
    .mtb-map-shell {
      min-height: 540px;
    }
    .mtb-panel-map-sidebar {
      position: absolute;
      left: 12px;
      right: 12px;
      top: 12px;
      bottom: auto;
      height: auto;
      max-height: 70vh;
      width: auto;
      grid-template-columns: 1fr;
      gap: 12px;
      padding: 14px;
      border-radius: 16px;
      border: 1px solid rgba(255,255,255,0.08);
      box-shadow: 0 12px 26px rgba(0,0,0,0.35);
      transition: transform 0.25s ease, opacity 0.25s ease;
      transform: translateY(-120%);
      opacity: 0;
      pointer-events: none;
    }
    .mtb-panel-map-sidebar.is-open {
      transform: translateY(0);
      opacity: 1;
      pointer-events: auto;
    }
    .mtb-map-canvas {
      min-height: 420px;
    }
    .mtb-map-rail { display: none; }
    .mtb-map-dock { display: grid; }
    .mtb-sidebar-detail { display: none; }
    .mtb-mobile-toggle { display: none; }
    .mtb-sidebar-rail { display: none; }
  .mtb-mobile-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
    border-radius: 16px;
    z-index: 140;
    display: none;
  }
  .mtb-panel-map-sidebar.is-open + .mtb-mobile-backdrop {
    display: block;
  }
  .mtb-mobile-bar {
    display: none !important;
  }
  }
}
