/* «Сходимся»: карта на весь экран, панель слева (компьютер) или снизу (телефон), страницы подборок */
:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --card-2: #f1ede6;
  --ink: #1d2733;
  --ink-2: #4b5664;
  --muted: #6d7782;
  --line: rgba(29, 39, 51, .1);
  --accent: #2463e8;
  --accent-ink: #ffffff;
  --warm: #ff8a2b;
  --ok: #1a8f55;
  --bad: #c8412f;
  --shadow: 0 6px 30px rgba(20, 30, 45, .16), 0 1px 3px rgba(20, 30, 45, .1);
  --radius: 18px;
  --display: 'Unbounded', 'Golos Text', system-ui, sans-serif;
  --text: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --c-food: #e8590c; --c-coffee: #b5651d; --c-bars: #9c36b5; --c-sights: #1c7ed6;
  --c-views: #0c8599; --c-nature: #2f9e44; --c-stay: #5f6b7a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --card: #1d222a;
    --card-2: #262c36;
    --ink: #eef1f5;
    --ink-2: #c3cad3;
    --muted: #98a2ae;
    --line: rgba(238, 241, 245, .1);
    --accent: #5b8ff5;
    --ok: #4cc386;
    --bad: #f07a68;
    --shadow: 0 6px 30px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }

[data-cat='food'] { --cat: var(--c-food); } [data-cat='coffee'] { --cat: var(--c-coffee); }
[data-cat='bars'] { --cat: var(--c-bars); } [data-cat='sights'] { --cat: var(--c-sights); }
[data-cat='views'] { --cat: var(--c-views); } [data-cat='nature'] { --cat: var(--c-nature); }
[data-cat='stay'] { --cat: var(--c-stay); }
.cat-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--cat, var(--accent)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--cat, var(--accent)) 25%, transparent); }

.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.brand img { flex: none; }
.brand span { display: flex; flex-direction: column; min-width: 0; }
.brand b { font: 600 19px/1.1 var(--display); letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang-link { flex: none; font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); }
.lang-link:hover { color: var(--accent); border-color: currentColor; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { color: var(--accent-ink); filter: brightness(1.08); }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { color: var(--accent); border-color: currentColor; }

/* ---------- Карта ---------- */
body.app { position: fixed; inset: 0; overflow: hidden; }
/* MapLibre задаёт контейнеру position: relative, поэтому селектор сильнее */
body.app #map { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, #12233f 0%, #070c18 70%); }
.side { position: fixed; z-index: 2; top: 14px; left: 14px; bottom: 14px; width: 392px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.topbar, .sheet { pointer-events: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.topbar { padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 12px; }
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.search { position: relative; }
.search input { width: 100%; height: 44px; padding: 0 14px 0 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); color: var(--ink); font: inherit; font-size: 15px; outline: none; }
.search input:focus { border-color: var(--accent); background: var(--card); }
.search-ico { position: absolute; left: 12px; top: 12px; width: 20px; height: 20px; color: var(--muted); }
.results { position: absolute; z-index: 5; left: 0; right: 0; top: 50px; margin: 0; padding: 6px; list-style: none; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); max-height: 60vh; overflow: auto; }
.results li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.results li[aria-selected='true'], .results li:hover { background: var(--card-2); }
.results li span { display: flex; flex-direction: column; min-width: 0; }
.results small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results .empty { color: var(--muted); cursor: default; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--cat, var(--accent)); }
.chip[aria-pressed='true'] { background: var(--cat, var(--accent)); border-color: var(--cat, var(--accent)); color: #fff; }
.chip[aria-pressed='true'] .cat-dot { background: #fff; box-shadow: none; }

.sheet { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.sheet-grab { display: none; }
.sheet-body { flex: 1; overflow-y: auto; padding: 18px 18px 22px; overscroll-behavior: contain; }
.h-sheet { font: 600 21px/1.25 var(--display); letter-spacing: -.01em; margin: 0 0 6px; }
.h-small { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 10px; }
.lead { color: var(--ink-2); margin: 6px 0 14px; }
.about { color: var(--muted); font-size: 12.5px; margin: 18px 0 0; }

.coll-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.coll { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--card-2); color: inherit; text-decoration: none; border: 1px solid transparent; transition: border-color .15s, transform .15s; }
.coll:hover { border-color: var(--cat, var(--accent)); transform: translateX(2px); }
.coll .cat-dot { width: 12px; height: 12px; }
.coll-text { display: flex; flex-direction: column; min-width: 0; }
.coll-text b { font-weight: 600; }
.coll-text small { color: var(--muted); font-size: 12.5px; }

.view-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.view-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.orig { color: var(--muted); margin: 0 0 6px; font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }

.coll-items { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.coll-item { display: flex; gap: 12px; width: 100%; text-align: left; padding: 10px; border-radius: 12px; border: 0; background: none; cursor: pointer; }
.coll-item:hover { background: var(--card-2); }
.num { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--cat, var(--accent)); color: #fff; font-weight: 700; font-size: 13px; }
.coll-item-text { display: flex; flex-direction: column; gap: 1px; }
.coll-item-text small { color: var(--muted); font-size: 12.5px; }
.coll-item-text span { color: var(--ink-2); font-size: 14px; }
.more-link { display: inline-block; margin-top: 14px; font-weight: 600; font-size: 14px; text-decoration: none; }

.wx { background: var(--card-2); border-radius: 14px; padding: 12px 14px; margin: 4px 0 12px; }
.wx p { margin: 0; }
.wx-now { display: flex; align-items: center; gap: 10px; }
.wx-big { font-size: 34px; line-height: 1; }
.wx-temp { font: 600 30px/1 var(--display); letter-spacing: -.02em; }
.wx-desc { font-size: 13.5px; line-height: 1.35; }
.wx-desc b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.wx-days { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.wx-day { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; background: var(--card); border-radius: 10px; padding: 7px 10px; font-size: 13.5px; }
.wx-day > span:first-child { width: 100%; font-size: 12px; color: var(--muted); }
.wx-emo { font-size: 17px; }
.wx-rain { color: #2a72d6; font-size: 12.5px; }
.wx-link { display: inline-block; margin-top: 10px; font-size: 13.5px; font-weight: 600; text-decoration: none; }

.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rows li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; overflow-wrap: anywhere; }
.rows .pre { display: block; white-space: pre-line; color: var(--ink-2); }
.is-open { color: var(--ok); } .is-closed { color: var(--bad); }
.row-ico { flex: none; width: 20px; height: 20px; margin-top: 1px; background: var(--muted); -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ico-pin { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 21s-7-6.5-7-11.5a7 7 0 0 1 14 0C19 14.5 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E"); }
.ico-clock { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.ico-dish { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 15h18M5 15a7 7 0 0 1 14 0M12 6V4M4 19h16'/%3E%3C/svg%3E"); }
.ico-mountain { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 20 10 8l4 6 2-3 5 9z'/%3E%3C/svg%3E"); }
.ico-star { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z'/%3E%3C/svg%3E"); }
.ico-phone { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M5 3h4l2 5-2.5 1.5a11 11 0 0 0 6 6L16 13l5 2v4a2 2 0 0 1-2 2A17 17 0 0 1 3 5a2 2 0 0 1 2-2z'/%3E%3C/svg%3E"); }
.ico-globe { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18'/%3E%3C/svg%3E"); }
.ico-camera { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='5'/%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3C/svg%3E"); }
.ico-book { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 4h6a2 2 0 0 1 2 2v14a2 2 0 0 0-2-2H4zM20 4h-6a2 2 0 0 0-2 2v14a2 2 0 0 1 2-2h6z'/%3E%3C/svg%3E"); }

.revs { display: flex; flex-wrap: wrap; gap: 8px; }
.rev { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.rev::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--rev); }
.rev:hover { border-color: var(--rev); }
.rev-google { --rev: #4285f4; } .rev-yandex { --rev: #fc3f1d; } .rev-2gis { --rev: #19aa1e; } .rev-tripadvisor { --rev: #34e0a1; }
.note { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }
.note a { color: inherit; }

.near { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.near button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px; border: 0; border-radius: 10px; background: none; cursor: pointer; }
.near button:hover { background: var(--card-2); }
.near span:not(.cat-dot) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.near b { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.near small { color: var(--muted); font-size: 12px; }
.near em { font-style: normal; color: var(--muted); font-size: 12.5px; flex: none; }

.toast { position: fixed; z-index: 10; left: 50%; bottom: calc(var(--sheet-h, 0px) + 20px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow); }

/* Подсказки и элементы MapLibre */
.hover-tip .maplibregl-popup-content { background: var(--card); color: var(--ink); font: 600 13px/1.3 var(--text); padding: 6px 10px; border-radius: 9px; box-shadow: var(--shadow); }
.hover-tip .maplibregl-popup-tip { display: none; }
.maplibregl-ctrl-group { border-radius: 12px !important; box-shadow: var(--shadow) !important; }
.maplibregl-ctrl-top-right { top: 6px; right: 6px; }
@media (prefers-color-scheme: dark) {
  .maplibregl-ctrl-group { background: var(--card); }
  .maplibregl-ctrl-group button + button { border-top-color: var(--line); }
  .maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(1) hue-rotate(180deg); }
  .maplibregl-ctrl.maplibregl-ctrl-attrib, .maplibregl-ctrl.maplibregl-ctrl-attrib.maplibregl-compact { background: rgba(29, 34, 42, .88); color: var(--ink-2); }
  .maplibregl-ctrl-attrib a { color: var(--ink-2); }
  .maplibregl-ctrl-attrib-button { filter: invert(1); }
}

/* ---------- Телефон: поиск сверху, панель снизу ---------- */
@media (max-width: 899px) {
  .side { display: contents; }
  .topbar { position: fixed; z-index: 3; top: 0; left: 0; right: 0; border-radius: 0 0 var(--radius) var(--radius); padding: calc(10px + env(safe-area-inset-top)) 12px 10px; gap: 9px; }
  .brand b { font-size: 17px; }
  .brand img { width: 30px; height: 30px; }
  .brand small { font-size: 12px; }
  .chips { margin: 0 -12px; padding: 0 12px 2px; }
  .sheet { position: fixed; z-index: 3; left: 0; right: 0; bottom: 0; max-height: 62vh; max-height: 62dvh; border-radius: var(--radius) var(--radius) 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .sheet-grab { display: flex; justify-content: center; align-items: center; height: 26px; flex: none; border: 0; background: none; cursor: pointer; touch-action: none; }
  .sheet-grab span { width: 42px; height: 5px; border-radius: 3px; background: var(--line); background: color-mix(in srgb, var(--ink) 22%, transparent); }
  .sheet:not(.open) .sheet-body { max-height: 64px; overflow: hidden; padding-top: 2px; }
  .sheet-body { padding: 4px 16px 18px; }
  .h-sheet { font-size: 19px; }
  .maplibregl-ctrl-top-right { top: calc(var(--top-h, 120px) + 4px); }
  .maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { bottom: var(--sheet-h, 90px); }
}

/* ---------- Страницы подборок ---------- */
body.guide { min-height: 100vh; }
.g-top { max-width: 820px; margin: 0 auto; padding: 18px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.g-main { max-width: 820px; margin: 0 auto; padding: 8px 16px 40px; }
.g-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; margin: 10px 0 6px; }
.g-main h1 { font: 600 clamp(26px, 5vw, 38px)/1.15 var(--display); letter-spacing: -.02em; margin: 0 0 12px; }
.g-lead { font-size: 17px; color: var(--ink-2); max-width: 680px; margin: 0 0 18px; }
.g-list { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.g-item { display: flex; gap: 14px; background: var(--card); border-radius: var(--radius); padding: 16px 18px; box-shadow: 0 1px 3px rgba(20, 30, 45, .08); }
.g-item h2 { font-size: 18px; margin: 2px 0 2px; }
.g-item p { margin: 4px 0; }
.g-type { color: var(--muted); font-size: 13.5px; }
.g-num { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--cat, var(--accent)); color: #fff; font-weight: 700; }
.g-link { display: inline-block; margin-top: 4px; font-weight: 600; font-size: 14px; text-decoration: none; }
.g-more { font: 600 20px/1.2 var(--display); margin: 40px 0 8px; }
.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.coll-grid .coll { background: var(--card); }
.g-foot { max-width: 820px; margin: 0 auto; padding: 0 16px 30px; color: var(--muted); font-size: 13px; }
