/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@600;800;900&display=swap');

/* Base Design System Tokens */
:root {
  --color-primary: #0B3C2B;        /* Deep Jungle Green */
  --color-primary-light: #16523d;  /* Lighter Jungle Green for hover states */
  --color-accent: #E5A93C;         /* Ochre / Sunshine Gold */
  --color-accent-hover: #cca02d;   /* Sunshine Gold hover state */
  --color-bg: #F7F5F0;             /* Soft Sand / Off-White */
  --color-card: #FFFFFF;           /* Pure White Cards */
  --color-border: #E5E7EB;         /* border-stone-200 */
  --color-text-dark: #1F2937;      /* stone-800 */
  --color-text-light: #6B7280;     /* stone-500 */
  --color-red: #DC2626;            /* Alert red */
}

/* Base resets & typography scale optimized for glare and vibrations */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: transparent; /* Transparent so the map background fills entirely */
  color: var(--color-text-dark);
  font-size: 13px; /* Reduced overall site's font size (was 14px) */
  line-height: 1.5;
  min-height: 100vh;
}

/* Global light corner rounding for all images on the site (Requirement 5) */
img {
  border-radius: 4px !important;
}

/* Smartphone Wrapper Constraint */
.app-wrapper {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background-color: var(--color-bg);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* If full mobile view, take 100% of viewport width */
@media (max-width: 480px) {
  body {
    background-color: var(--color-bg);
  }
  .app-wrapper {
    box-shadow: none;
  }
}

/* Pre-Hiding Fullscreen Loading Overlay (Clean & Flat) */
#app-loading-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  background-color: #0B3C2B; /* Deep Jungle Green */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: auto;
}

#app-loading-screen.fade-out {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#app-loading-screen img {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  filter: none !important;
  background: transparent !important;
}

/* Fun Keyframe Animations */
@keyframes bajaj-bounce {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-2px) rotate(-0.5deg);
  }
  75% {
    transform: translateY(1px) rotate(0.5deg);
  }
}

@keyframes elastic-pop {
  0% {
    transform: scale(0.96);
    opacity: 0;
  }
  60% {
    transform: scale(1.01);
    opacity: 0.95;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes compass-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse-gold {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 8px 0 rgba(229, 169, 60, 0.3);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 2px 14px 4px rgba(229, 169, 60, 0.5);
  }
}

@keyframes slide-up {
  0% {
    transform: translateY(100%);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes confetti-fall {
  0% { transform: translateY(-50px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* Snappy slide-in animation from left to right for Details pane content (Requirement 2) */
@keyframes slide-in-right {
  0% {
    transform: translateX(-20px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.animate-slide-in-right {
  animation: slide-in-right 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Playful Animation Utility Classes */
.animate-bounce-bajaj {
  animation: bajaj-bounce 0.8s ease-in-out infinite;
}

.animate-pop-elastic {
  animation: elastic-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.animate-pulse-gold {
  animation: pulse-gold 2s infinite ease-in-out;
}

.hover-spin-compass:hover .compass-icon {
  animation: compass-spin 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Glassmorphism & Cards (Significantly reduced rounding: 0.375rem/6px) */
.mizizi-card {
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem; /* Reduced rounding */
  padding: 1rem;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mizizi-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

/* Header Vibe */
.jungle-header {
  background-color: var(--color-primary);
  color: #FFFFFF;
}

/* Buttons (Significantly reduced rounding: 0.375rem/6px) */
.btn-gold {
  background-color: var(--color-accent);
  color: var(--color-primary);
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.5px;
  border-radius: 0.375rem; /* Reduced rounding */
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  border: none;
}

.btn-gold:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-1px);
}

.btn-jungle {
  background-color: var(--color-primary);
  color: #FFFFFF;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  border-radius: 0.375rem; /* Reduced rounding */
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  border: none;
}

.btn-jungle:hover {
  background-color: var(--color-primary-light);
  transform: translateY(-1px);
}

/* Blur Lock overlays for Landing page teaser grid */
.teaser-locked {
  position: relative;
  overflow: hidden;
}

.teaser-locked::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(247, 245, 240, 0) 0%, rgba(247, 245, 240, 0.95) 100%);
  pointer-events: none;
}

.blur-overlay {
  filter: blur(5px);
  user-select: none;
  opacity: 0.65;
}

/* Badge tags (Significantly reduced rounding: 0.25rem/4px) */
.badge-gold {
  background-color: rgba(229, 169, 60, 0.15);
  color: #925f0e;
  font-weight: 700;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem; /* Reduced rounding */
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-jungle {
  background-color: rgba(11, 60, 43, 0.1);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem; /* Reduced rounding */
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Timeline Components */
.timeline-line {
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--color-border);
}

.timeline-dot {
  position: absolute;
  left: 12px;
  width: 17px;
  height: 17px;
  border-radius: 9999px;
  background-color: var(--color-accent);
  border: 3px solid var(--color-bg);
  box-shadow: 0 0 0 1px var(--color-accent);
  z-index: 10;
}

/* Accordion expand/collapse transition */
.card-content-wrapper {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-expanded .card-content-wrapper {
  max-height: 1000px;
}

.rotate-arrow {
  transition: transform 0.3s ease;
}

.card-expanded .rotate-arrow {
  transform: rotate(180deg);
}

/* Input Styles (Significantly reduced rounding: 0.375rem/6px) */
.mizizi-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem; /* Reduced rounding */
  border: 2px solid var(--color-border);
  background-color: #FFFFFF;
  font-size: 0.95rem;
  color: var(--color-text-dark);
  transition: all 0.2s ease;
}

.mizizi-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(11, 60, 43, 0.1);
}

/* Modals & Fullsheets (Significantly reduced rounding) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(11, 60, 43, 0.4);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-sheet {
  background-color: var(--color-bg);
  width: 100%;
  max-width: 480px;
  border-top-left-radius: 0.375rem; /* Reduced rounding */
  border-top-right-radius: 0.375rem;
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.15);
}

.modal-overlay.active .modal-sheet {
  transform: translateY(0);
}

.modal-drag-handle {
  width: 40px;
  height: 5px;
  background-color: #CBD5E1;
  border-radius: 9999px;
  margin: 0.75rem auto;
}

/* Driver swahili overlay styling (Significantly reduced rounding) */
.driver-card {
  background-color: var(--color-primary);
  color: #FFFFFF;
  border-radius: 0.375rem; /* Reduced rounding */
  padding: 1.25rem;
  border-left: 5px solid var(--color-accent);
}

.driver-speech {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
  color: #FFFFFF;
}

/* Custom Scrollbar for app dashboard */
.app-wrapper::-webkit-scrollbar {
  width: 6px;
}

.app-wrapper::-webkit-scrollbar-track {
  background: var(--color-bg);
}

.app-wrapper::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 9999px;
}

/* Confetti element */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  z-index: 2000;
  opacity: 0.9;
  border-radius: 2px;
  animation: confetti-fall 2.5s linear infinite;
  pointer-events: none;
}

/* ==========================================================================
   WANDERLOG ARCHITECTURE (V2 Split-Pane & Background Maps)
   ========================================================================== */

/* Full-Screen Map Base */
.map-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
  background-color: #e5e9f0; /* Default neutral maps fallback */
}

/* Premium Leaflet Popup Aesthetic Overrides */
.leaflet-popup-content-wrapper {
  background-color: #F7F5F0 !important; /* Soft Sand */
  color: #1F2937 !important;            /* stone-800 */
  border-radius: 0.5rem !important;       /* 8px */
  font-family: 'Inter', system-ui, sans-serif !important;
  padding: 0.25rem !important;
  border: 1px solid #E5E7EB !important;   /* border-stone-200 */
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15) !important;
}

.leaflet-popup-tip {
  background-color: #F7F5F0 !important;
}

.leaflet-popup-content {
  margin: 10px 12px !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
  max-width: 260px !important;
}

.leaflet-popup-close-button {
  color: #6B7280 !important;
  font-weight: bold !important;
  font-size: 14px !important;
  padding: 6px !important;
}

/* ==========================================
   Custom Numbered Badge Map Markers
   ========================================== */

/* Reset Leaflet's default icon container styling */
.mizizi-marker-badge {
  background: none !important;
  border: none !important;
  overflow: visible !important;
}

/* Inner wrapper — centers the badge column */
.mizizi-marker-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: transform 0.2s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.mizizi-marker-inner:hover {
  transform: scale(1.08) translateY(-2px);
}

/* Circular step number badge — Jungle Green + Gold border (Main Route) */
.mizizi-marker-number {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background-color: var(--color-primary);        /* Jungle Green */
  border: 2.5px solid var(--color-accent);        /* Sunshine Gold */
  color: #FFFFFF;
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

/* Location name label — Soft Sand tint, high-contrast text */
.mizizi-marker-label {
  background-color: rgba(247, 245, 240, 0.92);   /* Soft Sand */
  color: var(--color-text-dark);                  /* stone-800 */
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.02em;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  line-height: 1.3;
}

/* Floating Hamburger Menu Button (Reduced rounding, aligned with M logo - Requirement 6) */
.hamburger-btn {
  position: fixed;
  top: 1.25rem; /* Re-aligned to balance with header brand row */
  left: 1rem;
  z-index: 70; /* ALWAYS ON TOP (Requirement 1) */
  width: 3rem;
  height: 3rem;
  border-radius: 0.375rem; /* Reduced rounding */
  background-color: var(--color-accent);
  color: var(--color-primary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.hamburger-btn:hover {
  background-color: var(--color-accent-hover);
  transform: scale(1.04);
}

.hamburger-btn.active {
  background-color: transparent;
  color: #FFFFFF;
  box-shadow: none;
}

.hamburger-btn.active:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1);
}

/* Split-Pane Two-Column Sidebar Container */
.sidebar-container {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  height: 100vh;
  display: flex;
  flex-direction: row;
  z-index: 60; /* ALWAYS ON TOP (Requirement 1) */
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-100%); /* Hidden by default */
  box-shadow: 8px 0 20px rgba(0,0,0,0.15);
  pointer-events: none; /* Let clicks pass through empty spaces to the map underneath */
}

.sidebar-container.active {
  transform: translateX(0); /* Exposed leftward */
}

/* Column 1: Main Dark Navigation */
.sidebar-nav {
  width: 200px;
  background-color: var(--color-primary);
  pointer-events: auto; /* Intercept clicks on navigation column */
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  font-family: 'Outfit', sans-serif;
}

/* Sidebar Nav Branding - Padded horizontally to make space for fixed Hamburger (Requirement 6) */
.sidebar-brand {
  height: 5.5rem;
  display: flex;
  align-items: center;
  padding-left: 4.5rem; /* Aligns horizontally next to the floating hamburger button */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Sidebar Navigation Items (Reduced font size to 12px and aligned text left straight - Requirement 4) */
.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Aligns straight to the left */
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  font-weight: 500; /* Removed bolding */
  font-size: 12px; /* Set font size to 12px */
  color: rgba(255, 255, 255, 0.85);
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  border-left: 4px solid transparent;
  width: 100%;
  text-align: left; /* Aligns straight */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 44px; /* Touch-friendly minimum tap target */
}

.sidebar-link:hover, .sidebar-link.active {
  color: var(--color-accent);
  background-color: rgba(255, 255, 255, 0.04);
  border-left-color: var(--color-accent);
}

/* Collapsible locations sub-menu */
.sidebar-sub-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
  background-color: rgba(0, 0, 0, 0.15);
}

.sidebar-sub-menu.open {
  max-height: 2000px; /* Large enough for all stops + expanded alternatives */
  overflow-y: auto;
}

/* Sidebar Sub Items (Reduced font size to 11px and aligned text left straight - Requirement 4) */
.sidebar-sub-link {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Aligns straight */
  gap: 0.5rem;
  padding: 0.65rem 0.75rem 0.65rem 1rem;
  font-size: 11px; /* Reduced sub items size */
  font-weight: 500; /* Removed bolding */
  color: rgba(255, 255, 255, 0.65);
  transition: all 0.2s ease;
  cursor: pointer;
  width: 100%;
  text-align: left; /* Aligns straight */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 40px; /* Touch-friendly minimum tap target */
}

.sidebar-sub-link:hover, .sidebar-sub-link.active {
  color: var(--color-accent);
}

/* Collapsible sub-link with chevron arrow for stops that have alternatives */
.sidebar-sub-link-collapsible {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  cursor: default; /* Container itself isn't clickable */
}

.sidebar-sub-link-collapsible .sub-link-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0 0.65rem 1rem;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  transition: all 0.2s ease;
  cursor: pointer;
  flex-grow: 1;
  text-align: left;
  background: none;
  border: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 40px;
}

.sidebar-sub-link-collapsible .sub-link-name:hover,
.sidebar-sub-link-collapsible .sub-link-name.active {
  color: var(--color-accent);
}

.sidebar-sub-link-collapsible .sub-link-chevron {
  padding: 0.65rem 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
  background: none;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.sidebar-sub-link-collapsible .sub-link-chevron:hover {
  color: var(--color-accent);
  background-color: rgba(255, 255, 255, 0.04);
}

.sidebar-sub-link-collapsible .sub-link-chevron svg {
  transition: transform 0.3s ease;
}

.sidebar-sub-link-collapsible .sub-link-chevron.open svg {
  transform: rotate(180deg);
}

/* Nested alternative locations sub-menu (deeper indent, darker) */
.sidebar-alt-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-out;
  background-color: rgba(0, 0, 0, 0.2);
}

.sidebar-alt-menu.open {
  max-height: 400px;
}

/* Alternative location links — deeper indent, same size as main route stops */
.sidebar-alt-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem 0.5rem 1.75rem;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  transition: all 0.2s ease;
  cursor: pointer;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 38px;
}

.sidebar-alt-link:hover, .sidebar-alt-link.active {
  color: var(--color-accent);
  border-left-color: rgba(229, 169, 60, 0.4);
}

/* ==========================================================
   Alternative Location Map Markers — Ochre/Gold Badge Style
   ========================================================== */

.mizizi-alt-marker-badge {
  background: none !important;
  border: none !important;
  overflow: visible !important;
}

.mizizi-alt-marker-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: transform 0.2s ease;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.2));
}

.mizizi-alt-marker-inner:hover {
  transform: scale(1.1) translateY(-2px);
}

/* Ochre circle with white border — visually distinct from Jungle Green main stops */
.mizizi-alt-marker-number {
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  background-color: var(--color-accent);         /* Ochre / Sunshine Gold */
  border: 2px solid #FFFFFF;
  color: var(--color-primary);                    /* Jungle Green text */
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

/* Smaller name label for alt markers */
.mizizi-alt-marker-label {
  background-color: rgba(247, 245, 240, 0.88);
  color: var(--color-text-dark);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 8px;
  letter-spacing: 0.02em;
  padding: 1px 5px;
  border-radius: 2px;
  white-space: nowrap;
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  line-height: 1.3;
}

/* Column 2: Light Sand Details Panel (Twice as wide: 560px - Requirement 6) */
.sidebar-details {
  width: 560px; /* TWICE AS WIDE */
  background-color: var(--color-bg);
  color: var(--color-text-dark);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden; /* Prevent horizontal scroll */
  border-right: 1px solid var(--color-border);
  position: relative; /* Position relative for floating collapse arrow toggle */
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto; /* Intercept clicks on details column */
}

/* Collapsed state for Column 2 Details Panel (Requirement 1) */
.sidebar-details.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  flex-grow: 0 !important;
  flex-basis: 0 !important;
  border-right-width: 0;
  overflow: hidden;
  padding: 0;
}

/* Column 2 Float Border toggle arrow button (Requirement 1) */
.details-toggle-btn {
  position: absolute;
  right: -18px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 64px;
  background-color: var(--color-accent);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  box-shadow: 3px 0 12px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.details-toggle-btn:hover {
  background-color: var(--color-accent-hover);
}

.details-toggle-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 3;
}

/* Details Panel Header */
.details-header {
  background-color: #FFFFFF;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.details-header h2 {
  font-weight: 800; /* Keep bold for titles */
}

/* Details Panel Body Container */
.details-body {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-x: hidden; /* Never allow horizontal scroll in content area */
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Dynamic Detailing Fullscreen Overlays ("Read More") */
.overlay-screen {
  position: fixed;
  inset: 0;
  height: 100vh;
  width: 100%;
  z-index: 50; /* BELOW SIDEBAR (Requirement 1) */
  background-color: rgba(247, 245, 240, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding-left: 200px; /* Offset to keep nav Column 1 always visible! */
}

/* Responsive adjustment if sidebar active */
.overlay-screen.active {
  opacity: 1;
  pointer-events: all;
}

.overlay-header {
  background-color: var(--color-primary);
  color: #FFFFFF;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  gap: 0.75rem;
}

.overlay-header h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.25;
  flex: 1 1 auto;
  min-width: 0;
}

#overlay-close-btn {
  flex-shrink: 0 !important;
  white-space: nowrap;
}

/* Detailing Scroll Container */
.overlay-scroll-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 2rem;
}

/* Content card inside overlay (Significantly reduced rounding) */
.overlay-content-card {
  max-width: 680px;
  margin: 0 auto;
  background-color: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem; /* Reduced rounding */
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.overlay-content-card img {
  border-radius: 0.375rem; /* Reduced rounding */
}

/* Enforce 12px font size for Column 2 Details Body and Full Page Overlay Body Text */
.details-body p,
.details-body li,
.details-body td,
.details-body th,
.details-body pre,
.details-body a,
.overlay-content-card p,
.overlay-content-card li,
.overlay-content-card td,
.overlay-content-card th,
.overlay-content-card pre,
.overlay-content-card span,
.overlay-content-card a {
  font-size: 12px !important;
}

/* Detailed Guide Sub-Section Spacing (Avoid wall-of-text feel) */
.overlay-content-card h4,
.details-body h4 {
  margin-top: 2rem !important;
  margin-bottom: 0.85rem !important;
  padding-bottom: 0.35rem !important;
  letter-spacing: 0.08em;
}

.overlay-content-card p,
.details-body p {
  margin-bottom: 1.25rem !important;
  line-height: 1.65 !important;
}

.overlay-content-card ul,
.details-body ul,
.overlay-content-card ol,
.details-body ol {
  margin-bottom: 1.5rem !important;
}

.overlay-content-card li,
.details-body li {
  margin-bottom: 0.5rem !important;
  line-height: 1.6 !important;
}

/* Mobile Table Responsiveness & Fit */
.overlay-content-card table,
.details-body table {
  width: 100% !important;
  border-collapse: collapse;
  min-width: 440px; /* Prevents column clipping on mobile viewports */
}

.table-wrapper,
.editorial-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 1rem;
  margin-bottom: 1.75rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  background-color: #FFFFFF;
}

/* Responsive constraints on mobile screens */
@media (max-width: 768px) {
  .overlay-screen {
    padding-left: 0; /* No offset on smaller screens */
  }
}

@media (max-width: 640px) {
  /* Sidebar spans full width on mobile */
  .sidebar-container {
    width: 100%;
    max-width: 100vw;
  }
  
  .sidebar-nav {
    width: 100% !important;
    max-width: 100vw !important;
    border-right: none;
  }

  /* Details Pane: takes full screen width on mobile so content is spacious and readable */
  .sidebar-details {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    z-index: 75 !important;
    background-color: var(--color-bg);
    transform: translateX(0);
    border-right: none;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
  }

  .sidebar-details.collapsed {
    transform: translateX(100%) !important;
    width: 0 !important;
    min-width: 0 !important;
    pointer-events: none !important;
    visibility: hidden;
  }

  /* Hide the desktop float chevron toggle on mobile since we have the dedicated back button */
  .details-toggle-btn {
    display: none !important;
  }

  /* Sidebar brand spacer: ensure hamburger/X never overlaps menu */
  .sidebar-brand {
    height: 4.5rem;
    min-height: 4.5rem;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 5;
    background-color: var(--color-primary);
  }

  /* Mobile sidebar links: spacious and comfortable */
  .sidebar-link {
    font-size: 12px;
    padding: 0.75rem 1rem;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
    justify-content: flex-start;
    white-space: nowrap;
    min-height: 44px;
  }

  /* Mobile sub-links: left-aligned, uniform */
  .sidebar-sub-link {
    padding: 0.6rem 1rem 0.6rem 1.25rem;
    font-size: 11px;
    text-align: left;
    justify-content: flex-start;
    white-space: nowrap;
    min-height: 40px;
  }
  .sidebar-sub-link-collapsible .sub-link-name {
    padding-left: 1.25rem;
    font-size: 11px;
  }
  .sidebar-alt-link {
    padding-left: 2rem;
    font-size: 11px;
    min-height: 38px;
  }

  /* Overlay adjustments */
  .overlay-scroll-container {
    padding: 1rem;
  }
  .overlay-content-card {
    padding: 1rem;
    border-radius: 0.375rem;
  }

  /* Overlay header */
  .overlay-header {
    padding: 0.75rem 1rem !important;
  }
  .overlay-header h2 {
    font-size: 14px;
  }
  #overlay-close-btn {
    padding: 0.4rem 0.75rem;
    font-size: 9px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Details header: compact and clean with back button */
  .details-header {
    padding: 0.75rem 1rem !important;
  }
  .details-body {
    padding: 1rem !important;
    gap: 1rem !important;
  }
}

/* Swahili surviving lingo badge style */
.lingo-badge {
  background-color: rgba(11, 60, 43, 0.05);
  border: 1px dashed var(--color-primary);
  border-radius: 0.375rem; /* Reduced rounding */
  padding: 0.85rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Map Backdrop Click Overlay — Disabled so the map always receives user touches directly on the first tap */
#map-click-overlay {
  display: none !important;
  pointer-events: none !important;
}

/* Ensure Leaflet's internal tile/interaction panes stack correctly */
#map {
  position: relative;
  z-index: 1;
}

/* ==========================================================
   Continuous Pulsing Glow Animation for Selected Markers
   ========================================================== */

.mizizi-marker-badge.pulse-active .mizizi-marker-number {
  animation: main-marker-pulse 1.4s infinite cubic-bezier(0.28, 0.84, 0.42, 1);
}

.mizizi-alt-marker-badge.pulse-active .mizizi-alt-marker-number {
  animation: alt-marker-pulse 1.4s infinite cubic-bezier(0.28, 0.84, 0.42, 1);
}

@keyframes main-marker-pulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 0 rgba(229, 169, 60, 0.8), 0 2px 6px rgba(0, 0, 0, 0.3);
  }
  25% {
    transform: translateY(-12px) scale(1.1);
    box-shadow: 0 0 0 8px rgba(229, 169, 60, 0.4), 0 2px 12px rgba(0, 0, 0, 0.2);
  }
  50% {
    transform: translateY(1px) scale(0.95);
    box-shadow: 0 0 0 16px rgba(229, 169, 60, 0.2), 0 2px 4px rgba(0, 0, 0, 0.4);
  }
  75% {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 0 0 24px rgba(229, 169, 60, 0), 0 2px 8px rgba(0, 0, 0, 0.25);
  }
}

@keyframes alt-marker-pulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 0 rgba(229, 169, 60, 0.8), 0 1px 4px rgba(0, 0, 0, 0.25);
  }
  25% {
    transform: translateY(-10px) scale(1.1);
    box-shadow: 0 0 0 8px rgba(229, 169, 60, 0.4), 0 1px 10px rgba(0, 0, 0, 0.15);
  }
  50% {
    transform: translateY(1px) scale(0.95);
    box-shadow: 0 0 0 14px rgba(229, 169, 60, 0.2), 0 1px 3px rgba(0, 0, 0, 0.3);
  }
  75% {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 0 0 20px rgba(229, 169, 60, 0), 0 1px 6px rgba(0, 0, 0, 0.2);
  }
}

/* Floating Map Theme Toggle Button */
.map-theme-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background-color: rgba(247, 245, 240, 0.92); /* Glassmorphism Soft Sand */
  backdrop-filter: blur(8px);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem; /* Match brand rounding */
  color: var(--color-text-dark);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 10px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.07);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.map-theme-btn:hover {
  background-color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.map-theme-btn:active {
  transform: translateY(0);
}

.map-theme-btn.active {
  background-color: var(--color-primary); /* Deep Jungle Green active state */
  color: #FFFFFF;
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(11, 60, 43, 0.2);
}

.map-theme-btn.active svg {
  color: var(--color-accent); /* Gold icon when active */
}

/* Minimal/Low-Contrast Map Filter (De-saturates tiles to allow pins and connectors to pop) */
#map.minimal-map .leaflet-tile-pane {
  filter: grayscale(100%) brightness(0.94) contrast(1.08) saturate(0.65);
}

/* ==========================================================
   Phase 4: Floating Safari Audio Mini-Player & Full Sheet
   ========================================================== */

@keyframes mini-player-bounce-in {
  0% { transform: translate(-50%, 30px); opacity: 0; }
  60% { transform: translate(-50%, -4px); opacity: 1; }
  100% { transform: translate(-50%, 0); opacity: 1; }
}

#safari-mini-player {
  animation: mini-player-bounce-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

#safari-mini-player:hover {
  border-color: rgba(229, 169, 60, 0.6);
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.5), 0 0 15px rgba(229, 169, 60, 0.15);
}

/* Scrub Bar Thumb Interaction */
#now-playing-scrub-track:hover #now-playing-scrub-thumb {
  transform: translateY(-50%) translateX(-50%) scale(1.25);
}

#now-playing-scrub-track:active #now-playing-scrub-thumb {
  transform: translateY(-50%) translateX(-50%) scale(1.4);
}

/* Proximity Toast Animation */
@keyframes proximity-slide-down {
  0% { transform: translate(-50%, -20px); opacity: 0; }
  100% { transform: translate(-50%, 0); opacity: 1; }
}

#safari-proximity-toast {
  animation: proximity-slide-down 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Layout Adjustments when Global Audio Player is Visible */
body:has(.global-audio-player.visible) .leaflet-bottom {
  margin-bottom: 50px !important;
  transition: margin-bottom 0.35s ease;
}

body:has(.global-audio-player.visible) .sidebar-nav,
body:has(.global-audio-player.visible) .sidebar-details {
  padding-bottom: 50px !important;
  transition: padding-bottom 0.35s ease;
}

body:has(.global-audio-player.visible) .overlay-scroll-container {
  padding-bottom: 70px !important;
  transition: padding-bottom 0.35s ease;
}

@media (max-width: 480px) {
  body:has(.global-audio-player.visible) .leaflet-bottom {
    margin-bottom: 42px !important;
  }
  body:has(.global-audio-player.visible) .sidebar-nav,
  body:has(.global-audio-player.visible) .sidebar-details {
    padding-bottom: 42px !important;
  }
  body:has(.global-audio-player.visible) .overlay-scroll-container {
    padding-bottom: 56px !important;
  }
}

/* ===== Mobile UX and Viewport Height Fixes ===== */
@supports (height: 100dvh) {
  body, .app-wrapper, .map-container, .sidebar-container, .overlay-screen {
    height: 100dvh !important;
    min-height: 100dvh !important;
  }
}

/* Ensure scrollable containers have ample bottom breathing room on all mobile devices */
.details-body {
  padding-bottom: 5rem !important; /* Extra padding at the bottom of Column 2 stop details */
}

.sidebar-nav {
  padding-bottom: 5rem !important; /* Extra padding at the bottom of Column 1 navigation */
}

.overlay-scroll-container {
  padding-bottom: 6rem !important; /* Extra padding at the bottom of full-screen overlays */
}



/* ═══════════════════════════════════════════════════════════════════════════
   EDITORIAL MAGAZINE-STYLE GUIDE IMAGE LAYOUT
   Applied across all Detailed Guide overlay pages.
═══════════════════════════════════════════════════════════════════════════ */

/* ── Hero / Primary Image ───────────────────────────────────────────────── */
.editorial-hero {
  margin: 0 0 1.5rem 0;
  padding: 0;
  border-radius: 0.375rem;
  overflow: hidden;
  border: 1px solid #e7e5e4;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.editorial-hero__img {
  width: 100%;
  height: 14rem; /* 224px */
  object-fit: cover;
  display: block;
}

/* ── Float-Wrapped Body Figure ──────────────────────────────────────────── */
.editorial-figure {
  margin: 0.5rem 0 1rem;
  padding: 0;
  border-radius: 0.375rem;
  overflow: hidden;
  border: 1px solid #e7e5e4;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  background: #fafaf9;
  max-width: 46%;
}
.editorial-figure--left {
  float: left;
  margin: 0.25rem 1.5rem 1rem 0;
}
.editorial-figure--right {
  float: right;
  margin: 0.25rem 0 1rem 1.5rem;
}
.editorial-figure--full {
  float: none;
  max-width: 100%;
  margin: 0 0 1.5rem 0;
}
.editorial-figure__img {
  width: 100%;
  height: 9rem;
  object-fit: cover;
  display: block;
}
.editorial-figure__caption {
  font-size: 0.65rem;
  font-weight: 600;
  color: #78716c;
  padding: 0.4rem 0.65rem;
  line-height: 1.3;
  font-style: italic;
  border-top: 1px solid #e7e5e4;
}

/* ── Clearfix ──────────────────────────────────────────────────────────── */
.editorial-clearfix {
  clear: both;
  display: block;
  height: 0;
  overflow: hidden;
  margin: 0.75rem 0;
}

/* ── Overflow Gallery Grid (3+ images beyond hero) ─────────────────────── */
.editorial-overflow-gallery {
  clear: both;
  margin-top: 1.5rem;
}
.editorial-overflow-gallery__heading {
  font-size: 0.625rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #44403c;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e7e5e4;
  margin-bottom: 0.75rem;
}
.editorial-overflow-gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
}
.editorial-overflow-gallery__item {
  margin: 0;
  padding: 0;
  border-radius: 0.375rem;
  overflow: hidden;
  border: 1px solid #e7e5e4;
  background: #fafaf9;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: transform 0.18s ease;
}
.editorial-overflow-gallery__item:hover {
  transform: scale(1.02);
}
.editorial-overflow-gallery__img {
  width: 100%;
  height: 8rem;
  object-fit: cover;
  display: block;
}

/* ── Responsive: Mobile — Disable floats ───────────────────────────────── */
@media (max-width: 768px) {
  .editorial-figure,
  .editorial-figure--left,
  .editorial-figure--right {
    float: none !important;
    max-width: 100% !important;
    margin: 0 0 1.25rem 0 !important;
  }
  .editorial-figure__img {
    height: 11rem;
  }
  .editorial-clearfix {
    display: none;
  }
  .editorial-overflow-gallery__grid {
    grid-template-columns: 1fr;
  }
  .editorial-overflow-gallery__img {
    height: 11rem;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   OFFLINE PRINTABLE CHEAT SHEET & PDF EXPORT STYLES (Phase 6)
   ══════════════════════════════════════════════════════════════════════════ */

/* Hidden on normal screen unless rendered inside #pdf-preview-content */
#printable-cheat-sheet {
  display: none;
}

/* Screen Preview & Print Shared Styles */
.print-page {
  background: #ffffff;
  color: #1c1917;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: 12px 14px;
  box-sizing: border-box;
}

.print-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #0B3C2B;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.print-brand .print-title {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #0B3C2B;
  margin: 0;
  line-height: 1.2;
}

.print-brand .print-subtitle {
  font-size: 9.5px;
  font-weight: 600;
  color: #57534e;
  margin-top: 2px;
}

.print-sos-box {
  background: #fef2f2;
  border: 1.5px solid #dc2626;
  border-radius: 6px;
  padding: 4px 8px;
  text-align: right;
  flex-shrink: 0;
}

.print-sos-box .sos-tag {
  font-size: 8px;
  font-weight: 900;
  color: #b91c1c;
  letter-spacing: 0.08em;
  display: block;
}

.print-sos-box .sos-num {
  font-size: 9.5px;
  font-weight: 800;
  color: #991b1b;
  line-height: 1.3;
}

.print-section-title {
  font-size: 11px;
  font-weight: 900;
  color: #0B3C2B;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 8px 0 5px 0;
  border-left: 3px solid #E5A93C;
  padding-left: 6px;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
  line-height: 1.35;
  margin-bottom: 8px;
}

.print-table th {
  background-color: #0B3C2B;
  color: #ffffff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 6px;
  text-align: left;
  border: 1px solid #0B3C2B;
  font-size: 8.5px;
}

.print-table td {
  padding: 4px 6px;
  border: 1px solid #d6d3d1;
  vertical-align: top;
}

.print-table tbody tr:nth-child(even) {
  background-color: #fafaf9;
}

.print-table .saloon-row {
  background-color: #fffbeb !important;
}

.text-alert {
  color: #b45309;
  font-weight: 900;
}

.text-red {
  color: #dc2626;
  font-weight: 900;
}

.print-rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 6px 0;
}

.print-rule-card {
  background: #f5f5f4;
  border: 1px solid #d6d3d1;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 8.5px;
  line-height: 1.35;
}

.print-rule-card h3 {
  font-size: 9px;
  font-weight: 900;
  color: #0B3C2B;
  margin: 0 0 4px 0;
  letter-spacing: 0.04em;
}

.print-rule-card ul {
  margin: 0;
  padding-left: 12px;
}

.print-rule-card li {
  margin-bottom: 2px;
}

.print-rule-card.alert-card {
  background: #fefce8;
  border-color: #f59e0b;
}

.print-rule-card.alert-card h3 {
  color: #92400e;
}

.print-phrases-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}

.print-phrase-cat {
  background: #ffffff;
  border: 1px solid #d6d3d1;
  border-radius: 6px;
  padding: 5px 6px;
}

.print-phrase-cat h3 {
  font-size: 9px;
  font-weight: 900;
  color: #0B3C2B;
  margin: 0 0 3px 0;
  padding-bottom: 2px;
  border-bottom: 1px solid #e7e5e4;
}

.phrase-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 8.5px;
}

.phrase-table td {
  padding: 2.5px 4px;
  border-bottom: 1px solid #f5f5f4;
  vertical-align: top;
}

.sw-cell {
  color: #0B3C2B;
  font-weight: 800;
  width: 48%;
}

.en-cell {
  color: #57534e;
  width: 52%;
}

.emergency-table td {
  font-size: 8.5px;
  padding: 3.5px 6px;
}

.print-footer-strip {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #d6d3d1;
  padding-top: 4px;
  margin-top: 8px;
  font-size: 7.5px;
  font-weight: 600;
  color: #78716c;
}

/* ── Ink-Saver (B&W) Override ────────────────────────────────────────── */
.ink-saver-mode .print-header {
  border-bottom-color: #000000;
}
.ink-saver-mode .print-title {
  color: #000000;
}
.ink-saver-mode .print-sos-box {
  background: #ffffff;
  border-color: #000000;
}
.ink-saver-mode .print-sos-box .sos-tag,
.ink-saver-mode .print-sos-box .sos-num {
  color: #000000;
}
.ink-saver-mode .print-section-title {
  color: #000000;
  border-left-color: #000000;
}
.ink-saver-mode .print-table th {
  background-color: #f5f5f4;
  color: #000000;
  border-color: #000000;
}
.ink-saver-mode .print-table .saloon-row {
  background-color: #ffffff !important;
}
.ink-saver-mode .text-alert,
.ink-saver-mode .text-red {
  color: #000000;
}
.ink-saver-mode .sw-cell {
  color: #000000;
}

/* ── Native @media print Rules ────────────────────────────────────────── */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm;
  }

  /* Hide everything on page except #printable-cheat-sheet */
  body > *:not(#printable-cheat-sheet) {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #printable-cheat-sheet {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    background: #ffffff !important;
    color: #000000 !important;
  }

  .print-page {
    page-break-inside: avoid;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .print-page-1 {
    page-break-after: always;
    break-after: page;
  }

  .print-page-2 {
    page-break-after: avoid;
    break-after: avoid;
  }
}

