/* ============================================================
   CMS26 — Liquid Glass Design System (iOS 27 Light)
   Nowoczesny, luksusowy interfejs w stylu Apple iOS / macOS:
   - Bogate, wielowarstwowe tło z siatką architektoniczną i światłem
   - Mapa ustawiona fizycznie POD wyszukiwarką i wyborem sektorów
   - Czyste plakietki literowe w rogach sektorów na mapie głównej
   - Rzeczywiste pola nagrobków z intensywnym czerwonym podświetleniem
   - Pełna responsywność pod smartfony i mobilny bottom-sheet
   ============================================================ */

:root {
  /* Kolory bazowe Liquid Glass Light */
  --bg-dark: #f8fafc;
  --bg-deep: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-glass-base: rgba(255, 255, 255, 0.82);
  --bg-glass-card: rgba(255, 255, 255, 0.90);
  --bg-glass-hover: rgba(255, 255, 255, 0.98);
  --bg-glass-active: rgba(241, 245, 249, 0.98);

  /* Obramowania i refleksy szklane */
  --glass-border: 1px solid rgba(255, 255, 255, 0.85);
  --glass-border-light: 1px solid rgba(255, 255, 255, 0.95);
  --glass-border-subtle: 1px solid rgba(148, 163, 184, 0.22);
  --glass-border-glow: 1px solid rgba(2, 132, 199, 0.45);

  /* Cienie i załamania światła */
  --glass-shadow: 0 12px 32px rgba(15, 23, 42, 0.07),
                  0 2px 6px rgba(15, 23, 42, 0.03),
                  inset 0 1px 1.5px rgba(255, 255, 255, 0.95);
  --glass-shadow-floating: 0 20px 50px rgba(15, 23, 42, 0.11),
                           0 4px 14px rgba(15, 23, 42, 0.05),
                           inset 0 1.5px 2px rgba(255, 255, 255, 1.0),
                           inset 0 -1px 1px rgba(0, 0, 0, 0.04);
  --glass-shadow-glow: 0 0 35px rgba(2, 132, 199, 0.22),
                       0 20px 50px rgba(15, 23, 42, 0.12),
                       inset 0 1px 2px rgba(255, 255, 255, 1.0);

  /* Akcenty kolorystyczne */
  --accent-cyan: #0284c7;
  --accent-cyan-rgb: 2, 132, 199;
  --accent-purple: #6366f1;
  --accent-amber: #d97706;
  --accent-amber-light: #f59e0b;
  --accent-amber-rgb: 217, 119, 6;
  --accent-emerald: #059669;
  --accent-red: #ef4444;

  /* Typografia */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-light: #0f172a;

  /* Fizyka animacji */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --radius-full: 9999px;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
}

/* Reset i ustawienia bazowe */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #f1f5f9;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Plus Jakarta Sans", "SF Pro Display", "Inter", sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   Bogate, wielowarstwowe tło atmosferyczne (Liquid Atmosphere)
   ============================================================ */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: 
    radial-gradient(circle at 50% 0%, #ffffff 0%, #f1f5f9 60%, #e2e8f0 100%);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.85;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.55;
  animation: float-orb 18s ease-in-out infinite alternate;
}

.ambient-orb.orb-1 {
  width: 550px;
  height: 550px;
  top: -120px;
  left: 5%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.35) 0%, transparent 70%);
}

.ambient-orb.orb-2 {
  width: 600px;
  height: 600px;
  top: 15%;
  right: -80px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.28) 0%, transparent 70%);
  animation-delay: -6s;
}

.ambient-orb.orb-3 {
  width: 500px;
  height: 500px;
  bottom: -100px;
  left: 35%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.22) 0%, transparent 70%);
  animation-delay: -12s;
}

@keyframes float-orb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 20px) scale(1.08); }
  100% { transform: translate(-20px, 40px) scale(0.95); }
}

/* ============================================================
   Główny kontener aplikacji
   ============================================================ */
.app-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

/* ============================================================
   Dedykowany obszar nagłówka (Strefa Kontrolek na samej górze)
   ============================================================ */
.app-header-area {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 24px 8px;
  z-index: 30;
  flex-shrink: 0;
}

.header-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}

/* Brand Badge */
.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--bg-glass-base);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: var(--glass-border);
  border-radius: var(--radius-full);
  box-shadow: var(--glass-shadow);
  cursor: pointer;
  transition: all 0.3s var(--ease-spring);
  flex-shrink: 0;
}

.brand-badge:hover {
  background: var(--bg-glass-hover);
  border-color: rgba(255, 255, 255, 1.0);
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.10);
}

.brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.14), rgba(99, 102, 241, 0.18));
  border: 1px solid rgba(2, 132, 199, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.brand-text h1 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #0f172a;
  line-height: 1.1;
}

.brand-text p {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.1;
}

/* Pływająca wyspa wyszukiwania */
.search-island-container {
  flex: 1;
  max-width: 580px;
  position: relative;
}

.search-island {
  position: relative;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(34px) saturate(200%);
  -webkit-backdrop-filter: blur(34px) saturate(200%);
  border: var(--glass-border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow-floating);
  overflow: hidden;
  transition: all 0.35s var(--ease-spring);
}

.search-island:focus-within {
  border-color: rgba(2, 132, 199, 0.5);
  box-shadow: var(--glass-shadow-glow);
  background: rgba(255, 255, 255, 0.98);
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 16px;
  gap: 10px;
}

.search-icon-lens {
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s var(--ease-spring);
}

.search-island:focus-within .search-icon-lens {
  transform: scale(1.1);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-primary);
  font-family: inherit;
}

.search-input::placeholder {
  color: #94a3b8;
}

.search-clear-btn {
  background: rgba(0, 0, 0, 0.06);
  border: none;
  color: var(--text-secondary);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s;
}

.search-clear-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.search-clear-btn:hover {
  background: rgba(0, 0, 0, 0.12);
  color: #0f172a;
}

/* Rozwijana lista wyników autouzupełniania */
.search-results-tray {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease-spring), opacity 0.3s ease;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
}

.search-island.has-results .search-results-tray {
  max-height: 400px;
  opacity: 1;
  overflow-y: auto;
}

.search-tray-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(241, 245, 249, 0.95);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(10px);
}

.search-tray-close-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.08);
  border: none;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-tray-close-btn:hover {
  background: #0f172a;
  color: #ffffff;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(241, 245, 249, 0.9);
  transition: background 0.2s ease, padding 0.2s var(--ease-spring);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover,
.search-result-item.active {
  background: rgba(2, 132, 199, 0.08);
  padding-left: 20px;
}

.result-person {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.result-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.result-name mark {
  background: rgba(254, 240, 138, 0.8);
  color: #0f172a;
  padding: 1px 3px;
  border-radius: 3px;
}

.result-dates {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.result-location {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sector-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(2, 132, 199, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(2, 132, 199, 0.25);
}

.search-no-results {
  padding: 24px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.search-scope-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(248, 250, 252, 0.85);
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
}

.search-scope-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.search-scope-pill {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid rgba(203, 213, 225, 0.8);
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-scope-pill:hover {
  border-color: #0284c7;
  color: #0284c7;
}

.search-scope-pill.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.btn-search-all-fallback {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: none;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
  transition: all 0.2s ease;
}

.btn-search-all-fallback:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
}

/* Statystyki i przycisk resetu widoku */
.top-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.stats-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--bg-glass-base);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: var(--glass-border);
  border-radius: var(--radius-full);
  box-shadow: var(--glass-shadow);
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.stat-val {
  font-weight: 800;
  color: #0f172a;
}

.stat-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #cbd5e1;
}

.control-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-glass-base);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
}

.control-btn:hover {
  background: var(--bg-glass-hover);
  color: var(--accent-cyan);
  transform: scale(1.06);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10);
}

/* ============================================================
   Rząd 2 Nagłówka: Pływający dok wyboru sektora (POD wyszukiwarką)
   ============================================================ */
.header-dock-row {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  position: relative;
}

.sector-nav-dock {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(30px) saturate(190%);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  border: var(--glass-border-light);
  border-radius: var(--radius-full);
  box-shadow: var(--glass-shadow);
  max-width: 95vw;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.sector-nav-dock::-webkit-scrollbar {
  display: none;
}

.sector-nav-chip {
  padding: 6px 13px;
  border-radius: var(--radius-full);
  background: rgba(241, 245, 249, 0.85);
  border: 1px solid rgba(203, 213, 225, 0.7);
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s var(--ease-spring);
  flex-shrink: 0;
}

.sector-nav-chip:hover {
  background: rgba(2, 132, 199, 0.12);
  border-color: rgba(2, 132, 199, 0.4);
  color: var(--accent-cyan);
  transform: translateY(-1px);
}

.sector-nav-chip.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.sector-nav-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 1.5px 5px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.08);
}

.sector-nav-chip.active .sector-nav-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Breadcrumbs (nawigacja powrotu w sektorze) */
.breadcrumbs-bar {
  display: none;
  align-items: center;
  gap: 8px;
}

.breadcrumbs-bar.visible {
  display: flex;
}

.breadcrumb-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-glass-base);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: var(--glass-border);
  border-radius: var(--radius-full);
  box-shadow: var(--glass-shadow);
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
}

.breadcrumb-chip:hover {
  background: var(--bg-glass-hover);
  color: var(--accent-cyan);
  transform: translateY(-1px);
}

.breadcrumb-chip.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.12), rgba(99, 102, 241, 0.15));
  border-color: rgba(2, 132, 199, 0.35);
  color: var(--accent-cyan);
  cursor: default;
}

/* ============================================================
   Główny obszar mapy — STRYKTNIE PONIŻEJ KONTROLEK
   ============================================================ */
.map-viewport {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 24px 18px;
  overflow: hidden;
}

/* Szklana ramka wokół mapy (Liquid Frame) */
.map-frame-card {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1550px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.70);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: var(--glass-border-light);
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.14),
              0 8px 24px -4px rgba(15, 23, 42, 0.06),
              inset 0 1.5px 2px rgba(255, 255, 255, 1);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  touch-action: none;
}

.map-canvas-container {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.fullmap-canvas {
  z-index: 1;
}

.sector-canvas {
  z-index: 2;
}

.map-image,
.sector-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 215px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  transition: none;
}

/* Floating Return Button: "← Wróć do mapy głównej" */
.map-floating-back-btn {
  position: absolute;
  top: 18px;
  left: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: var(--glass-border-light);
  border-radius: var(--radius-full);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  z-index: 25;
  opacity: 0;
  transform: translateY(-8px) scale(0.95);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.map-floating-back-btn.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.map-floating-back-btn:hover {
  background: #ffffff;
  color: #0284c7;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 30px rgba(2, 132, 199, 0.22), 0 4px 10px rgba(0, 0, 0, 0.1);
}

.map-floating-back-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Pływające kontrolki Zoom */
.map-floating-controls {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 25;
}

.map-float-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: var(--glass-border-light);
  box-shadow: var(--glass-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
}

.map-float-btn:hover {
  background: #ffffff;
  color: var(--accent-cyan);
  transform: scale(1.08);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.map-float-btn:active {
  transform: scale(0.95);
}

/* ============================================================
   Wektory SVG Sektorów na Mapie Głównej
   ============================================================ */
.fullmap-svg-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  z-index: 5;
}

.sector-polygon {
  fill: rgba(2, 132, 199, 0.12);
  stroke: #0284c7;
  stroke-width: 0.7;
  stroke-dasharray: 2.2 1.2;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sector-polygon:hover,
.sector-polygon.active {
  fill: rgba(2, 132, 199, 0.32);
  stroke: #0369a1;
  stroke-width: 1.2;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 8px rgba(2, 132, 199, 0.5));
}

.sector-polygon.fly-focus {
  fill: rgba(2, 132, 199, 0.45) !important;
  stroke: #ffffff !important;
  stroke-width: 1.8 !important;
  stroke-dasharray: none !important;
  filter: drop-shadow(0 0 16px rgba(2, 132, 199, 0.9)) !important;
}

/* Plakietka narożna sektora (zgodnie z życzeniem usera — czysta litera na widocznym tle) */
.sector-corner-badge {
  cursor: pointer;
  transition: transform 0.25s var(--ease-spring);
}

.sector-badge-bg {
  fill: rgba(255, 255, 255, 0.96);
  stroke: #0284c7;
  stroke-width: 0.5px;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.35));
  transition: all 0.25s ease;
}

.sector-badge-letter {
  font-size: 3.2px;
  font-weight: 900;
  fill: #0f172a;
  text-anchor: middle;
  dominant-baseline: central;
  font-family: -apple-system, BlinkMacSystemFont, "Plus Jakarta Sans", sans-serif;
  pointer-events: none;
  transition: fill 0.2s ease;
}

.sector-svg-group:hover .sector-badge-bg,
.sector-corner-badge.hovered .sector-badge-bg,
.sector-corner-badge.active .sector-badge-bg {
  fill: #0284c7;
  stroke: #ffffff;
  stroke-width: 0.7px;
  filter: drop-shadow(0 0 8px rgba(2, 132, 199, 0.8));
}

.sector-svg-group:hover .sector-badge-letter,
.sector-corner-badge.hovered .sector-badge-letter,
.sector-corner-badge.active .sector-badge-letter {
  fill: #ffffff;
}

/* ============================================================
   Rzeczywiste Pola Nagrobków (Mapa Pól na Sektorze)
   ============================================================ */
.graves-grid-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  z-index: 10;
}

.grave-plot {
  position: absolute;
  transform: none !important;
  transform-origin: top left !important;
  box-sizing: border-box;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  background: rgba(2, 132, 199, 0.16);
  border-radius: 3px;
  cursor: pointer;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.grave-plot:hover {
  background: rgba(2, 132, 199, 0.45);
  border-color: #ffffff;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.7);
  z-index: 20;
}

/* Kaskadowe ujawnianie nagrobków (Reveal / Stagger Effect — Apple Design) */
.grave-plot.stagger-in {
  opacity: 0;
  animation: gravePlotStagger 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  will-change: opacity, transform, filter;
}

@keyframes gravePlotStagger {
  0% {
    opacity: 0;
    transform: scale(0.95) !important;
    filter: brightness(1.25) drop-shadow(0 0 8px rgba(2, 132, 199, 0.6));
    border-color: #ffffff;
  }
  70% {
    opacity: 1;
    transform: scale(1.02) !important;
    filter: brightness(1.08) drop-shadow(0 0 4px rgba(2, 132, 199, 0.4));
  }
  100% {
    opacity: 1;
    transform: none !important;
    filter: none;
  }
}

/* WYRÓŻNIENIE WYBRANEGO NAGROBKA NA INTENSYWNY CZERWONY KOLOR (POLE NAGROBKA) */
.grave-plot.active,
.grave-plot.highlighted {
  background: rgba(239, 68, 68, 0.65) !important;
  border: 2.5px solid #ef4444 !important;
  box-shadow: 0 0 0 2.5px rgba(255, 255, 255, 0.95),
              0 0 16px #ef4444,
              0 0 35px rgba(239, 68, 68, 0.85) !important;
  z-index: 30;
  animation: pulse-red-plot 1.6s infinite alternate ease-in-out;
  transform: none !important;
  transform-origin: top left !important;
}

@keyframes pulse-red-plot {
  0% {
    background: rgba(239, 68, 68, 0.55);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 0 12px #ef4444;
  }
  100% {
    background: rgba(239, 68, 68, 0.90);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 1.0), 0 0 24px #ef4444, 0 0 42px rgba(239, 68, 68, 0.95);
  }
}

/* Czerwona pinezka nad wybranym nagrobkiem */
.plot-active-pin {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  animation: bounce-pin 1.2s infinite alternate ease-in-out;
}

.plot-pin-bubble {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.plot-pin-stem {
  width: 2px;
  height: 6px;
  background: #ef4444;
}

@keyframes bounce-pin {
  0% { transform: translateX(-50%) translateY(0); }
  100% { transform: translateX(-50%) translateY(-5px); }
}

/* Tooltip dla pola nagrobka */
.plot-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s ease;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 40;
}

.grave-plot:hover .plot-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   Panel boczny kwater sektora (Drawer)
   ============================================================ */
.sector-sidebar {
  position: fixed;
  top: 90px;
  right: 24px;
  bottom: 24px;
  width: 380px;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(34px) saturate(200%);
  -webkit-backdrop-filter: blur(34px) saturate(200%);
  border: var(--glass-border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow-floating);
  display: flex;
  flex-direction: column;
  z-index: 35;
  transform: translateX(calc(100% + 40px));
  transition: transform 0.4s var(--ease-spring);
}

.sector-sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.sidebar-title h2 {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}

.sidebar-title p {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.sidebar-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-close-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #0f172a;
}

.sidebar-filters {
  display: flex;
  gap: 8px;
  padding: 10px 18px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(241, 245, 249, 0.9);
}

.sidebar-filters::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(241, 245, 249, 0.8);
  border: 1px solid rgba(203, 213, 225, 0.6);
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-tab.active {
  background: var(--accent-cyan);
  color: #ffffff;
  border-color: var(--accent-cyan);
}

.graves-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.grave-card {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.9);
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
}

.grave-card:hover {
  background: #ffffff;
  border-color: rgba(2, 132, 199, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.grave-card.active {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.06);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

.grave-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.grave-coord-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-cyan);
}

.grave-card-meta {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.grave-deceased-names {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}

/* ============================================================
   Karta Nagrobka / Modal (Mobile-first Bottom Sheet)
   ============================================================ */
.grave-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.grave-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.grave-sheet {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(34px) saturate(200%);
  -webkit-backdrop-filter: blur(34px) saturate(200%);
  border: var(--glass-border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow-floating);
  width: 520px;
  max-width: 95vw;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.95) translateY(15px);
  transition: transform 0.35s var(--ease-spring);
}

.grave-modal-backdrop.open .grave-sheet {
  transform: scale(1) translateY(0);
}

.sheet-drag-handle {
  display: none;
  width: 40px;
  height: 5px;
  background: rgba(148, 163, 184, 0.5);
  border-radius: 3px;
  margin: 10px auto 4px;
}

.sheet-photo-hero {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: #e2e8f0;
  cursor: pointer;
}

.sheet-photo-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.sheet-photo-hero:hover img {
  transform: scale(1.05);
}

.photo-overlay-glass {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
}

.photo-zoom-hint {
  position: absolute;
  bottom: 14px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  pointer-events: none;
  transition: transform 0.2s ease, background 0.2s ease;
}

.sheet-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: transform 0.2s;
  z-index: 10;
}

.sheet-close-btn:hover {
  transform: scale(1.1);
}

.sheet-content {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sheet-location-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.location-chip {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(2, 132, 199, 0.12);
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 800;
}

.location-text {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.deceased-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.deceased-entry {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.deceased-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.deceased-fullname {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.deceased-age-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.deceased-dates-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
}

.date-segment {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Epitafium / Sentencja nagrobna */
.sheet-epitaph-container {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(217, 119, 6, 0.03) 100%);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-left: 4px solid var(--accent-amber);
}

.epitaph-quote-icon {
  color: var(--accent-amber);
  flex-shrink: 0;
  margin-top: 2px;
}

.sheet-epitaph-text {
  margin: 0;
  font-size: 13px;
  font-style: italic;
  font-weight: 500;
  line-height: 1.5;
  color: #78350f;
}

/* Karta trasy dojścia (Walking Route Card) */
.sheet-route-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.9);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sheet-route-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sheet-route-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sheet-route-title-box {
  display: flex;
  flex-direction: column;
}

.sheet-route-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.sheet-route-subtitle {
  font-size: 11px;
  color: #64748b;
}

.sheet-route-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 6px;
}

.route-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  min-height: 28px;
}

.route-step-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 16px;
  bottom: -6px;
  width: 2px;
  background: rgba(203, 213, 225, 0.8);
}

.route-step-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2.5px solid #0284c7;
  background: #ffffff;
  margin-top: 3px;
  flex-shrink: 0;
  z-index: 1;
}

.route-step-item:first-child .route-step-dot {
  border-color: #22c55e;
  background: #22c55e;
}

.route-step-item:last-child .route-step-dot {
  border-color: #ef4444;
  background: #ef4444;
}

.route-step-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  padding-bottom: 8px;
}

.route-step-item:last-child .route-step-name {
  font-weight: 700;
  color: #0f172a;
  padding-bottom: 0;
}

.btn-navigate {
  width: 100%;
  height: 50px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: none;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
  transition: all 0.25s var(--ease-spring);
}

.btn-navigate:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(239, 68, 68, 0.45);
}

.btn-navigate:active {
  transform: scale(0.98);
}

/* Lightbox Modal */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 30, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: zoom-out;
}

.lightbox-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-img-wrapper {
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.lightbox-backdrop.open .lightbox-img-wrapper {
  pointer-events: auto;
}

.lightbox-img-wrapper img {
  max-width: 92vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease;
  cursor: default;
}

.lightbox-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
}

/* Toast */
.liquid-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s var(--ease-spring);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 100;
}

.liquid-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   Optymalizacja Responsywna pod Smartfony (Mobile Optimization)
   ============================================================ */
@media (max-width: 768px) {
  .app-header-area {
    padding: 10px 12px 6px;
    gap: 8px;
  }

  .header-main-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .brand-badge {
    padding: 6px 12px;
  }
  .brand-text h1 {
    font-size: 13px;
  }
  .brand-text p {
    display: none;
  }

  .top-controls .stats-pill {
    display: none; /* Ukryj na małych ekranach, by zyskać miejsce */
  }

  .search-island-container {
    order: 3;
    width: 100%;
    max-width: 100%;
  }

  .search-input-wrapper {
    height: 44px;
  }
  .search-input {
    font-size: 13.5px;
  }

  .sector-nav-dock {
    max-width: 100%;
    padding: 4px 6px;
    scroll-snap-type: x mandatory;
  }

  .sector-nav-chip {
    padding: 5px 10px;
    font-size: 11px;
    scroll-snap-align: start;
  }

  .map-viewport {
    padding: 4px 10px 14px;
  }

  .map-frame-card {
    border-radius: 18px;
  }

  .map-image {
    max-height: calc(100vh - 190px);
    border-radius: 12px;
  }

  .map-floating-controls {
    right: 12px;
    bottom: 12px;
  }
  .map-float-btn {
    width: 38px;
    height: 38px;
  }

  /* Mobilny iOS Bottom-Sheet */
  .grave-modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .grave-sheet {
    width: 100vw;
    max-width: 100vw;
    max-height: 82vh;
    border-radius: 24px 24px 0 0;
    margin: 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .grave-modal-backdrop.open .grave-sheet {
    transform: translateY(0);
  }

  .sheet-drag-handle {
    display: block;
  }

  .sheet-photo-hero {
    height: 180px;
    border-radius: 0;
  }

  .sector-sidebar {
    top: 60px;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100vw;
    border-radius: 20px 20px 0 0;
  }
}

/* ============================================================
   Floating Turn-by-Turn Navigation Dock (Liquid Glass standard)
   ============================================================ */

.navigation-dock {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  z-index: 1000;
  width: min(92vw, 440px);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-xl);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.4s var(--ease-spring), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.navigation-dock.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.nav-dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-dock-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-dock-badge {
  font-size: 10px;
  font-weight: 800;
  color: #0284c7;
  background: rgba(2, 132, 199, 0.12);
  border: 1px solid rgba(2, 132, 199, 0.25);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  letter-spacing: 0.4px;
}

.nav-dock-target {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.nav-dock-close {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.08);
  border: none;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-dock-close:hover {
  background: #0f172a;
  color: #ffffff;
}

.nav-dock-step-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(241, 245, 249, 0.7);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.nav-dock-step-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.nav-dock-step-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-dock-step-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.nav-dock-step-number {
  font-weight: 800;
  color: #0284c7;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.nav-dock-step-distance {
  color: #64748b;
  font-weight: 500;
}

.nav-dock-step-name {
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
}

.nav-dock-step-instruction {
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
  margin-top: 2px;
}

.nav-dock-actions {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 8px;
}

.nav-btn-sec {
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn-sec:hover:not(:disabled) {
  background: #e2e8f0;
  color: #0f172a;
}

.nav-btn-sec:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.nav-btn-prim {
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: none;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.nav-btn-prim:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.4);
}

/* ============================================================
   Sector SVG Overlay & Animated Route Styling
   ============================================================ */

.sector-svg-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 12;
}

.route-neon-path {
  fill: none;
  stroke: #0284c7;
  stroke-width: 0.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 2.2, 1.2;
  animation: routeDashFlow 1s linear infinite;
  filter: drop-shadow(0 0 3px rgba(2, 132, 199, 0.9));
}

@keyframes routeDashFlow {
  to {
    stroke-dashoffset: -3.4;
  }
}

.route-glow-halo {
  fill: none;
  stroke: rgba(2, 132, 199, 0.25);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.waypoint-halo-pulse {
  animation: waypointPulseRing 1.8s cubic-bezier(0.25, 1, 0.5, 1) infinite;
  transform-origin: center;
}

@keyframes waypointPulseRing {
  0% {
    r: 1.2;
    opacity: 0.9;
  }
  100% {
    r: 3.4;
    opacity: 0;
  }
}

/* ============================================================
   Zaawansowany Filter Drawer Wyszukiwarki & Odznaki Zasłużonych
   ============================================================ */

.search-filter-toggle-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid transparent;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-right: 4px;
}

.search-filter-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #0f172a;
}

.search-filter-toggle-btn.active {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.3);
}

.search-filter-drawer {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease-spring), opacity 0.25s ease;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(226, 232, 240, 0.85);
  backdrop-filter: blur(20px);
}

.search-filter-drawer.open {
  max-height: 240px;
  opacity: 1;
  padding: 12px 18px 16px 18px;
}

.filter-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.filter-drawer-title {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.filter-drawer-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.filter-drawer-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.filter-drawer-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-field label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.filter-field input {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
  font-size: 12.5px;
  color: #0f172a;
  background: #ffffff;
}

.filter-field input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.filter-checkbox-row {
  display: flex;
  align-items: center;
}

.filter-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
}

.filter-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.btn-filter-clear {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-filter-clear:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-filter-apply {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: #2563eb;
  border: none;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.btn-filter-apply:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

/* Złota odznaka dla osób zasłużonych */
.notable-badge-gold {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.3));
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.2);
  margin-left: 6px;
  vertical-align: middle;
}

/* Kwatery ze zmarłymi zasłużonymi na siatce sektora */
.grave-plot-field.has-notable {
  border-color: #f59e0b !important;
  background: rgba(245, 158, 11, 0.22) !important;
}

.grave-plot-field.has-notable::after {
  content: "⭐";
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 9px;
  line-height: 1;
}

/* Przycisk eksportu CSV w nagłówku sektora */
.btn-sector-csv-export {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.25);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  margin-top: 4px;
}

.btn-sector-csv-export:hover {
  background: #2563eb;
  color: #ffffff;
}

/* ============================================================
   Optymalizacja Panningu (Zero-Jank 120 FPS na urządzeniach dotykowych)
   ============================================================ */
.is-panning .grave-plot,
.is-panning .sector-svg-group,
.is-panning svg polygon {
  pointer-events: none !important;
}

/* ============================================================
   Kolorowanie Kwater wg Statusu (Mapa Sektora & Widok Publiczny)
   ============================================================ */
.grave-plot.status-empty {
  border: 1.5px dashed #10b981 !important;
  background: rgba(16, 185, 129, 0.18) !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}

.grave-plot.status-reserved {
  border: 1.5px solid #a855f7 !important;
  background: rgba(168, 85, 247, 0.18) !important;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.25);
}

.grave-plot.status-expired {
  border: 1.5px solid #f43f5e !important;
  background: rgba(244, 63, 94, 0.2) !important;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.35);
}

/* Karta Kwatery: Status i Alert o Prolongacie (Pokładne) */
.sheet-status-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.sheet-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  width: fit-content;
}

.sheet-status-pill.empty {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.sheet-status-pill.reserved {
  background: rgba(168, 85, 247, 0.14);
  color: #7e22ce;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.sheet-status-pill.default {
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.sheet-type-pill {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 10px;
  font-weight: 600;
  color: #1e293b;
  margin-left: 6px;
}

.sheet-expired-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.32);
  color: #be123c;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.sheet-expired-alert svg {
  flex-shrink: 0;
  color: #f43f5e;
}

.empty-grave-desc-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  text-align: center;
  gap: 8px;
  color: #059669;
  font-size: 13px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.06);
  border-radius: 12px;
  border: 1px dashed rgba(16, 185, 129, 0.3);
  margin-top: 6px;
}

/* ============================================================
   Apple Liquid Glass (Mobile-First): Dotyk 44x44, Słońce & Bateria
   ============================================================ */
@media (max-width: 768px), (hover: none) {
  /* Zmniejszenie rozmycia dla 3x mniejszego obciążenia GPU na telefonach */
  .search-island,
  .sector-nav-dock,
  .grave-sheet,
  .breadcrumbs-bar,
  .map-float-btn {
    backdrop-filter: blur(12px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(160%) !important;
  }

  /* Specular Rim w stylu iOS 27 (Trójwymiarowa krawędź szkła bez obciążania procesora) */
  .search-island,
  .grave-sheet,
  .sector-nav-dock {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.32),
                inset 0 -1px 0 0 rgba(255, 255, 255, 0.08) !important;
  }

  /* Ergonomia dotykowa: Apple HIG Touch Targets min 44x44px */
  .control-btn,
  .map-float-btn,
  .sheet-close-btn,
  .breadcrumb-chip,
  .btn-navigate {
    min-height: 44px;
    min-width: 44px;
    -webkit-tap-highlight-color: transparent !important;
  }

  .control-btn:active,
  .map-float-btn:active,
  .btn-navigate:active,
  .sector-nav-chip:active {
    transform: scale(0.97) !important;
  }

  /* Wyłączenie animacji orbów w tle na mobile dla oszczędności baterii */
  .ambient-orb {
    animation: none !important;
  }
}

/* ============================================================
   Kancelaria Parafialna: Arkusz Stylów Druku (@media print)
   ============================================================ */
@media print {
  body, html {
    background: #ffffff !important;
    color: #000000 !important;
    overflow: visible !important;
    height: auto !important;
  }

  .admin-header,
  .admin-sector-nav,
  .admin-canvas-area,
  .admin-sidebar,
  .ambient-bg,
  .admin-zoom-dock,
  .admin-canvas-top-dock,
  .no-print {
    display: none !important;
  }

  .parish-dashboard-fullscreen {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    background: #ffffff !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }

  .parish-print-header {
    display: block !important;
    margin-bottom: 24px;
    border-bottom: 2px solid #000000;
    padding-bottom: 12px;
  }

  .parish-print-header h1 {
    font-size: 22px;
    font-weight: bold;
    color: #000000;
  }

  .parish-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 11px !important;
  }

  .parish-table th,
  .parish-table td {
    border: 1px solid #999999 !important;
    padding: 6px 8px !important;
    color: #000000 !important;
    background: #ffffff !important;
  }

  .parish-table th {
    background: #eeeeee !important;
    font-weight: bold !important;
  }

  .parish-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
  }

  .parish-kpi-card {
    border: 1px solid #cccccc !important;
    padding: 10px !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }
}


