/* ============================================================
   Тайны Синеокой — стили
   ============================================================ */
:root {
  --navy-900: #0e1838;
  --navy-800: #16234a;
  --navy-700: #1d2c57;
  --navy-650: #20305c;
  --navy-600: #28386c;
  --line:     #33457e;
  --gold:     #d8c07d;
  --gold-2:   #cdb06a;
  --cream:    #ece7d8;
  --blue-200: #9fb4dd;
  --blue-400: #5d77b8;
  --red:      #d9604a;
  --text:     #eaeaf2;
  --muted:    #9aa6c8;

  --maxw: 900px;
  --nav-h: 64px;

  --font-display: 'Montserrat', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--navy-900);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

/* шапка приложения занимает всю высоту, центрируем колонку */
#app {
  height: 100vh;            /* запасной вариант */
  height: 100dvh;
  height: var(--app-h, 100dvh);
  display: flex;
  flex-direction: column;
  max-width: var(--maxw);
  margin: 0 auto;
  background: var(--navy-800);
  position: relative;
  overflow: hidden;
}

/* ---------- Заставка ---------- */
#splash {
  position: fixed; inset: 0; z-index: 1800;
  background: radial-gradient(120% 90% at 50% 0%, #1c2c5c 0%, var(--navy-900) 70%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 32px;
  transition: opacity .5s ease;
}
#splash.hide { opacity: 0; pointer-events: none; }
#splash .splash-logo { width: min(340px, 80vw); height: auto; margin-bottom: 18px; filter: drop-shadow(0 8px 26px rgba(0,0,0,.45)); }
#splash h1 {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 7vw, 44px);
  letter-spacing: .04em; color: var(--cream);
}
#splash p { color: var(--blue-200); margin: 12px 0 38px; letter-spacing: .12em; text-transform: uppercase; font-size: 13px; }
.btn-primary {
  background: var(--gold); color: var(--navy-900); border: none;
  font-weight: 600; letter-spacing: .05em; padding: 14px 46px; border-radius: 999px;
  font-size: 15px; transition: transform .15s, background .2s;
}
.btn-primary:hover { background: #e6cf91; transform: translateY(-1px); }
#splash .copyright {
  position: absolute; bottom: 22px; left: 0; right: 0;
  font-size: 12px; color: var(--muted); letter-spacing: .02em;
}
#splash .copyright a { color: var(--blue-200); text-decoration: none; }
#splash .copyright a:hover { color: var(--gold); }
.btn-ghost {
  background: transparent; color: var(--cream); border: 1px solid var(--line);
  padding: 13px 46px; border-radius: 999px; font-size: 15px; letter-spacing: .05em;
  margin-top: 14px; transition: border-color .2s, color .2s;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- Верхняя панель ---------- */
header.topbar {
  flex: none; position: relative; z-index: 1100;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; background: var(--navy-800);
  border-bottom: 1px solid var(--line);
}
header.topbar .brand {
  font-family: var(--font-display); font-weight: 700; letter-spacing: .06em;
  font-size: 15px; color: var(--cream); text-transform: uppercase; margin-right: auto;
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
  background: none; border: none; padding: 0;
}
@media (max-width: 360px) { header.topbar .brand { font-size: 13.5px; letter-spacing: .04em; } }
header.topbar .brand-logo { width: 30px; height: 30px; flex: none; }
.demo-toggle { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.demo-toggle .switch {
  width: 40px; height: 22px; border-radius: 999px; background: var(--navy-600);
  position: relative; transition: background .2s; flex: none;
}
.demo-toggle .switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--cream); transition: transform .2s;
}
.demo-toggle.on .switch { background: var(--gold); }
.demo-toggle.on .switch::after { transform: translateX(18px); }
.demo-toggle.on span { color: var(--gold); }
.icon-btn {
  background: var(--navy-700); border: 1px solid var(--line); color: var(--cream);
  width: 38px; height: 38px; border-radius: 10px; font-size: 16px; flex: none;
  display: grid; place-items: center;
}
.icon-btn svg { display: block; }
.icon-btn:hover { border-color: var(--gold); }

/* индикатор демо-режима */
.demo-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--navy-900); background: var(--gold); border-radius: 999px;
  padding: 3px 9px; margin-right: 4px; flex: none;
}

/* всплывающее уведомление «вы рядом» / статус демо-режима */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translate(-50%, 20px);
  z-index: 1900; width: max-content; max-width: min(94%, 560px);
  display: flex; align-items: center; gap: 10px;
  background: var(--navy-700); color: var(--cream); border: 1px solid var(--gold-2);
  border-radius: 14px; padding: 12px 18px; font-size: 13.5px; line-height: 1.35;
  box-shadow: 0 14px 40px rgba(0,0,0,.5); cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.toast .toast-pin { font-size: 17px; flex: none; }

/* выпадающее меню */
.menu {
  position: absolute; top: calc(100% + 8px); right: 14px; z-index: 60;
  width: 252px; background: var(--navy-700); border: 1px solid var(--line);
  border-radius: 14px; padding: 8px; box-shadow: 0 14px 40px rgba(0,0,0,.45);
  display: flex; flex-direction: column; gap: 2px;
}
.menu-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px; border-radius: 10px; font-size: 14px; color: var(--cream);
  background: none; border: none; text-align: left;
}
.menu-row svg { flex: none; color: var(--blue-200); display: block; }
.menu .btn-row:hover { background: var(--navy-600); }
.menu .btn-row:hover svg { color: var(--gold); }
.menu .demo-toggle { justify-content: space-between; color: var(--cream); font-size: 14px; cursor: pointer; }
.menu .demo-toggle.on span { color: var(--gold); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 8px; }
.menu-nav .btn-row { font-weight: 600; }
.menu-nav .btn-row::before { content: '›'; color: var(--blue-400); margin-right: 2px; }

/* ---------- Основная область ---------- */
main {
  flex: 1; min-height: 0; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--navy-600) transparent;
}
main::-webkit-scrollbar { width: 10px; }
main::-webkit-scrollbar-track { background: transparent; }
main::-webkit-scrollbar-thumb { background: var(--navy-600); border-radius: 999px; border: 3px solid var(--navy-800); }
main::-webkit-scrollbar-thumb:hover { background: var(--line); }
.screen { display: none; }
.screen.active { display: block; }
#screen-map.active { height: 100%; }
.pad { padding: 20px 18px 30px; }

.eyebrow {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--blue-400); margin-bottom: 10px;
}
h2.section {
  font-family: var(--font-display); font-weight: 600; letter-spacing: .03em;
  font-size: 20px; color: var(--cream); margin: 26px 0 14px;
}

/* hero на главной */
.hero {
  margin: 18px; border-radius: 18px; padding: 26px 24px;
  background: linear-gradient(135deg, #243a78 0%, #1a2a55 100%);
  position: relative; overflow: hidden;
}
.hero .hero-kicker {
  font-family: var(--font-display); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 12px;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(22px, 6.2vw, 30px); line-height: 1.18; letter-spacing: .01em;
  color: var(--cream); margin-bottom: 14px;
}
.hero .hero-lead {
  color: var(--blue-200); font-size: 14.5px; line-height: 1.6;
  margin-bottom: 24px; max-width: 52ch;
}
.hero .hero-cta-label {
  display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.hero .hero-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 380px; }
.btn-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border-radius: 999px; font-weight: 600; font-size: 14px;
  cursor: pointer; white-space: nowrap;
  transition: transform .15s, background .15s, border-color .15s, color .15s;
}
.btn-cta svg { display: block; }
.btn-cta-primary { background: var(--cream); color: var(--navy-900); border: 1px solid var(--cream); }
.btn-cta-primary:hover { background: #fff; transform: translateY(-1px); }
.btn-cta-ghost { background: transparent; color: var(--cream); border: 1px solid var(--line); }
.btn-cta-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- Достижения ---------- */
.ach-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
@media (min-width: 620px) { .ach-grid { grid-template-columns: repeat(3, 1fr); } }
.ach {
  background: var(--navy-700); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; display: flex; flex-direction: column; gap: 10px;
}
.ach .thumb { position: relative; border-radius: 10px; overflow: hidden; }
.ach .thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.ach.locked .thumb img { filter: grayscale(1) brightness(.7); }
.ach .lock {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 22px; color: var(--cream); background: rgba(14,24,56,.45);
}
.ach.done .lock { display: none; }
.ach .a-title { font-size: 12px; color: var(--muted); min-height: 32px; }
.ach.done .a-title { color: var(--cream); }
.ach .bar { height: 5px; border-radius: 999px; background: var(--navy-600); overflow: hidden; }
.ach .bar i { display: block; height: 100%; background: var(--gold); border-radius: 999px; transition: width .4s; }
.ach .ach-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.ach .count { font-size: 11px; color: var(--muted); }
.ach .ach-share {
  background: none; border: none; color: var(--muted); padding: 4px;
  border-radius: 8px; display: grid; place-items: center; line-height: 0;
  opacity: .7; transition: color .15s, opacity .15s, background .15s;
}
.ach .ach-share:hover { color: var(--gold); opacity: 1; background: var(--navy-600); }
.ach .ach-share svg { display: block; }

/* ---------- Список легенд (жанры / открытое) ---------- */
.genre-block { margin-bottom: 26px; }
.legend-card {
  display: flex; gap: 14px; align-items: center;
  background: var(--navy-700); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px; margin-bottom: 12px;
  transition: border-color .2s, transform .12s; width: 100%; text-align: left; color: inherit;
}
.legend-card:hover { border-color: var(--gold-2); }
.legend-card:active { transform: scale(.995); }
.legend-card .lc-thumb {
  width: 60px; height: 60px; border-radius: 10px; flex: none; overflow: hidden;
  background: linear-gradient(135deg, #2a3c74, #16234a); display: grid; place-items: center;
}
.legend-card .lc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.legend-card.locked .lc-thumb img { filter: blur(4px) brightness(.8); transform: scale(1.1); }
#app.lock-bw .legend-card.locked .lc-thumb img { filter: grayscale(1) brightness(.6); transform: none; }
.legend-card .lc-orn { width: 30px; opacity: .5; }
.legend-card .lc-body { flex: 1; min-width: 0; }
.legend-card .lc-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--cream); line-height: 1.25; }
.legend-card .lc-meta { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-card .lc-dist {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px;
  font-size: 11.5px; color: var(--blue-200);
}
.legend-card .lc-dist svg { color: var(--blue-400); flex: none; }
.legend-card .lc-dist.near { color: var(--gold); font-weight: 600; }
.legend-card .lc-dist.near svg { color: var(--gold); }
@media (max-width: 400px) {
  .legend-card .lc-title { font-size: 14px; }
  .legend-card .lc-meta { font-size: 10.5px; }
  .legend-card { gap: 11px; padding: 11px; }
  .legend-card .lc-thumb { width: 54px; height: 54px; }
}
.legend-card .lc-state { width: 20px; text-align: center; font-size: 14px; color: var(--blue-400); flex: none; }
.legend-card.unlocked .lc-state { color: var(--gold); }

.tag {
  display: inline-block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--blue-200);
}
.tag.mystical { color: #b6a8e0; border-color: #4a4080; }
.tag.romantic { color: #e6b6c2; border-color: #7d4a5e; }
.tag.modern   { color: #9fd6c2; border-color: #3f7d68; }

/* поиск */
.search {
  width: 100%; background: var(--navy-700); border: 1px solid var(--line);
  color: var(--text); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 6px;
}
.search::placeholder { color: var(--muted); }

/* ---------- Карта ---------- */
#map { width: 100%; height: 100%; min-height: 320px; }
.map-wrap { position: relative; height: 100%; }
.map-bar {
  position: absolute; z-index: 500; top: 12px; right: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.locate-btn {
  flex: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(22,35,74,.92); backdrop-filter: blur(4px); color: var(--cream);
  font-size: 18px; cursor: pointer; line-height: 1;
  display: grid; place-items: center;
}
.locate-btn:hover { background: var(--navy-700); }
.locate-btn.on { background: var(--gold); color: var(--navy-900); border-color: #fff4d6; }
.coord-readout {
  position: absolute; z-index: 500; left: 12px; right: 12px; bottom: 12px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  background: rgba(22,35,74,.95); backdrop-filter: blur(4px);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
  font-size: 13px; color: var(--cream);
}
.coord-readout code { font-family: ui-monospace, monospace; color: var(--gold); }
.coord-readout .coord-copy {
  border: 1px solid var(--line); background: var(--navy-700); color: var(--cream);
  border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 12px;
}
.coord-readout .coord-hint { color: var(--muted); font-size: 12px; }

/* легенда цветов жанров (фильтр) */
.genre-key {
  position: absolute; z-index: 500; left: 12px; bottom: 12px;
  display: flex; flex-direction: column; gap: 6px;
  background: rgba(22,35,74,.92); backdrop-filter: blur(4px);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.genre-key .gk {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; color: var(--cream); font-size: 12.5px;
  padding: 2px 0; text-align: left; line-height: 1.2;
}
.genre-key .gk i { width: 14px; height: 14px; border-radius: 50%; flex: none; border: 1px solid rgba(255,255,255,.5); }
.genre-key .gk.off { color: var(--muted); }
.genre-key .gk.off span { text-decoration: line-through; }
.genre-key .gk.off i { opacity: .3; }

.empty .empty-logo { width: min(280px, 72%); height: auto; opacity: .55; margin: 0 auto 18px; }

/* всплывающая карточка легенды на карте */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(8,14,34,.55); z-index: 1500;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(110%);
  bottom: 0; width: min(100%, var(--maxw)); z-index: 1501;
  background: var(--navy-800); border-top: 1px solid var(--line);
  border-radius: 20px 20px 0 0; padding: 22px 22px 28px;
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.sheet.show { transform: translateX(-50%) translateY(0); }
.sheet .close {
  position: absolute; top: 16px; right: 16px; background: var(--navy-700);
  border: 1px solid var(--line); color: var(--cream); width: 32px; height: 32px;
  border-radius: 50%; font-size: 16px;
}
.sheet .s-eyebrow { font-size: 12px; color: var(--muted); }
.sheet h3 {
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  text-transform: uppercase; letter-spacing: .02em; color: var(--cream);
  margin: 4px 0 14px; line-height: 1.15;
}
.sheet .row { font-size: 13px; color: var(--blue-200); margin: 6px 0; }
.sheet .row b { color: var(--cream); font-weight: 600; }
.sheet .teaser { color: var(--muted); font-size: 14px; margin: 12px 0 18px; }
.sheet .sheet-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sheet .read-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--cream); color: var(--navy-900); border: none;
  padding: 11px 26px; border-radius: 999px; font-weight: 600; font-size: 14px;
}
.sheet .read-btn[disabled] { background: var(--navy-600); color: var(--muted); cursor: not-allowed; }
.sheet .sheet-map-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--cream); border: 1px solid var(--line);
  padding: 11px 22px; border-radius: 999px; font-weight: 600; font-size: 14px;
}
.sheet .sheet-map-btn:hover { border-color: var(--gold); color: var(--gold); }
.sheet .sheet-map-btn svg { display: block; }
.sheet .hint { font-size: 12px; color: var(--gold-2); margin-top: 12px; }

/* ---------- Чтение легенды ---------- */
.reading .r-hero {
  position: relative; overflow: hidden; background: var(--navy-900);
  display: flex; align-items: center; justify-content: center;
  max-height: 62vh; min-height: 260px; padding: 26px;
}
.reading .r-hero .r-hero-bg {
  position: absolute; inset: -12%;
  background-size: cover; background-position: center;
  filter: blur(38px) brightness(.72) saturate(1.6);
  transform: scale(1.1);
}
.reading .r-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(130% 100% at 50% 38%, transparent 42%, rgba(8,12,28,.6) 100%);
}
.reading .r-hero img {
  position: relative; z-index: 1; display: block;
  max-height: calc(62vh - 52px); max-width: 100%; width: auto; object-fit: contain;
  border-radius: 14px; border: 1px solid rgba(216,192,125,.45);
  box-shadow: 0 18px 50px rgba(0,0,0,.6);
}
.reading .r-hero.placeholder {
  height: 220px; min-height: 0; padding: 0;
  background: radial-gradient(80% 120% at 50% 0%, #2a3c74, #16234a);
}
.reading .r-hero.placeholder img { width: 90px; height: auto; opacity: .6; border: none; box-shadow: none; }
.reading .r-back {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: rgba(14,24,56,.6); border: 1px solid var(--line); color: var(--cream);
  width: 40px; height: 40px; border-radius: 12px; font-size: 18px; backdrop-filter: blur(4px);
}
.reading .r-body { padding: 22px 20px 40px; }
.reading .r-eyebrow { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.reading h1 {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 6vw, 34px);
  text-transform: uppercase; letter-spacing: .02em; color: var(--cream); margin: 6px 0 14px;
}
.reading .r-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; }
.reading .r-meta .place { font-size: 13px; color: var(--blue-200); }
.reading .r-hero img.zoomable { cursor: zoom-in; }
.reading .r-back-bottom {
  margin-top: 26px; width: 100%;
  background: var(--navy-700); color: var(--cream); border: 1px solid var(--line);
  padding: 14px; border-radius: 12px; font-size: 15px; font-weight: 600;
  transition: border-color .2s, color .2s;
}
.reading .r-back-bottom:hover { border-color: var(--gold); color: var(--gold); }

/* лайтбокс иллюстрации */
.lightbox {
  position: fixed; inset: 0; z-index: 2000; background: rgba(8,12,28,.92);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.lightbox .lb-close {
  position: absolute; top: 18px; right: 18px; width: 44px; height: 44px;
  border-radius: 50%; background: rgba(22,35,74,.85); border: 1px solid var(--line);
  color: var(--cream); font-size: 20px;
}

/* модальное окно (как установить) */
.modal {
  position: fixed; inset: 0; z-index: 2000; background: rgba(8,12,28,.7);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-card {
  position: relative; width: min(420px, 100%);
  background: var(--navy-700); border: 1px solid var(--line); border-radius: 18px;
  padding: 26px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.modal-card h3 {
  font-family: var(--font-display); font-weight: 700; font-size: 19px;
  color: var(--cream); margin-bottom: 12px; padding-right: 30px;
}
.modal-card p { color: var(--blue-200); font-size: 14px; line-height: 1.6; }
.modal-card .modal-note { color: var(--muted); font-size: 12.5px; margin-top: 12px; }
.modal-card .lb-close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px;
  border-radius: 50%; background: var(--navy-600); border: 1px solid var(--line);
  color: var(--cream); font-size: 15px;
}
#install-btn svg { color: var(--gold); }
#install-btn span { color: var(--gold); font-weight: 600; }

.reading .r-text p { margin-bottom: 16px; color: #dfe3f1; }
.reading .r-text p.lead { min-height: 3.2em; }
.reading .r-text .dropcap {
  float: left; font-family: var(--font-display); font-weight: 700;
  font-size: 3.6em; line-height: .72; color: var(--gold);
  margin: 6px 12px 0 0;
}

/* пустое состояние */
.empty { text-align: center; color: var(--muted); padding: 60px 24px; }
.empty img { width: 70px; opacity: .4; margin: 0 auto 18px; }

/* ---------- Нижняя навигация ---------- */
nav.tabbar {
  flex: none; width: 100%; height: var(--nav-h); z-index: 40;
  background: var(--navy-800); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
nav.tabbar button {
  background: none; border: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 10.5px; letter-spacing: .03em;
}
nav.tabbar button .ic { font-size: 19px; line-height: 1; display: grid; place-items: center; height: 19px; }
nav.tabbar button .ic svg { display: block; }
nav.tabbar button.active { color: var(--gold); }

.hidden { display: none !important; }

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

/* ---------- Маркеры карты (без внешних картинок) ---------- */
.pin-wrap {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.pin {
  width: 30px; height: 30px; box-sizing: border-box;
  background: var(--blue-400); border: 2px solid #cdd6ee;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 3px 8px rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
}
.pin-glyph {
  transform: rotate(45deg);
  font-size: 13px; line-height: 1; color: #fff; text-align: center;
}
.pin-glyph .pin-star { display: block; }
.pin.g-mystical { background: #193A6F; border-color: #6f87bd; }
.pin.g-romantic { background: #EB7A68; border-color: #ffd2c8; }
.pin.g-modern   { background: #E0C58D; border-color: #fff0cf; }
.pin.g-modern .pin-glyph { color: #16234a; }
.pin.is-read { box-shadow: 0 0 0 3px rgba(216,192,125,.5), 0 3px 8px rgba(0,0,0,.4); }

.leaflet-popup-content-wrapper { background: var(--navy-700); color: var(--text); border-radius: 12px; }
.leaflet-popup-tip { background: var(--navy-700); }
.user-dot {
  width: 18px; height: 18px; border-radius: 50%; background: #4aa3ff;
  border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(74,163,255,.25);
  animation: userpulse 2s ease-out infinite;
}
@keyframes userpulse {
  0%   { box-shadow: 0 0 0 0 rgba(74,163,255,.45); }
  70%  { box-shadow: 0 0 0 14px rgba(74,163,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,163,255,0); }
}
@media (prefers-reduced-motion: reduce) { .user-dot { animation: none; } }
