:root {
  /* Тёмная полоса */
  --rail-bg: #1f2b3a;
  --rail-fg: #93a3b8;
  --rail-active: #ffffff;
  /* Светлая панель */
  --sb-bg: #f6f7f9;
  --sb-fg: #262b33;
  --sb-muted: #8b929d;
  --sb-line: #e5e8ec;
  --sb-hover: #eceef2;
  --sb-active: #e4e9f3;
  --sb-input: #eceef1;
  /* Акценты */
  --accent: #ff8a3d;
  --accent-2: #ffb26b;
  /* Тёмные всплывающие карточки на карте */
  --bg: rgba(18, 22, 30, 0.88);
  --bg-solid: #12161e;
  --fg: #e8ecf3;
  --muted: #8f9bb0;
  --line: rgba(255, 255, 255, 0.09);
  --hover: rgba(255, 255, 255, 0.06);
  --radius: 14px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--rail-bg); overflow: hidden; }
button { font: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Каркас: полоса | панель | карта ---------- */
.app { display: flex; height: 100%; }
.map-wrap { position: relative; flex: 1; min-width: 0; }
#map { position: absolute; inset: 0; }
body:not(.in-city) .city-only { display: none !important; }

/* ---------- Тёмная полоса с иконками ---------- */
.rail {
  flex: none; width: 52px; background: var(--rail-bg); display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 10px 0 12px; z-index: 3;
}
.rail__logo {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 14px;
  background: linear-gradient(135deg, #2f4560, #1a2533); box-shadow: inset 0 0 0 1.5px #5d7491; color: #fff;
}
.rail__logo svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.rail__btn {
  position: relative; width: 36px; height: 36px; border: 0; border-radius: 9px; background: none; color: var(--rail-fg);
  display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s;
}
.rail__btn:hover { background: rgba(255,255,255,.08); color: #dbe4ef; }
.rail__btn.active { background: rgba(255,255,255,.12); color: var(--rail-active); }
.rail__badge {
  position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: #2fa55a; color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.rail__spacer { flex: 1; }

/* ---------- Светлая панель ---------- */
.sidebar {
  flex: none; width: 272px; display: flex; flex-direction: column; background: var(--sb-bg); color: var(--sb-fg);
  border-right: 1px solid var(--sb-line); font-size: 13px; z-index: 2; transition: margin-left .25s ease;
}
.app.collapsed .sidebar { margin-left: -272px; }
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 8px 16px; }
.sb-head h1 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: .1px; }
.sb-icon { width: 26px; height: 26px; border: 0; border-radius: 6px; background: none; color: var(--sb-muted); cursor: pointer; display: grid; place-items: center; }
.sb-icon:hover { background: var(--sb-hover); color: var(--sb-fg); }
.sb-icon svg { width: 15px; height: 15px; }

.sb-search { position: relative; padding: 2px 12px 10px; border-bottom: 1px solid var(--sb-line); }
.sb-input {
  width: 100%; height: 32px; padding: 0 10px 0 32px; border: 1px solid transparent; border-radius: 8px; outline: none;
  background: var(--sb-input) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238b929d' stroke-width='2'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath d='m10 10 3 3'/%3E%3C/svg%3E") no-repeat 11px center;
  color: var(--sb-fg); font: inherit; font-size: 13px;
}
.sb-input:focus { background-color: #fff; border-color: #c9d3e3; box-shadow: 0 0 0 3px rgba(80,120,200,.12); }
.sb-input[hidden] { display: none; }

.sb-scroll { flex: 1; overflow-y: auto; padding: 6px 0 12px; }
.sb-sec { padding: 4px 0; }
.sb-sec + .sb-sec { border-top: 1px solid var(--sb-line); }
.sb-sec__head {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 16px 6px; border: 0; background: none;
  color: var(--sb-fg); font-weight: 600; font-size: 13px; cursor: pointer; text-align: left;
}
.sb-sec__head:hover { color: #000; }
.caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; transition: transform .15s; opacity: .7; }
.sb-sec.closed .caret { transform: rotate(-90deg); }
.sb-sec.closed > :not(.sb-sec__head) { display: none; }
.sb-count { color: var(--sb-muted); font-weight: 400; font-size: 12px; }

.sb-list { list-style: none; margin: 0; padding: 0 8px; }
.sb-item {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 30px; padding: 4px 8px; border: 0; border-radius: 7px;
  background: none; color: var(--sb-fg); font-size: 13px; text-align: left; cursor: pointer;
}
.sb-item:hover, .sb-item.hover { background: var(--sb-hover); }
.sb-item.current { background: var(--sb-active); font-weight: 600; }
.sb-item.disabled { color: var(--sb-muted); cursor: default; }
.sb-item.disabled:hover { background: none; }
.sb-item__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-sq {
  flex: none; width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center;
  color: #fff; font-size: 9.5px; font-weight: 700; letter-spacing: -.2px; overflow: hidden;
}
.sb-sq img { width: 100%; height: 100%; object-fit: cover; }
.sb-tag { flex: none; font-size: 10.5px; padding: 1px 6px; border-radius: 99px; background: #e9ebef; color: var(--sb-muted); }
.sb-tag.on { background: #fff1e6; color: #e2711d; }
.sb-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #f5a524; }
.sb-empty { padding: 6px 10px; color: var(--sb-muted); font-size: 12px; }
.sb-more { color: var(--sb-muted); }

.sb-about { padding: 0 16px 6px; }
.sb-muted { color: var(--sb-muted); margin: 0 0 8px; font-size: 12px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; }
.facts div { background: #fff; border: 1px solid var(--sb-line); border-radius: 8px; padding: 6px 8px; }
.facts dt { font-size: 10.5px; color: var(--sb-muted); }
.facts dd { margin: 1px 0 0; font-weight: 600; font-size: 12.5px; }
.about { font-size: 12.5px; line-height: 1.5; color: #4a515c; margin: 10px 0 2px; }

.sb-foot { padding: 8px 16px; border-top: 1px solid var(--sb-line); color: var(--sb-muted); font-size: 11px; }

/* ---------- Результаты поиска ---------- */
.results {
  /* Шире панели: выпадает поверх карты, чтобы длинные названия помещались */
  list-style: none; margin: 4px 0 0; padding: 4px; position: absolute; left: 12px; top: 36px; z-index: 10;
  width: min(400px, calc(100vw - 76px));
  background: #fff; border: 1px solid var(--sb-line); border-radius: 10px;
  box-shadow: 0 12px 30px rgba(20,30,50,.18); max-height: 380px; overflow-y: auto;
}
.results[hidden] { display: none; }
.results__msg { padding: 10px; font-size: 12.5px; color: var(--sb-muted); }
.result {
  display: flex; gap: 9px; align-items: center; width: 100%; padding: 6px 7px; border: 0; border-radius: 7px;
  background: none; color: var(--sb-fg); text-align: left; cursor: pointer;
}
.result:hover, .result.active { background: var(--sb-hover); }
.result__img, .result__icon { flex: none; width: 30px; height: 30px; border-radius: 6px; }
.result__img { object-fit: cover; }
.result__icon { display: grid; place-items: center; background: #fff1e6; color: #e2711d; font-size: 15px; }
.result__body { display: flex; flex-direction: column; min-width: 0; }
/* Название и подпись переносятся полностью, без обрезки многоточием */
.result { align-items: flex-start; }
.result__img, .result__icon { margin-top: 1px; }
.result__name { font-size: 13px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.result__sub { font-size: 11.5px; line-height: 1.35; color: var(--sb-muted); overflow-wrap: anywhere; margin-top: 1px; }

/* ---------- Панель инструментов на карте ---------- */
.toolbar {
  position: absolute; top: 12px; right: 52px; left: 12px; width: fit-content; margin-left: auto; z-index: 2;
  display: flex; gap: 2px; align-items: center; flex-wrap: wrap; justify-content: flex-end;
  padding: 4px; background: rgba(255,255,255,.96); color: var(--sb-fg); font-size: 13px;
  border: 1px solid var(--sb-line); border-radius: 10px; box-shadow: 0 4px 16px rgba(20,30,50,.15);
}
.toggle { display: flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 7px; cursor: pointer; user-select: none; }
.toggle:hover { background: var(--sb-hover); }
.toggle input { accent-color: var(--accent); margin: 0; }
.tb-sep { width: 1px; height: 20px; background: var(--sb-line); margin: 0 4px; }
.btn { border: 0; background: none; color: var(--sb-fg); padding: 5px 9px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.btn:hover { background: var(--sb-hover); }
.btn:disabled { color: #c3c7ce; cursor: default; background: none; }
.fontsize { display: flex; align-items: center; }
.fontsize .btn { font-weight: 600; padding: 5px 8px; }
#fontValue { min-width: 38px; text-align: center; font-size: 12px; color: var(--sb-muted); font-variant-numeric: tabular-nums; }
.select { background: var(--sb-input); color: var(--sb-fg); border: 0; border-radius: 7px; padding: 5px 8px; font: inherit; font-size: 13px; cursor: pointer; }

.btn--accent { background: var(--accent); color: #fff; font-weight: 600; }
.btn--accent:hover { background: #f07a2c; }
.btn--icon { display: grid; place-items: center; padding: 5px 7px; }
.btn--icon svg { width: 17px; height: 17px; }

/* ---------- Экскурсия ---------- */
.tour {
  position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 6;
  width: min(460px, calc(100% - 24px)); background: #fff; color: var(--sb-fg);
  border: 1px solid var(--sb-line); border-radius: 14px; box-shadow: 0 12px 34px rgba(20,30,50,.28); overflow: hidden;
}
.tour[hidden] { display: none; }
.tour__progress { height: 3px; background: var(--sb-input); }
.tour__progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s; }
.tour__row { display: flex; align-items: center; gap: 4px; padding: 8px 10px; }
.tour__btn {
  flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--sb-fg);
  font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.tour__btn:hover { background: var(--sb-hover); }
.tour__btn--main { background: var(--accent); color: #fff; font-size: 14px; }
.tour__btn--main:hover { background: #f07a2c; }
.tour__close { font-size: 15px; color: var(--sb-muted); }
.tour__info { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0 6px; }
.tour__label { font-size: 11px; color: var(--sb-muted); }
.tour__info b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tour__timer { height: 2px; background: transparent; }
.tour__timer span { display: block; height: 100%; width: 0; background: rgba(255,138,61,.45); }
body.touring .hint { display: none; }
.tour { --tour-color: var(--accent); }
.tour__progress span, .tour__btn--main { background: var(--tour-color); }
.tour__btn--main:hover { background: var(--tour-color); filter: brightness(.93); }

/* ---------- Список экскурсий в панели ---------- */
.tour-list { display: grid; gap: 4px; padding: 0 8px 4px; }
.tour-card {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 8px; border: 1px solid transparent; border-radius: 9px;
  background: none; color: var(--sb-fg); text-align: left; cursor: pointer;
}
.tour-card:hover { background: #fff; border-color: var(--sb-line); box-shadow: 0 2px 8px rgba(20,30,50,.06); }
.tour-card.playing { background: #fff; border-color: var(--tc); box-shadow: 0 0 0 1px var(--tc) inset; }
.tour-card__icon {
  flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--tc); color: #fff; font-size: 15px;
}
.tour-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tour-card__title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.tour-card__meta { font-size: 11.5px; color: var(--sb-muted); }
.tour-card__about { font-size: 12px; color: #5b6370; line-height: 1.4; display: none; }
.tour-card:hover .tour-card__about, .tour-card.playing .tour-card__about { display: block; }
.tour-card__play {
  flex: none; align-self: center; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sb-input); color: var(--tc); font-size: 11px;
}
.tour-card:hover .tour-card__play, .tour-card.playing .tour-card__play { background: var(--tc); color: #fff; }

/* ---------- Уведомление ---------- */
.toast {
  position: absolute; left: 50%; top: 70px; transform: translate(-50%, -10px); z-index: 20; pointer-events: none;
  background: #1f2b3a; color: #fff; font-size: 13px; padding: 8px 14px; border-radius: 99px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); opacity: 0; transition: opacity .25s, transform .25s; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.hint {
  position: absolute; bottom: 92px; left: 50%; transform: translateX(-50%); z-index: 2;
  font-size: 12px; color: var(--sb-fg); background: rgba(255,255,255,.92); padding: 6px 12px; border-radius: 99px;
  border: 1px solid var(--sb-line); pointer-events: none; white-space: nowrap; transition: opacity .4s;
}
.hint.hidden { opacity: 0; }

/* ---------- Маркеры городов (обзор) ---------- */
.city-marker { display: flex; align-items: center; gap: 6px; cursor: pointer; transform-origin: left center; }
.city-marker .pin {
  width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(255,138,61,.7); animation: pulse 2s infinite;
}
.city-marker .label {
  font-size: 12px; font-weight: 600; color: #fff; background: rgba(18,22,30,.85);
  padding: 3px 8px; border-radius: 6px; white-space: nowrap;
}
.city-marker.label-left { flex-direction: row-reverse; }
.city-marker.disabled { cursor: default; }
.city-marker.disabled .pin { background: #8f9bb0; animation: none; width: 10px; height: 10px; }
.city-marker.disabled .label { opacity: .7; font-weight: 500; }
.city-marker:not(.disabled):hover .label, .city-marker.hover .label { background: var(--accent); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,138,61,.7); }
  70% { box-shadow: 0 0 0 14px rgba(255,138,61,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,138,61,0); }
}

/* ---------- Фото-маркеры объектов ---------- */
.photo-marker {
  width: 48px; height: 48px; padding: 0; border-radius: 50%; overflow: hidden; cursor: pointer;
  border: 3px solid #fff; background: #333; box-shadow: 0 3px 10px rgba(0,0,0,.45);
  transition: width .2s, height .2s, border-color .2s;
}
.photo-marker img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-marker:hover, .photo-marker.hover { border-color: var(--accent); z-index: 5; width: 60px; height: 60px; }
.photo-marker.small { width: 30px; height: 30px; border-width: 2px; }

/* ---------- Карточка объекта / галерея ---------- */
/* Светлые, в стиле боковой панели */
.card { width: 300px; max-width: 100%; color: var(--sb-fg); }
.card h4 { margin: 8px 18px 4px 0; font-size: 15px; font-weight: 600; line-height: 1.3; color: #1d2128; }
.card__imgbtn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.card__img { width: 100%; height: 170px; object-fit: cover; border-radius: 8px; display: block; background: var(--sb-input); }
.card__text { margin: 4px 0 8px; color: #4a515c; font-size: 13px; line-height: 1.45; }
.card a { color: #e2711d; font-size: 13px; font-weight: 500; text-decoration: none; }
.card a:hover { text-decoration: underline; }
.gallery-wrap { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--sb-line); }
.gallery__title { font-size: 11px; color: var(--sb-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 7px; }
.gallery { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.gallery__item { flex: none; width: 76px; height: 76px; padding: 0; border: 0; border-radius: 7px; overflow: hidden; cursor: zoom-in; background: var(--sb-input); box-shadow: inset 0 0 0 1px var(--sb-line); }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.gallery__item:hover img { transform: scale(1.08); }
.gallery__loading { font-size: 12px; color: var(--sb-muted); padding: 6px 0; }

/* ---------- Лайтбокс ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(5,7,10,.92); color: var(--fg);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; width: min(1280px, 100% - 100px); height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lightbox img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 140px); min-height: 0; object-fit: contain; border-radius: 6px; }
.lightbox figcaption { margin-top: 10px; text-align: center; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.lightbox figcaption b { color: var(--fg); font-size: 15px; }
.lightbox figcaption a { color: var(--accent-2); }
.lb-close, .lb-nav {
  position: absolute; border: 0; background: rgba(255,255,255,.1); color: #fff; cursor: pointer;
  border-radius: 50%; width: 44px; height: 44px; font-size: 26px; line-height: 1;
}
.lb-close { top: 16px; right: 16px; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 16px; } .lb-next { right: 16px; }
.lb-close:hover, .lb-nav:hover { background: var(--accent); }

/* ---------- Всплывающие окна MapLibre ---------- */
.maplibregl-popup-content {
  background: #fff; color: var(--sb-fg); border-radius: 12px; padding: 12px; font-size: 13px;
  border: 1px solid var(--sb-line); box-shadow: 0 10px 30px rgba(20, 30, 50, .22);
}
.maplibregl-popup-tip { border-top-color: #fff !important; border-bottom-color: #fff !important; }
.maplibregl-popup-close-button {
  top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 6px; font-size: 18px; line-height: 22px;
  color: var(--sb-muted); background: rgba(255,255,255,.9);
}
.maplibregl-popup-close-button:hover { background: var(--sb-hover); color: var(--sb-fg); }
/* В карточке с фото крестик лежит поверх снимка — делаем его заметнее */
.photo-popup .maplibregl-popup-close-button { top: 16px; right: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.25); z-index: 1; }
.photo-popup .card:not(:has(.card__img)) ~ .maplibregl-popup-close-button,
.photo-popup:not(:has(.card__img)) .maplibregl-popup-close-button { top: 6px; right: 6px; box-shadow: none; }

/* ---------- Телефон: полоса скрыта, панель — шторка снизу ---------- */
@media (max-width: 720px) {
  .rail { display: none; }
  .app { display: block; }
  .map-wrap { position: absolute; inset: 0; }
  .sidebar {
    position: absolute; left: 0; right: 0; bottom: 0; width: auto; height: 50%; z-index: 4;
    border-right: 0; border-top: 1px solid var(--sb-line); border-radius: 14px 14px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.25);
    transition: height .25s ease;
  }
  .app.collapsed .sidebar { margin-left: 0; height: 104px; }
  .app.collapsed #panelToggle svg { transform: rotate(90deg); }
  #panelToggle svg { transform: rotate(-90deg); }
  .toolbar { left: 8px; right: 50px; top: 8px; justify-content: flex-start; }
  .toolbar .tb-sep { display: none; }
  .results { width: auto; right: 12px; }
  .hint { display: none; }
}

/* Во время экскурсии карточка компактнее — не заходит под панель экскурсии */
body.touring .card__text { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Нижние панели инструментов (сравнение, измерения) ---------- */
.tool-bar {
  position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 6;
  width: min(460px, calc(100% - 24px)); background: #fff; color: var(--sb-fg);
  border: 1px solid var(--sb-line); border-radius: 14px; box-shadow: 0 12px 34px rgba(20,30,50,.28);
}
.tool-bar[hidden] { display: none; }
.tool-bar--wide { width: min(720px, calc(100% - 24px)); }
.tool-bar__row { display: flex; align-items: center; gap: 8px; padding: 8px 8px 4px 12px; flex-wrap: wrap; }
.tool-bar__icon { font-size: 20px; }
.tool-bar__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tool-bar__label { font-size: 11px; color: var(--sb-muted); }
.tool-bar__hint { padding: 0 12px 9px; font-size: 11.5px; color: var(--sb-muted); line-height: 1.4; }
.cmp-pick { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.cmp-pick .select { font-weight: 500; }

/* Шторка */
.cmp-map { position: absolute; inset: 0; pointer-events: none; }
.cmp-map[hidden] { display: none; }
.cmp-slider { position: absolute; top: 0; bottom: 0; width: 0; z-index: 3; }
.cmp-slider[hidden] { display: none; }
.cmp-slider__line { position: absolute; top: 0; bottom: 0; left: -1.5px; width: 3px; background: #fff; box-shadow: 0 0 8px rgba(0,0,0,.45); pointer-events: none; }
.cmp-slider__handle {
  position: absolute; top: 50%; left: -22px; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%;
  border: 3px solid #fff; background: var(--accent); color: #fff; font-size: 18px; cursor: ew-resize; touch-action: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.cmp-chip {
  position: absolute; top: 96px; white-space: nowrap; font-size: 12px; font-weight: 600; color: #fff;
  background: rgba(31,43,58,.85); padding: 4px 10px; border-radius: 99px; pointer-events: none;
}
.cmp-chip--left { right: 12px; }
.cmp-chip--right { left: 12px; background: rgba(255,138,61,.92); }

/* Измерения */
body.measuring .maplibregl-canvas { cursor: crosshair !important; }
.ms-tabs { display: flex; background: var(--sb-input); border-radius: 9px; padding: 3px; gap: 2px; }
.ms-tab { border: 0; background: none; padding: 5px 10px; border-radius: 7px; font-size: 12.5px; color: var(--sb-fg); cursor: pointer; white-space: nowrap; }
.ms-tab:hover { background: rgba(255,255,255,.6); }
.ms-tab.active { background: #fff; box-shadow: 0 1px 3px rgba(20,30,50,.15); font-weight: 600; }
.ms-result { flex: 1; min-width: 140px; font-size: 13px; }
.ms-profile { border-top: 1px solid var(--sb-line); padding: 8px 12px 10px; }
.ms-profile__msg { font-size: 12.5px; color: var(--sb-muted); padding: 8px 0; }
.ms-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 6px; }
.ms-stats div { display: flex; flex-direction: column; background: var(--sb-bg); border-radius: 7px; padding: 4px 7px; }
.ms-stats span { font-size: 10.5px; color: var(--sb-muted); }
.ms-stats b { font-size: 13px; }
.ms-chart-wrap { position: relative; }
.ms-chart { width: 100%; height: 150px; display: block; cursor: crosshair; }
.ms-grid { stroke: var(--sb-line); stroke-width: 1; }
.ms-axis { font-size: 10px; fill: var(--sb-muted); }
.ms-line { fill: none; stroke: #ff8a3d; stroke-width: 2; vector-effect: non-scaling-stroke; }
.ms-cross { stroke: #1f2b3a; stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.ms-dot { fill: #fff; stroke: #ff8a3d; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.ms-tip {
  position: absolute; top: 0; transform: translateX(-50%); background: #1f2b3a; color: #fff; font-size: 11.5px;
  padding: 2px 7px; border-radius: 5px; pointer-events: none; white-space: nowrap;
}
.ms-note { font-size: 10.5px; color: var(--sb-muted); margin-top: 4px; }
.ms-label {
  background: #1f2b3a; color: #fff; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 6px;
  white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.3); pointer-events: none;
}
.ms-hover-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid #ff8a3d; box-shadow: 0 0 0 3px rgba(31,43,58,.35); }
@media (max-width: 720px) {
  .ms-stats { grid-template-columns: repeat(3, 1fr); }
  .ms-result { min-width: 100%; order: 3; }
  .cmp-chip { top: 120px; }
}

/* «Тогда и сейчас» — такая же заметная кнопка, как «Экскурсии», но своего цвета */
.btn--then { background: #5b8def; margin-left: 4px; }
.btn--then:hover { background: #4a7de0; }
.btn--then.active { background: #1f2b3a; box-shadow: inset 0 0 0 2px #5b8def; }
.btn--accent { white-space: nowrap; }

/* Шторка проходит под панелью инструментов; подписи — у ручки, не зависят от высоты панели */
.toolbar { z-index: 5; }
.cmp-chip { top: calc(50% - 58px); }
@media (max-width: 720px) { .cmp-chip { top: calc(50% - 58px); } }

/* Однотонные линейные значки на кнопках (вместо цветных эмодзи) */
.ico { width: 15px; height: 15px; flex: none; vertical-align: -3px; }
.btn--accent { display: inline-flex; align-items: center; gap: 6px; }
.btn--accent .ico { stroke-width: 2; }
.ms-tab { display: inline-flex; align-items: center; gap: 5px; }
.ms-tab .ico { width: 14px; height: 14px; }
.tool-bar__icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #eaf0fd; color: #5b8def; }
.tool-bar__icon .ico { width: 18px; height: 18px; stroke-width: 1.9; }

/* ---------- Солнце и время суток ---------- */
.btn--sun { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; font-weight: 600; }
.btn--sun .ico--moon { display: none; }
.btn--sun.is-night .ico--moon { display: block; }
.btn--sun.is-night .ico:not(.ico--moon) { display: none; }
.btn--sun .ico { color: #e0a21a; }
.btn--sun.is-night .ico { color: #5b6fbf; }
.tool-bar__icon--sun { background: #fff4dc; color: #e0a21a; }
.sun-now { font-size: 13px; }
.sun-now b { font-size: 16px; font-variant-numeric: tabular-nums; margin-right: 4px; }
.sun-now span { color: var(--sb-muted); }
.sun-date { font-size: 12.5px; padding: 4px 6px; }
.sun-live.active { background: #fff4dc; color: #b57a00; font-weight: 600; }
.sun-play.active { background: var(--accent); color: #fff; }
.sun-slider { padding: 2px 14px 0; }
.sun-slider input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border-radius: 99px; outline: none;
  background: linear-gradient(90deg, #1d2a52, #8ec5f5 50%, #1d2a52); margin: 6px 0 2px;
}
.sun-slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  border: 3px solid #f59e42; box-shadow: 0 2px 6px rgba(0,0,0,.3); cursor: grab;
}
.sun-slider input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid #f59e42; cursor: grab; }
.sun-ticks { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--sb-muted); font-variant-numeric: tabular-nums; }
.sun-presets { display: flex; gap: 4px; padding: 6px 12px 10px; flex-wrap: wrap; }
.sun-presets .ms-tab { background: var(--sb-input); }

/* ---------- Фильтры объектов ---------- */
.flt-row { cursor: pointer; }
.flt-row input { margin: 0 2px 0 4px; accent-color: var(--accent); flex: none; }
.flt-ico svg { width: 13px; height: 13px; stroke: #fff; stroke-width: 2; fill: none; }
.flt-count { flex: none; font-size: 11.5px; color: var(--sb-muted); font-variant-numeric: tabular-nums; }
.flt-actions { display: flex; align-items: center; gap: 10px; padding: 6px 10px 2px; }
.link-mini { border: 0; background: none; padding: 0; color: #e2711d; font-size: 12px; cursor: pointer; }
.link-mini:hover { text-decoration: underline; }
.flt-note { margin-left: auto; font-size: 11px; color: var(--sb-muted); }

/* Общая галочка в заголовке раздела — на одной вертикали с галочками строк */
.sb-sec { position: relative; }
.sb-sec__check { position: absolute; top: 12px; right: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.sb-sec.closed .sb-sec__check { display: block; }
.flt-actions { padding-top: 4px; }
.flt-note { margin-left: 10px; }

/* Карточка города внутри раздела «Города» */
.sb-list > .sb-about { padding: 6px 8px 8px; }

/* ---------- Поддержка проекта ---------- */
.city-marker.disabled.soon { cursor: pointer; }
.promo-li { padding: 8px 0 4px; }
.promo-cta {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: 10px; cursor: pointer; text-align: left;
  border: 1px dashed #f3b27a; background: linear-gradient(135deg, #fff6ee, #fff); color: var(--sb-fg);
}
.promo-cta:hover { border-style: solid; box-shadow: 0 3px 12px rgba(245,158,66,.18); }
.promo-cta__icon { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); }
.promo-cta__icon svg { width: 16px; height: 16px; stroke: #fff; fill: none; stroke-width: 2; }
.promo-cta__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: #6b6259; line-height: 1.35; }
.promo-cta__body b { font-size: 13px; color: var(--sb-fg); }
.promo-cta__go { flex: none; font-size: 20px; color: #e2711d; }

.promo-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(15,20,30,.55); display: grid; place-items: center; padding: 16px; }
.promo-dialog {
  position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  background: #fff; color: var(--sb-fg); border-radius: 16px; padding: 22px 22px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
  font-size: 13.5px;
}
.promo-close { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; font-size: 22px; color: var(--sb-muted); cursor: pointer; }
.promo-close:hover { background: var(--sb-hover); color: var(--sb-fg); }
.promo-badge { display: inline-block; font-size: 11px; font-weight: 600; color: #e2711d; background: #fff1e6; padding: 3px 9px; border-radius: 99px; }
.promo-dialog h2 { margin: 10px 0 6px; font-size: 20px; }
.promo-lead { margin: 0 0 14px; color: #555d69; line-height: 1.5; }
.promo-price { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 14px; border-radius: 10px; background: #fff6ee; margin-bottom: 14px; }
.promo-price span { color: #6b6259; }
.promo-price b { font-size: 22px; color: #e2711d; }
.promo-step { display: grid; grid-template-columns: 24px 1fr; gap: 6px 10px; align-items: center; margin-bottom: 12px; font-weight: 600; }
.promo-step > :nth-child(n+3) { grid-column: 2; font-weight: 400; }
.promo-step__n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--rail-bg); color: #fff; font-size: 12px; }
.promo-input { background-image: none; padding-left: 10px; }
.promo-card { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border: 1px solid var(--sb-line); border-radius: 10px; background: var(--sb-bg); }
.promo-card__num { flex: 1; font-size: 18px; font-weight: 700; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.promo-purpose__text { flex: 1; font-size: 14px; }
.promo-copy { flex: none; border: 0; border-radius: 7px; padding: 6px 10px; background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.promo-copy:hover { background: #f07a2c; }
.promo-note { margin: 4px 0 0; font-size: 12px; color: var(--sb-muted); }

/* ---------- Посещаемость ---------- */
.rail__badge--online { background: #2fa55a; }
.st-box { padding: 2px 16px 8px; }
.st-total { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.st-total__n { display: block; font-size: 28px; line-height: 1.05; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.st-total__l { font-size: 11.5px; color: var(--sb-muted); }
.st-online { flex: none; display: grid; grid-template-columns: auto auto; align-items: center; gap: 0 5px; padding: 5px 8px; border-radius: 9px; background: #eaf7ef; }
.st-online b { font-size: 15px; color: #1f7a42; }
.st-online span:last-child { grid-column: 1 / -1; font-size: 10.5px; color: #3a8a58; }
.st-dot { width: 8px; height: 8px; border-radius: 50%; background: #2fa55a; box-shadow: 0 0 0 0 rgba(47,165,90,.6); animation: stPulse 1.8s infinite; }
@keyframes stPulse { 70% { box-shadow: 0 0 0 7px rgba(47,165,90,0); } 100% { box-shadow: 0 0 0 0 rgba(47,165,90,0); } }
.st-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.st-tiles div { background: #fff; border: 1px solid var(--sb-line); border-radius: 8px; padding: 5px 7px; display: flex; flex-direction: column; }
.st-tiles span { font-size: 10.5px; color: var(--sb-muted); }
.st-tiles b { font-size: 14px; font-variant-numeric: tabular-nums; }
.st-sub { font-size: 11px; font-weight: 600; color: var(--sb-muted); text-transform: uppercase; letter-spacing: .5px; margin: 12px 0 6px; }
.st-chart { width: 100%; height: 44px; display: block; }
.st-bar { fill: #f3c49b; }
.st-bar--today { fill: var(--accent); }
.st-top { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.st-obj { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 6px; border: 0; border-radius: 7px; background: none; color: var(--sb-fg); font-size: 12.5px; text-align: left; cursor: pointer; }
.st-obj:hover { background: var(--sb-hover); }
.st-rank { flex: none; width: 16px; font-weight: 700; color: var(--sb-muted); text-align: center; font-variant-numeric: tabular-nums; }
.st-top li:first-child .st-rank { color: #e2a20b; }
.st-obj img, .st-noimg { flex: none; width: 26px; height: 26px; border-radius: 6px; object-fit: cover; background: var(--sb-input); }
.st-obj__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-obj__n { flex: none; display: inline-flex; align-items: center; gap: 3px; color: var(--sb-muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.st-ico svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; display: block; }
.st-tours { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; }
.st-tours li { display: flex; align-items: center; gap: 8px; }
.st-tour__dot { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.st-tour__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-tours b { font-size: 11.5px; color: var(--sb-muted); font-weight: 500; }
.st-note { font-size: 10.5px; color: var(--sb-muted); margin: 10px 0 0; }
/* строки топа не шире панели (иначе grid растягивает их по длине названия) */
.sb-scroll { overflow-x: hidden; }
.st-top, .st-tours { grid-template-columns: minmax(0, 1fr); }
.st-tiles div { min-width: 0; }
.st-tiles span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.city-marker.label-top { flex-direction: column-reverse; gap: 3px; transform-origin: center bottom; }

/* ---------- Разрушения (оценка по снимкам) ---------- */
.sb-sec[hidden] { display: none !important; }
.dm-box { padding: 2px 16px 10px; }
.dm-lead { margin: 0 0 8px; font-size: 12px; color: #4a515c; line-height: 1.45; }
.dm-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; margin-bottom: 8px; background: var(--sb-input); }
.dm-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; }
.dm-legend li { display: flex; align-items: center; gap: 8px; }
.dm-sw { flex: none; width: 12px; height: 12px; border-radius: 3px; }
.dm-name { flex: 1; min-width: 0; }
.dm-legend b { font-variant-numeric: tabular-nums; }
.dm-pct { width: 34px; text-align: right; color: var(--sb-muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.dm-note { margin: 10px 0 0; font-size: 10.5px; color: var(--sb-muted); line-height: 1.45; }
.dm-chip { display: inline-block; color: #fff; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.dm-small { font-size: 11.5px !important; color: var(--sb-muted) !important; margin-top: -4px !important; }
