﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-black: #020617;
  --bg-surface: #0f172a;
  --bg-card: #1e293b;
  --accent-primary: #6366f1;
  --accent-secondary: #4f46e5;
  --accent-premium: #a855f7;
  --accent-warning: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.1);
  --nav-height: 80px;
  --sidebar-width: 400px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --glass-bg: rgba(15, 23, 42, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
}

/* Light theme overrides */
[data-theme="light"] {
  --bg-black: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-card: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: rgba(0, 0, 0, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] body,
[data-theme="light"] .navbar,
[data-theme="light"] .map-loader {
  background-color: var(--bg-black) !important;
  color: var(--text-main);
}

/* Map background stays dark in light mode (same as dark mode) */
[data-theme="light"] #map {
  background-color: #020617 !important;
}

[data-theme="light"] .leaflet-popup-content-wrapper,
[data-theme="light"] .leaflet-popup-tip {
  background: #fff !important;
  color: #0f172a !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12) !important;
}

[data-theme="light"] .glass,
[data-theme="light"] .modal-content.glass {
  background: rgba(255,255,255,0.92) !important;
  border-color: rgba(0,0,0,0.08) !important;
  color: var(--text-main);
}

[data-theme="light"] .ctx-menu.glass {
  background: rgba(255,255,255,0.95) !important;
  border-color: rgba(0,0,0,0.1) !important;
}

[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: rgba(0,0,0,0.15) !important;
}

[data-theme="light"] .nav-icon-btn {
  color: var(--text-main);
}

[data-theme="light"] .sentinel-stat {
  background: rgba(0,0,0,0.03) !important;
  border-color: rgba(0,0,0,0.08) !important;
}

[data-theme="light"] .atbl th {
  color: var(--text-muted) !important;
  border-color: rgba(0,0,0,0.1) !important;
}

[data-theme="light"] .atbl td {
  border-color: rgba(0,0,0,0.06) !important;
}

[data-theme="light"] .map-loader {
  background: rgba(241,245,249,0.95) !important;
}

[data-theme="light"] .loader-text {
  color: #64748b !important;
}

[data-theme="light"] .nav-links {
  background: rgba(0,0,0,0.03) !important;
  border-color: rgba(0,0,0,0.08) !important;
}

[data-theme="light"] .nav-link.active {
  color: #fff !important;
}

[data-theme="light"] .nav-link:hover {
  background: rgba(0,0,0,0.05) !important;
}

[data-theme="light"] .user-profile-area {
  background: rgba(0,0,0,0.03) !important;
  border-color: rgba(0,0,0,0.08) !important;
}

[data-theme="light"] .nav-icon-btn {
  background: rgba(0,0,0,0.04) !important;
  border-color: rgba(0,0,0,0.1) !important;
}

[data-theme="light"] .nav-icon-btn:hover {
  background: rgba(0,0,0,0.08) !important;
}

[data-theme="light"] .tk-counter {
  background: rgba(245,158,11,0.08) !important;
  border-color: rgba(245,158,11,0.2) !important;
}

[data-theme="light"] .logout-btn {
  background: rgba(239,68,68,0.06) !important;
  border-color: rgba(239,68,68,0.15) !important;
}

[data-theme="light"] .event-feed-panel {
  background: rgba(255,255,255,0.95) !important;
  border-color: rgba(0,0,0,0.08) !important;
}

[data-theme="light"] .feed-card {
  background: rgba(0,0,0,0.02) !important;
  border-color: rgba(0,0,0,0.06) !important;
}

[data-theme="light"] .popup-container {
  color: #0f172a;
}

[data-theme="light"] .footer {
  background: rgba(255,255,255,0.95) !important;
  border-color: rgba(0,0,0,0.06) !important;
}

[data-theme="light"] .footer h4,
[data-theme="light"] .footer .c-label {
  color: #0f172a !important;
}

[data-theme="light"] .footer a {
  color: #6366f1 !important;
}

[data-theme="light"] .footer .footer-bottom {
  color: #64748b !important;
}

/* Smooth theme transition */
body, .navbar, .glass, .modal-content, .ctx-menu, input, textarea, select,
.leaflet-popup-content-wrapper, .atbl th, .atbl td, .sentinel-stat, .nav-icon-btn {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Basic Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-black);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── Navbar (Enhanced & Animated) ── */
.navbar {
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: var(--nav-height) !important;
  z-index: 9999 !important;
  background: var(--glass-bg) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid var(--glass-border) !important;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.6) !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 0 2.5rem !important;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-left, .nav-center, .nav-right {
  display: flex;
  align-items: center;
}

.nav-left {
  overflow: visible;
  z-index: 10;
}

.nav-center {
  justify-content: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand:hover {
  transform: scale(1.03);
}

.brand img {
  height: clamp(48px, 6vh, 88px);
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.3));
}

.nav-links {
  display: flex;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.45rem;
  border-radius: 100px;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: 100px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
}

.nav-link i {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.nav-link:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link:hover i {
  transform: translateY(-1px);
}

.nav-link.active {
  color: #fff;
  background: var(--accent-primary);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.nav-link.active i {
  color: #fff;
}

/* User Controls */
.nav-right {
  gap: 1rem;
}

.nav-icon-wrapper {
  position: relative;
}

.nav-icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.nav-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.notif-badge {
  display: none !important;
}

.tk-counter {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.6rem 1.1rem;
  border-radius: 14px;
  color: #f59e0b;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.tk-counter:hover {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.15);
}

.user-profile-area {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.45rem 0.45rem 0.45rem 1.15rem;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.user-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.logout-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1.1rem;
}

.logout-btn:hover {
  background: #ef4444;
  color: #fff;
  transform: translateX(3px);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

/* Dropdowns */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 15px);
  right: 0;
  width: 350px;
  background: #0f172a;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.8);
  display: none;
  flex-direction: column;
  z-index: 10000;
  overflow: hidden;
  animation: navDropdownIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(25px);
}

@keyframes navDropdownIn {
  from { opacity: 0; transform: translateY(15px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.nav-dropdown.open { display: flex; }

.dropdown-header {
  padding: 1.25rem;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dropdown-header span {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.dropdown-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.dropdown-close:hover { color: #fff; }

.dropdown-body {
  max-height: 450px;
  overflow-y: auto;
  padding: 1rem;
}

/* Modal Close Button (Stylish) */
.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1;
  padding: 0;
}
.modal-close:hover {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.4);
  color: #ef4444;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 0 20px rgba(239,68,68,0.3);
}
[data-theme="light"] .modal-close {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.1);
}
[data-theme="light"] .modal-close:hover {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.3);
  color: #ef4444;
  box-shadow: 0 0 15px rgba(239,68,68,0.15);
}

/* Scrollable Layouts */
body.map-page {
  height: 100vh !important;
  overflow: hidden !important;
}

body:not(.map-page) {
  height: auto !important;
  min-height: 100vh !important;
  overflow-y: auto !important;
}

/* Responsive */
@media (max-width: 1200px) {
  .navbar { padding: 0 1.5rem !important; }
  .nav-links { gap: 0.4rem; padding: 0.35rem; }
  .nav-link { padding: 0.5rem 0.9rem; font-size: 0.8rem; }
}

/* Common UI Components */
.tier-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.tier-plus { background: rgba(79, 110, 247, 0.1); color: #4f6ef7; border: 1px solid rgba(79, 110, 247, 0.2); }
.tier-pro { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.tier-premium { background: rgba(168, 85, 247, 0.1); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.2); }

.quota-item, .notif-item {
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  margin-bottom: 0.75rem;
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.3s ease;
}

.quota-item:hover, .notif-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
  transform: translateX(4px);
}

.quota-item { display: flex; justify-content: space-between; align-items: center; }
.quota-label { font-size: 0.9rem; font-weight: 600; color: var(--text-main); }
.quota-val { font-family: 'JetBrains Mono', monospace; font-weight: 800; color: #f59e0b; font-size: 1rem; }

.notif-time { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem; font-weight: 500; }

/* ── Pulsing Animation for Markers ── */
@keyframes iconPulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(99, 102, 241, 0)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.6)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(99, 102, 241, 0)); }
}
@keyframes iconPulsePremium {
  0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(168, 85, 247, 0)); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 15px rgba(168, 85, 247, 0.8)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(168, 85, 247, 0)); }
}
@keyframes iconPulseFeatured {
  0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(245, 158, 11, 0)); }
  50% { transform: scale(1.12); filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.7)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(245, 158, 11, 0)); }
}

.marker-pulse { animation: iconPulse 2s infinite ease-in-out; }
.marker-pulse-premium { animation: iconPulsePremium 1.8s infinite ease-in-out; }
.marker-pulse-featured { animation: iconPulseFeatured 2.2s infinite ease-in-out; }

/* ── Under Review: Yellow triangle + exclamation animation ── */
@keyframes reviewBadgeBounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
  60% { transform: translateY(-2px); }
}
.review-badge {
  animation: reviewBadgeBounce 1.8s infinite ease-in-out;
  filter: drop-shadow(0 0 6px rgba(234, 179, 8, 0.7));
}
@keyframes iconPulseReview {
  0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(245, 158, 11, 0)); }
  50% { transform: scale(1.18); filter: drop-shadow(0 0 18px rgba(245, 158, 11, 0.9)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(245, 158, 11, 0)); }
}
.marker-pulse-review { animation: iconPulseReview 1.5s infinite ease-in-out; }

/* Feed card review flash */
@keyframes feedCardReviewFlash {
  0%, 100% { border-color: rgba(245, 158, 11, 0.15); box-shadow: none; }
  50% { border-color: rgba(245, 158, 11, 0.6); box-shadow: 0 0 12px rgba(245, 158, 11, 0.3); }
}
.feed-card-review { animation: feedCardReviewFlash 2s infinite ease-in-out; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); border: 2px solid transparent; background-clip: padding-box; }

/* ── Page Transition ── */
html {
  scroll-behavior: smooth;
}

body {
  animation: pageFadeIn 0.25s ease-out;
}

@keyframes pageFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Smooth nav link active state transition */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 2px;
  background: var(--accent-primary);
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-link.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN – Phone / Tablet / Desktop
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tablet (≤1024px) ─────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-width: 320px; }

  .navbar {
    padding: 0 1rem !important;
    height: 64px !important;
  }
  .nav-left { display: none !important; }
  .nav-center { display: none !important; }
  .nav-right { gap: 0.5rem !important; }

  /* Hamburger menu for mobile nav */
  .mobile-menu-btn {
    display: flex !important;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 40px; height: 40px;
    border-radius: 10px;
    align-items: center; justify-content: center;
    cursor: pointer; font-size: 1.2rem;
  }

  .nav-links {
    display: none !important;
  }

  .nav-links.mobile-open {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.75rem;
    gap: 0.25rem;
    z-index: 9998;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  }

  .nav-links.mobile-open .nav-link {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    width: 100%;
    justify-content: flex-start;
  }

  .nav-icon-btn { width: 38px; height: 38px; border-radius: 10px; }
  .user-name { display: none; }
  .tier-badge { font-size: 0.55rem; padding: 0.15rem 0.4rem; }
  .tk-counter { font-size: 0.75rem; padding: 0.4rem 0.7rem; }

  /* Map takes full height */
  #map { height: calc(100vh - 64px) !important; }

  /* Modals */
  .modal-content { max-width: 95vw !important; margin: 0.5rem; }
  .modal-overlay { padding: 0.5rem; }

  /* Sentinel/Package tabs */
  .sentinel-tab { font-size: 0.7rem; padding: 0.4rem 0.6rem; }

  /* Event feed panel */
  .event-feed-panel { width: 280px !important; font-size: 0.8rem; }

  /* Tables */
  .atbl { font-size: 0.72rem; }
  .atbl th, .atbl td { padding: 0.4rem 0.5rem; }
}

/* ── Phone (≤640px) ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  :root { --nav-height: 56px; --sidebar-width: 100%; }

  .navbar {
    height: 56px !important;
    padding: 0 0.75rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .brand img { height: clamp(28px, 5vh, 40px); max-height: 40px; }
  .brand .version-tag { display: none; }

  .nav-center { display: none !important; }

  .nav-right {
    display: flex !important;
    gap: 0.5rem !important;
    justify-content: space-around !important;
    align-items: center !important;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
  }
  .nav-icon-btn { width: 34px; height: 34px; border-radius: 8px; font-size: 0.9rem; flex-shrink: 0; }

  .tk-counter {
    font-size: 0.65rem;
    padding: 0.25rem 0.4rem;
    border-radius: 8px;
    white-space: nowrap;
    max-width: 30vw;
    overflow: hidden;
    text-overflow: ellipsis;
    gap: 0.3rem;
  }
  .user-profile-area { padding: 0.25rem; border-radius: 10px; gap: 0.3rem; min-width: 0; }
  .tier-badge { font-size: 0.5rem; }
  .logout-btn { width: 30px; height: 30px; border-radius: 8px; font-size: 0.9rem; flex-shrink: 0; }
  .user-name { display: none !important; }

  /* App container: stack vertically on phone */
  .app-container {
    flex-direction: column !important;
  }

  .map-wrapper {
    flex: 1;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  /* Sidebar becomes bottom sheet */
  .sidebar {
    width: 100% !important;
    height: 40vh;
    order: 2;
    border-left: none !important;
    border-top: 1px solid var(--border-color);
    border-radius: 16px 16px 0 0;
    overflow: hidden;
  }

  #map { height: calc(100vh - 56px - 40vh) !important; }

  /* Modals full screen on phone */
  .modal-content {
    width: 95vw !important;
    max-width: 500px !important;
    max-height: 90vh !important;
    margin: auto;
    border-radius: 16px !important;
  }
  .modal-overlay { padding: 0.5rem; }
  .modal-header { padding: 0.75rem 1rem; }
  .modal-body { padding: 0.75rem; max-height: calc(90vh - 50px); }

  /* Sentinel/Package panel tabs scroll */
  .sentinel-tab { font-size: 0.65rem; padding: 0.35rem 0.5rem; white-space: nowrap; }

  /* Event feed hidden on phone (toggle button instead) */
  .event-feed-panel {
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    max-height: 50vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }
  .event-feed-panel.open { transform: translateY(0); }

  /* Context menu */
  .ctx-menu { min-width: 180px !important; }

  /* Report form */
  .af-row, .form-group { flex-direction: column; gap: 0.5rem; }

  /* Stats grid */
  .sentinel-stat { padding: 0.5rem; }
  .sentinel-stat-val { font-size: 1.2rem; }
  .sentinel-stat-label { font-size: 0.6rem; }

  /* Tables scroll */
  .atbl { font-size: 0.65rem; display: block; overflow-x: auto; }
  .atbl th, .atbl td { padding: 0.3rem 0.4rem; }

  /* Popup */
  .leaflet-popup-content-wrapper { max-width: 240px; }
  .leaflet-popup-content { font-size: 0.8rem; margin: 8px 10px; }

  /* ── Fluid icon scaling on mobile ── */
  .brand img { height: clamp(28px, 5vh, 40px); max-height: 40px; }
  .leaflet-marker-icon img { height: clamp(24px, 3vh, 48px); width: auto; }
  .map-wrapper img { max-height: clamp(24px, 3vh, 48px); width: auto; }
  .leaflet-popup-content img { max-height: clamp(20px, 2.5vh, 32px); width: auto; }

  /* ── Event card compacting for bottom sheet ── */
  .event-card {
    padding: 0.5rem 0.65rem;
    max-height: 12vh;
    overflow: hidden;
    gap: 0.25rem;
  }
  .event-card-header {
    margin-bottom: 0.2rem;
    flex-wrap: nowrap;
  }
  .severity-pill {
    font-size: 0.55rem;
    padding: 0.15rem 0.35rem;
    gap: 0.2rem;
  }
  .severity-dot { width: 4px; height: 4px; }
  .id-badge {
    font-size: 0.55rem;
    padding: 0.1rem 0.3rem;
  }
  .event-location {
    font-size: 0.6rem;
    max-width: 40%;
  }
  .event-details {
    font-size: 0.65rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .event-actions {
    gap: 0.25rem;
  }
  .btn-action {
    padding: 0.3rem 0.5rem;
    font-size: 0.6rem;
    gap: 0.2rem;
    border-radius: 6px;
  }

  /* ── All modals/popups responsive on mobile ── */
  .modal-content,
  .edit-cam-popup,
  .ctx-menu {
    width: 95vw !important;
    max-width: 500px !important;
  }
  #subPopup {
    min-width: 0;
    width: 95vw;
    max-width: 500px;
    left: 50%;
  }

  /* Footer */
  .footer { padding: 1.5rem 1rem; }
  .footer-grid { grid-template-columns: 1fr !important; gap: 1rem; }
}

/* ── Mobile menu button (hidden on desktop) ──────────────────────────────── */
.mobile-menu-btn { display: none !important; }

/* ── Landscape phone adjustments ─────────────────────────────────────────── */
@media (max-width: 640px) and (orientation: landscape) {
  .navbar { height: 48px !important; }
  .sidebar { height: 50vh; }
  #map { height: calc(100vh - 48px - 50vh) !important; }
  .modal-body { max-height: calc(100vh - 40px); }
}

/* ── Large desktop (≥1400px) ─────────────────────────────────────────────── */
@media (min-width: 1400px) {
  .navbar { padding: 0 3rem !important; }
  .nav-links { gap: 1rem; }
  .event-feed-panel { width: 380px; }
  :root { --sidebar-width: 400px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONSOLIDATED INLINE STYLES (moved from index.html / alkalmazas.html)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Page-specific overrides ── */
.map-user-panel { display: none; }

.status-badge {
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 100px;
  color: #4ade80;
  font-weight: 600;
  font-size: 0.75rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
}

.logo-box {
  width: 32px;
  height: 32px;
  background: #6366f1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── App Footer (map page version) ── */
.app-footer {
  background: #0b0f19;
  padding: 5rem 2.5rem 2rem;
  border-top: 1px solid var(--border-color);
}

.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.f-brand img { height: 72px; margin-bottom: 1.5rem; }
.f-brand p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.7; }

.f-col h4 {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
  color: #fff;
}

.f-links { list-style: none; padding: 0; margin: 0; }
.f-links li { margin-bottom: 1rem; transition: transform 0.3s ease; }
.f-links li:hover { transform: translateX(8px); }

.f-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s;
}
.f-links a:hover { color: #fff; }

.f-contact .c-item { margin-bottom: 1.5rem; }
.f-contact .c-label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.f-contact .c-val { font-size: 1.1rem; font-weight: 700; color: #fff; }

.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ── Map Loader ── */
.map-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s;
}
.map-loader.hidden {
  opacity: 0;
  visibility: hidden;
}
.loader-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(99, 102, 241, 0.1);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}
.loader-text {
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  max-width: 80%;
  min-height: 1.5em;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.02em;
  transition: opacity 0.3s ease;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Main Content Area ── */
.app-container {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* ── Map Section ── */
.map-wrapper {
  flex: 1;
  position: relative;
  background: #262626;
  margin: 1rem;
  border-radius: 20px;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
  background: #262626;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border-left: 1px solid var(--border-color);
  z-index: 100;
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-header h2 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Hide Leaflet UI Elements ── */
.leaflet-control-attribution,
.leaflet-bottom.leaflet-right,
.leaflet-control-attribution a {
  display: none !important;
}

.feed-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Log Items ── */
.event-card {
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.event-card:hover {
  background: var(--bg-card);
  border-color: var(--accent-secondary);
  transform: translateY(-1px);
}

.event-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.severity-pill {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.id-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #818cf8;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 0;
}

.id-badge:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.severity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.event-location {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  max-width: 60%;
}

.event-details {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.event-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-action {
  flex: 1;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-black);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.btn-action:hover {
  background: var(--bg-surface);
  border-color: var(--accent-secondary);
}

.btn-confirm { color: #10b981; }
.btn-confirm:hover { background: rgba(16, 185, 129, 0.1); border-color: #10b981; }

.btn-resolve { color: #3b82f6; }
.btn-resolve:hover { background: rgba(59, 130, 246, 0.1); border-color: #3b82f6; }

/* ── Custom Controls ── */
.map-controls {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1000;
}

.control-btn {
  width: 40px;
  height: 40px;
  background: var(--bg-black);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}

.control-btn:hover {
  border-color: var(--accent-primary);
  background: var(--bg-surface);
}

/* ── Context Menu ── */
.ctx-menu {
  position: fixed;
  width: 260px;
  background: var(--bg-black);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.5rem;
  z-index: 2000;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  display: none;
}

.ctx-header {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.75rem 0.75rem 0.5rem;
}

.ctx-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}

.ctx-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s;
}

.ctx-item:hover {
  background: var(--bg-surface);
}

.ctx-item img {
  width: 24px;
  height: 24px;
}

.ctx-item span {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
}

/* ── Animations (pulse variants) ── */
@keyframes pulse-v2 {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); opacity: 0.8; }
  50% { transform: scale(1.15); box-shadow: 0 0 15px 8px rgba(255, 255, 255, 0); opacity: 0.5; }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); opacity: 0.8; }
}
@keyframes pulse-v2-large {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5); opacity: 0.85; }
  50% { transform: scale(1.5); box-shadow: 0 0 15px 8px rgba(255, 255, 255, 0); opacity: 0.3; }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); opacity: 0.85; }
}
.pulse-v2 {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  margin: 0;
  background: rgba(255,255,255,0.15);
  animation: pulse-v2 2.8s infinite ease-in-out;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}
.pulse-v2.pulse-large {
  animation: pulse-v2-large 2s infinite ease-in-out;
}
@keyframes pulse-review {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(234,179,8,0.5); opacity: 0.7; }
  50% { transform: scale(1.2); box-shadow: 0 0 20px 10px rgba(234,179,8,0); opacity: 0.4; }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(234,179,8,0); opacity: 0.7; }
}
.pulse-review {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  margin: 0;
  background: rgba(234,179,8,0.2);
  animation: pulse-review 1.5s infinite ease-in-out;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

.version-badge {
  font-family: monospace;
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-muted);
  opacity: 0.8;
}

.countdown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 8px;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  display: none;
}

.modal-content {
  width: 92%;
  max-width: 480px;
  background: #1a1d24;
  border: 1px solid #2d3748;
  border-radius: 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid #2d3748;
  background: rgba(255,255,255,0.02);
  flex-shrink: 0;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.char-counter {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.7;
  font-family: monospace;
}

.form-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid #2d3748;
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  color: var(--text-main);
  outline: none;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.form-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.13);
  background: rgba(99,102,241,0.04);
}

/* White calendar/clock icons for datetime-local inputs */
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}
.form-input.icon-valid {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.1);
}
.form-input.icon-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

.duration-picker {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: rgba(255,255,255,0.03);
  border: 1px solid #2d3748;
  border-radius: 10px;
  overflow: hidden;
}
.duration-picker .control-btn {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.05);
  border: none;
  border-radius: 0;
  flex-shrink: 0;
  color: var(--text-main);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.15s;
}
.duration-picker .control-btn:hover {
  background: rgba(99,102,241,0.2);
}
.duration-picker #durationValue {
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  align-self: center;
  color: var(--text-main);
}

.radio-group {
  display: flex;
  width: 100%;
  gap: 0;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.radio-option {
  flex: 1;
  position: relative;
}

.radio-option input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}

.radio-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

.radio-option input:checked + .radio-label {
  background: #6366f1;
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-action:disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
  filter: grayscale(1);
}

/* ── Popup Styling ── */
.leaflet-popup-content-wrapper {
  background: var(--bg-surface) !important;
  color: var(--text-main) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  border: 1px solid var(--border-color);
}

.leaflet-popup-content {
  margin: 0 !important;
  width: 240px !important;
}

.leaflet-popup-tip {
  background: var(--bg-surface) !important;
}

.popup-container {
  padding: 1rem;
}

.popup-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

.popup-title {
  font-weight: 700;
  font-size: 1rem;
  color: #6366f1;
}

.popup-body {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.popup-footer {
  margin-top: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.popup-question {
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}

.popup-actions {
  display: flex;
  gap: 0.5rem;
}

/* ── Editor Styling ── */
.editor-container {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.editor-toolbar {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border-color);
}

.toolbar-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  border-radius: 4px;
}

.toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.editor-content {
  min-height: 150px;
  max-height: 400px;
  padding: 1rem;
  background: transparent;
  color: var(--text-main);
  outline: none;
  overflow-y: auto;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
  resize: vertical;
}

.editor-content::-webkit-resizer,
.bbcode-area::-webkit-resizer {
  border: 15px solid transparent;
  border-right: 15px solid var(--accent-primary);
  border-bottom: 15px solid var(--accent-primary);
  cursor: nwse-resize;
}

.bbcode-area {
  width: 100%;
  min-height: 150px;
  max-height: 500px;
  padding: 1rem;
  background: transparent;
  color: var(--text-main);
  border: none;
  outline: none;
  display: none;
  font-family: monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow-x: hidden;
  overflow-y: auto;
  resize: vertical;
}

/* ── Scrollbar (thin variant for feed/sidebar) ── */
.feed-container::-webkit-scrollbar { width: 4px; }
.feed-container::-webkit-scrollbar-track { background: transparent; }
.feed-container::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }
.feed-container::-webkit-scrollbar-thumb:hover { background: var(--accent-secondary); }

/* ── Subscription tier badge + TK balance in nav ── */
#subInfoWrapper {
  display: none;
  align-items: center;
  gap: 0.4rem;
}
#subTierBadge {
  --tier-color: #94a3b8;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  background: color-mix(in srgb, var(--tier-color) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--tier-color) 35%, transparent);
  color: var(--tier-color);
  white-space: nowrap;
}
#subTkBalance {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

/* ── Event modal toggle switches ── */
.evt-toggle-track {
  position: relative;
  width: 34px;
  height: 18px;
  flex-shrink: 0;
}
.evt-toggle-track input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.evt-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 18px;
  cursor: pointer;
  transition: background 0.2s;
}
.evt-toggle-slider::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.evt-toggle-track input:checked + .evt-toggle-slider { background: var(--accent-primary, #6366f1); }
.evt-toggle-track input:checked + .evt-toggle-slider::after { transform: translateX(16px); }
.evt-toggle-track input:disabled + .evt-toggle-slider { opacity: 0.4; cursor: not-allowed; }

/* ── TK Store modal ── */
#tkStoreBtn {
  display: none;
  align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3);
  border-radius: 8px; color: #fbbf24;
  font-size: 0.75rem; font-weight: 700; cursor: pointer;
  transition: background 0.2s; white-space: nowrap;
}
#tkStoreBtn:hover { background: rgba(245,158,11,0.22); }

/* ── Notification bell ── */
#bellBtn {
  display: none; position: relative;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.15rem; padding: .25rem .35rem;
  transition: color .2s;
}
#bellBtn:hover { color: var(--text-main); }
#bellBadge {
  display: none !important;
}

/* ── Footer (app version) ── */
.app-footer {
  background: #0f172a;
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: auto;
  z-index: 100;
}

.footer-top {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer-col h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
  margin-bottom: 1.25rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col ul li {
  margin-bottom: 0.75rem;
}

.footer-col ul li a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-col ul li a:hover {
  color: var(--text-main);
}

.footer-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 1rem;
}

.contact-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  text-align: center;
}

.footer-legal {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-legal a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-legal a:hover {
  color: var(--text-main);
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--accent-secondary);
}

body.map-page {
  overflow: hidden;
  height: 100vh;
}

body.map-page .app-footer {
  display: none;
}

body:not(.map-page) {
  overflow-y: auto;
  height: auto;
  min-height: 100vh;
}

body:not(.map-page) .app-container {
  flex: none;
  overflow: visible;
  min-height: calc(100vh - var(--nav-height) - 300px);
}

/* ── Bell dropdown ── */
#bellDropdown {
  max-height: 400px;
  overflow-y: auto;
}

.bell-hdr { padding: .7rem 1rem; font-size: .78rem; font-weight: 700;
  color: var(--text-muted); border-bottom: 1px solid var(--border-color);
  text-transform: uppercase; letter-spacing: .05em; }
.bell-item { padding: .65rem 1rem; font-size: .8rem; border-bottom: 1px solid rgba(255,255,255,.04);
  display: flex; align-items: flex-start; gap: .55rem; line-height: 1.45; }
.bell-item:last-child { border-bottom: none; }
.bell-item-icon { flex-shrink: 0; margin-top: .05rem; }
#bellWrapper { position: relative; }

/* ── Sub popup ── */
#subPopup {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  z-index: 9998; min-width: 340px; max-width: 480px; width: 90vw;
  background: #16181f; border: 1px solid var(--border-color);
  border-radius: 14px; box-shadow: 0 16px 48px rgba(0,0,0,.6);
  padding: 1.15rem 1.25rem; display: none;
  animation: slideInUp .35s ease;
}
@keyframes slideInUp { from { transform: translateX(-50%) translateY(40px); opacity:0; } to { transform: translateX(-50%) translateY(0); opacity:1; } }
#subPopup .sp-close { position:absolute; top:.7rem; right:.85rem; background:none; border:none; color:var(--text-muted); font-size:1.2rem; cursor:pointer; }
#subPopup .sp-title { font-weight:700; font-size:.95rem; margin-bottom:.75rem; display:flex; align-items:center; gap:.5rem; }
#subPopup .sp-row { display:flex; justify-content:space-between; align-items:center; padding:.45rem 0; border-bottom:1px solid rgba(255,255,255,.05); font-size:.82rem; }
#subPopup .sp-row:last-child { border-bottom:none; }
#subPopup .sp-label { color:var(--text-muted); }
#subPopup .sp-val { font-weight:600; font-family:'JetBrains Mono',monospace; color:var(--text-main); }

/* ── TK Store modal cards ── */
#tkStoreModal .store-card {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border-color);
  border-radius: 12px; padding: 1rem 1.1rem;
  display: flex; align-items: center; gap: 0.9rem;
  margin-bottom: 0.65rem; transition: border-color 0.2s;
}
#tkStoreModal .store-card:hover { border-color: rgba(245,158,11,0.4); }
#tkStoreModal .store-card:last-child { margin-bottom: 0; }
#tkStoreModal .store-icon { font-size: 1.5rem; flex-shrink: 0; width: 38px; text-align: center; }
#tkStoreModal .store-info { flex: 1; }
#tkStoreModal .store-name { font-size: 0.9rem; font-weight: 700; color: var(--text-main); }
#tkStoreModal .store-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; line-height: 1.45; }
#tkStoreModal .store-buy-btn {
  padding: 0.45rem 0.9rem;
  background: linear-gradient(135deg, #b45309, #f59e0b); color: white;
  border: none; border-radius: 8px; font-size: 0.78rem; font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: opacity 0.2s;
}
#tkStoreModal .store-buy-btn:hover { opacity: 0.85; }
#tkStoreModal .store-buy-btn:disabled { opacity: 0.35; cursor: not-allowed; }
#tkStoreFeedback { font-size: 0.78rem; margin-top: 0.85rem; padding: 0.6rem 0.9rem;
  border-radius: 8px; display: none; }
#tkStoreFeedback.ok  { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.25); color: #34d399; display: block; }
#tkStoreFeedback.err { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.25);  color: #f87171;  display: block; }

/* ── Sentinel panel styles ── */
.sentinel-tab {
  padding:0.6rem 1.1rem;font-size:0.82rem;font-weight:600;color:var(--text-muted);
  background:transparent;border:none;border-bottom:2px solid transparent;cursor:pointer;
  transition:all 0.2s;white-space:nowrap;
}
.sentinel-tab:hover { color:var(--text-main); }
.sentinel-tab.active { color:#06b6d4;border-bottom-color:#06b6d4; }
.sentinel-stat {
  background:rgba(255,255,255,0.03);border:1px solid var(--border-color);border-radius:12px;
  padding:1rem 1.25rem;text-align:center;
}
.sentinel-stat-val { font-size:1.8rem;font-weight:800;color:#06b6d4;font-family:'JetBrains Mono',monospace; }
.sentinel-stat-label { font-size:0.72rem;color:var(--text-muted);margin-top:0.25rem;text-transform:uppercase;letter-spacing:0.05em; }
.sentinel-feed-item {
  display:flex;align-items:center;gap:0.75rem;padding:0.65rem 0.85rem;
  border-radius:10px;background:rgba(255,255,255,0.02);border:1px solid rgba(255,255,255,0.04);
  margin-bottom:0.5rem;transition:background 0.15s;
}
.sentinel-feed-item:hover { background:rgba(255,255,255,0.05); }
.sentinel-badge {
  font-size:0.65rem;font-weight:700;padding:0.15rem 0.45rem;border-radius:6px;text-transform:uppercase;
}
.sentinel-kamu-btn {
  background:rgba(239,68,68,0.1);border:1px solid rgba(239,68,68,0.25);color:#f87171;
  padding:0.25rem 0.6rem;border-radius:8px;font-size:0.72rem;font-weight:600;cursor:pointer;
  transition:all 0.2s;
}
.sentinel-kamu-btn:hover { background:rgba(239,68,68,0.2);border-color:#f87171; }
.sentinel-restore-btn {
  background:rgba(16,185,129,0.1);border:1px solid rgba(16,185,129,0.25);color:#34d399;
  padding:0.25rem 0.6rem;border-radius:8px;font-size:0.72rem;font-weight:600;cursor:pointer;
  transition:all 0.2s;
}
.sentinel-restore-btn:hover { background:rgba(16,185,129,0.2);border-color:#34d399; }
.sentinel-delete-btn {
  background:rgba(239,68,68,0.1);border:1px solid rgba(239,68,68,0.25);color:#f87171;
  padding:0.25rem 0.6rem;border-radius:8px;font-size:0.72rem;font-weight:600;cursor:pointer;
  transition:all 0.2s;
}
.sentinel-delete-btn:hover { background:#ef4444;color:#fff; }
.marker-under-review {
  opacity:0.5;filter:grayscale(0.7);
}

/* ── Footer responsive ── */
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr !important; gap: 2rem; }
  .footer-top { grid-template-columns: 1fr !important; gap: 1.5rem; }
  .app-footer { padding: 2rem 1rem 1rem; }
}