/* ===== Токены темы. Хочешь поменять вид — начинай отсюда. ===== */
:root {
  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;

  --bg: #dfe9f0;
  --ink: #10233b;
  --ink-2: #4b5e74;
  --ink-3: #8394a8;
  /* «жидкое стекло»: прозрачный фон + сильное размытие + блики по краям */
  --glass: rgba(255, 255, 255, 0.26);
  --glass-strong: rgba(255, 255, 255, 0.5);
  --glass-tile: rgba(255, 255, 255, 0.42);
  --glass-card: rgba(255, 255, 255, 0.46);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-hi: radial-gradient(120% 80% at 0% 0%, rgba(255,255,255,0.55), rgba(255,255,255,0) 55%), radial-gradient(90% 60% at 100% 100%, rgba(255,255,255,0.25), rgba(255,255,255,0) 60%);
  --glass-edge: inset 0 1px 0 rgba(255,255,255,0.85), inset 0 -1px 0 rgba(255,255,255,0.25), inset 1px 0 0 rgba(255,255,255,0.35), inset -1px 0 0 rgba(255,255,255,0.2);
  --line: rgba(16, 35, 59, 0.1);
  --accent: #0d6d8a;
  --accent-ink: #ffffff;
  --gold: #e09b2d;
  --good: #1a9e77;
  --mid: #e6a93a;
  --bad: #d1495b;
  --shadow: 0 18px 50px -20px rgba(16, 35, 59, 0.45);
  --blur: blur(26px) saturate(1.9) brightness(1.04);
  --radius-l: 22px;
  --radius-m: 14px;
  --radius-s: 9px;
  --topbar-h: 64px;
}

:root[data-theme="night"] {
  --bg: #03060d;
  --ink: #eef3fb;
  --ink-2: #a3b1c4;
  --ink-3: #6b7b91;
  /* тёмные панели теперь всегда — и над светлой подробной картой тоже, поэтому стекло плотнее */
  --glass: rgba(16, 24, 48, 0.55);
  --glass-strong: rgba(16, 24, 48, 0.72);
  --glass-tile: rgba(255, 255, 255, 0.06);
  --glass-card: rgba(14, 22, 44, 0.8);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-hi: radial-gradient(120% 80% at 0% 0%, rgba(255,255,255,0.16), rgba(255,255,255,0) 55%), radial-gradient(90% 60% at 100% 100%, rgba(140,180,255,0.12), rgba(255,255,255,0) 60%);
  --glass-edge: inset 0 1px 0 rgba(255,255,255,0.22), inset 0 -1px 0 rgba(255,255,255,0.06), inset 1px 0 0 rgba(255,255,255,0.1), inset -1px 0 0 rgba(255,255,255,0.05);
  --line: rgba(255, 255, 255, 0.09);
  --accent: #ffc56b;
  --accent-ink: #1a1203;
  --gold: #ffc56b;
  --good: #3fd4a4;
  --mid: #ffc56b;
  --bad: #ff6f7d;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.8);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .6s ease;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--ink-2); }

#map {
  position: fixed; inset: 0;
  /* то, что видно вокруг глобуса */
  background: radial-gradient(110% 85% at 50% 50%, #f8fbfe 0%, #e3edf4 55%, #cbdce9 100%);
}
.globe-halo { position: absolute; left: 0; top: 0; width: 0; height: 0; border-radius: 50%; pointer-events: none; filter: blur(6px); }
/* самолётики — свой холст поверх карты (см. app.js «самолётики») */
.planes-layer { position: absolute; left: 0; top: 0; pointer-events: none; }
:root[data-theme="night"] #map {
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.75), transparent 60%),
    radial-gradient(1px 1px at 27% 72%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1.5px 1.5px at 41% 9%, rgba(255,240,210,.8), transparent 60%),
    radial-gradient(1px 1px at 58% 88%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1px 1px at 66% 14%, rgba(255,255,255,.65), transparent 60%),
    radial-gradient(1.5px 1.5px at 79% 63%, rgba(210,225,255,.8), transparent 60%),
    radial-gradient(1px 1px at 88% 31%, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(1px 1px at 6% 52%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1px 1px at 93% 84%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1px 1px at 34% 38%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1px 1px at 71% 44%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1px 1px at 18% 92%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 52% 26%, rgba(255,255,255,.45), transparent 60%),
    radial-gradient(110% 85% at 50% 50%, #0a1734 0%, #040a1a 45%, #01030a 100%);
}
/* мягкая виньетка ночью */
:root[data-theme="night"] body::after {
  content: ''; position: fixed; inset: 0; z-index: 5; pointer-events: none;
  background: radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(0, 2, 10, 0.55) 100%);
}
.maplibregl-ctrl-attrib { font-size: 10px; background: var(--glass) !important; color: var(--ink-2); backdrop-filter: var(--blur); }
.maplibregl-ctrl-attrib a { color: var(--ink-2) !important; }
.maplibregl-ctrl-group { background: var(--glass) !important; backdrop-filter: var(--blur); border: 1px solid var(--glass-border); box-shadow: var(--shadow) !important; border-radius: 12px !important; }
.maplibregl-ctrl-group button + button { border-top-color: var(--line) !important; }
:root[data-theme="night"] .maplibregl-ctrl-icon { filter: invert(1); }

.glass {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

/* ===== Верхняя панель ===== */
.topbar {
  position: fixed; z-index: 20;
  top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px;
  height: var(--topbar-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.brand {
  justify-self: start; cursor: pointer; font: inherit;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 12px; border-radius: 999px;
  text-decoration: none; color: var(--ink);
  font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -0.01em;
  background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow);
}
.brand svg { width: 28px; height: 28px; }
.brand-wrap { justify-self: start; display: flex; align-items: center; gap: 6px; }
.brand-wrap .reload-btn { display: none; }
.reload-btn.spin svg { animation: mm-spin .7s linear infinite; }
@keyframes mm-spin { to { transform: rotate(360deg); } }
.ly-day { display: none; }
.brand-globe { fill: var(--ink); }
.brand-light { fill: var(--gold); }
:root[data-theme="night"] .brand-globe { fill: #13233f; }

.mode {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  padding: 5px; border-radius: 999px;
  background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow);
}
.mode button {
  position: relative; z-index: 1;
  border: 0; background: none; padding: 10px 22px; border-radius: 999px;
  font-weight: 700; font-size: 14px; color: var(--ink-2); white-space: nowrap;
  transition: color .3s;
}
.mode button[aria-selected="true"] { color: var(--accent-ink); }
.mode-thumb {
  position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px);
  border-radius: 999px; background: var(--accent);
  transition: transform .35s cubic-bezier(.5, 0, .2, 1);
}
.mode[data-mode="travel"] .mode-thumb { transform: translateX(100%); } /* запасной вариант; точное место ставит app.js */
.mode-thumb { transition: transform .35s cubic-bezier(.5, 0, .2, 1), width .35s cubic-bezier(.5, 0, .2, 1); }

.tools { justify-self: end; display: flex; align-items: center; gap: 8px; }
.icon-btn, .pill-btn, .search input {
  height: 44px; border-radius: 999px; color: var(--ink);
  background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow);
}
.icon-btn { width: 44px; display: grid; place-items: center; padding: 0; position: relative; }
.icon-btn svg, .pill-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover, .pill-btn:hover { background: var(--glass-strong); }
#theme-btn svg, #daystyle-btn svg { display: none; }
#theme-btn[data-theme="day"] .ico-night, #theme-btn[data-theme="night"] .ico-day { display: block; }
#daystyle-btn[data-style="space"] .ico-map, #daystyle-btn[data-style="map"] .ico-space { display: block; }
.user-dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 2px var(--glass-strong); }

.pill-btn { display: inline-flex; align-items: center; gap: 7px; padding: 0 12px 0 14px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.pill-btn .chev { width: 16px; height: 16px; color: var(--ink-3); transition: transform .2s; }
.pill-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.picker { position: relative; }
.picker-label { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.picker-flag { font-size: 18px; line-height: 1; }
.picker-flag:empty { display: none; }
.picker.has-value .picker-ico { display: none; }
.picker.has-value .pill-btn { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }

/* стеклянные выпадающие панели */
.dropdown {
  position: absolute; top: 52px; right: 0; z-index: 30; margin: 0; padding: 6px; list-style: none;
  min-width: 240px; max-height: min(420px, 70vh); overflow: auto; border-radius: var(--radius-m);
  background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow);
  animation: drop-in .18s ease-out;
}
.dropdown::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--glass-hi); pointer-events: none; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px); } }
.dropdown.small { min-width: 180px; }
.dropdown li { position: relative; padding: 9px 10px; border-radius: var(--radius-s); cursor: pointer; display: flex; gap: 10px; align-items: center; font-size: 14px; }
.dropdown li[aria-selected="true"], .dropdown li:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.dropdown li.current { font-weight: 700; }
.dropdown li.current::after { content: '✓'; margin-left: auto; color: var(--accent); }
.dropdown li.empty { color: var(--ink-2); cursor: default; background: none; }
.dropdown .flag { width: 22px; text-align: center; font-size: 17px; }
.picker-panel { display: flex; flex-direction: column; padding: 8px; }
.picker-panel[hidden] { display: none; }
.picker-search { position: relative; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--glass); padding: 0 12px; margin-bottom: 6px; outline: none; }
.picker-search:focus { border-color: var(--accent); }
.picker-list { list-style: none; margin: 0; padding: 0; overflow: auto; max-height: 340px; }
#passport-panel { width: 290px; }

.search { position: relative; display: flex; }
.search input { width: 220px; padding: 0 16px; font-weight: 500; outline-offset: 0; }
.search input::placeholder { color: var(--ink-3); }
.search-toggle { display: none; }
#search-results { left: 0; right: 0; min-width: 0; }

.user-menu { padding: 8px; }
.um-head { padding: 6px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: grid; }
.um-head small { color: var(--ink-3); }
.um-row { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; background: none; border-radius: var(--radius-s); font-size: 14px; color: var(--ink); text-decoration: none; cursor: pointer; }
.um-row:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.um-row.ok { color: var(--good); font-weight: 700; cursor: default; background: none; }
.um-warn { margin: 4px 0; padding: 8px 10px; border-radius: var(--radius-s); font-size: 12.5px; background: color-mix(in srgb, var(--bad) 15%, transparent); }

/* ===== Легенда ===== */
.legend {
  position: fixed; z-index: 10; left: 12px; bottom: max(14px, env(safe-area-inset-bottom));
  padding: 12px 14px; border-radius: var(--radius-m); min-width: 220px; max-width: 280px;
  background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow);
  font-size: 12.5px;
}
.legend h3 { margin: 0 0 8px; font-size: 13px; font-weight: 700; }
.legend-bar { height: 8px; border-radius: 99px; }
.legend-ends { display: flex; justify-content: space-between; color: var(--ink-2); margin-top: 4px; }
.legend-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.legend-list li { display: flex; align-items: center; gap: 8px; }
.swatch { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.legend-war { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.hatch-swatch { width: 18px; height: 12px; border-radius: 3px; flex: none; background: repeating-linear-gradient(135deg, var(--bad) 0 2px, transparent 2px 6px); border: 1px solid color-mix(in srgb, var(--bad) 50%, transparent); }

/* ===== Подсказка при наведении ===== */
#tooltip {
  position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none;
  min-width: 230px; max-width: 330px; padding: 13px 15px; border-radius: 16px;
  background: var(--glass); backdrop-filter: blur(24px) saturate(1.8); -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.35);
  font-size: 13px; overflow: hidden;
}
#tooltip::before { content: ''; position: absolute; inset: 0; background: var(--glass-hi); pointer-events: none; }
#tooltip > * { position: relative; }
.tt-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; margin-bottom: 7px; }
.tt-flag { font-size: 20px; line-height: 1; }
.tt-row { display: flex; justify-content: space-between; gap: 14px; color: var(--ink-2); padding: 1px 0; }
.tt-row b { color: var(--ink); font-weight: 600; white-space: nowrap; text-align: right; }
.tt-row span { min-width: 0; }
.tt-score { margin-left: auto; font-family: var(--font-display); font-size: 13px; padding: 2px 8px; border-radius: 99px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.tt-visa, .tt-adv { margin-top: 7px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.tt-adv { color: var(--c); }
.tt-adv i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent); }
.tt-hint { margin-top: 7px; color: var(--ink-3); font-size: 12px; }

/* ===== Карточка страны ===== */
#card {
  position: fixed; z-index: 15;
  top: calc(var(--topbar-h) + 24px); right: 12px; bottom: 12px;
  width: min(430px, calc(100vw - 24px));
  border-radius: var(--radius-l); overflow: hidden;
  background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow);
  animation: card-in .45s cubic-bezier(.2, .8, .2, 1);
}
@keyframes card-in { from { opacity: 0; transform: translateX(24px) scale(.98); } }
.card-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; }
/* полосы прокрутки в стиле стеклянных плашек: шире стандартной тонкой, скруглённый ползунок, золотой при наведении */
.card-scroll::-webkit-scrollbar, .picker-list::-webkit-scrollbar, .dropdown::-webkit-scrollbar, .profile-box::-webkit-scrollbar, .about-box::-webkit-scrollbar, .pf-users ul::-webkit-scrollbar, .fav-scroll::-webkit-scrollbar { width: 12px; }
.card-scroll::-webkit-scrollbar-track, .picker-list::-webkit-scrollbar-track, .dropdown::-webkit-scrollbar-track, .profile-box::-webkit-scrollbar-track, .about-box::-webkit-scrollbar-track, .pf-users ul::-webkit-scrollbar-track, .fav-scroll::-webkit-scrollbar-track { background: transparent; margin: 14px 0; }
.card-scroll::-webkit-scrollbar-thumb, .picker-list::-webkit-scrollbar-thumb, .dropdown::-webkit-scrollbar-thumb, .profile-box::-webkit-scrollbar-thumb, .about-box::-webkit-scrollbar-thumb, .pf-users ul::-webkit-scrollbar-thumb, .fav-scroll::-webkit-scrollbar-thumb {
  border: 3px solid transparent; background-clip: padding-box; border-radius: 99px;
  background-color: color-mix(in srgb, var(--ink) 26%, transparent); box-shadow: inset 0 0 0 1px var(--glass-border);
}
.card-scroll::-webkit-scrollbar-thumb:hover, .picker-list::-webkit-scrollbar-thumb:hover, .dropdown::-webkit-scrollbar-thumb:hover, .profile-box::-webkit-scrollbar-thumb:hover, .about-box::-webkit-scrollbar-thumb:hover, .pf-users ul::-webkit-scrollbar-thumb:hover, .fav-scroll::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--accent) 70%, transparent); }
@supports not selector(::-webkit-scrollbar) {
  .card-scroll, .picker-list, .dropdown, .profile-box, .about-box, .pf-users ul, .fav-scroll { scrollbar-width: auto; scrollbar-color: color-mix(in srgb, var(--ink) 30%, transparent) transparent; }
}
.card-close { position: absolute; top: 12px; right: 12px; z-index: 3; background: rgba(0, 0, 0, .28); color: #fff; border-color: rgba(255, 255, 255, .25); box-shadow: none; }
.card-handle { display: none; }

.hero { position: relative; height: 210px; overflow: hidden; color: #fff; }
.hero video, .hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-art { position: absolute; inset: 0; }
.hero-credit { position: absolute; top: 12px; left: 14px; z-index: 2; max-width: 60%; font-size: 10.5px; color: rgba(255,255,255,.78); text-shadow: 0 1px 3px rgba(0,0,0,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-art .big-flag { position: absolute; right: -18px; bottom: -36px; font-size: 190px; line-height: 1; opacity: .9; transform: rotate(-8deg); filter: drop-shadow(0 20px 30px rgba(0,0,0,.3)); }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.6)); }
.hero-text { position: absolute; left: 22px; right: 22px; bottom: 16px; z-index: 2; }
.hero-text h1 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
.hero-text p { margin: 4px 0 0; opacity: .85; font-size: 13.5px; }

.card-content { padding: 18px 22px 28px; }
.summary { margin: 0 0 16px; font-size: 15.5px; line-height: 1.55; }

.scores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.score { padding: 12px 14px; border-radius: var(--radius-m); background: var(--line); position: relative; overflow: hidden; }
.score.active { outline: 2px solid var(--accent); outline-offset: -2px; }
.score small { display: block; color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.score strong { font-family: var(--font-display); font-size: 28px; line-height: 1.1; }
.score strong span { font-size: 14px; color: var(--ink-3); font-family: var(--font-body); font-weight: 600; }
.score-meter { height: 4px; border-radius: 4px; background: var(--line); margin-top: 8px; overflow: hidden; }
.score-meter i { display: block; height: 100%; border-radius: 4px; }
.score .na { font-size: 13px; color: var(--ink-2); font-weight: 600; }

.visa-badge { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--radius-m); margin-bottom: 18px; background: var(--line); }
.visa-badge .swatch { margin-top: 4px; }
.visa-badge p { margin: 4px 0 0; font-size: 13px; }
.visa-badge.blocked { background: color-mix(in srgb, var(--bad) 16%, transparent); }

.adv { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--radius-m); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 13%, transparent); }
.adv-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adv-head b { color: var(--c); }
.adv-head span { color: var(--ink-2); font-size: 13px; }
.adv-ico { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; font-weight: 800; font-size: 13px; }
.adv p { margin: 7px 0 0; font-size: 14px; line-height: 1.5; }
.adv .adv-air { font-weight: 600; }
.adv small { display: block; margin-top: 8px; color: var(--ink-3); font-size: 11.5px; }
.adv small a { color: var(--ink-2); }

.card-content h2 { font-family: var(--font-display); font-size: 16px; font-weight: 500; margin: 26px 0 12px; letter-spacing: -0.01em; }
.card-content h2:first-of-type { margin-top: 4px; }

.key-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: var(--radius-m); overflow: hidden; }
.key { padding: 12px 14px; background: var(--glass-strong); }
:root[data-theme="night"] .key { background: rgba(9, 15, 29, .55); }
.key > small { display: block; font-size: 12px; color: var(--ink-2); line-height: 1.3; }
.key b { display: block; font-size: 17px; font-weight: 700; margin-top: 3px; }
.key b small, .row b small { font-size: 12px; font-weight: 600; color: var(--ink-2); }

details.section { border-top: 1px solid var(--line); }
details.section:last-of-type { border-bottom: 1px solid var(--line); }
details.section summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 13px 2px; font-weight: 700; }
details.section summary::-webkit-details-marker { display: none; }
details.section summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform .2s; margin-right: 4px; }
details.section[open] summary::after { transform: rotate(-135deg); }
details.section summary .count { margin-left: auto; margin-right: 12px; color: var(--ink-3); font-weight: 600; font-size: 13px; }
.rows { padding: 0 2px 12px; }
.row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; font-size: 14px; }
.row + .row { border-top: 1px dashed var(--line); }
.row span { color: var(--ink-2); }
.row b { font-weight: 600; text-align: right; }
.row .bar { display: inline-flex; gap: 2px; vertical-align: middle; margin-left: 6px; }
.row .bar i { width: 6px; height: 10px; border-radius: 2px; background: var(--line); }
.row .bar i.on { background: var(--accent); }
.row.locked b { filter: blur(5px); user-select: none; color: var(--ink-3); }
.lock { width: 13px; height: 13px; vertical-align: -1px; margin-right: 4px; fill: none; stroke: var(--ink-3); stroke-width: 2; }

.unlock-strip { margin: 16px 0 0; padding: 14px 16px; border-radius: var(--radius-m); background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 16%, transparent), color-mix(in srgb, var(--gold) 14%, transparent)); display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.unlock-strip p { margin: 0; font-size: 13.5px; }
.btn { border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 700; background: var(--accent); color: var(--accent-ink); white-space: nowrap; }
.btn.ghost { background: var(--line); color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.chips.small { margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: var(--glass); color: var(--ink); border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.chips.small .chip { padding: 4px 10px; font-size: 12.5px; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.route-list { display: grid; gap: 8px; }
.route { border-radius: var(--radius-m); background: var(--line); border: 1px solid transparent; overflow: hidden; }
.route.open { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 8%, var(--line)); }
.route-head { width: 100%; display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 0; background: none; text-align: left; color: var(--ink); }
.rdays { width: 46px; height: 46px; border-radius: 12px; background: var(--glass-strong); display: grid; place-content: center; text-align: center; line-height: 1; }
.rdays b { font-family: var(--font-display); font-size: 18px; }
.rdays small { font-size: 10px; color: var(--ink-2); margin-top: 2px; }
.rtitle b { display: block; font-size: 14.5px; line-height: 1.3; }
.rtitle small { color: var(--ink-2); font-size: 12.5px; }
.rbadge { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.rbadge.free { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.rbadge.lock { padding: 3px 6px; }
.rbadge.lock .lock { margin: 0; }
.route.is-locked .rtitle b { color: var(--ink-2); }
.route-body { padding: 4px 12px 12px; }
.route-locked { margin: 0 12px 12px; padding: 14px; border-radius: var(--radius-m); background: var(--glass-strong); display: grid; gap: 10px; justify-items: start; }
.route-locked p { margin: 0; font-size: 14px; }

.city-block { margin-bottom: 14px; }
.city-block h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; font-size: 14px; }
.city-block h3 span { color: var(--ink-3); font-weight: 600; font-size: 12px; }
.place-list { display: grid; gap: 8px; }
.place { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; padding: 10px; border-radius: var(--radius-m); background: var(--line); cursor: pointer; border: 1px solid transparent; transition: border-color .2s; }
.route-body .place { background: var(--glass-strong); margin-bottom: 8px; }
.place:hover, .place.active { border-color: var(--accent); }
.place-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; background: var(--glass-strong); }
.place-ico b { font-family: var(--font-display); font-size: 15px; color: var(--accent); }
.place h4 { margin: 0; font-size: 14.5px; }
.place p { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.place a { font-size: 12.5px; color: var(--accent); font-weight: 600; text-decoration: none; }
.link { border: 0; background: none; padding: 4px 0; color: var(--accent); font-weight: 700; font-size: 13px; cursor: pointer; }
.link.more { margin-top: 6px; }

.route-day { position: relative; padding-left: 26px; margin-bottom: 4px; }
.route-day::before { content: ''; position: absolute; left: 8px; top: 22px; bottom: -4px; width: 2px; background: var(--line); }
.route-day:last-child::before { display: none; }
.route-day > h4 { margin: 6px 0; font-size: 13px; color: var(--ink-2); position: relative; }
.route-day > h4::before { content: ''; position: absolute; left: -23px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }

.sources { margin-top: 28px; font-size: 12px; color: var(--ink-3); }
.sources ul { margin: 6px 0 0; padding-left: 16px; }
.sources a { color: var(--ink-2); }
.empty-note { color: var(--ink-2); padding: 12px 0; }
.card-loading { padding: 40px 22px; color: var(--ink-2); }

/* ===== Маркеры мест ===== */
/* .pin-wrap двигает MapLibre через transform, поэтому свои трансформации — только у вложенной .pin */
.pin-wrap { width: 34px; height: 42px; display: flex; align-items: flex-start; justify-content: center; transition: opacity .25s; }
.pin-wrap.dim { opacity: .35; }
.pin-wrap.in-route { z-index: 2; }
.pin { width: 34px; height: 34px; padding: 0; border-radius: 50% 50% 50% 6px; transform: rotate(-45deg); transform-origin: 50% 50%; background: var(--glass-strong); backdrop-filter: blur(8px); border: 2px solid var(--accent); display: grid; place-items: center; box-shadow: var(--shadow); cursor: pointer; transition: transform .2s; }
.pin span { transform: rotate(45deg); font-size: 16px; line-height: 1; }
.pin span b { font-family: var(--font-display); font-size: 14px; color: var(--accent); }
.pin-wrap.in-route .pin { background: var(--accent); }
.pin-wrap.in-route .pin span b { color: var(--accent-ink); }
.pin.locked { opacity: .6; }
.pin-wrap:hover .pin, .pin-wrap.active .pin { transform: rotate(-45deg) scale(1.18); }
.maplibregl-popup-content { background: var(--glass-strong) !important; color: var(--ink); border-radius: var(--radius-m) !important; box-shadow: var(--shadow) !important; padding: 12px 14px !important; backdrop-filter: var(--blur); max-width: 240px; font-family: var(--font-body); }
.maplibregl-popup-tip { display: none; }
.maplibregl-popup-content h4 { margin: 0 0 4px; font-size: 14px; }
.maplibregl-popup-content p { margin: 0 0 6px; font-size: 13px; color: var(--ink-2); }
.maplibregl-popup-content a { color: var(--accent); font-weight: 600; font-size: 12.5px; }
.maplibregl-popup-close-button { color: var(--ink-2); font-size: 18px; right: 4px; top: 2px; }

/* ===== Модалка и заставка ===== */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(5, 10, 20, .45); padding: 20px; }
.modal-box { max-width: 420px; padding: 26px; border-radius: var(--radius-l); background: var(--glass-strong); backdrop-filter: var(--blur); border: 1px solid var(--glass-border); box-shadow: var(--shadow); }
.modal-box { position: relative; overflow: hidden; }
.modal-box::before { content: ''; position: absolute; inset: 0; background: var(--glass-hi); pointer-events: none; }
.modal-box > * { position: relative; }
.modal-box h2 { margin: 0 0 10px; font-family: var(--font-display); font-size: 22px; letter-spacing: -0.02em; padding-right: 36px; }
.modal-box p { margin: 0 0 12px; }
.modal-x { position: absolute !important; top: 14px; right: 14px; width: 36px; height: 36px; box-shadow: none; z-index: 5; } /* поверх заголовка: иначе заголовок перекрывал половину кнопки */
.modal-x svg { pointer-events: none; }
.about-box { max-width: 560px; max-height: 86vh; overflow: auto; }
.about-box section { padding: 12px 0; border-top: 1px solid var(--line); }
.about-box section:first-child { border-top: 0; padding-top: 4px; }
.about-box h3 { margin: 0 0 4px; font-size: 15px; }
.about-box p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.small { font-size: 12.5px; }
.auth-box { width: min(380px, 100%); display: grid; gap: 12px; }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input { height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); padding: 0 14px; font-size: 15px; color: var(--ink); outline: none; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.field small { font-weight: 500; color: var(--ink-3); }
.form-error { margin: 0 !important; color: var(--bad); font-size: 13.5px; font-weight: 600; }
.btn.wide { width: 100%; height: 46px; }
.btn:disabled { opacity: .6; }
.auth-switch { margin: 0 !important; text-align: center; color: var(--ink-2); font-size: 13.5px; }

.splash { position: fixed; inset: 0; z-index: 60; display: grid; place-content: center; justify-items: center; gap: 16px; background: var(--bg); transition: opacity .6s; color: var(--ink-2); }
.splash.done { opacity: 0; pointer-events: none; }
.splash-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 var(--gold); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 22px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ===== Ноутбук и планшет боком (861–1240 px) =====
   Полная панель сюда не помещается: правые кнопки уходили за край экрана.
   Поиск сворачивается в значок (по нажатию раскрывается во всю ширину),
   у «Мой паспорт» остаются значок и флаг, у логотипа — только значок. */
@media (min-width: 861px) and (max-width: 1240px) {
  .topbar { grid-template-columns: auto 1fr auto; }
  .center { justify-self: center; }
  .brand span { display: none; }
  .brand { padding: 8px; }
  .search input { display: none; }
  .search-toggle { display: grid; }
  .search.open { position: fixed; left: 12px; right: 12px; top: max(12px, env(safe-area-inset-top)); z-index: 40; }
  .search.open input { display: block; width: 100%; }
  .search.open .search-toggle { display: none; }
  .picker-label, .pill-btn .chev { display: none; }
  .mode button { padding: 10px 16px; }
}

/* ===== Телефон ===== */
@media (max-width: 860px) {
  :root { --topbar-h: 108px; }
  .topbar { grid-template-columns: auto 1fr; grid-template-rows: 44px 48px; height: auto; gap: 8px; }
  .brand { padding: 8px 12px 8px 8px; font-size: 14px; }
  .brand svg { width: 24px; height: 24px; }
  .tools { grid-column: 2; grid-row: 1; gap: 6px; }
  .mode { justify-self: stretch; }
  .mode button { padding: 9px 10px; }
  .search input { display: none; }
  .search-toggle { display: grid; }
  .search.open { position: fixed; left: 12px; right: 12px; top: max(12px, env(safe-area-inset-top)); z-index: 40; }
  .search.open input { display: block; width: 100%; }
  .search.open .search-toggle { display: none; }
  .brand span { display: none; }
  .brand { padding: 8px; }
  .picker-label, .pill-btn .chev { display: none; }
  .pill-btn { height: 40px; padding: 0 10px; gap: 4px; }
  #lang-btn { padding: 0 9px; }
  .icon-btn { width: 40px; height: 40px; }
  .dropdown { position: fixed; top: 64px; left: 12px; right: 12px; width: auto !important; }
  .legend { left: 12px; right: auto; bottom: 12px; min-width: 0; max-width: 60vw; padding: 9px 11px; font-size: 11.5px; }
  .legend h3 { font-size: 12px; margin-bottom: 6px; }
  .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group { display: none; }

  #card {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%;
    height: 46vh; border-radius: var(--radius-l) var(--radius-l) 0 0;
    transition: height .35s cubic-bezier(.2, .8, .2, 1);
    animation: sheet-in .4s cubic-bezier(.2, .8, .2, 1);
  }
  #card.expanded { height: calc(100vh - 70px); height: calc(100dvh - 70px); }
  @keyframes sheet-in { from { transform: translateY(100%); } }
  .card-handle { display: grid; place-items: center; position: absolute; top: 0; left: 0; right: 0; height: 30px; z-index: 4; border: 0; background: none; }
  /* ручка карточки — в стиле стеклянной плашки */
  .card-handle span { width: 64px; height: 8px; border-radius: 9px; background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 8px rgba(0,0,0,.35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  .hero { height: 160px; }
  .hero-text h1 { font-size: 24px; }
  .hero-art .big-flag { font-size: 150px; }
  #tooltip { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ===== Жидкое стекло: блики и объём для всех стеклянных поверхностей ===== */
.brand, .mode, .icon-btn, .pill-btn, .search input, .legend, #card, #tooltip, .dropdown, .modal-box {
  box-shadow: var(--shadow), var(--glass-edge);
}
#card, .legend, .modal-box, .mode { isolation: isolate; }
#card::before, .legend::before, .mode::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--glass-hi); pointer-events: none; z-index: -1;
}
.legend { position: fixed; }
.key { background: var(--glass-tile) !important; }
.key-grid { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.score, .route, .place, .visa-badge { background: var(--glass-tile); }
.route-body .place, .place-ico, .rdays { background: var(--glass-strong); }
.card-content { text-shadow: 0 0 1px color-mix(in srgb, var(--bg) 30%, transparent); }

/* центр верхней панели: режим + случайная страна */
.center { display: flex; align-items: center; gap: 8px; justify-self: center; }
.random-btn svg .fill { fill: currentColor; stroke: none; }
.random-btn.spin svg { animation: dice .7s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes dice { from { transform: rotate(-200deg) scale(.7); } }

/* блок «Безопасность сейчас» — спокойная информация, а не сирена */
.adv { margin: 0 0 18px; padding: 12px 14px 12px 16px; border-radius: var(--radius-m); background: var(--glass-tile); border: 1px solid var(--line); border-left: 4px solid var(--c); }
.adv-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.adv-label { width: 100%; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.adv-head b { color: var(--c); }

@media (max-width: 860px) {
  .center { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .center .mode { flex: 1; }
  .random-btn { width: 48px; height: 48px; }
}

/* панели с текстом — чуть плотнее, чтобы читалось поверх любой карты */
#card, #tooltip, .dropdown, .modal-box, .legend { background: var(--glass-card); backdrop-filter: blur(30px) saturate(2) brightness(1.05); -webkit-backdrop-filter: blur(30px) saturate(2) brightness(1.05); }

/* ---------- слои: золотые города и природа ---------- */
.layers-panel { min-width: 250px; padding: 8px; }
.ly-title { margin: 4px 8px 6px; font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.ly { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.ly:hover { background: var(--line); }
.ly i { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.8) inset; }
.ly i.ly-gold { width: 4px; height: 18px; border-radius: 3px; margin: 0 5px; background: linear-gradient(#fff0c4, #f2b33d); box-shadow: 0 0 8px rgba(255,196,80,.9); }
.ly span { flex: 1; }
.ly .ly-check { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--ink-3); flex: none; position: relative; }
.ly.on .ly-check { background: var(--accent); border-color: var(--accent); }
.ly.on .ly-check::after { content: ''; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ly:not(.on) { opacity: .62; }
.tt-kind { color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }
.tt-blurb { margin-top: 6px; font-size: 13px; max-width: 240px; }

/* карточка города / природы */
.point-hero .hero-art { position: absolute; inset: 0; }
.hero-pillar { position: absolute; right: 22%; bottom: 18%; width: 4px; height: 62%; border-radius: 4px; background: linear-gradient(rgba(255,230,160,0), #fff1c8); box-shadow: 0 0 24px 6px rgba(255,200,90,.55); }
.hero-pillar::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: 36px; height: 12px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(rgba(255,214,130,.95), rgba(255,200,90,0) 70%); }
.hero-text .kicker { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 12px; padding: 6px 12px 6px 6px; border: 0; border-radius: 999px; background: var(--line); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.back-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- гражданство ---------- */
.cit { margin: 0 0 18px; }
.cit h3 { margin: 16px 0 6px; font-size: 14.5px; }
.cit p { margin: 6px 0; font-size: 14px; line-height: 1.5; }
.cit-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.cit-stat { padding: 10px 12px; border-radius: var(--radius-m); background: var(--glass-tile, var(--line)); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cit-stat small { color: var(--ink-2); font-size: 11.5px; }
.cit-stat b { font-size: 15px; line-height: 1.25; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.cit-stat b.long { font-size: 13.5px; }
.cit-stat b.xlong { font-size: 12.5px; }
.cit-stat span.cit-lvl { color: var(--ink); font-size: 12.5px; font-weight: 600; }
.cit-stat span { font-size: 12px; color: var(--ink-2); overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.cit-stat .dots { display: flex; gap: 3px; }
.cit-stat .dots i { width: 14px; height: 5px; border-radius: 3px; background: var(--line); }
.cit-stat .dots i.on { background: var(--gold); }
.cit-dual { margin: 12px 0; padding: 12px 14px; border-radius: var(--radius-m); border: 1px solid var(--line); }
.cit-dual h3 { margin: 0 0 6px; }
.cit-dual h3 span { font-weight: 500; color: var(--ink-2); }
.verdict { display: flex; gap: 9px; align-items: flex-start; font-weight: 600; }
.verdict i { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); }
.verdict.good { --c: var(--good); } .verdict.mid { --c: var(--mid); } .verdict.bad { --c: var(--bad); }
.cit-paths, .cit-docs, .cit-notes, .cit-changes { margin: 0; padding: 0; list-style: none; }
.cit-paths li { padding: 7px 0; border-top: 1px dashed var(--line); font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.cit-paths li span { color: var(--ink-2); font-size: 13px; }
.cit-docs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.cit-docs li { font-size: 13.5px; padding-left: 20px; position: relative; }
.cit-docs li::before { content: ''; position: absolute; left: 2px; top: 4px; width: 9px; height: 5px; border: solid var(--good); border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.cit-notes li, .cit-changes li { font-size: 13.5px; padding: 5px 0 5px 14px; position: relative; line-height: 1.45; }
.cit-notes li::before { content: ''; position: absolute; left: 2px; top: 12px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.cit-changes time { display: block; font-size: 12px; color: var(--ink-2); }
.cit-foot { font-size: 12.5px !important; color: var(--ink-2); margin-top: 14px !important; }
@media (max-width: 860px) { .cit-top { grid-template-columns: 1fr 1fr; } .cit-docs { grid-template-columns: 1fr; } }
.cit .unlock-strip { flex-wrap: wrap; }
.cit .unlock-strip p { flex: 1 1 220px; margin: 0; }
.cit-foot a { color: var(--accent); }

/* ---------- менталитет ---------- */
.ment-body { padding: 4px 2px 14px; font-size: 14px; line-height: 1.5; }
.ment-body p { margin: 6px 0; }
.ment-group { font-weight: 700; margin-top: 12px !important; }
.ment-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ment-head span { color: var(--ink-2); font-size: 13px; }
.ment-lvl { font-size: 15px; }
.ment-lvl.l1, .ment-lvl.l2 { color: var(--good); } .ment-lvl.l3 { color: var(--mid); } .ment-lvl.l4, .ment-lvl.l5 { color: var(--bad); }
.ment-meter { display: flex; gap: 4px; margin: 6px 0 8px; }
.ment-meter i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.ment-meter i.on { background: linear-gradient(90deg, var(--good), var(--mid), var(--bad)); background-size: 500% 100%; }
.ment-meter i.on:nth-child(1) { background-position: 0 0; } .ment-meter i.on:nth-child(2) { background-position: 25% 0; } .ment-meter i.on:nth-child(3) { background-position: 50% 0; } .ment-meter i.on:nth-child(4) { background-position: 75% 0; } .ment-meter i.on:nth-child(5) { background-position: 100% 0; }
.ment-list { margin: 0; padding: 0; list-style: none; }
.ment-list li { position: relative; padding: 4px 0 4px 14px; }
.ment-list li::before { content: ''; position: absolute; left: 2px; top: 12px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.ment-lang { color: var(--ink-2); font-size: 13px; }
.section.ment .count { font-weight: 600; }

/* ---------- арабский: письмо справа налево ---------- */
[dir="rtl"] .dropdown:not(#search-results) { right: auto; left: 0; }
[dir="rtl"] .dropdown li.current::after, [dir="rtl"] .tt-score { margin-left: 0; margin-right: auto; }
[dir="rtl"] details.section summary .count { margin-left: 12px; margin-right: auto; }
[dir="rtl"] .row .bar { margin-left: 0; margin-right: 6px; }
[dir="rtl"] .um-row, [dir="rtl"] .route-head, [dir="rtl"] .ly { text-align: right; }
[dir="rtl"] .card-close { right: auto; left: 12px; }
[dir="rtl"] .back-link svg, [dir="rtl"] .chev { transform: scaleX(-1); }
[dir="rtl"] .cit-docs li { padding-left: 0; padding-right: 20px; }
[dir="rtl"] .cit-docs li::before { left: auto; right: 2px; }
[dir="rtl"] .cit-notes li, [dir="rtl"] .cit-changes li, [dir="rtl"] .ment-list li { padding-left: 0; padding-right: 14px; }
[dir="rtl"] .cit-notes li::before, [dir="rtl"] .ment-list li::before { left: auto; right: 2px; }
[dir="rtl"] .mode { direction: ltr; }
[dir="rtl"] .card-content p, [dir="rtl"] .card-content li, [dir="rtl"] .tt-blurb, [dir="rtl"] .summary { unicode-bidi: plaintext; }

/* ---------- реклама ---------- */
.pt-slot { margin: 18px 0 6px; display: flex; flex-direction: column; gap: 10px; }
.pt-partners { padding: 12px 14px; border-radius: var(--radius-m); border: 1px solid var(--line); background: var(--glass-tile, transparent); }
.pt-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-weight: 700; font-size: 14px; }
.pt-head small, .pt-label { font-weight: 500; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.pt-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.pt-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; background: var(--line); color: var(--ink); text-decoration: none; transition: transform .15s, background .15s; }
.pt-link:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.pt-link span { display: flex; flex-direction: column; min-width: 0; }
.pt-link b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-link small { font-size: 11.5px; color: var(--ink-2); }
.pt-ico { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--gold) 22%, transparent); }
.pt-ico svg { width: 17px; height: 17px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ad-box { position: relative; padding: 8px 10px 10px; border-radius: var(--radius-m); border: 1px solid var(--line); min-height: 60px; }
.ad-box .pt-label { display: block; margin-bottom: 4px; }
.ad-placeholder { border-style: dashed; text-align: center; color: var(--ink-2); padding: 14px; }
.ad-placeholder p { margin: 4px 0; font-weight: 700; color: var(--ink); }
.ad-placeholder span { font-size: 12px; }
.map-promo { position: fixed; left: 12px; bottom: 112px; z-index: 5; width: 300px; padding: 0; border-radius: var(--radius-m); background: var(--glass-card); backdrop-filter: blur(26px) saturate(1.9); -webkit-backdrop-filter: blur(26px) saturate(1.9); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.map-promo .ad-box { border: 0; }
.ad-close { position: absolute; top: 4px; right: 6px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--line); color: var(--ink); font-size: 16px; line-height: 1; cursor: pointer; }
[dir="rtl"] .ad-close { right: auto; left: 6px; }
@media (max-width: 860px) { .map-promo { display: none; } }

/* отели в карточке города и свои баннеры */
.hotels { margin: 18px 0 6px; padding: 12px 14px; border-radius: var(--radius-m); border: 1px solid var(--line); }
.hotel-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hotel { display: flex; flex-direction: column; gap: 4px; padding: 0 0 8px; border-radius: 12px; background: var(--line); color: var(--ink); text-decoration: none; overflow: hidden; transition: transform .15s; }
.hotel:hover { transform: translateY(-2px); }
.hotel-art { position: relative; height: 72px; display: grid; place-items: center; }
.hotel-art svg { width: 28px; height: 28px; fill: none; stroke: rgba(255,255,255,.95); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hotel-art i { position: absolute; left: 6px; bottom: 6px; padding: 2px 7px; border-radius: 99px; background: rgba(0,0,0,.38); color: #fff; font-size: 10.5px; font-style: normal; font-weight: 600; }
.hotel b { padding: 0 9px; font-size: 13px; line-height: 1.3; }
.hotel small { padding: 0 9px; font-size: 11.5px; color: var(--ink-2); }
.hotel-go { margin-top: auto; padding: 0 9px; font-size: 12px; font-weight: 700; color: var(--accent); }
.pt-banner { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--radius-m); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.pt-banner img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex: none; }
.pt-banner span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pt-banner b { font-size: 14px; }
.pt-banner em { font-style: normal; font-size: 12.5px; color: var(--ink-2); }
.map-promo .pt-banner { border: 0; padding-right: 30px; }
@media (max-width: 860px) { .hotel-list { grid-template-columns: 1fr; } .hotel { flex-direction: row; align-items: center; padding: 0; } .hotel-art { width: 78px; height: 64px; flex: none; } .hotel-go { margin: 0 10px 0 auto; } }

/* легенда и реклама на карте одной ширины, без «лесенки» */
@media (min-width: 861px) { .legend { width: 300px; min-width: 0; max-width: none; } }

/* ---------- личный профиль ---------- */
.profile-box { max-width: 520px; width: calc(100vw - 32px); max-height: 86vh; overflow: auto; }
.pf-head { display: flex; align-items: center; gap: 14px; margin: 0 36px 16px 0; }
.pf-head h2 { margin: 0; font-size: 20px; word-break: break-all; }
.pf-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; }
.pf-ava { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-size: 22px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--gold), var(--accent)); }
.pf-ava.sm { width: 34px; height: 34px; font-size: 14px; }
.pf-badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: var(--line); color: var(--ink-2); white-space: nowrap; }
.pf-badge.on { background: color-mix(in srgb, var(--good) 20%, transparent); color: var(--good); }
.pf-badge.admin { background: color-mix(in srgb, var(--gold) 24%, transparent); color: var(--ink); }
.pf-badge.del { background: color-mix(in srgb, #d1495b 20%, transparent); color: #e0626f; }
.pf-sub { padding: 14px 16px; border-radius: var(--radius-m); border: 1px solid var(--line); margin-bottom: 12px; }
.pf-sub.on { border-color: color-mix(in srgb, var(--good) 45%, transparent); background: color-mix(in srgb, var(--good) 10%, transparent); }
.pf-sub b { font-size: 15px; }
.pf-sub.on b { color: var(--good); }
.pf-sub p { margin: 6px 0 10px; font-size: 13.5px; color: var(--ink-2); }
.pf-sub.on p { margin-bottom: 0; }
.pf-sec { border-top: 1px solid var(--line); padding: 10px 0; }
.pf-sec summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.pf-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.pf-form input, .pf-search { height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass-tile, transparent); color: var(--ink); font: inherit; }
.pf-msg { margin: 0; font-size: 13px; } .pf-msg.ok { color: var(--good); } .pf-msg.err { color: var(--bad); }
.pf-users { border-top: 1px solid var(--line); padding-top: 12px; }
.pf-users-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pf-users-head h3 { margin: 0; font-size: 15px; } .pf-users-head h3 span { color: var(--ink-3); font-weight: 600; }
.pf-users-head small { color: var(--ink-2); font-size: 12.5px; }
.pf-search { width: 100%; margin: 10px 0 6px; }
.pf-users ul { list-style: none; margin: 0 0 10px; padding: 0; max-height: 300px; overflow: auto; }
.pf-users li { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px dashed var(--line); }
.pf-users li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pf-users li b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.pf-users li small { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-foot { display: flex; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
[dir="rtl"] .pf-head { margin: 0 0 16px 36px; }

/* ---------- телефон: развёрнутая карточка не залезает под верхнюю панель, легенда сворачивается ---------- */
@media (max-width: 860px) {
  #card.expanded { height: calc(100vh - var(--topbar-h) - 26px - env(safe-area-inset-top)); height: calc(100dvh - var(--topbar-h) - 26px - env(safe-area-inset-top)); }
  .legend { cursor: pointer; max-width: calc(100vw - 110px); }
  .legend:not(.open) .legend-list { display: flex; gap: 4px; flex-wrap: wrap; }
  .legend:not(.open) .legend-list li { font-size: 0; gap: 0; }
  .legend:not(.open) .legend-list .swatch { width: 18px; height: 10px; border-radius: 3px; margin: 0; }
  .legend h3::after { content: ' ▾'; opacity: .6; }
  .legend.open h3::after { content: ' ▴'; }
  .legend:not(:has(.legend-list)) h3::after { content: ''; }
}
@media (max-width: 560px) {
  .pf-users li { flex-wrap: wrap; row-gap: 4px; }
  .pf-users li > div { flex: 1 1 calc(100% - 46px); }
  .pf-users li .pf-badge:first-of-type { margin-left: 44px; }
}
@media (max-width: 860px) {
  body:has(#card:not([hidden])) .legend, body:has(.modal:not([hidden])) .legend { display: none; }
}

/* ---------- гид для жизни ---------- */
.g-body { padding: 4px 2px 14px; font-size: 14px; line-height: 1.5; }
.g-body h4 { margin: 12px 0 4px; font-size: 13.5px; }
.g-body p { margin: 6px 0; }
.g-body .row span small { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.g-big { font-size: 15px; }
.g-big b { font-size: 18px; }
.g-chips, .g-dia { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.g-chips span, .g-dia span { padding: 4px 10px; border-radius: 99px; background: var(--line); font-size: 12.5px; }
.g-dia span.me { background: color-mix(in srgb, var(--gold) 26%, transparent); }
.g-dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.g-dots i { width: 12px; height: 5px; border-radius: 3px; background: var(--line); }
.g-dots i.on { background: var(--gold); }
.g-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 0 0 6px; }
.g-bar i { display: block; height: 100%; border-radius: 3px; }
.g-permits, .g-districts { list-style: none; margin: 4px 0; padding: 0; }
.g-permits li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--line); }
.g-permits .g-pm { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.g-pr { width: 54px; flex: none; min-height: 44px; border-radius: 12px; background: var(--glass-strong); display: grid; place-content: center; text-align: center; line-height: 1.05; padding: 4px 2px; }
.g-pr b { font-family: var(--font-display); font-size: 17px; }
.g-pr small { font-size: 9.5px; color: var(--ink-2); margin-top: 2px; }
.g-pr.now b { color: var(--good, #1a9e77); }
.g-pr.none { background: transparent; }
.g-permits small { color: var(--ink-2); font-size: 12px; }
.g-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 12px; color: var(--ink-2); text-align: right; flex: none; max-width: 48%; }
.g-steps { margin: 4px 0 8px; padding-left: 22px; }
.g-steps li { padding: 3px 0; }
.g-steps small { margin-left: 6px; color: var(--ink-2); font-size: 12px; }
.g-districts li { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 5px 0; border-top: 1px dashed var(--line); }
.g-districts li b { margin-right: 4px; }
.g-districts li span { padding: 1px 8px; border-radius: 99px; background: var(--line); font-size: 11.5px; }
.g-src { font-size: 12px !important; color: var(--ink-3); }
.g-note { padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--gold) 14%, transparent); }
.g-teaser { margin: 10px 0 16px; padding: 14px 16px; border-radius: var(--radius-m); border: 1px dashed color-mix(in srgb, var(--gold) 60%, transparent); }
.g-teaser h3 { margin: 0 0 8px; font-size: 15px; }
.g-teaser ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 13.5px; }
.g-teaser li { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.g-teaser p { margin: 0 0 10px; font-size: 13px; color: var(--ink-2); }
/* калькулятор поездки */
.trip { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--radius-m); border: 1px solid var(--line); }
.trip > p { margin: 0 0 8px; font-size: 13px; }
.trip-total { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 10px 0 8px; }
.trip-total b { font-family: var(--font-display); font-size: 26px; }
.trip-total span { color: var(--ink-2); font-size: 13px; }
.trip-parts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.trip-part { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 10px; background: var(--line); font-size: 13px; }
[dir="rtl"] .g-steps { padding-left: 0; padding-right: 22px; }
[dir="rtl"] .g-meta { align-items: flex-start; text-align: left; }
.g-teaser li svg { width: 14px; height: 14px; flex: none; }


/* ===== Телефон: кнопка «обновить», компактная верхняя панель и лёгкая отрисовка ===== */
@media (max-width: 860px) {
  .brand-wrap .reload-btn { display: grid; place-items: center; }
  .reload-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  /* вид дневной карты переключается в «Слоях», чтобы всё влезало в одну строку */
  #daystyle-btn { display: none !important; }
  .ly-day { display: block; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
  .ly-day .chips { display: flex; gap: 6px; padding: 0 8px 4px; }
  .ly-day .chip { flex: 1; }
  /* размытие «стекла» на телефоне сильно тормозит прокрутку и поворот глобуса — делаем панели плотными */
  *, *::before, *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  :root { --glass: rgba(255, 255, 255, 0.84); --glass-strong: rgba(255, 255, 255, 0.92); --glass-card: rgba(250, 252, 255, 0.95); }
  :root[data-theme="night"] { --glass: rgba(14, 22, 44, 0.86); --glass-strong: rgba(18, 28, 54, 0.92); --glass-card: rgba(10, 17, 36, 0.95); }
}
@media (max-width: 420px) {
  .topbar { gap: 6px; }
  .tools { gap: 4px; }
  .brand-wrap { gap: 4px; }
  .icon-btn, .pill-btn, .brand { height: 36px; }
  .icon-btn, .brand { width: 36px; padding: 0; justify-content: center; }
  .pill-btn { padding: 0 8px; }
  #lang-btn { padding: 0 7px; }
  .icon-btn svg { width: 19px; height: 19px; }
  .brand svg { width: 22px; height: 22px; }
  .mode button { padding: 9px 6px; font-size: 13px; }
  .random-btn { width: 44px; height: 44px; }
}
@media (max-width: 340px) {
  .icon-btn, .pill-btn, .brand { height: 32px; }
  .icon-btn, .brand { width: 32px; }
  .tools { gap: 3px; }
}

.places-sec .places-body { padding-bottom: 6px; }
.routes-sec { margin-top: 18px; }
.routes-sec summary { font-size: 17px; }
.routes-sec .routes-body { padding-bottom: 10px; }

/* «Нишевое» */
.niche-body { padding: 0 2px 12px; font-size: 14px; line-height: 1.5; }
.niche-body p { margin: 0 0 6px; }
.niche-buy { display: grid; gap: 8px; }
.nb-item { padding: 10px 12px; border-radius: 12px; background: var(--line); }
.nb-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.nb-head span { flex: none; color: var(--accent); font-weight: 700; font-size: 13px; }
.nb-item p { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; }
.niche-haggle { display: flex; align-items: center; gap: 10px; }
.hg-bar { display: inline-flex; gap: 3px; flex: none; }
.hg-bar i { width: 16px; height: 6px; border-radius: 3px; background: var(--line); }
.hg-bar i.on { background: var(--accent); }
.niche-fests { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.niche-fests li { display: flex; flex-direction: column; }
.niche-fests time { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-weight: 700; }
.niche-fests span { color: var(--ink-2); font-size: 13px; }
.niche-extra { padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, transparent); margin-bottom: 8px; }
.niche-extra p { margin: 4px 0 0; }

/* ---------- оплата пожизненного доступа ---------- */
.pay-note { margin: 10px 0 14px; line-height: 1.45; }
.pay-note.warn { color: var(--warn, #e0a33a); }
.pay-consent { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; cursor: pointer; line-height: 1.4; text-align: left; }
.pay-consent input { margin-top: 3px; flex: 0 0 auto; width: 18px; height: 18px; cursor: pointer; }
.pay-msg { margin: 10px 0 0; min-height: 1em; }
.pay-msg.warn { color: var(--warn, #e0a33a); }
#premium-pay { margin-bottom: 16px; }           /* чтобы «Оплатить» и «Понятно» не слипались */
/* оговорка внизу карточки страны: заметна, но не кричит */
.card-note { margin: 14px 22px 22px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.auth-docs { margin: 2px 0 14px; font-size: 13px; }
.auth-docs a { color: var(--accent); }

/* ---------- плашка про файлы cookie ---------- */
.cookie-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  padding: 12px; animation: cookie-up .25s ease-out;
}
@keyframes cookie-up { from { transform: translateY(14px); opacity: 0; } }
.cookie-in {
  max-width: 1000px; margin: 0 auto;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 14px 18px; border-radius: var(--radius-m);
  background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow);
}
.cookie-text { flex: 1 1 320px; min-width: 0; }
.cookie-text b { display: block; margin-bottom: 3px; }
.cookie-text p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.cookie-btns { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cookie-btns .link { font-size: 13.5px; }
@media (max-width: 560px) {
  .cookie-btns { width: 100%; }
  .cookie-btns .btn { flex: 1 1 auto; }
}

/* ---------- избранное: звёздочка в карточке страны ---------- */
.card-fav { position: absolute; top: 12px; right: 62px; z-index: 3; background: rgba(0, 0, 0, .28); color: #fff; border-color: rgba(255, 255, 255, .25); box-shadow: none; }
.card-fav[aria-pressed="true"] { color: var(--gold); }
.card-fav[aria-pressed="true"] svg { fill: currentColor; }
.card-fav.pop svg { animation: fav-pop .3s ease-out; }
@keyframes fav-pop { 50% { transform: scale(1.3); } }
[dir="rtl"] .card-fav { right: auto; left: 62px; }
/* список избранного в профиле */
.pf-favs { margin: 0 0 12px; }
.pf-favs h3 { font-size: 15px; margin: 0 0 8px; }
.pf-favs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pf-favs button.fav-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--glass-tile); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.pf-favs button.fav-chip:hover { border-color: var(--accent); }
.pf-favs .muted { font-size: 13.5px; color: var(--ink-2); margin: 0; }

/* ===== избранное в верхней панели ===== */
.fav-top { position: relative; width: 44px; padding: 0; display: grid; place-items: center; }
.fav-top svg { transition: transform .2s; }
.fav-top.on { color: var(--gold); }
.fav-top.on svg { fill: currentColor; }
.fav-top:hover svg { transform: scale(1.08); }
.fav-count { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--gold); color: #1b1300; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
[dir="rtl"] .fav-count { right: auto; left: -3px; }
.fav-panel { right: auto; left: 0; width: 280px; }
[dir="rtl"] .fav-panel { left: auto; right: 0; }
.fav-head { position: relative; font-weight: 700; font-size: 14px; padding: 4px 6px 8px; }
.fav-head span { color: var(--ink-2); font-weight: 500; margin-inline-start: 4px; }
.fav-empty { position: relative; margin: 0 6px 8px; font-size: 13.5px; color: var(--ink-2); line-height: 1.4; }
.fav-panel .btn { position: relative; }
.fav-panel li .fav-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-panel li.current::after { content: none; }
.fav-x { border: 0; background: none; color: var(--ink-2); font-size: 18px; line-height: 1; width: 26px; height: 26px; border-radius: 50%; opacity: .55; cursor: pointer; flex: none; }
.fav-x:hover { opacity: 1; background: color-mix(in srgb, var(--ink) 10%, transparent); }
@media (max-width: 860px) {
  .fav-top { width: 48px; height: 48px; }
  /* звёздочка во втором ряду — список открывается под ним, на всю ширину */
  .topbar .dropdown.fav-panel { top: calc(max(12px, env(safe-area-inset-top)) + 108px); left: 12px; right: 12px; }
}
@media (max-width: 420px) { .fav-top { width: 44px; height: 44px; } }
.fav-mode { flex: none; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; color: var(--ink-2);
  background: color-mix(in srgb, var(--ink) 8%, transparent); }
.fav-mode.travel { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.fav-scroll { position: relative; overflow: auto; max-height: min(380px, 60vh); }
.fav-scroll .picker-list { max-height: none; overflow: visible; }
.fav-sub { margin: 6px 6px 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.fav-panel li .fav-name b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.fav-panel li .fav-name small { display: block; font-size: 11.5px; color: var(--ink-2); }

/* ===== удаление аккаунта ===== */
.pf-danger { border-color: color-mix(in srgb, #d1495b 35%, var(--line)); }
.pf-danger summary { color: #e0626f; }
.pf-del-text { margin: 0 0 4px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.btn.danger { background: #c43c4b; color: #fff; }
.btn.danger:hover { background: #ad3140; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 90; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: min(440px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 600; text-align: center;
  background: var(--glass-card); color: var(--ink); border: 1px solid var(--glass-border); box-shadow: var(--shadow); backdrop-filter: var(--blur); transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== восстановление пароля ===== */
.auth-forgot { margin: -6px 0 12px; text-align: right; font-size: 13px; }
[dir="rtl"] .auth-forgot { text-align: left; }
.reset-note { margin: -4px 0 14px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.reset-help { margin: 10px 0 0 !important; font-size: 12.5px; text-align: center; color: var(--ink-2); }
#reset-code { letter-spacing: .3em; font-variant-numeric: tabular-nums; }
#auth-login-hint { display: block; margin-top: 4px; color: var(--ink-2); font-size: 12.5px; }
#reset-resend:not([hidden]) { margin-inline-end: 16px; }
#auth-resend { margin-inline-end: 16px; }
#auth-code { letter-spacing: .3em; font-variant-numeric: tabular-nums; }
.search.open input { background: #f7f9fc; } /* раскрытый поиск лежит поверх кнопок — фон плотный, чтобы они не просвечивали */
:root[data-theme="night"] .search.open input { background: #0e1730; }

/* ---------- общественный транспорт ---------- */
.transport { padding: 2px 0 14px; }
.tr-meta { margin: -4px 0 8px; font-size: 12.5px; }
.tr-modes { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.tr-mode { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--glass-tile, var(--line)); color: var(--ink-2); }
.tr-cl { display: flex; gap: 9px; align-items: flex-start; padding: 9px 11px; border-radius: 11px; background: var(--line); font-size: 13px; line-height: 1.4; margin-bottom: 10px; }
.tr-cl i { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; background: var(--good); }
.tr-cl-partial i { background: var(--mid); }
.tr-cl-no i { background: var(--bad); }
.tr-cl small { display: block; color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }
.tr-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--line); margin-bottom: 10px; }
.tr-tab { flex: 1; border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 700; padding: 7px 6px; border-radius: 9px; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 6px; min-width: 0; }
.tr-tab span { font-size: 11px; font-weight: 700; color: var(--ink-3); }
.tr-tab.on { background: var(--glass-strong); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.tr-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tr-panel .chips { margin-bottom: 8px; }
.tr-tickets, .tr-apps { display: grid; gap: 7px; }
.tr-ticket, .tr-app { padding: 9px 11px; border-radius: 11px; background: var(--glass-tile, var(--line)); min-width: 0; }
.tr-t-head, .tr-a-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 3px; }
.tr-kind, .tr-for, .tr-akind { font-size: 10.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: var(--line); color: var(--ink-2); }
.tr-for { background: transparent; border: 1px solid var(--line); }
.tr-k-month, .tr-k-year, .tr-k-week { color: var(--good); }
.tr-k-tourist, .tr-k-day, .tr-k-airport { color: var(--gold); }
.tr-t-main { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tr-t-main b { font-size: 14px; overflow-wrap: anywhere; min-width: 0; }
.tr-price { flex: none; font-weight: 800; font-size: 14.5px; text-align: right; white-space: nowrap; }
.tr-price small { display: block; font-weight: 600; font-size: 11.5px; color: var(--ink-3); }
.tr-ticket p, .tr-app p { margin: 4px 0 0; font-size: 12.8px; line-height: 1.45; color: var(--ink-2); }
.tr-a-head b { font-size: 14px; }
.tr-a-head a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.tr-rules { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13.3px; line-height: 1.45; }
.tr-src { margin: 10px 0 0; font-size: 12.5px; }
.tr-src a { color: var(--ink-2); }
[dir="rtl"] .tr-rules { padding-left: 0; padding-right: 20px; }
[dir="rtl"] .tr-price { text-align: left; }
.g-src-end { margin: 16px 0 4px; }
.legend-hint { margin: -4px 0 8px; font-size: 11.5px; line-height: 1.35; color: var(--ink-2); max-width: 260px; }
.score-pp { display: block; margin-top: 6px; font-size: 11.5px; color: var(--ink-2); }
