/* Карта к открытию (12.11.2026): лента годов, легенда, карточки, «Показать точки», «Здесь: …». Перенесено из макета. */
/* МАКЕТ «Старая Москва по векам» — только для снимков */
#veka-legend { position: absolute; right: 12px; top: 68px; z-index: 6; background: var(--color-paper); border: 1px solid var(--color-line); border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0,0,0,.1); font: var(--text-s) var(--font-sans); color: var(--color-ink); min-width: 210px; }
#veka-legend button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
#veka-legend .vl-h { display: block; width: 100%; padding: 10px 14px; font-family: var(--font-serif); font-size: 17px; font-weight: 600; }
#veka-legend .vl-h::after { content: '▾'; float: right; color: var(--color-muted); }
#veka-legend.closed .vl-h::after { content: '▸'; }
#veka-legend.closed .vl-b { display: none; }
#veka-legend .vl-b { padding: 0 8px 10px; }
#veka-legend .vl-i { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 4px 8px; border-radius: var(--radius); font-size: 15px; }
#veka-legend .vl-i:hover { background: #f3ede2; }
#veka-legend .vl-i span { margin-left: auto; color: var(--color-muted); font-size: 13px; }
#veka-legend .vl-i[aria-pressed=false] { color: var(--color-muted); text-decoration: line-through; }
#veka-legend .vl-i[aria-pressed=false] i { opacity: .25; }
#veka-legend i { display: inline-block; width: 16px; height: 16px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1.2px #fff, 0 0 0 2px rgba(0,0,0,.15); }
#veka-legend .vl-n { margin: 6px 8px 0; display: flex; align-items: center; gap: 10px; color: var(--color-muted); font-size: 13px; }
#veka-legend .vl-vit { box-shadow: 0 0 0 1.5px #fff, 0 0 0 4px var(--color-ochre), 0 0 0 5px #5a3a24; width: 14px; height: 14px; margin: 1px 3px; }
#veka-legend .vl-ring { width: 12px; height: 12px; margin: 2px; }
#veka-find { position: absolute; right: 12px; top: 12px; z-index: 6; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px;
  background: var(--color-paper); color: var(--color-accent); border: 1.5px solid var(--color-accent); border-radius: var(--radius);
  font: 600 var(--text-m) var(--font-sans); text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
#veka-find svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
#veka-find:hover { background: var(--color-accent); color: var(--color-paper); }
.veka-pop .maplibregl-popup-content { font-family: var(--font-sans); padding: 12px 30px 12px 14px; border-radius: var(--radius); background: var(--color-paper); }
.veka-pop p { margin: 0 0 4px; }
.veka-pop .vp-t { font: 600 17px/1.3 var(--font-serif); color: var(--color-ink); }
.veka-pop .vp-a { color: var(--color-muted); font-size: 13px; }
.veka-pop .vp-d { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-top: 6px; }
.veka-pop .vp-d i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.veka-pop .vp-l { font: italic 14px/1.4 var(--font-serif); color: var(--color-ink); margin-top: 6px; }
.veka-pop .vp-go { display: inline-block; margin-top: 8px; padding: 8px 12px; background: var(--color-accent); color: var(--color-paper); border-radius: var(--radius); text-decoration: none; font-weight: 600; font-size: 14px; }
.veka-pop .maplibregl-popup-close-button { font-size: 22px; width: 30px; height: 30px; }
/* крупная панель сравнения (Лупа / Шторка / годы) на компьютере */
@media (min-width: 700px) {
  #cmp-panel { font-size: 15px; padding: 6px 10px; gap: 8px; bottom: 40px; }
  .cmp-modes button { width: 46px; height: 42px; }
  #cmp-panel svg { width: 24px; height: 24px; }
  #cmp-layers select { height: 42px; max-width: 220px; font-size: 15px; }
  #ctl-epochs button, #cmp-swap, #cmp-close { height: 42px; }
  #cmp-close { padding: 0 12px 0 8px; font-size: 15px; }   /* «× Закрыть» (11.11) */
  #cmp-panel input[type=range] { width: 160px; }
}
@media (max-width: 699px) {
  #veka-legend { top: 8px; right: 8px; min-width: 0; }
  #veka-find { display: none; }
  #veka-legend .vl-h { font-size: 15px; padding: 8px 12px; }
}
/* старая легенда карты («есть история места») заменяется легендой «Время постройки» */
main > .legend { display: none !important; }
@media (max-width: 699px) {  }
.maplibregl-popup.veka-pop { z-index: 7; }

/* легенда из двух строк (10.11 ночь) */
#veka-legend { padding: 8px 12px; min-width: 0; }
#veka-legend .vl-n { margin: 4px 0; color: var(--color-ink); font-size: 14px; }
#veka-legend .vl-dot { width: 10px; height: 10px; margin: 0 5px; box-shadow: 0 0 0 1.2px #fff, 0 0 0 2px rgba(0,0,0,.15); }
#veka-legend .vl-vit { width: 14px; height: 14px; margin: 3px; }
.veka-pop .vp-d { display: block; font-size: 15px; }
@media (max-width: 699px) { #veka-legend { padding: 6px 10px; } #veka-legend .vl-n { font-size: 13px; } }
#veka-legend { top: 78px; } @media (max-width: 699px) { #veka-legend { top: 8px; } }
/* лента годов вместо кнопки сравнения */
#cmp-open { display: none !important; }
#veka-ribbon { position: absolute; left: 50%; transform: translateX(-50%); bottom: 34px; z-index: 6; text-align: center; pointer-events: none; }
#veka-ribbon p { margin: 0 0 4px; font: 600 12px var(--font-sans); letter-spacing: .04em; color: var(--color-muted); text-shadow: 0 0 4px #fbf8f2, 0 0 8px #fbf8f2; }
#veka-ribbon .yrs { display: inline-flex; align-items: center; gap: 2px; background: var(--color-paper); border: 1px solid var(--color-line); border-radius: 999px;
  padding: 4px 6px; box-shadow: 0 2px 10px rgba(0,0,0,.14); pointer-events: auto; white-space: nowrap; }
#veka-ribbon i { color: var(--color-muted); font-style: normal; padding: 0 2px; }
#veka-ribbon button { font: 600 16px var(--font-sans); color: var(--color-plan); background: none; border: 0; border-radius: 999px; padding: 8px 14px; min-height: 40px; cursor: pointer; }
#veka-ribbon button:hover { background: var(--color-plan-soft); }
#veka-ribbon button.on { background: var(--color-plan); color: var(--color-paper); }
#veka-ribbon button.pulse { animation: veka-pulse 0.9s ease-in-out 3; }
@keyframes veka-pulse { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 6px var(--color-plan-soft); background: var(--color-plan-soft); } }
body.cmp-on #veka-ribbon { bottom: 116px; }
#veka-hint { position: absolute; left: 50%; top: calc(50% - 150px); transform: translateX(-50%); z-index: 7; background: var(--color-ochre-soft); color: var(--color-ink); border: 1px solid var(--color-ochre);
  font: 600 15px var(--font-sans); padding: 8px 14px; border-radius: var(--radius); pointer-events: none; white-space: nowrap; }
body.veka-hint-fade #lens-wrap, body.veka-hint-fade #lens-ring, body.veka-hint-fade #veka-hint { opacity: 0; transition: opacity .8s ease; }
@media (max-width: 699px) {
  #veka-ribbon { bottom: 58px; width: calc(100% - 16px); }
  #veka-ribbon .yrs { gap: 0; padding: 3px 4px; }
  #veka-ribbon button { font-size: 14px; padding: 6px 8px; min-height: 36px; }
  #veka-ribbon i { padding: 0; }
  body.cmp-on #veka-ribbon { bottom: 188px; }
  #veka-hint { font-size: 13px; top: calc(50% - 120px); }
}
/* страховка (замечание 11.11): ничего не выходит за правый край окна при любом масштабе браузера */
html, body { max-width: 100%; overflow-x: hidden; }
#veka-find, #veka-legend { max-width: calc(100% - 24px); box-sizing: border-box; }
/* за краем плана в лупе */
#veka-noplan { position: absolute; z-index: 4; transform: translate(-50%, -50%); max-width: 180px; text-align: center; pointer-events: none;
  font: 600 14px/1.35 var(--font-sans); color: var(--color-muted); background: rgba(251,248,242,.92); padding: 8px 12px; border-radius: 8px; }
/* лупа за границей плана — плавно гаснет (11.11) */
#lens-wrap, #lens-ring { transition: opacity .35s ease; }
body.lens-off-plan #lens-wrap, body.lens-off-plan #lens-ring { opacity: 0; }
#veka-noplan { display: none !important; }
/* «Показать точки» при плане целиком (11.11) */
#veka-pts { position: absolute; z-index: 4; top: 12px; left: 50%; transform: translateX(-50%); min-height: 40px; padding: 0 16px; border-radius: var(--radius);
            background: var(--color-paper); color: var(--color-accent); border: 1px solid var(--color-accent); font: 600 15px var(--font-sans); cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
#veka-pts:hover { background: var(--color-accent); color: var(--color-paper); }
#veka-pts[hidden] { display: none; }
@media (max-width: 699px) { #veka-pts { top: 56px; font-size: 14px; } }
/* план целиком: годы уже на ленте — в панели их не повторяем (11.11) */
body.veka-full #ctl-epochs { display: none !important; }
/* «Здесь: …» — несколько объектов в одной точке (11.11) */
.veka-pop .vp-here { font: 600 12px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--color-muted); margin: 0 0 6px; }
.veka-pop .vp-it + .vp-it { border-top: 1px solid var(--color-line); margin-top: 10px; padding-top: 10px; }
.veka-pop .vp-it .vp-t { font-size: 16px; }
.veka-pop .vp-it .vp-go { margin-top: 6px; padding: 6px 10px; font-size: 13px; }
.veka-pop .vp-or { display: block; margin-top: 6px; font: 12px var(--font-sans); color: var(--color-muted); }
/* значки легенды — SVG из public/js/veka-dots.js (13.11): рамка шириной под самый крупный значок, по центру */
#veka-legend .vl-ic { display: inline-flex; width: 30px; justify-content: center; align-items: center; flex: none; margin-right: 6px; }
#veka-legend .vl-n { display: flex; align-items: center; }

/* ---------- «Старые фото», часть 1 (13.11.2026): карточка снимка, пара «тогда / сейчас», фото на весь экран ---------- */
#veka-photo { position: absolute; z-index: 8; left: 52px; top: 12px;   /* 15.11 (п. 4): правее кнопок «+ / −» */
   width: 380px; max-height: calc(100% - 24px); overflow: auto;
  background: var(--color-paper); border: 1px solid var(--color-line); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(35, 31, 26, .22); }
#veka-photo[hidden] { display: none; }
#veka-photo .x { position: absolute; top: 8px; right: 8px; z-index: 3; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(251, 248, 242, .92); color: var(--color-ink); font-size: 20px; line-height: 1; }
#veka-photo .ph { background: #2b2722; cursor: zoom-in; }
/* полдень 15.11 (п. 11): в группе снимков поле снимка одной высоты — при листании «‹ ›» кнопки и текст не прыгают */
#veka-photo.grp .ph { height: 270px; display: flex; align-items: center; justify-content: center; }
#veka-photo.grp .ph img { max-height: 100%; width: auto; max-width: 100%; }
#veka-photo .ph img { display: block; width: 100%; height: auto; }
#veka-photo .body { padding: 12px 16px 16px; }
#veka-photo .t { margin: 0 0 6px; font: 600 20px/1.25 'CG Page', 'Cormorant Garamond', Georgia, serif; font-variant-numeric: lining-nums; color: var(--color-ink); }
#veka-photo .c { margin: 0 0 6px; font: italic 13.5px/1.45 'Lora Page', Lora, Georgia, serif; color: var(--color-muted); }
#veka-photo .acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
#veka-photo .b { border: 1px solid var(--color-line); background: var(--color-paper); color: var(--color-ink); border-radius: 999px; padding: 8px 14px; cursor: pointer;
  font: 600 13px 'Lora Page', Lora, Georgia, serif; }
#veka-photo .b:hover { border-color: var(--color-accent); color: var(--color-accent); }
#veka-photo .b.main { background: var(--color-plan); border-color: var(--color-plan); color: var(--color-paper); }
/* пара «тогда / сейчас»: снизу «сегодня», сверху «тогда» обрезан по ползунку */
#veka-photo .pair { position: relative; aspect-ratio: var(--ar); background: #2b2722; overflow: hidden; --x: 50%; }
#veka-photo .pair img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
#veka-photo .pair .then-w { position: absolute; inset: 0; }
#veka-photo .pair::after { content: ''; position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; margin-left: -1px; background: var(--color-paper);
  box-shadow: 0 0 4px rgba(0, 0, 0, .5); pointer-events: none; }
#veka-photo .pair .lb { position: absolute; bottom: 8px; padding: 2px 8px; border-radius: 3px; background: rgba(251, 248, 242, .9); color: var(--color-ink);
  font: 600 13px 'Lora Page', Lora, Georgia, serif; pointer-events: none; z-index: 2; }
#veka-photo .pair .lb.l { left: 8px; } #veka-photo .pair .lb.r { right: 8px; }
#veka-photo .pair input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 2; }
#veka-photo-full { position: fixed; inset: 0; z-index: 50; background: rgba(20, 18, 15, .92); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
#veka-photo-full[hidden] { display: none; }
#veka-photo-full img { max-width: 96vw; max-height: 92vh; }
#veka-photo-full .x { position: absolute; top: 14px; right: 14px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(251, 248, 242, .92); font-size: 24px; }
@media (max-width: 699px) {
  #veka-photo { position: fixed; left: 0; right: 0; top: auto; bottom: 56px; width: auto; max-height: 72vh; border-radius: 14px 14px 0 0; border-bottom: 0; }
  #veka-photo .ph img { max-height: 44vh; object-fit: contain; margin: 0 auto; }
  /* полдень 15.11 (п. 11): у группы снимков карточка постоянной высоты — при листании «‹ ›» не прыгает; снимок — в поле одной высоты */
  #veka-photo.grp { height: 72vh; }
  #veka-photo.grp .ph { height: 44vh; display: flex; align-items: center; justify-content: center; }
  #veka-photo.grp .ph img { max-height: 100%; }
}
/* «Старые фото»: листание снимков с одной точки и строка «откуда снято» (решение заказчицы 13.11) */
#veka-photo .nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; padding: 8px 12px; border-bottom: 1px solid var(--color-line);
  font: italic 13px 'Lora Page', Lora, Georgia, serif; color: var(--color-muted); }
#veka-photo .nav .b { width: 34px; height: 34px; padding: 0; font-size: 20px; line-height: 1; }
#veka-photo .from { margin: -2px 0 6px; font: italic 13px/1.4 'Lora Page', Lora, Georgia, serif; color: var(--color-muted); }   /* 15.11: под названием, мелкий курсив Lora */
/* лента годов + кнопки слоёв справа от неё (итог 13.11): «Старые фото» — пилюля той же высоты, что лента; место для «Реклама 1901 г.» */
#veka-ribbon .rb-row { display: flex; flex-wrap: wrap-reverse; justify-content: center; align-items: center; gap: 6px 8px; }
#veka-ribbon .layers { display: inline-flex; gap: 6px; pointer-events: none; }
#veka-ribbon .layers > * { pointer-events: auto; }   /* щелчки ловят только кнопки, не пустое место строки (14.11) */
#veka-ribbon .layers:empty { display: none; }
#veka-ribbon .layer-btn { display: inline-flex; align-items: center; gap: 6px; height: 50px; min-height: 0; box-sizing: border-box; padding: 0 16px 0 10px;
  border: 1.5px solid #1f3a68; border-radius: 999px; background: var(--color-paper); color: #1f3a68; box-shadow: 0 2px 10px rgba(0,0,0,.14);
  font: 600 15px 'Lora Page', Lora, Georgia, serif; white-space: nowrap; cursor: pointer; }
#veka-ribbon .layer-btn:hover { background: #e9edf4; }
#veka-ribbon .layer-btn[aria-pressed=true] { background: #1f3a68; color: #fff; }
#veka-ribbon .layer-btn[hidden] { display: none; }
#veka-ribbon .layer-btn .ico { flex: none; }
@media (max-width: 699px) {
  #veka-ribbon .layer-btn { height: 44px; font-size: 14px; padding: 0 14px 0 8px; }
}

/* утраченное главное здание (13.11): строка под заголовком карточки — Lora курсивом, сепия */
.veka-pop .vp-lost { margin: 2px 0 4px; font: italic 13.5px/1.4 'Lora Page', Lora, Georgia, serif; color: #6b5a48; }

/* подсказка «Показать план целиком» — план со «Исторических планов» открыт крупно в центре (14.11) */
#veka-planhint { position: absolute; z-index: 7; left: 50%; transform: translateX(-50%); top: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  max-width: calc(100% - 24px); box-sizing: border-box; background: var(--color-paper); border: 1px solid var(--color-line); border-radius: var(--radius); padding: 6px 8px 6px 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,.12); font: 15px/1.35 var(--font-serif); color: var(--color-ink); }
#veka-planhint button[data-all] { background: none; border: 0; padding: 4px 2px; font: 600 15px var(--font-serif); color: var(--color-accent); text-decoration: underline; cursor: pointer; }
#veka-planhint .x { background: none; border: 0; font-size: 20px; line-height: 1; color: var(--color-muted); cursor: pointer; padding: 2px 6px; }
@media (max-width: 699px) { #veka-planhint { top: 8px; font-size: 14px; } #veka-planhint button[data-all] { font-size: 14px; } }

/* боковая панель истории (/map?o=…) открыта — таблички «Найдите свой дом» и легенда переезжают левее панели, ничего её не перекрывает (14.11) */
@media (min-width: 700px) {
  body.card-open #veka-find, body.card-open #veka-legend { right: 372px; }
}
@media (max-width: 699px) {   /* телефон: панель — снизу; лента годов и «Старые фото» на это время скрыты */
  body.card-open #veka-ribbon { display: none; }
}

/* «экран для плана» (14.11, п. 17): пока показан исторический план — без «Найдите свой дом» и «Старых фото», легенда только с точками */
body.veka-plan #veka-find, body.veka-plan #veka-ribbon .layers { display: none !important; }
body.veka-plan:not(.veka-pts-on) #veka-legend { display: none !important; }
