/* ================================================================
   ГРОДНО GUIDE — ГЛАВНАЯ ТАБЛИЦА СТИЛЕЙ
   ================================================================ */

:root {
  --font-head: 'Playfair Display', serif;
  --font-body: 'Nunito', sans-serif;
  --bg-sidebar: #f0f2f7;
  --bg-card:    #ffffff;
  --bg-facts:   #f4f6fb;
  --bg-tab:     #e2e5ef;
  --text-main:  #1c1e2e;
  --text-muted: #596080;
  --border:     rgba(0,0,0,0.09);
  --header-h:   54px;
  --accent:     #4361ee;
  --accent2:    #f72585;
  --gold:       #ffd166;
  --green:      #06d6a0;
  --cover-bg:   #8a8a9a;
  --scrollbar:  rgba(0,0,0,0.18);
  --modal-bg:   rgba(10,11,24,0.72);
}
[data-theme="dark"] {
  --bg-sidebar: #131520;
  --bg-card:    #1e2235;
  --bg-facts:   #252940;
  --bg-tab:     #252940;
  --text-main:  #e8eaf8;
  --text-muted: #8890b5;
  --border:     rgba(255,255,255,0.07);
  --cover-bg:   #0e0f1a;
  --scrollbar:  rgba(255,255,255,0.15);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { font-family: var(--font-body); color: var(--text-main); background: var(--bg-sidebar); transition: background 0.3s, color 0.3s; }

/* ── HEADER ── */
#header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
  background: linear-gradient(100deg, #0d0e1a 0%, #1a1d35 60%, #2a2060 100%);
  display: flex; align-items: center; gap: 9px; padding: 0 13px;
  z-index: 3000; box-shadow: 0 3px 20px rgba(0,0,0,0.45);
}
.logo { font-family: var(--font-head); font-size: 15px; font-weight: 700; color: #fff; white-space: nowrap; flex-shrink: 0; }
.logo em { color: var(--gold); font-style: normal; }
.logo-dot { color: var(--accent2); }

#searchWrap { flex: 1; max-width: 260px; min-width: 80px; position: relative; }
#searchWrap svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; stroke: #aaa; fill: none; pointer-events: none; }
#searchBar { width: 100%; padding: 7px 10px 7px 28px; border-radius: 20px; border: none; background: rgba(255,255,255,0.12); color: #fff; font-size: 13px; font-family: var(--font-body); outline: none; transition: background 0.2s; }
#searchBar::placeholder { color: rgba(255,255,255,0.45); }
#searchBar:focus { background: rgba(255,255,255,0.2); }

#visitedCounter { color: var(--gold); font-size: 12px; font-weight: 700; white-space: nowrap; background: rgba(255,209,102,0.12); padding: 5px 9px; border-radius: 20px; flex-shrink: 0; }

.hdr-btn { width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer; font-size: 17px; background: rgba(255,255,255,0.12); color: #fff; display: flex; align-items: center; justify-content: center; transition: background 0.2s; flex-shrink: 0; }
.hdr-btn:hover { background: rgba(255,255,255,0.24); }
.hdr-btn.active-modal { background: rgba(255,255,255,0.3); outline: 2px solid rgba(255,255,255,0.3); }
#mobileSearchBtn { display: none; }

/* ── GEO BUTTON (поверх карты) ── */
#geoBtn {
  position: absolute; top: 80px; right: 12px; z-index: 1500;
  width: 40px; height: 40px; background: var(--bg-card);
  border: 2px solid var(--border); border-radius: 10px;
  font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.22); transition: background 0.2s, transform 0.15s;
}
#geoBtn:hover { transform: scale(1.08); }
#geoBtn.locating { animation: geoPulse 1s infinite; }
@keyframes geoPulse { 0%,100%{opacity:1} 50%{opacity:0.45} }

/* ── LAYOUT ── */
.container { display: flex; height: 100vh; padding-top: var(--header-h); }
#map { flex: 2; position: relative; min-width: 0; }
#info { flex: 1; min-width: 320px; max-width: 620px; padding: 12px; background: var(--bg-sidebar); border-left: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; transition: background 0.3s; }
#info::-webkit-scrollbar { width: 4px; }
#info::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 10px; }

#cover {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 22px;
  background: var(--cover-bg);
  z-index: 9999;
  pointer-events: none;
}
.leaflet-control-attribution { z-index: 1 !important; }

/* ── TABS ── */
.categories { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.category-tab { display: flex; align-items: center; gap: 4px; padding: 6px 10px; background: var(--bg-tab); color: var(--text-muted); border-radius: 9px; cursor: pointer; font-size: 12px; font-weight: 600; transition: all 0.2s; border: 1px solid var(--border); white-space: nowrap; }
.category-tab:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
.category-tab .icon { font-size: 13px; }
.category-tab.active { color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(0,0,0,0.25); }
.category-tab.interesting.active { background: linear-gradient(135deg,#4361ee,#3a0ca3); }
.category-tab.legends.active     { background: linear-gradient(135deg,#f72585,#b5179e); }
.category-tab.monuments.active   { background: linear-gradient(135deg,#ffd166,#ef9d07); color:#2a1a00; }
.category-tab.museum.active      { background: linear-gradient(135deg,#06d6a0,#099773); color:#0a2a1e; }
.category-tab.insta.active       { background: linear-gradient(135deg,#833ab4,#fd1d1d,#fcb045); }
.category-tab.routes.active      { background: linear-gradient(135deg,#0f2027,#2c5364); }
.category-tab.quiz.active        { background: linear-gradient(135deg,#480ca8,#7209b7); }

/* ── SECTION TITLE ── */
.section-title { font-family: var(--font-head); font-size: 16px; font-weight: 700; color: var(--text-main); margin-bottom: 12px; display: flex; align-items: center; gap: 7px; }
.section-count { font-family: var(--font-body); font-size: 11px; font-weight: 600; color: var(--text-muted); background: var(--bg-tab); padding: 2px 7px; border-radius: 10px; }

/* ── CARDS ── */
.card { display: flex; align-items: center; margin-bottom: 9px; padding: 9px; border-radius: 12px; background: var(--bg-card); box-shadow: 0 2px 10px rgba(0,0,0,0.07); cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; border-left: 4px solid transparent; }
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.14); }
.card img { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; margin-right: 10px; flex-shrink: 0; }
.card-content { flex: 1; min-width: 0; }
.card-title { font-weight: 700; font-size: 13px; color: var(--text-main); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-fact { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.card.interesting { border-left-color: #4361ee; }
.card.legends     { border-left-color: #f72585; }
.card.museum      { border-left-color: #06d6a0; }
.card.monuments   { border-left-color: #ffd166; }
.card.insta       { border-left-color: #833ab4; }
.card-address { font-size: 11px; color: var(--text-muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visited-badge { display: inline-block; background: #06d6a0; color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 8px; margin-left: 4px; font-weight: 700; vertical-align: middle; }

/* ── PLACE DETAIL ── */
.place-card { background: var(--bg-card); border-radius: 16px; padding: 15px; box-shadow: 0 6px 24px rgba(0,0,0,0.10); animation: fadeIn 0.3s ease; }
.place-title { font-family: var(--font-head); font-size: 19px; font-weight: 700; color: var(--text-main); margin-bottom: 9px; line-height: 1.3; }
.place-description { font-size: 13px; line-height: 1.7; color: var(--text-muted); margin-bottom: 12px; }
.facts-block { background: var(--bg-facts); padding: 12px; border-radius: 12px; margin-top: 10px; }
.facts-title { font-weight: 700; font-size: 13px; margin-bottom: 7px; color: var(--text-main); }
.facts-block ul { padding-left: 16px; }
.facts-block li { font-size: 12.5px; color: var(--text-muted); margin-bottom: 5px; line-height: 1.5; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 11px; }
.back-button { display: inline-flex; align-items: center; gap: 5px; padding: 8px 13px; background: linear-gradient(135deg,#f72585,#b5179e); color: white; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600; transition: 0.2s; }
.back-button:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(247,37,133,0.4); }
.map-btn { display: inline-flex; align-items: center; gap: 5px; padding: 8px 13px; background: linear-gradient(135deg,#4361ee,#3a0ca3); color: #fff; border: none; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600; font-family: var(--font-body); transition: 0.2s; }
.map-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(67,97,238,0.4); }

/* ── PHOTO CAROUSEL ── */
.photo-carousel {
  width: 100%; margin: 12px 0;
  overflow: hidden;
  position: relative;
  /* padding создаёт зону peek: overflow:hidden обрезает соседние слайды на ±40px.
     Видимый peek = 40px − spaceBetween(12px) = ~28px с каждой стороны */
  padding: 0 40px;
  box-sizing: border-box;
}
.photo-carousel .swiper {
  /* overflow:visible — соседние слайды выступают за bounds свайпера;
     .photo-carousel overflow:hidden обрезает их по краям padding-зоны */
  width: 100%; height: 220px;
  overflow: visible;
}
.photo-carousel .swiper-slide {
  /* width НЕ задаётся здесь: slidesPerView:1 сам выставляет inline width = 100% свайпера */
  display: flex; justify-content: center; align-items: center;
  height: 200px;
  opacity: 0.42;
  filter: blur(2.5px);
  transition: opacity 0.3s ease, filter 0.3s ease;
  will-change: opacity, filter;
}
.photo-carousel .swiper-slide-active {
  opacity: 1; filter: none;
}
.photo-carousel .swiper-slide img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  display: block; pointer-events: none;
}
.photo-carousel .swiper-button-prev,
.photo-carousel .swiper-button-next {
  top: 50%;
  transform: translateY(-50%);
  margin-top: 0;
  width: 32px; height: 32px;
  background: rgba(0,0,0,0.48);
  border-radius: 50%;
  color: #fff;
  z-index: 20;
  transition: background 0.2s;
}
.photo-carousel .swiper-button-prev:hover,
.photo-carousel .swiper-button-next:hover {
  background: rgba(0,0,0,0.72);
}
.photo-carousel .swiper-button-prev { left: 8px; }
.photo-carousel .swiper-button-next { right: 8px; }
.photo-carousel .swiper-button-prev::after,
.photo-carousel .swiper-button-next::after { font-size: 12px !important; font-weight: 700; }

/* ── MARKER PREVIEW ── */
.marker-preview { position: absolute; pointer-events: none; display: none; z-index: 9999; background: rgba(13,14,26,0.96); backdrop-filter: blur(12px); border-radius: 14px; overflow: hidden; width: 190px; box-shadow: 0 12px 35px rgba(0,0,0,0.4); transform: translate(-50%, -112%); }
.marker-preview img { width: 100%; height: 110px; object-fit: cover; }
.marker-preview .title { padding: 8px 11px; font-size: 12.5px; font-weight: 700; color: #fff; text-align: center; }

/* ── ROUTES ── */
.route-card { background: var(--bg-card); border-radius: 14px; padding: 14px; margin-bottom: 11px; box-shadow: 0 3px 12px rgba(0,0,0,0.08); cursor: pointer; transition: 0.2s; border-left: 5px solid #2c5364; }
.route-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.14); }
.route-title { font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--text-main); margin-bottom: 6px; }
.route-meta { display: flex; gap: 8px; font-size: 11px; color: var(--text-muted); margin-bottom: 7px; flex-wrap: wrap; }
.route-meta span { background: var(--bg-tab); padding: 2px 7px; border-radius: 7px; }
.route-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 9px; line-height: 1.5; }
.route-stop { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: var(--text-muted); padding: 3px 0; }
.route-stop-num { width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(135deg,#4361ee,#3a0ca3); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.route-start-btn { display: inline-flex; align-items: center; gap: 5px; margin-top: 9px; padding: 7px 13px; background: linear-gradient(135deg,#0f2027,#2c5364); color: #fff; border: none; border-radius: 9px; cursor: pointer; font-size: 12px; font-weight: 600; font-family: var(--font-body); transition: 0.2s; }
.route-start-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 14px rgba(0,0,0,0.3); }

/* ── QUIZ ── */
.quiz-card { background: var(--bg-card); border-radius: 18px; padding: 20px 16px; text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,0.09); color: var(--text-main); }
.quiz-header { font-family: var(--font-head); font-size: 18px; margin-bottom: 5px; }
.quiz-subhead { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.quiz-q { font-size: 14.5px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; font-weight: 600; }
.quiz-btn { display: block; width: 100%; padding: 10px 14px; margin: 6px 0; border: 2px solid var(--bg-tab); border-radius: 11px; font-size: 13px; font-weight: 600; cursor: pointer; background: var(--bg-tab); color: var(--text-main); font-family: var(--font-body); transition: 0.2s; text-align: left; }
.quiz-btn:hover:not(.disabled) { border-color: var(--accent); color: var(--accent); transform: translateX(4px); }
.quiz-btn.correct  { background: linear-gradient(135deg,#06d6a0,#099773) !important; color:#fff !important; border-color:transparent !important; }
.quiz-btn.wrong    { background: linear-gradient(135deg,#f72585,#b5179e) !important; color:#fff !important; border-color:transparent !important; }
.quiz-btn.disabled { pointer-events: none; opacity: 0.7; }
.quiz-explanation  { font-size: 12px; color: var(--text-muted); margin-top: 10px; background: var(--bg-facts); padding: 8px 11px; border-radius: 9px; text-align: left; line-height: 1.5; }
.quiz-restart { padding: 10px 22px; font-size: 13px; font-weight: 700; color: white; background: linear-gradient(135deg,#f72585,#b5179e); border: none; border-radius: 11px; cursor: pointer; margin-top: 14px; font-family: var(--font-body); transition: 0.2s; }
.quiz-restart:hover { transform: scale(1.04); }
.quiz-stars { font-size: 26px; margin: 7px 0; }
.quiz-big-score { font-family: var(--font-head); font-size: 34px; color: var(--text-main); }
.quiz-result-msg { font-size: 13.5px; color: var(--text-muted); margin: 7px 0 14px; }
.progress-bar-bg { background: var(--bg-tab); border-radius: 10px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg,var(--gold),var(--accent2)); border-radius: 10px; transition: width 0.7s ease; }

/* ── TOAST ── */
.toast { position: fixed; bottom: 18px; right: 16px; background: linear-gradient(135deg,#f77f00,var(--gold)); color: #1a0a00; padding: 11px 16px; border-radius: 14px; font-weight: 700; font-size: 13px; font-family: var(--font-body); z-index: 9999; box-shadow: 0 6px 24px rgba(0,0,0,0.3); animation: slideUp 0.4s ease; max-width: 300px; transition: opacity 0.5s; }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: var(--modal-bg); backdrop-filter: blur(6px); z-index: 8000; display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box { background: var(--bg-card); border-radius: 20px; width: 100%; max-width: 520px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 24px 64px rgba(0,0,0,0.45); transform: translateY(18px) scale(0.97); transition: transform 0.25s ease; overflow: hidden; }
.modal-overlay.open .modal-box { transform: translateY(0) scale(1); }
.modal-header { display: flex; align-items: center; padding: 17px 18px 13px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-header-title { flex: 1; font-family: var(--font-head); font-size: 17px; font-weight: 700; color: var(--text-main); }
.modal-close { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-tab); border: none; cursor: pointer; font-size: 15px; color: var(--text-muted); display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.modal-close:hover { background: var(--bg-facts); }
.modal-body { overflow-y: auto; padding: 16px 18px 20px; flex: 1; }
.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 10px; }

/* About inside modal */
.about-card { background: var(--bg-facts); border-radius: 14px; padding: 13px; margin-bottom: 10px; }
.about-card h3 { font-family: var(--font-head); font-size: 14px; margin-bottom: 7px; color: var(--text-main); }
.about-card p  { font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.tag { display: inline-block; padding: 3px 10px; font-size: 11.5px; font-weight: 700; border-radius: 20px; background: linear-gradient(135deg,#4361ee,#3a0ca3); color: #fff; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.stat-box { background: var(--bg-card); border-radius: 10px; padding: 10px; text-align: center; border: 1px solid var(--border); }
.stat-num { font-family: var(--font-head); font-size: 26px; color: var(--accent); }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Achievements inside modal */
.progress-wrap { background: var(--bg-facts); border-radius: 14px; padding: 13px; margin-bottom: 13px; }
.progress-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
.progress-pct { font-size: 11px; color: var(--text-muted); margin-top: 4px; text-align: right; }
.achievements-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.achievement-card { background: var(--bg-card); border-radius: 14px; padding: 13px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.07); transition: 0.2s; position: relative; overflow: hidden; border: 1px solid var(--border); }
.achievement-card.unlocked { border: 2px solid var(--gold); }
.achievement-card.locked { opacity: 0.5; filter: grayscale(0.7); }
.achievement-card.unlocked:hover { transform: scale(1.03); box-shadow: 0 6px 18px rgba(255,209,102,0.3); }
.ach-icon { font-size: 32px; display: block; margin-bottom: 6px; }
.ach-title { font-weight: 700; font-size: 11.5px; color: var(--text-main); margin-bottom: 3px; }
.ach-desc  { font-size: 10.5px; color: var(--text-muted); line-height: 1.4; }
.ach-lock  { position: absolute; top: 7px; right: 8px; font-size: 13px; opacity: 0.6; }
.ach-shine { position: absolute; top: -60%; left: -30%; width: 60%; height: 200%; background: rgba(255,255,255,0.12); transform: rotate(20deg); pointer-events: none; }

/* ── ANIMATIONS ── */
@keyframes fadeIn  { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
@keyframes slideUp { from{opacity:0;transform:translateY(18px)} to{opacity:1;transform:translateY(0)} }

/* ================================================================
   MOBILE  ≤ 768px
================================================================ */
@media (max-width: 768px) {
  :root { --header-h: 50px; }

  /* Header */
  #header { padding: 0 10px; gap: 6px; }
  .logo { font-size: 13px; }
  #visitedCounter { font-size: 11px; padding: 4px 8px; }
  .hdr-btn { width: 34px; height: 34px; font-size: 15px; }

  /* Search drop-down on mobile */
  #searchWrap {
    position: fixed;
    top: var(--header-h); left: 0; right: 0;
    max-width: 100%; background: #1a1d35;
    padding: 8px 12px; display: none; z-index: 3001;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  }
  #searchWrap.mobile-open { display: block; }
  #searchBar { font-size: 15px; padding: 10px 12px 10px 34px; border-radius: 12px; }
  #mobileSearchBtn { display: flex !important; }

  /* Layout: vertical stack */
  .container { flex-direction: column; }
  #map {
    position: relative;
    overflow: hidden;
    z-index: 0;
  }
  #cover {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 22px;
    background: var(--cover-bg);
    z-index: 9999;
    pointer-events: none;
  }
  #info {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 55vh;
    max-height: 85vh;
    min-height: 28vh;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.25);
    z-index: 2000;
    background: var(--bg-sidebar);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Swipe handle */
  #info::before {
    content: "";
    display: block;
    width: 40px;
    height: 5px;
    background: rgba(120,120,120,0.4);
    border-radius: 10px;
    margin: 8px auto;
  }

  /* Tabs: horizontal scroll */
  .categories {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    padding: 6px 10px 35px;
    margin: 0 -10px 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .categories::-webkit-scrollbar { display: none; }
  .category-tab {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 12px;
    padding: 15px 10px;
  }

  /* Cards */
  .card img { width: 60px; height: 46px; margin-right: 9px; }
  .card-title { font-size: 12.5px; }

  /* Place detail */
  .place-title { font-size: 17px; }
  .photo-carousel { padding: 0 28px; } /* меньший peek на узких экранах */
  .photo-carousel .swiper { height: 185px; }
  .photo-carousel .swiper-slide { height: 165px; }

  /* Geo button */
  #geoBtn { top: calc(45vh - 52px); right: 10px; width: 38px; height: 38px; font-size: 18px; }

  /* No hover preview on touch */
  .marker-preview { display: none !important; }

  /* Toast: full width at bottom */
  .toast { bottom: 12px; right: 10px; left: 10px; text-align: center; max-width: none; }

  /* Modal: bottom sheet */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box { max-width: 100%; width: 100%; max-height: 80vh; border-radius: 20px 20px 0 0; transform: translateY(40px); }
  .modal-overlay.open .modal-box { transform: translateY(0); }

  /* Routes */
  .route-title { font-size: 13px; }
  .route-meta { gap: 5px; }
}

@media (max-width: 380px) {
  .logo { font-size: 12px; }
  #visitedCounter { display: none; }
}

/* ================================================================
   GPS МАРКЕР — пульсирующая синяя точка
================================================================ */
.gps-marker-dot {
  width: 16px; height: 16px;
  background: #4361ee;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(67,97,238,0.6);
  animation: gpsDotPulse 2s infinite;
}
@keyframes gpsDotPulse {
  0%   { box-shadow: 0 0 0 0   rgba(67,97,238,0.55); }
  70%  { box-shadow: 0 0 0 14px rgba(67,97,238,0);   }
  100% { box-shadow: 0 0 0 0   rgba(67,97,238,0);    }
}

/* ================================================================
   КНОПКА «МАРШРУТ» — зелёная, рядом с «На карте»
================================================================ */
.route-trigger-btn {
  background: linear-gradient(135deg, #06d6a0, #059973) !important;
}
.route-trigger-btn:hover {
  box-shadow: 0 4px 12px rgba(6,214,160,0.45) !important;
}

/* ================================================================
   ПАНЕЛЬ ВЫБОРА МАРШРУТА
================================================================ */
.route-mode-panel {
  background: var(--bg-facts);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 9px;
  animation: fadeIn 0.2s ease;
}
.route-mode-label {
  font-size: 11.5px; font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.route-mode-btns {
  display: flex;
  gap: 8px;
}
.route-mode-btn {
  flex: 1; padding: 9px 10px; border: none; border-radius: 9px;
  cursor: pointer; font-size: 12px; font-weight: 700;
  font-family: var(--font-body); transition: 0.2s;
}
.route-mode-btn.walk  { background: linear-gradient(135deg,#4361ee,#3a0ca3); color:#fff; }
.route-mode-btn.drive { background: linear-gradient(135deg,#f72585,#b5179e); color:#fff; }
.route-mode-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }

/* ================================================================
   РЕЗУЛЬТАТ МАРШРУТА
================================================================ */
.route-result {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  background: var(--bg-facts); border-radius: 10px;
  padding: 10px 12px; margin-top: 9px;
  font-size: 12.5px; font-weight: 600; color: var(--text-main);
  animation: fadeIn 0.25s ease;
}
.route-result-icon { font-size: 17px; }
.route-result-dist { color: var(--accent); font-weight: 700; }
.route-result-time { color: var(--text-muted); }
.route-clear-btn {
  margin-left: auto; background: var(--bg-tab); border: none;
  border-radius: 8px; padding: 4px 10px; cursor: pointer;
  font-size: 11.5px; color: var(--text-muted);
  font-family: var(--font-body); transition: 0.2s;
}
.route-clear-btn:hover { background: #f72585; color:#fff; }

/* ================================================================
   СТАТУСЫ МАРШРУТА (нет GPS / загрузка / ошибка)
================================================================ */
.route-no-gps,
.route-loading,
.route-error {
  font-size: 12px; color: var(--text-muted);
  background: var(--bg-facts); border-radius: 10px;
  padding: 10px 12px; margin-top: 9px; text-align: center;
  animation: fadeIn 0.2s ease;
}
.route-no-gps  { border-left: 3px solid var(--gold); }
.route-loading { border-left: 3px solid var(--accent); }
.route-error   { border-left: 3px solid #f72585; color: #f72585; }

/* ================================================================
   MAPBOX GL JS — переопределения позиций
================================================================ */
/* Атрибуция — выше cover-плашки */
.mapboxgl-ctrl-bottom-left { bottom: 28px !important; }
/* Навигация zoom — ниже хедера */
.mapboxgl-ctrl-top-left    { top: calc(var(--header-h) + 10px) !important; }

/* Popup стиль */
.mapboxgl-popup-content {
  background: rgba(13,14,26,0.95) !important;
  color: #fff !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  font-family: var(--font-body);
  font-size: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.4) !important;
}
.mapboxgl-popup-tip {
  border-top-color: rgba(13,14,26,0.95) !important;
}
.mapboxgl-popup-content strong { color: var(--gold); }
