/* ===== GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ===== DESIGN TOKENS (Light Theme) ===== */
:root, [data-theme="light"] {
  --color-primary: #2563EB;
  --color-primary-hover: #1D4ED8;
  --color-primary-light: rgba(37,99,235,0.1);
  --color-accent: #D97706;
  --color-accent-hover: #B45309;
  --color-accent-light: rgba(217,119,6,0.12);
  --color-bg: #F8FAFC;
  --color-surface: #FFFFFF;
  --color-surface-hover: #F1F5F9;
  --color-text: #1E293B;
  --color-text-secondary: #64748B;
  --color-text-muted: #94A3B8;
  --color-border: #E2E8F0;
  --color-success: #059669;
  --color-danger: #DC2626;
  --color-warning: #D97706;
  --color-info: #0284C7;
  --color-star: #FBBF24;
  --color-heart: #EF4444;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
  --glass-bg: rgba(255,255,255,0.82);
  --glass-border: rgba(255,255,255,0.3);
  --glass-blur: blur(16px);
  --navbar-bg: rgba(255,255,255,0.85);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --transition: 0.2s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== DARK THEME ===== */
[data-theme="dark"] {
  --color-primary: #3B82F6;
  --color-primary-hover: #60A5FA;
  --color-primary-light: rgba(59,130,246,0.15);
  --color-accent: #F59E0B;
  --color-accent-hover: #FBBF24;
  --color-accent-light: rgba(245,158,11,0.15);
  --color-bg: #0F172A;
  --color-surface: #1E293B;
  --color-surface-hover: #334155;
  --color-text: #E2E8F0;
  --color-text-secondary: #94A3B8;
  --color-text-muted: #64748B;
  --color-border: #334155;
  --color-success: #10B981;
  --color-danger: #EF4444;
  --color-warning: #F59E0B;
  --color-info: #38BDF8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.5);
  --glass-bg: rgba(30,41,59,0.82);
  --glass-border: rgba(51,65,85,0.4);
  --navbar-bg: rgba(15,23,42,0.88);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#mainContent {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
}

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary-hover); }

img { max-width: 100%; height: auto; }

/* ===== NAVBAR ===== */
.app-navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1050;
  background: var(--navbar-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--color-border);
  padding: 0 20px;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  transition: background var(--transition);
}
.app-navbar .nav-brand {
  font-size: 1.15rem; font-weight: 700; color: var(--color-text);
  display: flex; align-items: center; gap: 8px;
}
.brand-text-short { display: none; }
.app-navbar .nav-brand .nav-logo {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  object-fit: contain; transition: transform 0.3s ease;
}
.app-navbar .nav-brand:hover .nav-logo { transform: rotate(-8deg) scale(1.1); }
.app-navbar .nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.app-navbar .nav-links a {
  padding: 6px 14px; border-radius: var(--radius-full); font-size: 0.88rem;
  font-weight: 500; color: var(--color-text-secondary); transition: all var(--transition);
}
.app-navbar .nav-links a:hover,
.app-navbar .nav-links a.active {
  background: var(--color-primary-light); color: var(--color-primary);
}
.app-navbar .nav-right { display: flex; align-items: center; gap: 8px; }

/* Theme toggle */
.theme-toggle {
  width: 38px; height: 38px; border-radius: var(--radius-full);
  border: 1px solid var(--color-border); background: var(--color-surface);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; transition: all var(--transition);
}
.theme-toggle:hover { background: var(--color-surface-hover); transform: scale(1.08); }

/* User menu */
.user-menu { position: relative; }
.user-menu-btn {
  display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px;
  border-radius: var(--radius-full); border: 1px solid var(--color-border);
  background: var(--color-surface); cursor: pointer; transition: all var(--transition);
  font-family: var(--font); font-size: 0.88rem; color: var(--color-text);
}
.user-menu-btn:hover { background: var(--color-surface-hover); }
.user-avatar {
  width: 30px; height: 30px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600;
}
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 180px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: all 0.18s ease; z-index: 1060;
}
.user-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown a {
  display: block; padding: 10px 16px; font-size: 0.88rem;
  color: var(--color-text); transition: background var(--transition);
}
.user-dropdown a:hover { background: var(--color-surface-hover); }

/* ===== CARDS ===== */
.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: all var(--transition); overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-body { padding: 20px; }
.card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius-sm); font-family: var(--font);
  font-size: 0.88rem; font-weight: 500; border: none; cursor: pointer;
  transition: all var(--transition); line-height: 1.5;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hover); color: #fff; }
.btn-accent { background: var(--color-accent); color: #fff; }
.btn-accent:hover { background: var(--color-accent-hover); color: #fff; }
.btn-outline {
  background: transparent; border: 1px solid var(--color-border);
  color: var(--color-text);
}
.btn-outline:hover { background: var(--color-surface-hover); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; color: #fff; }
.btn-ghost { background: transparent; color: var(--color-text-secondary); }
.btn-ghost:hover { background: var(--color-primary-light); color: var(--color-primary); }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-icon {
  width: 36px; height: 36px; padding: 0; border-radius: var(--radius-full);
}

/* ===== FORM CONTROLS ===== */
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px; font-family: var(--font); font-size: 0.9rem;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-surface); color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.form-label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 6px; color: var(--color-text); }
.form-group { margin-bottom: 16px; }
.form-hint { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 4px; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600;
}
.badge-primary { background: var(--color-primary-light); color: var(--color-primary); }
.badge-accent { background: var(--color-accent-light); color: var(--color-accent); }
.badge-success { background: rgba(5,150,105,0.1); color: var(--color-success); }

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed; top: 68px; right: 16px; z-index: 1100;
  display: flex; flex-direction: column; gap: 8px; max-width: 380px;
}
.toast {
  padding: 14px 18px; border-radius: var(--radius-md);
  background: var(--color-surface); border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg); display: flex; align-items: flex-start; gap: 10px;
  animation: slideInRight 0.3s ease; font-size: 0.9rem;
}
.toast-success { border-left: 4px solid var(--color-success); }
.toast-danger { border-left: 4px solid var(--color-danger); }
.toast-warning { border-left: 4px solid var(--color-warning); }
.toast-info { border-left: 4px solid var(--color-info); }
.toast-close {
  margin-left: auto; cursor: pointer; opacity: 0.5; background: none;
  border: none; font-size: 1.1rem; color: var(--color-text);
}
.toast-close:hover { opacity: 1; }

/* ===== STAR RATING ===== */
.star-rating { display: inline-flex; gap: 2px; }
.star-rating .star {
  cursor: pointer; font-size: 1.3rem; color: var(--color-border);
  transition: color 0.15s, transform 0.15s;
}
.star-rating .star.active, .star-rating .star:hover { color: var(--color-star); }
.star-rating .star:hover { transform: scale(1.15); }
.star-display { color: var(--color-star); font-size: 0.9rem; }

/* ===== SIDEBAR PANEL ===== */
.sidebar {
  position: fixed; top: 56px; left: 0; bottom: 0; width: 340px;
  background: var(--color-surface); border-right: 1px solid var(--color-border);
  z-index: 1020; overflow-y: auto; transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
}
.sidebar.collapsed { transform: translateX(-340px); }
.sidebar-header { padding: 16px 20px; border-bottom: 1px solid var(--color-border); }
.sidebar-body { padding: 16px 20px; }
.sidebar-section { margin-bottom: 20px; }
.sidebar-section-title {
  font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--color-text-muted); margin-bottom: 10px;
}
.sidebar-toggle {
  position: fixed; top: 68px; left: 12px; z-index: 1025;
  width: 40px; height: 40px; border-radius: var(--radius-full);
  background: var(--color-surface); border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md); cursor: pointer; display: flex;
  align-items: center; justify-content: center; font-size: 1.1rem;
  transition: all 0.3s ease;
}
.sidebar-toggle.shifted { left: 352px; }

/* Autocomplete */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--shadow-md); max-height: 260px; overflow-y: auto;
  z-index: 100; display: none;
}
.autocomplete-list.show { display: block; }
.autocomplete-item {
  padding: 10px 14px; cursor: pointer; font-size: 0.88rem;
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition);
}
.autocomplete-item:hover { background: var(--color-primary-light); }
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item small { color: var(--color-text-muted); }

/* Category checkboxes */
.category-check { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.category-check input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--color-primary);
}
.category-check label { font-size: 0.88rem; cursor: pointer; }

/* ===== HERO SECTION ===== */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  min-height: 300px; display: flex; align-items: flex-end;
}
.hero-image {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
}
.hero-content { position: relative; z-index: 2; padding: 24px; color: #fff; width: 100%; }
.hero-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 4px; }
.hero-subtitle { font-size: 0.95rem; opacity: 0.85; }

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,0.92);
  display: none; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.lightbox.show { display: flex; }
.lightbox img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 4px; }
.lightbox-close {
  position: absolute; top: 16px; right: 16px; width: 44px; height: 44px;
  border-radius: var(--radius-full); background: rgba(255,255,255,0.15);
  border: none; color: #fff; font-size: 1.5rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: var(--radius-full);
  background: rgba(255,255,255,0.15); border: none; color: #fff;
  font-size: 1.3rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-counter {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.7); font-size: 0.9rem;
}

/* ===== FOOTER ===== */
.app-footer {
  padding: 24px 20px; text-align: center; font-size: 0.82rem;
  color: var(--color-text-muted); border-top: 1px solid var(--color-border);
  background: var(--color-surface); margin-top: auto;
}

/* ===== GLASSMORPHISM ===== */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background-size: cover; background-position: center; position: relative;
}
.auth-page::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(15,23,42,0.6);
}
.auth-card {
  position: relative; z-index: 2; width: 100%; max-width: 420px;
  padding: 40px; border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 25px 60px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.1);
  animation: slideUp 0.4s ease;
  color: #1e293b;
}
[data-theme="dark"] .auth-card {
  background: rgba(30,41,59,0.92);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
  color: #e2e8f0;
}
.auth-card h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 24px; text-align: center; color: #1e293b; }
.auth-card .form-label { font-weight: 600; color: #334155; }
.auth-card .form-input {
  background: #fff; border: 1.5px solid #cbd5e1; color: #1e293b;
}
.auth-card .form-input:focus {
  background: #fff; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.auth-footer {
  margin-top: 20px; text-align: center; font-size: 0.9rem; color: #64748b;
}
.auth-footer a { color: var(--color-primary); font-weight: 600; }
[data-theme="dark"] .auth-card h2 { color: #e2e8f0; }
[data-theme="dark"] .auth-card .form-label { color: #94a3b8; }
[data-theme="dark"] .auth-card .form-input {
  background: rgba(15,23,42,0.6); border-color: rgba(255,255,255,0.15); color: #e2e8f0;
}
[data-theme="dark"] .auth-card .form-input:focus {
  background: rgba(15,23,42,0.8); border-color: var(--color-primary);
}
[data-theme="dark"] .auth-footer { color: #94a3b8; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInLeft { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }
@keyframes spin { to { transform: rotate(360deg); } }

.animate-fadeIn { animation: fadeIn 0.3s ease; }
.animate-slideUp { animation: slideUp 0.4s ease; }

/* ===== PLACE DETAIL ===== */
.place-info-grid { display: grid; grid-template-columns: 1fr 360px; gap: 24px; margin-top: 20px; }
.place-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px,1fr)); gap: 8px; margin-top: 12px; }
.place-gallery-grid img {
  width: 100%; height: 100px; object-fit: cover; border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition);
}
.place-gallery-grid img:hover { transform: scale(1.05); box-shadow: var(--shadow-md); }

.comment-item { padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.comment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.comment-avatar {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 600; flex-shrink: 0;
}
.comment-username { font-weight: 600; font-size: 0.9rem; }
.comment-date { font-size: 0.78rem; color: var(--color-text-muted); }
.comment-text { font-size: 0.9rem; line-height: 1.5; color: var(--color-text); }

/* Favorite button */
.fav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-full);
  border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer; transition: all var(--transition); font-family: var(--font); font-size: 0.88rem;
}
.fav-btn:hover { border-color: var(--color-heart); color: var(--color-heart); }
.fav-btn.active { background: rgba(239,68,68,0.12); border-color: var(--color-heart); color: var(--color-heart); }
.fav-btn .heart { font-size: 1.1rem; transition: transform 0.2s; }
.fav-btn.active .heart { animation: pulse 0.4s ease; }

/* Route panel */
.route-panel { padding: 16px; border-radius: var(--radius-md); background: var(--color-surface); border: 1px solid var(--color-border); }
.route-mode-btns { display: flex; gap: 6px; margin-bottom: 12px; }
.route-mode-btn {
  flex: 1; padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--color-border);
  background: var(--color-surface); cursor: pointer; text-align: center; font-size: 0.85rem;
  transition: all var(--transition); font-family: var(--font);
}
.route-mode-btn.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.route-info { font-size: 0.88rem; color: var(--color-text-secondary); margin-top: 10px; }

/* Working hours */
.working-hours { font-size: 0.88rem; }
.working-hours .day { display: flex; justify-content: space-between; padding: 4px 0; }
.working-hours .day.today { font-weight: 600; color: var(--color-primary); }

/* ===== PROFILE ===== */
.profile-avatar {
  width: 80px; height: 80px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 700;
}
.profile-stats { display: flex; gap: 24px; margin: 16px 0; }
.profile-stat { text-align: center; }
.profile-stat-value { font-size: 1.4rem; font-weight: 700; color: var(--color-primary); }
.profile-stat-label { font-size: 0.78rem; color: var(--color-text-muted); }
.profile-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; align-items: start; }

.fav-card {
  display: flex; gap: 12px; padding: 12px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border); transition: all var(--transition);
}
.fav-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.fav-card-img {
  width: 80px; height: 60px; object-fit: cover; border-radius: var(--radius-sm);
  background: var(--color-surface-hover); flex-shrink: 0;
}

/* ===== LOADING ===== */
.spinner { width: 24px; height: 24px; border: 3px solid var(--color-border); border-top-color: var(--color-primary); border-radius: 50%; animation: spin 0.6s linear infinite; }

/* ===== MOBILE NAVBAR ===== */
.mobile-nav-toggle {
  display: none; background: none; border: none; font-size: 1.4rem;
  color: var(--color-text); cursor: pointer; padding: 4px;
}
.nav-links-mobile {
  display: none; position: absolute; top: 56px; left: 0; right: 0;
  background: var(--color-surface); border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-md); padding: 12px 16px; flex-direction: column; gap: 4px;
  z-index: 1060; max-height: 70vh; overflow-y: auto;
}
.nav-links-mobile.show { display: flex; }
.nav-links-mobile a {
  display: block; padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 0.92rem; font-weight: 500; color: var(--color-text);
  transition: background var(--transition);
}
.nav-links-mobile a:hover { background: var(--color-primary-light); color: var(--color-primary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .place-info-grid { grid-template-columns: 1fr; }
  .sidebar { width: 300px; }
  .sidebar.collapsed { transform: translateX(-300px); }
  .sidebar-toggle.shifted { left: 312px; }
  /* Disable sticky sidebar card on stacked layouts */
  .place-sidebar .card { position: static !important; top: auto !important; }
}

@media (max-width: 768px) {
  /* --- Navbar --- */
  .app-navbar .nav-links { display: none; }
  .mobile-nav-toggle { display: block; }
  .app-navbar .nav-right { gap: 6px; }
  .app-navbar .nav-right .btn-sm { display: none; }
  .user-menu-btn span:not(.user-avatar) { display: none; }
  .user-menu-btn .bi-chevron-down { display: none; }
  .user-menu-btn { padding: 3px; }

  /* --- Sidebar --- */
  .sidebar { width: 85%; max-width: 340px; }
  .sidebar.collapsed { transform: translateX(-100%); }
  .sidebar-toggle.shifted { left: calc(85% + 12px); }

  /* --- Hero --- */
  .hero { min-height: 200px; }
  .hero-title { font-size: 1.3rem; }
  .hero-content { padding: 16px; }

  /* --- Auth --- */
  .auth-card { margin: 16px; max-width: none; padding: 24px 20px; }
  .auth-card h2 { font-size: 1.25rem; }

  /* --- Profile --- */
  .profile-stats { gap: 16px; flex-wrap: wrap; }
  .profile-avatar { width: 64px; height: 64px; font-size: 1.4rem; }
  .profile-grid { grid-template-columns: 1fr; }

  /* --- Place detail --- */
  .place-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
  .place-gallery-grid img { height: 80px; }

  /* --- Toast --- */
  .toast-container { left: 12px; right: 12px; max-width: none; }

  /* --- Map controls --- */
  .map-controls-panel { bottom: 80px; right: 10px; }
  .map-ctrl-btn { width: 36px; height: 36px; font-size: 1rem; }

  /* --- Weather --- */
  .weather-fab { width: 40px; height: 40px; font-size: 1.2rem; top: 10px; right: 10px; }
  .weather-widget { top: 58px; right: 10px; max-width: 220px; padding: 8px 10px; }
  .weather-widget .weather-icon { width: 36px; height: 36px; }
  .weather-widget .weather-temp { font-size: 1.15rem; }

  /* --- Tickets panel on map --- */
  .tickets-panel-toggle { padding: 8px 16px; font-size: 0.82rem; bottom: 12px; }
  .tickets-flyout { width: calc(100% - 24px); max-width: none; bottom: 56px; left: 12px; right: 12px; transform: none; }

  /* --- Route info overlay --- */
  #route-info-panel {
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    max-width: none !important;
    min-width: 0 !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    max-height: 50vh;
    overflow-y: auto;
  }

  /* --- Bot --- */
  .bot-fab { width: 48px; height: 48px; font-size: 1.3rem; bottom: 16px; right: 16px; }
  .bot-window {
    width: calc(100% - 24px) !important;
    right: 12px !important;
    left: 12px !important;
    bottom: 74px !important;
    max-height: 60vh !important;
  }

  /* --- Lightbox touch targets --- */
  .lightbox-close { width: 48px; height: 48px; font-size: 1.6rem; top: 12px; right: 12px; }
  .lightbox-nav { width: 48px; height: 48px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }

  /* --- Ticket cards in profile --- */
  .ticket-card { flex-direction: column; align-items: flex-start; gap: 10px; }

  /* --- Footer --- */
  .app-footer { padding: 20px 16px; font-size: 0.78rem; }
}

@media (max-width: 480px) {
  .app-navbar { padding: 0 8px; gap: 4px; }
  .nav-brand { font-size: 1rem !important; }
  .brand-text-long { display: none; }
  .brand-text-short { display: inline; }
  .app-navbar .nav-right { gap: 4px; }
  .theme-toggle { width: 34px; height: 34px; font-size: 1rem; }
  .route-mode-btns { flex-wrap: wrap; }
  .card-body { padding: 14px; }
  .hero { min-height: 160px; }
  .hero-title { font-size: 1.1rem; }
  .sidebar-toggle { width: 36px; height: 36px; font-size: 1rem; top: 64px; }
  .fav-card { flex-direction: column; }
  .fav-card-img { width: 100%; height: 120px; }

  /* --- Compact right map-controls panel --- */
  .map-controls-panel { bottom: 74px; right: 6px; padding: 4px; gap: 2px; }
  .map-ctrl-btn { width: 30px; height: 30px; font-size: 0.9rem; }
  .map-ctrl-divider { margin: 1px 2px; }

  /* --- Compact balloon card --- */
  .map-balloon-card { width: 190px; }
  .map-balloon-img { height: 90px; margin-bottom: 6px; }
  .map-balloon-title { font-size: 0.85rem; margin-bottom: 2px; }
  .map-balloon-desc { font-size: 0.75rem; margin-bottom: 4px; line-height: 1.25; }
  .map-balloon-category { font-size: 0.65rem; padding: 1px 6px; margin-bottom: 6px; }
  .map-balloon-btn { padding: 4px 8px; font-size: 0.75rem; }

  /* --- Compact Yandex balloon container --- */
  [class*="ymaps"][class*="balloon__content"] { padding: 6px 10px !important; }
  [class*="ymaps"][class*="balloon__close"] { top: 4px !important; right: 4px !important; }

  /* --- Smaller tickets button --- */
  .tickets-panel-toggle { padding: 6px 12px; font-size: 0.78rem; bottom: 10px; }
}

/* ===== BOT UI ===== */
.bot-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 1200;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--color-primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; cursor: pointer; box-shadow: 0 4px 16px rgba(37,99,235,0.4);
  transition: all var(--transition); border: none;
}
.bot-fab:hover { transform: scale(1.05); }

.bot-window {
  position: fixed; bottom: 90px; right: 24px; z-index: 1200;
  width: 340px; max-height: 500px; display: none;
  flex-direction: column; background: var(--color-surface);
  border-radius: var(--radius-lg); box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  border: 1px solid var(--color-border); overflow: hidden;
}
.bot-window.show { display: flex; animation: slideUp 0.3s ease; }

.bot-header {
  padding: 16px; background: var(--color-primary); color: white;
  display: flex; justify-content: space-between; align-items: center;
}
.bot-messages {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px;
  background: var(--color-bg); min-height: 250px;
}
.bot-msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; font-size: 0.9rem; line-height: 1.4; color: var(--color-text); }
.bot-msg.ai { background: var(--color-surface); border: 1px solid var(--color-border); align-self: flex-start; border-bottom-left-radius: 4px; }
.bot-msg.user { background: var(--color-primary-light); color: var(--color-primary); align-self: flex-end; border-bottom-right-radius: 4px; }

.bot-input-area {
  padding: 12px; background: var(--color-surface); border-top: 1px solid var(--color-border);
  display: flex; gap: 8px;
}
.bot-input {
  flex: 1; padding: 8px 12px; border: 1px solid var(--color-border); border-radius: 20px;
  background: var(--color-bg); color: var(--color-text); font-family: var(--font);
  outline: none;
}
.bot-input:focus {
  border-color: var(--color-primary);
}
.bot-send {
  background: var(--color-primary); color: white; border: none; width: 36px; height: 36px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer;
}

/* ===== ROUTES UI ===== */
.route-card {
  padding: 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md);
  margin-bottom: 12px; cursor: pointer; transition: all var(--transition);
  background: var(--color-surface);
}
.route-card:hover { border-color: var(--color-primary); }
.route-card.active { border-color: var(--color-primary); box-shadow: 0 0 0 1px var(--color-primary); }

/* ===== MAP CONTROLS PANEL ===== */
.map-controls-panel {
  position: fixed; bottom: 100px; right: 16px; z-index: 1010;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--color-surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); border: 1px solid var(--color-border);
  padding: 6px;
}
.map-ctrl-btn {
  width: 40px; height: 40px; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--color-text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; transition: all var(--transition);
}
.map-ctrl-btn:hover { background: var(--color-primary-light); color: var(--color-primary); }
.map-ctrl-btn.active { background: var(--color-primary); color: white; }
.map-ctrl-btn.loading { animation: pulse 1s infinite; }
.map-ctrl-divider { height: 1px; background: var(--color-border); margin: 2px 4px; }

/* ===== CLEAN MAP MODE ===== */
/* Desaturate Yandex base tiles so POI labels/icons become nearly invisible,
   while our custom placemarks (in overlay panes) remain crisp and colorful. */
.clean-map-mode [class*="ground-pane"] {
  filter: grayscale(0.9) brightness(1.1) contrast(0.85) !important;
  transition: filter 0.4s ease;
}
[data-theme="dark"] .clean-map-mode [class*="ground-pane"] {
  filter: grayscale(0.9) brightness(0.7) contrast(0.9) !important;
}

/* ===== SHARE DROPDOWN ===== */
.share-dropdown {
  display: none; position: absolute; top: 100%; left: 0; right: 0; margin-top: 6px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  min-width: 200px; z-index: 1050; overflow: visible;
}
.share-dropdown.share-dropdown-up {
  top: auto; bottom: 100%; margin-top: 0; margin-bottom: 6px;
}
.share-dropdown.show { display: block; animation: fadeIn 0.2s ease; }
.share-dropdown button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px;
  border: none; background: transparent; color: var(--color-text); cursor: pointer;
  font-size: 0.9rem; font-family: var(--font); text-align: left;
  transition: background var(--transition);
}
.share-dropdown button:hover { background: var(--color-primary-light); }
.share-dropdown button i { font-size: 1.15rem; width: 22px; text-align: center; color: var(--color-primary); }

/* ===== ACCESSIBILITY MODE ===== */
.a11y-mode {
  --font-size-base: 1.15rem;
  letter-spacing: 0.02em;
}
.a11y-mode body {
  font-size: var(--font-size-base) !important;
  line-height: 1.8 !important;
}
.a11y-mode p, .a11y-mode li, .a11y-mode span, .a11y-mode label, .a11y-mode a, .a11y-mode div {
  font-size: inherit !important;
}
.a11y-mode h1 { font-size: 2.2rem !important; }
.a11y-mode h2 { font-size: 1.8rem !important; }
.a11y-mode h3 { font-size: 1.5rem !important; }
.a11y-mode h4 { font-size: 1.3rem !important; }
.a11y-mode .form-input, .a11y-mode .form-label {
  font-size: 1.1rem !important;
}
.a11y-mode .btn {
  font-size: 1.05rem !important; padding: 10px 20px !important;
}
.a11y-mode .sidebar-section-title { font-size: 0.95rem !important; }
.a11y-mode .app-navbar { height: 64px; }
.a11y-mode .nav-brand { font-size: 1.2rem; }
.a11y-mode .card-body { font-size: 1.1rem; }
.a11y-mode * {
  border-color: rgba(0,0,0,0.25) !important;
}
[data-theme="dark"].a11y-mode * {
  border-color: rgba(255,255,255,0.3) !important;
}
.a11y-mode .hero-title { font-size: 2rem !important; }
.a11y-mode #place-full { font-size: 1.15rem !important; line-height: 1.9 !important; }

/* ===== DARK THEME — QUILL EDITOR ===== */
[data-theme="dark"] .ql-toolbar.ql-snow {
  background: var(--color-surface-hover);
  border-color: var(--color-border);
}
[data-theme="dark"] .ql-toolbar.ql-snow .ql-stroke {
  stroke: var(--color-text-secondary);
}
[data-theme="dark"] .ql-toolbar.ql-snow .ql-fill {
  fill: var(--color-text-secondary);
}
[data-theme="dark"] .ql-toolbar.ql-snow .ql-picker-label {
  color: var(--color-text-secondary);
}
[data-theme="dark"] .ql-toolbar.ql-snow button:hover .ql-stroke,
[data-theme="dark"] .ql-toolbar.ql-snow button.ql-active .ql-stroke {
  stroke: var(--color-primary);
}
[data-theme="dark"] .ql-toolbar.ql-snow button:hover .ql-fill,
[data-theme="dark"] .ql-toolbar.ql-snow button.ql-active .ql-fill {
  fill: var(--color-primary);
}
[data-theme="dark"] .ql-container.ql-snow {
  color: var(--color-text);
}
[data-theme="dark"] .ql-editor.ql-blank::before {
  color: var(--color-text-muted);
}
[data-theme="dark"] .ql-snow .ql-picker-options {
  background: var(--color-surface);
  border-color: var(--color-border);
}
[data-theme="dark"] .ql-snow .ql-picker-item {
  color: var(--color-text);
}
[data-theme="dark"] .ql-snow .ql-tooltip {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
  box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .ql-snow .ql-tooltip input[type="text"] {
  background: var(--color-bg);
  border-color: var(--color-border);
  color: var(--color-text);
}

/* ===== DARK THEME — YANDEX MAP BALLOONS ===== */
[data-theme="dark"] .ymaps-2-1-79-balloon__content,
[data-theme="dark"] [class*="balloon__content"] {
  color: #1e293b;
}

/* ===== DARK THEME — CHART.JS ===== */
[data-theme="dark"] .card canvas {
  filter: none;
}

/* ===== DARK THEME — MISC FIXES ===== */
[data-theme="dark"] .fav-card {
  background: var(--color-surface);
}
[data-theme="dark"] .route-mode-btn {
  color: var(--color-text);
}
[data-theme="dark"] .comment-text {
  color: var(--color-text);
}
[data-theme="dark"] .form-select option {
  background: var(--color-surface);
  color: var(--color-text);
}

/* ===== DARK THEME — ADMIN BALLOON POPUP ===== */
[data-theme="dark"] .popup-row label {
  color: var(--color-text-secondary);
}

/* ===== PHOTO UPLOAD MODAL ===== */
.photo-upload-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.photo-upload-dialog {
  background: var(--color-surface);
  border-radius: var(--radius-lg, 16px);
  padding: 28px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.upload-dropzone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md, 12px);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--color-bg);
}
.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.05);
}
[data-theme="dark"] .upload-dropzone:hover,
[data-theme="dark"] .upload-dropzone.dragover {
  background: rgba(37, 99, 235, 0.1);
}

/* Moderation card transition */
.mod-photo-card {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ===== DARK MAP (Yandex Maps 2.1 CSS Filter) ===== */
[data-theme="dark"] .ymaps-2-1-79-ground-pane,
[data-theme="dark"] [class*="ymaps"][class*="ground-pane"],
[data-theme="dark"] .ymaps-layers-pane {
  filter: invert(0.92) hue-rotate(180deg) brightness(0.95) contrast(1.05);
}
/* Un-invert overlays so markers/balloons/controls stay normal */
[data-theme="dark"] .ymaps-2-1-79-events-pane,
[data-theme="dark"] .ymaps-2-1-79-balloon,
[data-theme="dark"] .ymaps-2-1-79-balloon-pane,
[data-theme="dark"] [class*="ymaps"][class*="events-pane"],
[data-theme="dark"] [class*="ymaps"][class*="balloon"],
[data-theme="dark"] [class*="ymaps"][class*="controls-pane"],
[data-theme="dark"] .ymaps-2-1-79-controls-pane {
  filter: none;
}
/* Fix for copyrights text in dark mode */
[data-theme="dark"] [class*="ymaps"][class*="copyrights"] {
  filter: invert(0.92) hue-rotate(180deg);
}

/* ===== ROUTE AUTOCOMPLETE DROPDOWN ===== */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 280px;
  overflow-y: auto;
  margin-top: 4px;
}
.autocomplete-dropdown .autocomplete-item:hover {
  background: var(--color-surface-hover);
}

/* ===== ROUTE CARDS ===== */
.route-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ===== NAV & FOOTER LOGO ===== */
.footer-logo {
  width: 20px; height: 20px; border-radius: 4px;
  object-fit: contain; vertical-align: middle; margin-right: 4px;
}

/* ===== WEATHER WIDGET ===== */
.weather-fab {
  position: absolute; top: 16px; right: 16px; z-index: 1010;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; cursor: pointer; box-shadow: var(--shadow-md);
  transition: all var(--transition); color: var(--color-text);
}
.weather-fab:hover { box-shadow: var(--shadow-lg); transform: scale(1.05); color: var(--color-primary); }

.weather-widget {
  position: absolute; top: 70px; right: 16px; z-index: 1010;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-md);
  cursor: default;
  animation: fadeSlideIn 0.6s ease;
  transition: all 0.3s ease;
  max-width: 260px;
}
.weather-widget:hover {
  box-shadow: var(--shadow-lg); transform: translateY(-1px);
}
.weather-widget .weather-icon {
  width: 44px; height: 44px; flex-shrink: 0;
}
.weather-widget .weather-temp {
  font-size: 1.4rem; font-weight: 700; line-height: 1.1;
}
.weather-widget .weather-desc {
  font-size: 0.78rem; color: var(--color-text-secondary);
  text-transform: capitalize; line-height: 1.2;
}
.weather-widget .weather-extra {
  font-size: 0.7rem; color: var(--color-text-muted);
  display: flex; gap: 8px; margin-top: 2px;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== TICKET CARD ===== */
.ticket-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  transition: all var(--transition);
}
.ticket-card:hover { box-shadow: var(--shadow-md); }
.ticket-card .ticket-status {
  display: inline-block; padding: 2px 10px; border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
}
.ticket-status.paid { background: rgba(5,150,105,0.12); color: var(--color-success); }
.ticket-status.pending { background: rgba(245,158,11,0.12); color: var(--color-warning); }
.ticket-status.used { background: rgba(100,116,139,0.12); color: var(--color-text-muted); }

/* ===== TICKET BUY MODAL ===== */
.ticket-modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.ticket-modal-overlay .card {
  max-width: 420px; width: 92%;
  animation: slideUp 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ===== TICKETS PANEL ON MAP ===== */
.tickets-panel-toggle {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 500;
  background: linear-gradient(135deg, var(--color-primary), #7C3AED);
  color: #fff; border: none; border-radius: var(--radius-full);
  padding: 10px 22px; font-family: var(--font);
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 8px;
  transition: all 0.3s ease;
  animation: fadeSlideIn 0.8s ease 0.5s backwards;
}
.tickets-panel-toggle:hover {
  transform: translateX(-50%) translateY(-2px); box-shadow: var(--shadow-xl);
}
.tickets-flyout {
  position: absolute; bottom: 60px; left: 50%; transform: translateX(-50%);
  z-index: 500; width: 380px; max-width: 92vw;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 16px;
  animation: slideUp 0.3s ease;
  max-height: 400px; overflow-y: auto;
}
.tickets-flyout .ticket-place-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}
.tickets-flyout .ticket-place-item:last-child { border-bottom: none; }

/* ===== Photo Gallery Mode Markers ===== */
.photo-marker {
  width: 48px; height: 48px;
  border-radius: 10px;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s ease;
  position: relative;
}
.photo-marker:hover {
  transform: scale(1.6);
  box-shadow: 0 6px 20px rgba(0,0,0,0.45);
  z-index: 9999 !important;
}
.photo-marker-wrap {
  position: relative; display: inline-block;
}
.photo-marker-placeholder {
  width: 48px; height: 48px;
  border-radius: 10px;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  background: var(--color-surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: var(--color-primary);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1);
}
.photo-marker-placeholder:hover { transform: scale(1.6); }

/* ===== Improved Route Info Panel ===== */
.route-summary {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 12px; padding: 10px 14px;
  background: var(--color-primary);
  border-radius: var(--radius-sm);
  color: #fff;
}
.route-summary-badge {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.9rem; font-weight: 600;
}
.route-summary-badge i { font-size: 1rem; opacity: 0.85; }
.route-summary-divider {
  width: 1px; height: 20px; background: rgba(255,255,255,0.3);
}

.route-leg-divider {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0 4px 10px;
  font-size: 0.75rem; color: var(--color-text-muted);
}
.route-leg-divider::before {
  content: '';
  width: 2px; height: 16px;
  background: var(--color-primary);
  border-radius: 2px;
  opacity: 0.4;
}

.route-point-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0;
}
.route-point-num {
  min-width: 26px; height: 26px;
  border-radius: 50%;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.75rem;
  flex-shrink: 0;
}
.route-point-title {
  font-size: 0.88rem; font-weight: 500;
  color: var(--color-text);
}

.route-share-btn {
  width: 100%; margin-top: 8px; padding: 8px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 0.85rem; font-weight: 600;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s;
}
.route-share-btn:hover {
  background: var(--color-primary);
  color: #fff; border-color: var(--color-primary);
}

/* Animated dashed route line */
@keyframes routeDash {
  to { stroke-dashoffset: -20; }
}

/* ===== YANDEX MAP BALLOON STYLING ===== */
.map-balloon-card {
  width: 250px;
  font-family: var(--font);
  color: #1e293b;
}
.map-balloon-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  display: block;
}
.map-balloon-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: #1e293b;
  line-height: 1.3;
}
.map-balloon-desc {
  font-size: 0.82rem;
  color: #4b5563;
  margin-bottom: 8px;
  line-height: 1.35;
}
.map-balloon-category {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.map-balloon-actions {
  margin-top: 6px;
}
.map-balloon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 6px 12px;
  background: var(--color-primary);
  color: #ffffff !important;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  text-decoration: none;
  font-weight: 500;
  transition: background var(--transition);
  text-align: center;
  box-sizing: border-box;
}
.map-balloon-btn:hover {
  background: var(--color-primary-hover);
}
