@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Open+Sans:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-formal: 'Cormorant Garamond', Georgia, serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Dark Theme (Default) */
  --oro-griego: #D4AF37;
  --dorado-sutil: #E1C16E;
  --marmol-blanco: #FDFDFD;
  --marmol-gris: #BFBFBF;
  --marmol-beige: #F4EBD8;
  --azul-marino: #0A192F;

  --bg-primary: var(--azul-marino);
  --bg-secondary: #061122;
  --bg-surface: rgba(10, 25, 47, 0.75);
  --bg-surface-elevated: rgba(10, 25, 47, 0.90);
  --bg-hover: rgba(212, 175, 55, 0.15);

  --border-subtle: rgba(212, 175, 55, 0.2);
  --border-strong: rgba(212, 175, 55, 0.4);
  --border-glow: rgba(212, 175, 55, 0.4);

  --text-primary: var(--marmol-blanco);
  --text-secondary: var(--marmol-beige);
  --text-muted: var(--marmol-gris);

  --accent-primary: var(--oro-griego);
  --accent-secondary: var(--dorado-sutil);
  --accent-gradient: linear-gradient(135deg, var(--oro-griego) 0%, var(--dorado-sutil) 100%);
  --accent-gold: var(--oro-griego);
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px rgba(212, 175, 55, 0.25);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-surface: rgba(255, 255, 255, 0.94);
  --bg-surface-elevated: #ffffff;
  --bg-hover: rgba(140, 102, 21, 0.08);

  --border-subtle: rgba(203, 213, 225, 0.8);
  --border-strong: rgba(148, 163, 184, 0.6);
  --border-glow: rgba(180, 130, 20, 0.25);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --accent-gold: #8c6615;
  --oro-griego: #8c6615;
  --dorado-sutil: #a1781c;
  --accent-primary: #8c6615;
  --accent-secondary: #a1781c;
  --accent-subtle: rgba(140, 102, 21, 0.08);
  --accent-gradient: linear-gradient(135deg, #a1781c 0%, #785610 100%);

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 20px rgba(140, 102, 21, 0.15);
}



/* Global Scrollbar Aesthetics (Sleek Dark Mode) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) rgba(15, 23, 42, 0.6);
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
  user-select: none;
}

.ambient-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(120px);
  opacity: 0.15;
  z-index: 0;
  transition: opacity 0.5s ease;
}

.ambient-glow.top-left {
  top: -150px;
  left: -150px;
  background: radial-gradient(circle, #38bdf8, transparent 70%);
}

.ambient-glow.bottom-right {
  bottom: -150px;
  right: -150px;
  background: radial-gradient(circle, #818cf8, transparent 70%);
}

#familyDiagram {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  outline: none;
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.02) 0%, transparent 80%);
}

.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-panel:hover {
  border-color: var(--border-strong);
}

/* Floating Top Navigation Bar */
.top-navbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  min-height: 64px;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  pointer-events: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.top-navbar.collapsed {
  transform: translateY(-100%);
}

/* Navbar Toggle Button (Flecha para ocultar/mostrar navbar) */
.navbar-toggle-btn {
  position: absolute;
  bottom: -28px;
  right: 28px;
  width: 36px;
  height: 28px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  border-top: none;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
  transition: all var(--transition-fast);
  pointer-events: auto;
  z-index: 101;
}

.navbar-toggle-btn:hover {
  background: var(--bg-hover);
  color: var(--accent-primary);
  height: 32px;
  bottom: -32px;
}

.navbar-toggle-btn .toggle-icon {
  font-size: 11px;
  display: inline-block;
  transition: transform 0.3s ease;
  line-height: 1;
}

.top-navbar.collapsed .navbar-toggle-btn .toggle-icon {
  transform: rotate(180deg);
}

.nav-left-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 480px;
}

/* ==================== SEPARACIÓN VISUAL NAVBAR: PC vs MOBILE ==================== */

/* Ocultar botón flecha toggle del navbar mientras la portada/landing esté visible */
body:not(.portal-active) .navbar-toggle-btn,
body:has(#landingOverlay:not(.hidden)) .navbar-toggle-btn {
  display: none !important;
}

/* En Desktop (PC) */
#desktopNavbar {
  display: flex !important;
}
#mobileNavbar {
  display: none !important;
}

/* Ajuste responsivo de la barra de navegación de árbol en pantallas medianas (769px a 1250px) */
@media (max-width: 1250px) and (min-width: 769px) {
  #desktopNavbar {
    padding: 8px 12px !important;
    gap: 8px !important;
  }
  #desktopNavbar .nav-left-group {
    max-width: 260px !important;
    gap: 6px !important;
  }
  #desktopNavbar .search-input {
    width: 110px !important;
    font-size: 0.78rem !important;
    padding: 6px 8px 6px 26px !important;
  }
  #desktopNavbar .nav-actions {
    gap: 5px !important;
  }
  #desktopNavbar .btn {
    padding: 6px 9px !important;
    font-size: 0.78rem !important;
    letter-spacing: 0px !important;
  }
  #desktopNavbar .navbar-toggle-btn {
    right: 14px !important;
  }
}

/* En Mobile (Smartphones <= 768px) */
@media (max-width: 768px) {
  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    height: 100% !important;
    height: 100dvh !important;
  }

  .ambient-glow {
    display: none !important;
  }

  #desktopNavbar {
    display: none !important;
  }
  #mobileNavbar {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    padding: 8px 12px 10px 12px !important;
    gap: 8px !important;
    background: rgba(10, 25, 47, 0.97) !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.35) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    min-height: auto !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45) !important;
  }

  /* Fila 1 de Mobile: Logo + Botones compactos */
  .mobile-nav-top-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
  }

  .mobile-brand {
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  .mobile-brand .brand-title-text {
    font-family: var(--font-formal, 'Cinzel', serif) !important;
    font-size: 1.02rem !important;
    font-weight: 700 !important;
    color: var(--accent-gold, #D4AF37) !important;
    letter-spacing: 0.8px !important;
  }

  .mobile-nav-quick-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  /* Botones circulares/píldora para acciones en móvil */
  .btn-mobile-icon {
    height: 34px !important;
    min-width: 34px !important;
    padding: 0 8px !important;
    border-radius: 9999px !important;
    background: rgba(212, 175, 55, 0.12) !important;
    border: 1px solid rgba(212, 175, 55, 0.35) !important;
    color: var(--accent-gold, #D4AF37) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
  }

  .btn-mobile-icon:active {
    transform: scale(0.92) !important;
    background: rgba(212, 175, 55, 0.25) !important;
  }

  /* Fila 2 de Mobile: Buscador completo + Foco Thiago */
  .mobile-nav-search-row {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .mobile-search-container {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    position: relative !important;
  }

  .mobile-focus-btn {
    flex-shrink: 0 !important;
    height: 36px !important;
    padding: 6px 14px !important;
    font-size: 0.82rem !important;
    white-space: nowrap !important;
  }

  /* Dropdown en Mobile */
  .mobile-dropdown {
    position: fixed !important;
    top: 52px !important;
    right: 12px !important;
    left: auto !important;
    width: min(300px, calc(100vw - 24px)) !important;
    max-height: 75vh !important;
    overflow-y: auto !important;
    z-index: 2500 !important;
  }

  .mobile-navbar-toggle {
    bottom: -22px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: 44px !important;
    height: 22px !important;
    border-radius: 0 0 12px 12px !important;
    font-size: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1001 !important;
  }

  .mobile-navbar.collapsed {
    transform: translateY(-100%) !important;
  }

  .mobile-navbar.collapsed .mobile-navbar-toggle .toggle-icon {
    transform: rotate(180deg) !important;
  }
}

/* Search Bar */
.search-container {
  flex: 1;
  max-width: 360px;
  position: relative;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  gap: 10px;
  transition: all var(--transition-fast);
}

.search-input-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.search-icon {
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text-primary);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  padding: 2px;
  font-size: 14px;
  transition: color var(--transition-fast);
}

.search-clear-btn:hover {
  color: var(--text-primary);
}

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 380px;
  overflow-y: auto;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 50;
  flex-direction: column;
}

.search-results-dropdown.active {
  display: flex;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--transition-fast);
}

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

.search-item:hover, .search-item.highlighted {
  background: var(--bg-hover);
}

.search-item-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  background: #1e293b;
  color: #fff;
}

.search-item-details {
  flex: 1;
  min-width: 0;
}

.search-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-meta {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* Stats Pill */
.stats-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.stat-pill strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* Actions Group in Topbar */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

/* Evitar espacios vacíos fantasmas si hay un span sin contenido dentro del botón */
.btn span:empty {
  display: none !important;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.5);
  filter: brightness(1.08);
}

.btn-secondary-purple {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  color: #ffffff;
  border: none;
}

.btn-icon-only {
  padding: 7px;
  width: 34px;
  height: 34px;
  justify-content: center;
  border-radius: var(--radius-md);
}

/* Canvas Controls */
.canvas-controls {
  position: absolute;
  left: 20px;
  bottom: 24px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
}

.canvas-controls .btn-icon-only {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  font-size: 16px;
}

.canvas-controls .divider {
  width: 100%;
  height: 1px;
  background: var(--border-subtle);
  margin: 2px 0;
}

/* Radar Minimap */
.overview-container {
  position: absolute;
  right: 20px;
  bottom: 24px;
  z-index: 10;
  width: 260px;
  height: 170px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--transition-smooth), opacity var(--transition-smooth);
}

.overview-container.collapsed {
  transform: translateY(180px);
  pointer-events: none;
  opacity: 0;
}

.overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 8px 6px;
}

.overview-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.overview-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  padding: 2px;
}

#overviewMap {
  width: 100%;
  flex: 1;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  outline: none;
}

.overview-fab {
  position: absolute;
  right: 20px;
  bottom: 24px;
  z-index: 9;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.overview-fab.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Filter Bar Floating */
.filter-toolbar {
  position: absolute;
  top: 82px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.filter-chip {
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.filter-chip.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-primary);
  border-color: rgba(56, 189, 248, 0.3);
}

/* Side Drawer (Person Inspector) */
.side-drawer {
  position: absolute;
  top: 80px;
  right: 20px;
  bottom: 24px;
  width: 400px;
  max-width: calc(100vw - 40px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(450px);
  transition: transform var(--transition-smooth);
}

.side-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 16px 18px 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-header h2 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.drawer-close-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.drawer-close-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.drawer-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.person-hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 16px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  position: relative;
}

.avatar-upload-wrapper {
  position: relative;
  cursor: pointer;
}

.person-hero-avatar {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-primary);
  box-shadow: var(--shadow-glow);
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  transition: filter var(--transition-fast);
}

.avatar-upload-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.avatar-upload-wrapper:hover .avatar-upload-overlay {
  opacity: 1;
}

.person-hero-name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.person-status-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.person-status-badge.alive {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.person-status-badge.deceased {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* Banner de investigación para parientes sueltos */
.investigation-banner {
  padding: 12px 14px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px dashed var(--accent-gold);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.investigation-banner-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 6px;
}

.investigation-banner-text {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.info-item {
  padding: 8px 12px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.info-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.info-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.bio-box {
  padding: 10px 12px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.relations-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.relation-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  gap: 10px;
  min-height: 42px;
}

.relation-card:hover {
  border-color: var(--accent-primary);
  background: var(--bg-hover);
  transform: translateX(3px);
}

.relation-card-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.relation-type-tag {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-primary);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.relation-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.relation-card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.drawer-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 8px;
}

.drawer-footer .btn {
  flex: 1;
  justify-content: center;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 6000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-overlay:not(.active) {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.modal-overlay:not(.active) * {
  pointer-events: none !important;
}

.modal-overlay.active {
  z-index: 6000 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

.modal-content {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  padding: 24px;
  transform: scale(0.95);
  transition: transform var(--transition-smooth);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

.form-group {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-body);
  font-size: 0.86rem;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.form-control:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

textarea.form-control {
  resize: vertical;
  min-height: 70px;
}

.modal-translation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.link-child-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Zona de Carga y Previsualización de Certificados y Fotos */
.file-upload-dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.file-upload-dropzone:hover {
  border-color: var(--accent-primary);
  background: var(--bg-hover);
}

/* Sección de Edición de Relaciones Familiares */
.relations-edit-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 14px 0;
}

.relations-edit-header {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.relations-edit-header .badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-primary);
  font-weight: 600;
}

.child-tag-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: 0.78rem;
  color: var(--text-primary);
}

.child-tag-unlink-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0 2px;
  transition: color var(--transition-fast);
}

.child-tag-unlink-btn:hover {
  color: var(--accent-rose);
}

.spouse-tag-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: 0.78rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.spouse-tag-item:hover {
  border-color: var(--accent-primary);
}

.spouse-tag-pill {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.spouse-tag-pill.married {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
}

.spouse-tag-pill.divorced {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}

.spouse-tag-pill.partnership {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.spouse-tag-pill.coparents {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

.spouse-tag-edit-btn,
.spouse-tag-unlink-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0 2px;
  display: inline-flex;
  align-items: center;
  transition: color var(--transition-fast);
}

.spouse-tag-edit-btn:hover {
  color: var(--accent-primary);
}

.spouse-tag-unlink-btn:hover {
  color: var(--accent-rose);
}

.link-spouse-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.certificate-preview-box {
  width: 100%;
  max-height: 240px;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  position: relative;
  margin-top: 8px;
}

.certificate-preview-img {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
}

/* Lista de parientes etiquetados en fotos grupales */
.participants-tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.participant-tag-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.participant-tag-item:hover {
  border-color: var(--accent-purple);
  color: var(--text-primary);
}

.participant-tag-item.selected {
  background: rgba(168, 85, 247, 0.2);
  border-color: var(--accent-purple);
  color: #f3e8ff;
  font-weight: 600;
}

.participant-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-purple);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 0 14px rgba(212, 175, 55, 0.2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
  max-width: 90vw;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .top-navbar {
    flex-wrap: wrap;
  }
  .search-container {
    order: 3;
    max-width: 100%;
    width: 100%;
  }
  .stats-badge-group {
    display: none;
  }
  .overview-container {
    width: 200px;
    height: 140px;
  }
  .focus-breadcrumb-bar {
    top: 130px;
    flex-direction: column;
    align-items: stretch;
    border-radius: var(--radius-md);
  }
}

/* Dynamic Pedigree Focus Breadcrumb Bar (Ventana de 4 Generaciones) */
.focus-breadcrumb-bar {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 18px;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  max-width: 94vw;
  animation: slideDownFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all var(--transition-normal);
}

.focus-breadcrumb-bar.hidden {
  display: none !important;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.focus-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.focus-indicator-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  color: #f59e0b;
  font-size: 0.84rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
  animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 14px #f59e0b; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.focus-label {
  font-weight: 500;
  opacity: 0.85;
}

.focus-gen-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.focus-bar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 620px;
  padding: 3px 6px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.focus-bar-nav::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
  width: 0;
  height: 0;
}

.focus-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.focus-nav-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
}

.focus-nav-btn.up {
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.focus-nav-btn.up:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
}

.focus-nav-btn.down {
  border-color: rgba(16, 185, 129, 0.35);
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

.focus-nav-btn.down:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
}

.focus-nav-btn.sibling {
  border-color: rgba(168, 85, 247, 0.35);
  color: #c084fc;
  background: rgba(168, 85, 247, 0.08);
}

.focus-nav-btn.sibling:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: #c084fc;
}

.focus-nav-btn.spouse {
  border-color: rgba(219, 39, 119, 0.35);
  color: #f472b6;
  background: rgba(219, 39, 119, 0.08);
}

.focus-nav-btn.spouse:hover {
  background: rgba(219, 39, 119, 0.22);
  border-color: #f472b6;
}

.focus-nav-btn.sibling:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: #c084fc;
}

.btn-focus-mode {
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.btn-focus-mode:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
}

.btn-focus-mode.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.25));
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
}

/* ==========================================================================
   LANDING PAGE DE ACCESO Y SOLICITUDES (FAMILIA FISCHER, KOCOUREK, LEMOS, FRANCO Y BROUSSE)
   ========================================================================== */
.landing-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg-primary);
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  width: 100vw;
  height: 100vh;
  box-sizing: border-box;
}

.landing-overlay.hidden {
  display: none !important;
}

/* Landing Top Navbar */
.landing-top-navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 84px;
  padding: 0 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2100;
  box-sizing: border-box;
  background: rgba(10, 25, 47, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.22);
  box-shadow: none;
}

.landing-nav-brand {
  font-family: var(--font-formal);
  font-size: 1.65rem;
  color: var(--accent-gold);
  font-weight: 700;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  user-select: none;
  text-shadow: 0 2px 10px rgba(212, 175, 55, 0.25);
  white-space: nowrap;
}

.landing-nav-links {
  display: flex;
  gap: 2.2rem;
  align-items: center;
  background: transparent;
  border: none;
  padding: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.mobile-only-nav-item {
  display: none;
}

.btn-landing-nav {
  background: transparent;
  border: none;
  color: var(--marmol-beige);
  font-family: var(--font-formal);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  padding: 8px 6px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-landing-nav::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent-gold);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateX(-50%);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent-gold);
}

.btn-landing-nav:hover {
  color: var(--accent-gold);
  transform: translateY(-1px);
}

.btn-landing-nav:hover::after {
  width: 100%;
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Selector de Idioma en Navbar Landing */
.landing-lang-wrapper {
  position: relative;
}

.btn-landing-lang {
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--accent-gold);
  font-family: var(--font-formal);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
}

.btn-landing-lang:hover {
  background: rgba(212, 175, 55, 0.18);
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.25);
}

.landing-lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(10, 25, 47, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-md);
  padding: 6px;
  display: none;
  flex-direction: column;
  min-width: 145px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.12);
  z-index: 2200;
  animation: fadeIn 0.2s ease-out;
}

.landing-lang-dropdown.active {
  display: flex;
}

.landing-lang-opt {
  background: transparent;
  border: none;
  color: var(--marmol-beige);
  font-family: var(--font-formal);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 9px 12px;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.landing-lang-opt:hover {
  background: rgba(212, 175, 55, 0.16);
  color: var(--accent-gold);
  transform: translateX(3px);
}

/* Botón Iniciar Sesión en Navbar */
.btn-landing-nav-login {
  background: linear-gradient(135deg, #D4AF37 0%, #C59B27 100%);
  color: #0A192F;
  font-family: var(--font-formal);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 10px 22px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-landing-nav-login svg {
  width: 18px;
  height: 18px;
}

.btn-landing-nav-login:hover {
  background: linear-gradient(135deg, #E1C16E 0%, #D4AF37 100%);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
  transform: translateY(-2px);
}

/* Botón Hamburguesa Móvil */
.btn-landing-mobile-menu {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 40px;
  height: 40px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 9px 8px;
  box-sizing: border-box;
  transition: all 0.25s ease;
}

.btn-landing-mobile-menu:hover {
  background: rgba(212, 175, 55, 0.18);
  border-color: var(--accent-gold);
}

.btn-landing-mobile-menu span {
  width: 100%;
  height: 2px;
  background-color: var(--accent-gold);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.btn-landing-mobile-menu.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.btn-landing-mobile-menu.active span:nth-child(2) {
  opacity: 0;
}

.btn-landing-mobile-menu.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Secciones de Landing Page */
.landing-section {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 85px;
  position: relative;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#section-hero {
  background-image: linear-gradient(180deg, rgba(10, 25, 47, 0.55) 0%, rgba(10, 25, 47, 0.82) 100%), url('../img/hero_bg.jpg');
}

#section-fischer {
  background-image: linear-gradient(180deg, rgba(10, 25, 47, 0.82) 0%, rgba(10, 25, 47, 0.90) 100%), url('../img/legacy_bg.jpg');
}

#section-kocourek {
  background-image: linear-gradient(180deg, rgba(10, 25, 47, 0.84) 0%, rgba(10, 25, 47, 0.92) 100%), url('../img/filigree_bg.jpg');
}

#section-otras {
  background-image: linear-gradient(180deg, rgba(10, 25, 47, 0.82) 0%, rgba(10, 25, 47, 0.90) 100%), url('../img/hero_bg.jpg');
}

#section-login {
  background-image: linear-gradient(180deg, rgba(10, 25, 47, 0.78) 0%, rgba(10, 25, 47, 0.90) 100%), url('../img/filigree_bg.jpg');
}

.landing-info-panel {
  background: rgba(10, 25, 47, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vh, 32px) clamp(24px, 3.5vw, 42px);
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.7), 0 0 25px rgba(212, 175, 55, 0.1);
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.landing-panel-badge,
.landing-tags-row {
  /* badges y tags activos en exhibicion editorial */
}

.landing-section-image {
  width: auto;
  max-width: min(100%, 880px);
  height: auto;
  max-height: clamp(220px, 37vh, 360px);
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  margin: 0 auto 6px auto;
  border-radius: 12px;
  border: 2px solid rgba(212, 175, 55, 0.52);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.85), 0 0 24px rgba(212, 175, 55, 0.22);
  display: block;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.landing-section-image:hover {
  transform: scale(1.01);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.9), 0 0 32px rgba(212, 175, 55, 0.32);
}

.landing-section-image-caption {
  font-family: var(--font-body, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: clamp(0.82rem, 1vw, 0.92rem);
  font-style: italic;
  color: rgba(212, 175, 55, 0.92);
  text-align: center;
  margin: 6px auto 14px auto;
  max-width: 880px;
  line-height: 1.4;
  letter-spacing: 0.25px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
  display: block;
}

.landing-section.no-image .landing-section-image,
.landing-section-image:not([src]),
.landing-section-image[src=""],
.landing-section-image[style*="display: none"] {
  display: none !important;
}

.landing-section.no-image .landing-section-image-caption,
.landing-section-image-caption[style*="display: none"] {
  display: none !important;
}

.landing-section-heading {
  font-family: var(--font-formal, inherit);
  color: var(--accent-gold, #D4AF37);
  font-size: clamp(1.42rem, 2.1vw, 1.9rem);
  margin: 0 0 6px 0;
  letter-spacing: 0.6px;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.7);
  text-align: center;
}

.landing-section-text {
  font-family: var(--font-body, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: clamp(0.9rem, 1.02vw, 1rem);
  line-height: 1.58;
  color: var(--marmol-beige, #EAE6DF);
  text-align: center;
  text-wrap: balance;
  max-width: 840px;
  margin: 0 auto;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.landing-section-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
}

.btn-primary-landing {
  background: linear-gradient(135deg, #D4AF37 0%, #C59B27 100%);
  color: #0A192F;
  font-family: var(--font-formal);
  font-size: 0.98rem;
  font-weight: 700;
  padding: 9px 22px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.3);
}

.btn-primary-landing:hover {
  background: linear-gradient(135deg, #E1C16E 0%, #D4AF37 100%);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.55);
  transform: translateY(-2px);
}

.btn-secondary-landing {
  background: rgba(10, 25, 47, 0.8);
  color: var(--marmol-beige);
  font-family: var(--font-formal);
  font-size: 0.98rem;
  font-weight: 600;
  padding: 9px 20px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-secondary-landing:hover {
  background: rgba(212, 175, 55, 0.18);
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  transform: translateY(-2px);
}

.landing-section-content {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 2;
}

.landing-hero-title {
  font-family: var(--font-formal);
  font-size: 3.4rem;
  color: var(--accent-gold);
  margin-bottom: 1.2rem;
  text-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
}

.landing-hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.landing-photo-placeholder {
  width: 100%;
  max-width: 800px;
  height: 350px;
  background: var(--bg-surface-elevated);
  border: 2px dashed var(--accent-gold);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  color: var(--text-muted);
}

.landing-family-buttons {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.btn-landing-family {
  padding: 1rem 2.5rem;
  font-size: 1.2rem;
  border-radius: var(--radius-full);
  background: rgba(10, 25, 47, 0.8);
  border: 2px solid var(--accent-gold);
  color: var(--marmol-blanco);
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: var(--font-formal);
  text-decoration: none;
}

.btn-landing-family:hover {
  background: var(--accent-gold);
  color: var(--bg-primary);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}

.btn-landing-scroll {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 25, 47, 0.85);
  border: 1.5px solid rgba(212, 175, 55, 0.6);
  color: var(--accent-gold);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: bounceLanding 2.4s infinite;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8), 0 0 14px rgba(212, 175, 55, 0.25);
  transition: all 0.3s ease;
  z-index: 50;
  margin: 0;
}

.btn-landing-scroll:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: #F5E6B3;
  color: #F5E6B3;
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.6);
  transform: translateX(-50%) translateY(-3px);
}

@keyframes bounceLanding {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-5px); }
  60% { transform: translateX(-50%) translateY(-2px); }
}

/* RESPONSIVE DESIGN PARA MÓVIL Y TABLET (LANDING PAGE) */
@media (max-width: 1120px) {
  .landing-top-navbar {
    height: 68px;
    padding: 0 20px;
  }

  .landing-nav-brand {
    font-size: 1.25rem;
  }

  .landing-nav-links {
    position: fixed;
    top: 68px;
    left: 0;
    width: 100vw;
    background: rgba(10, 25, 47, 0.98);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.35);
    padding: 16px 20px;
    display: none;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
    transform: none;
    z-index: 2150;
    box-sizing: border-box;
  }

  .landing-nav-links.mobile-open {
    display: flex;
    animation: fadeInDown 0.25s ease-out;
  }

  .btn-landing-nav {
    width: 100%;
    text-align: left;
    font-size: 1.1rem;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.12);
  }

  .btn-landing-mobile-menu {
    display: flex;
  }
}

@media (max-width: 768px) {
  .btn-landing-nav-login {
    display: none;
  }

  .mobile-only-nav-item {
    display: block !important;
    background: linear-gradient(135deg, #D4AF37 0%, #C59B27 100%) !important;
    color: #0A192F !important;
    font-weight: 700 !important;
    border-radius: var(--radius-md) !important;
    text-align: center !important;
    margin-top: 6px !important;
    border: none !important;
  }
}

@media (max-width: 768px) {
  .landing-overlay {
    scroll-snap-type: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .landing-section {
    min-height: 100vh;
    height: auto !important;
    padding: 80px 16px 75px !important;
    scroll-snap-align: none !important;
    overflow-y: visible !important;
    position: relative !important;
  }

  .landing-hero-title {
    font-size: 2.1rem !important;
    margin-bottom: 0.8rem !important;
    line-height: 1.25 !important;
  }

  .landing-hero-subtitle {
    font-size: 1.02rem !important;
    margin-bottom: 2rem !important;
    padding: 0 8px !important;
  }

  .landing-info-panel {
    padding: 20px 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .landing-section-image {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: clamp(180px, 30vh, 270px) !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    margin-bottom: 6px !important;
    border-radius: 8px !important;
  }

  .landing-section-image-caption {
    font-size: 0.82rem !important;
    margin: 4px auto 8px auto !important;
  }

  .landing-section-heading {
    font-size: 1.55rem !important;
    line-height: 1.3 !important;
    margin: 4px 0 6px 0 !important;
  }

  .landing-section-text {
    font-size: 0.95rem !important;
    line-height: 1.55 !important;
  }

  .landing-tags-row {
    gap: 6px !important;
    margin-bottom: 10px !important;
  }

  .landing-tag {
    font-size: 0.76rem !important;
    padding: 3px 8px !important;
  }

  .landing-section-actions {
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
  }

  .landing-section-actions button {
    width: 100% !important;
    justify-content: center !important;
  }

  .landing-card {
    padding: 24px 16px !important;
    max-width: 100% !important;
    margin: 16px auto !important;
  }

  .btn-landing-scroll {
    display: flex !important;
    bottom: 16px !important;
    width: 40px !important;
    height: 40px !important;
  }
}


.landing-card {
  width: 100%;
  max-width: 580px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(212, 175, 55, 0.15);
  padding: 32px 36px;
  background: rgba(10, 25, 47, 0.94);
  animation: fadeInScale 0.35s ease-out;
}

.landing-header {
  text-align: center;
  margin-bottom: 24px;
}

.landing-crest {
  font-size: 2.8rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px rgba(245, 158, 11, 0.4));
}

.landing-title {
  font-family: var(--font-formal);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #f8fafc;
  line-height: 1.35;
  margin-bottom: 12px;
}

.landing-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #f59e0b, transparent);
  margin: 0 auto 14px auto;
}

.landing-desc {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-style: italic;
}

.landing-privacy-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--accent-gold);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  box-shadow: inset 0 0 8px rgba(212, 175, 55, 0.1);
}

.landing-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
  padding-bottom: 8px;
}

.landing-tab-btn {
  flex: 1;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: rgba(148, 163, 184, 0.6); /* Azulado grisáceo apagado */
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.landing-tab-btn:hover {
  color: var(--marmol-blanco);
  background: rgba(255, 255, 255, 0.05);
}

.landing-tab-btn.active {
  color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.12);
  border-bottom: 2px solid var(--accent-gold);
}

/* Formularios - Inputs con iconos */
.input-with-icon .input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-gold, #D4AF37);
  opacity: 0.85;
  pointer-events: none;
  z-index: 3;
  width: 18px;
  height: 18px;
}

.input-with-icon .form-control,
.input-with-icon input.form-control {
  padding-left: 44px !important;
  padding-right: 14px !important;
  padding-top: 13px !important;
  padding-bottom: 13px !important;
  height: 48px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md, 8px);
  transition: all 0.2s ease;
  background: rgba(10, 25, 47, 0.65);
  color: #fff;
  font-size: 0.96rem;
}

.input-with-icon .form-control.input-password-toggleable,
.input-with-icon input.form-control.input-password-toggleable {
  padding-right: 48px !important;
}

.input-with-icon .form-control:focus,
.input-with-icon input.form-control:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.35);
  outline: none;
  background: rgba(10, 25, 47, 0.88);
}

.btn-toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 6px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  color: rgba(212, 175, 55, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  z-index: 5;
  transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.btn-toggle-password:hover {
  color: #F5E6B3;
  background: rgba(212, 175, 55, 0.15);
  transform: translateY(-50%) scale(1.08);
}

.btn-toggle-password:active {
  transform: translateY(-50%) scale(0.95);
}

/* Boton login refinado */
.btn-login-submit {
  background: linear-gradient(180deg, rgba(225, 193, 110, 1) 0%, rgba(212, 175, 55, 1) 100%);
  color: var(--bg-primary);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 4px 12px rgba(212, 175, 55, 0.3);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-login-submit:hover {
  background: linear-gradient(180deg, rgba(235, 203, 120, 1) 0%, rgba(222, 185, 65, 1) 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 6px 16px rgba(212, 175, 55, 0.4);
  transform: translateY(-1px);
}

.landing-help-text {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 16px;
}

.landing-help-text a {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
}

.landing-help-text a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   PANEL DE ADMINISTRACIÓN (/admin)
   ========================================================================== */
.btn-admin {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #f59e0b;
  font-weight: 700;
}

.btn-admin:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: #f59e0b;
}

.user-pill {
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--text-primary);
}

.badge-role {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: #f59e0b;
  color: #0f172a;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.admin-tab-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.admin-tab-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.admin-tab-btn.active {
  background: rgba(245, 158, 11, 0.14);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.35);
}

.tab-badge {
  background: #ef4444;
  color: #ffffff;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.admin-table th {
  text-align: left;
  padding: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* ==========================================================================
   CONTACT SECTION IN SIDE DRAWER
   ========================================================================== */
.drawer-contact-card {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
}

.drawer-contact-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.drawer-contact-item a {
  color: #38bdf8;
  text-decoration: none;
}

.drawer-contact-item a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   GALERÍA DE EVENTOS FAMILIARES Y FOTOS GRUPALES
   ========================================================================== */
.events-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 6px 2px;
}

.event-gallery-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.event-gallery-card:hover {
  transform: translateY(-2px);
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.event-gallery-img-box {
  width: 100%;
  height: 170px;
  background: rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-gallery-no-img {
  font-size: 2.5rem;
  opacity: 0.6;
}

.event-gallery-badge-date {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #c084fc;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.event-gallery-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.event-gallery-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 4px;
}

.event-gallery-place {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.event-gallery-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 12px;
  flex: 1;
}

.event-gallery-participants-box {
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  margin-top: auto;
}

.event-gallery-participants-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.event-gallery-participants-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.event-participant-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 0.72rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.event-participant-chip:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #38bdf8;
}

.event-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

/* ==================== DROPDOWN MENU DE OPCIONES ==================== */
.dropdown-wrapper {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.dropdown-menu.active {
  display: flex;
  animation: fadeIn 0.18s ease forwards;
}

.dropdown-item-header {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--accent-subtle);
  color: var(--accent-primary);
}

.dropdown-item-danger {
  color: #f43f5e;
}

.dropdown-item-danger:hover {
  background: rgba(244, 63, 94, 0.12);
  color: #f43f5e;
}

/* ==================== ESTILOS PARA EVENTOS.HTML ==================== */
.events-page-body {
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  width: 100%;
}

.events-page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 24px 80px 24px;
  position: relative;
  z-index: 2;
  width: 100%;
  box-sizing: border-box;
}

.events-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.events-page-title-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.events-header-quick-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.events-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-btn-text-short {
  display: none;
}

.events-page-title-group h1 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.events-page-title-group p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.events-filter-bar {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.events-filter-search {
  flex: 1;
  min-width: 260px;
  max-width: 440px;
  position: relative;
}

.events-grid-full {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 24px;
  width: 100%;
  box-sizing: border-box;
}

.event-full-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.event-full-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.event-full-card-img-wrap {
  width: 100%;
  height: 220px;
  background: rgba(0, 0, 0, 0.15);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

[data-theme="light"] .event-full-card-img-wrap {
  background: rgba(0, 0, 0, 0.05);
}

.event-full-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.event-full-card:hover .event-full-card-img {
  transform: scale(1.03);
}

/* Visor y tarjeta de archivo PDF para eventos */
.event-pdf-card-wrap {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.88) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 16px;
  box-sizing: border-box;
  text-align: center;
  position: relative;
  border-bottom: 1px solid rgba(212, 175, 55, 0.22);
}

[data-theme="light"] .event-pdf-card-wrap {
  background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.event-pdf-badge-type {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(239, 68, 68, 0.22);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.45);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 3px 9px;
  border-radius: var(--radius-full, 9999px);
  text-transform: uppercase;
}

.event-pdf-icon-huge {
  font-size: 3.4rem;
  line-height: 1;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px rgba(239, 68, 68, 0.4));
  transition: transform 0.3s ease;
}

.event-full-card:hover .event-pdf-icon-huge {
  transform: scale(1.1) translateY(-2px);
}

.event-pdf-title-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 12px;
}

.btn-view-pdf {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  background: rgba(212, 175, 55, 0.16);
  color: #d4af37;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: var(--radius-full, 9999px);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-view-pdf:hover {
  background: #d4af37;
  color: #0b1329;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4);
}

.file-upload-dropzone.drag-active {
  border-color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.18) !important;
  transform: scale(1.01);
}

.event-full-card-content {
  padding: 18px 20px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.event-full-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.event-full-card-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.35;
}

.event-full-card-place {
  font-size: 0.8rem;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.event-full-card-desc {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.event-gallery-badge-date {
  position: absolute;
  top: 10px;
  right: 10px;
  max-width: calc(100% - 20px);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  z-index: 3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.event-card-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

/* ==================== RESPONSIVE PARA EVENTOS.HTML ==================== */
@media (max-width: 860px) {
  .events-page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 16px;
  }

  .events-page-title-group {
    width: 100%;
    justify-content: space-between;
  }

  .events-nav-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .events-hero-section {
    padding: 22px 20px;
  }

  .events-hero-section h1 {
    font-size: 1.35rem;
  }
}

@media (max-width: 640px) {
  .nav-btn-text-full {
    display: none;
  }

  .nav-btn-text-short {
    display: inline;
  }

  .events-page-container {
    padding: 12px 10px 60px 10px;
    width: 100%;
  }

  .events-page-header {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    gap: 10px;
  }

  .events-nav-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  .btn-back-tree {
    padding: 7px 11px;
    font-size: 0.8rem;
    gap: 4px;
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
  }

  .btn-add-event-header {
    padding: 7px 14px !important;
    font-size: 0.82rem !important;
    flex: 2 1 100%;
    justify-content: center;
  }

  .events-hero-section {
    padding: 16px 14px !important;
    margin-bottom: 14px !important;
    border-radius: var(--radius-md) !important;
  }

  .events-hero-section h1 {
    font-size: 1.22rem !important;
    line-height: 1.3 !important;
    margin-bottom: 6px !important;
  }

  .events-hero-section p {
    font-size: 0.82rem !important;
    line-height: 1.45 !important;
  }

  .events-hero-section::after {
    display: none !important;
  }

  .events-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 14px;
  }

  .events-filter-search {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .events-filter-search .search-input {
    font-size: 0.84rem;
    padding: 9px 12px 9px 36px;
  }

  .events-filter-bar > div:last-child {
    text-align: right;
    font-size: 0.78rem;
    margin-left: 0 !important;
  }

  .events-grid-full {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    width: 100% !important;
  }

  .event-full-card {
    border-radius: var(--radius-md);
    width: 100% !important;
    max-width: 100% !important;
  }

  .event-full-card-img-wrap {
    height: 185px;
  }

  .event-full-card-content {
    padding: 14px 12px;
  }

  .event-full-card-title {
    font-size: 1.05rem;
    line-height: 1.35;
  }

  .event-full-card-desc {
    font-size: 0.82rem;
    line-height: 1.45;
    margin-bottom: 12px;
  }

  .event-tag-interactive {
    font-size: 0.72rem;
    padding: 3px 8px;
  }

  .event-card-actions-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  .event-card-actions-row .btn {
    flex: 1 1 auto;
    justify-content: center;
    padding: 7px 10px;
    font-size: 0.78rem;
  }

  /* Modal de Eventos en móvil */
  #eventModal .modal-content {
    width: 95vw !important;
    max-width: 95vw !important;
    margin: 10px auto !important;
    padding: 16px 12px !important;
    border-radius: var(--radius-md) !important;
  }

  #eventModal .file-upload-dropzone {
    padding: 14px 10px !important;
  }

  #eventModal .file-upload-dropzone span:first-child {
    font-size: 1.8rem !important;
  }

  #eventModal .form-row {
    flex-direction: column !important;
    gap: 10px !important;
  }

  #eventModal .modal-actions {
    flex-direction: column-reverse !important;
    gap: 8px !important;
  }

  #eventModal .modal-actions .btn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 40px !important;
  }
}

@media (max-width: 400px) {
  .events-nav-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
  }

  .events-nav-actions .btn-back-tree,
  .events-nav-actions .btn-add-event-header {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
    text-align: center;
    padding: 6px 4px;
    font-size: 0.76rem;
  }

  .events-nav-actions .btn-add-event-header {
    grid-column: 1 / -1;
  }
}

/* ==================== PANEL LATERAL IZQUIERDO: ÁRBOL DE ARCHIVOS DE ANTEPASADOS ==================== */
.ancestor-file-tree-drawer {
  position: absolute;
  top: 86px;
  left: 20px;
  bottom: 24px;
  width: 360px;
  max-width: calc(100vw - 40px);
  z-index: 15;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform var(--transition-normal), opacity var(--transition-normal);
  overflow: hidden;
}

.ancestor-file-tree-drawer.collapsed {
  transform: translateX(-380px);
  opacity: 0;
  pointer-events: none;
}

.ancestor-tree-header {
  padding: 14px 16px 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.ancestor-tree-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ancestor-tree-header-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.ancestor-tree-header-title span {
  font-size: 0.72rem;
  color: var(--text-secondary);
  display: block;
}

/* Pestañas de navegación en el panel izquierdo */
.sidebar-tabs-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-tab-btn.active {
  background: var(--bg-surface-elevated);
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

/* Buscador del directorio */
.sidebar-search-box {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-search-box input {
  font-size: 0.8rem;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
}

/* Acordeones por familia */
.family-accordion-group {
  margin-bottom: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.family-accordion-group:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.family-accordion-header {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.025);
  user-select: none;
  transition: background var(--transition-fast);
}

.family-accordion-header:hover {
  background: var(--bg-hover);
}

.family-accordion-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
}

.family-count-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.accordion-chevron {
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.family-accordion-group.open .accordion-chevron {
  transform: rotate(180deg);
}

.family-accordion-body {
  display: none;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid var(--border-subtle);
}

.family-accordion-group.open .family-accordion-body {
  display: flex;
}

/* Fila de miembro familiar en el directorio */
.family-member-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.family-member-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  background: var(--bg-hover);
  transform: translateX(2px);
}

.family-member-card.is-active-member {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.08);
}

.family-member-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.member-gender-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: bold;
  flex-shrink: 0;
}

.member-gender-avatar.M {
  background: rgba(2, 132, 199, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.member-gender-avatar.F {
  background: rgba(219, 39, 119, 0.15);
  color: #f472b6;
  border: 1px solid rgba(244, 114, 182, 0.4);
}

.member-gender-avatar.default {
  background: rgba(217, 119, 6, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.member-meta-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.member-name-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-relations-sub {
  font-size: 0.69rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-sidebar-quick-edit {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.76rem;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.btn-sidebar-quick-edit:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: scale(1.08);
}

.ancestor-tree-fab {
  position: absolute;
  top: 86px;
  left: 20px;
  z-index: 14;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.ancestor-file-tree-drawer:not(.collapsed) ~ .ancestor-tree-fab {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
}

.ancestor-tree-container {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  font-family: var(--font-body);
}

.ancestor-tree-root {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ancestor-file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.ancestor-file-item:hover {
  background: var(--accent-subtle);
  border-color: rgba(56, 189, 248, 0.25);
  color: var(--accent-primary);
}

.ancestor-file-item.is-focal-root {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #f59e0b;
  font-weight: 700;
}

.file-icon {
  font-size: 1rem;
  line-height: 1;
}

.file-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: normal;
}

.badge-you {
  font-size: 0.65rem;
  padding: 1px 6px;
  background: #f59e0b;
  color: #0f172a;
  border-radius: var(--radius-full);
  font-weight: 800;
  margin-left: 4px;
}

.ancestor-sublist {
  list-style: none;
  padding-left: 18px;
  margin: 4px 0 6px 4px;
  border-left: 1px dashed var(--border-subtle);
  position: relative;
}

.ancestor-branch {
  margin-top: 4px;
}

.branch-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 2px;
}

.branch-tag-father {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

.branch-tag-mother {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.1);
}

/* ==================== SELECTOR DE IDIOMA ==================== */
.lang-selector-wrapper {
  position: relative;
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 120;
}

.lang-dropdown-menu.active {
  display: flex;
}

.lang-option-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  width: 100%;
}

.lang-option-btn:hover {
  background: var(--accent-subtle);
  color: var(--accent-primary);
}

.lang-option-btn.active-lang {
  background: rgba(56, 189, 248, 0.18);
  color: var(--accent-primary);
  font-weight: 700;
}

/* ==================== BANDERITAS SVG Y BADGES DE PAÍS ==================== */
.flag-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.2;
}

.flag-img-icon {
  width: 14px;
  height: 10px;
  border-radius: 1.5px;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  display: inline-block;
}

/* ==================== SELECTOR DE PÍLDORAS DEL NAVEGADOR DE FAMILIAS ==================== */
.family-nav-pills-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border-subtle);
}

.family-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.family-pill-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(56, 189, 248, 0.4);
}

.family-pill-btn.active {
  background: var(--accent-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.35);
}

/* ==================== DETALLES DE CABECERA Y SUBRAMAS DE FAMILIA ==================== */
.family-title-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.family-desc-sub {
  font-size: 0.65rem;
  font-weight: normal;
  color: var(--text-muted);
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.family-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-family-focus {
  padding: 3px 7px;
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--accent-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-family-focus:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.family-subbranch-block {
  margin-bottom: 8px;
}

.family-subbranch-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-gold);
  border-left: 2px solid var(--accent-gold);
  margin-bottom: 4px;
  background: rgba(245, 158, 11, 0.06);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.subbranch-count {
  font-weight: normal;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.family-subbranch-members {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* ==================== MIEMBROS VINCULANTES Y BOTONES DE SALTO ==================== */
.badge-linking {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  background: rgba(14, 165, 233, 0.18);
  color: #0284c7;
  border: 1px solid rgba(14, 165, 233, 0.3);
  margin-left: 5px;
  letter-spacing: 0.02em;
}

.member-crosslinks-bar {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 5px;
}

.btn-linking-jump {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(56, 189, 248, 0.1));
  border: 1px solid rgba(14, 165, 233, 0.35);
  color: #38bdf8;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  width: fit-content;
}

.btn-linking-jump:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.3), rgba(56, 189, 248, 0.25));
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateX(3px);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
}

.family-member-card.has-crosslink {
  border-left: 3px solid #0284c7;
}

/* ==================== BANNER DE MIEMBRO VINCULANTE EN DRAWER ==================== */
.drawer-linking-banner {
  margin: 12px 0;
}

.drawer-linking-member-box {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(30, 41, 59, 0.5));
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.linking-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.linking-icon {
  font-size: 1.1rem;
}

.linking-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #38bdf8;
}

.linking-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.linking-item:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.linking-description {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.btn-linking-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  border: none;
  color: #ffffff;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 3px 10px rgba(56, 189, 248, 0.3);
}

.btn-linking-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(56, 189, 248, 0.45);
}



/* Soporte de modo claro en contenedor nativo */
[data-theme="light"] body,
[data-theme="light"] #nativeTreeContainer,
[data-theme="light"] #familyDiagram {
  background-color: #f1f5f9 !important;
}

/* NATIVE PEDIGREE ENGINE STYLES */

.pan-zoom-container {
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  cursor: grab;
  z-index: 10;
}
.pan-zoom-container:active {
  cursor: grabbing;
}

#nativeTreeSurface {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

#treeLinesLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}

@keyframes cardAppear {
  0% {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.92);
  }
  60% {
    opacity: 0.95;
    transform: translate(-50%, -50.5%) scale(1.015);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes lineFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.tree-line {
  stroke: rgba(240, 244, 255, 0.85); /* Color claro luminoso en modo oscuro para alto contraste */
  stroke-width: 2.5px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s ease;
  animation: lineFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

[data-theme="light"] .tree-line {
  stroke: #0f172a !important; /* Negro / azul muy oscuro en modo claro para contraste óptimo */
  stroke-width: 2.5px;
}

#treeNodesLayer {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

/* ==========================================================================
   TARJETAS DEL ÁRBOL GENEALÓGICO (FULL-COVER PHOTO & CINEMATIC DESIGN)
   ========================================================================== */
.native-person-card {
  position: absolute;
  width: 160px;
  height: 210px;
  background: #0b111e;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  user-select: none;
  contain: layout style;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: visible; /* Permite ver los botones expansores ▴ y ▾ */
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.native-person-card:hover {
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.75), 0 0 25px rgba(212, 175, 55, 0.35);
  z-index: 10;
}

/* Distinción visual sutil por género en el borde */
.native-person-card[data-gender="M"] {
  border-color: rgba(14, 165, 233, 0.55);
}
.native-person-card[data-gender="M"]:hover {
  border-color: #38bdf8;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.75), 0 0 25px rgba(14, 165, 233, 0.45);
}

.native-person-card[data-gender="F"] {
  border-color: rgba(244, 63, 94, 0.55);
}
.native-person-card[data-gender="F"]:hover {
  border-color: #fb7185;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.75), 0 0 25px rgba(244, 63, 94, 0.45);
}

.native-person-card[data-gender="U"] {
  border-color: rgba(168, 85, 247, 0.55);
}
.native-person-card[data-gender="U"]:hover {
  border-color: #c084fc;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.75), 0 0 25px rgba(168, 85, 247, 0.45);
}

/* 1. Zona de fotografía / retrato (70% superior de la tarjeta) */
.card-media-zone {
  position: relative;
  width: 100%;
  height: 70%;
  flex: 0 0 70%;
  max-height: 70%;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  background: radial-gradient(circle at 50% 35%, #1e293b 0%, #090e17 100%);
}

.card-media-zone .card-cover-media {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  transition: transform 0.3s ease;
}

.native-person-card:hover .card-media-zone .card-cover-media {
  transform: scale(1.06);
}

.card-media-zone .card-cover-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, #1e293b 0%, #090e17 100%);
}

.card-monogram-watermark {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--accent-gold, #D4AF37);
  opacity: 0.32;
  user-select: none;
}

/* 2. Zona de información (30% inferior de la tarjeta: Nombre y Años de vida) */
.card-info-zone {
  position: relative;
  width: 100%;
  height: 30%;
  flex: 0 0 30%;
  max-height: 30%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  box-sizing: border-box;
  background: rgba(11, 17, 30, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 0 12px 12px;
  text-align: center;
  overflow: hidden;
  pointer-events: none;
}

.native-person-name {
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 700;
  color: #f8fafc;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.native-person-dates {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.2px;
  line-height: 1.2;
  margin-top: 2px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}


/* ==========================================================================
   VISOR DE FOTOS EN PANTALLA COMPLETA (LIGHTBOX MODAL)
   ========================================================================== */
.lightbox-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(3, 7, 18, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeInLightbox 0.22s ease forwards;
  opacity: 1 !important;
  pointer-events: auto !important;
}

@keyframes fadeInLightbox {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-modal-card {
  position: relative;
  width: 100%;
  max-width: 980px;
  max-height: 92vh;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 20px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px rgba(212, 175, 55, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleUpLightbox 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto !important;
}

.lightbox-modal-header,
.lightbox-header-actions,
.lightbox-upload-btn,
.lightbox-close-btn,
#lightboxSetPrimaryBtn,
.lightbox-stage,
.lightbox-stage-arrow,
.lightbox-thumbnails-track,
.lightbox-thumb {
  pointer-events: auto !important;
}

@keyframes scaleUpLightbox {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.lightbox-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 18, 32, 0.85);
}

.lightbox-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lightbox-avatar-mini {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4af37, #b45309);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.lightbox-person-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
  line-height: 1.2;
}

.lightbox-counter-badge {
  font-size: 0.74rem;
  color: #fbbf24;
  font-weight: 600;
  display: block;
  margin-top: 2px;
}

.lightbox-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lightbox-upload-btn {
  font-size: 0.78rem;
  padding: 6px 12px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: #fbbf24;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  background: rgba(212, 175, 55, 0.1);
  transition: all 0.2s ease;
}

.lightbox-upload-btn:hover {
  background: rgba(212, 175, 55, 0.22);
  border-color: #fbbf24;
  color: #ffffff;
}

.lightbox-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.lightbox-close-btn:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  transform: scale(1.1);
}

.lightbox-stage {
  position: relative;
  flex: 1;
  min-height: 380px;
  max-height: calc(88vh - 160px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgba(30, 41, 59, 0.5) 0%, rgba(8, 13, 24, 0.98) 100%);
  overflow: hidden;
  padding: 16px 64px;
}

.lightbox-stage-media {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-main-img {
  max-width: 100%;
  max-height: calc(75vh - 140px);
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
  transition: transform 0.25s ease;
}

.lightbox-stage-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: #fbbf24;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.lightbox-stage-arrow.prev {
  left: 14px;
}

.lightbox-stage-arrow.next {
  right: 14px;
}

.lightbox-stage-arrow:hover {
  background: #fbbf24;
  color: #0f172a;
  transform: translateY(-50%) scale(1.12);
  border-color: #ffffff;
}

.lightbox-modal-footer {
  padding: 12px 20px;
  background: rgba(10, 18, 32, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
}

.lightbox-thumbnails-track {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  min-height: 64px;
}

.lightbox-thumb {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.5;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.lightbox-thumb:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

.lightbox-thumb.active {
  border-color: #fbbf24;
  opacity: 1;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.55);
  transform: scale(1.06);
}

.lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   ÁLBUM DE FOTOS EN EL DRAWER LATERAL (EXPEDIENTE)
   ========================================================================== */
.drawer-gallery-section {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

[data-theme="light"] .drawer-gallery-section {
  background: #f8fafc;
  border-color: #e2e8f0;
}

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

.drawer-gallery-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 6px;
}

[data-theme="light"] .drawer-gallery-title {
  color: #d97706;
}

.drawer-add-photo-btn {
  font-size: 0.74rem;
  padding: 3px 8px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: #fbbf24;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: rgba(212, 175, 55, 0.08);
  transition: all 0.2s ease;
}

.drawer-add-photo-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  color: #ffffff;
}

.drawer-gallery-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  min-height: 48px;
  align-items: center;
}

.drawer-gallery-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  border: 1.5px solid var(--border-subtle);
  flex-shrink: 0;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.drawer-gallery-thumb:hover {
  transform: scale(1.08);
  border-color: #fbbf24;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.drawer-gallery-empty {
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-style: italic;
  padding: 8px 4px;
}

.native-expand-btn {
  position: absolute;
  width: 24px;
  height: 24px;
  background: #1e293b;
  border: 2px solid #6366f1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff !important;
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

[data-theme="light"] .native-expand-btn {
  background: #ffffff;
  border-color: #6366f1;
  color: #4338ca !important;
}

.native-expand-btn:hover {
  background: #6366f1 !important;
  color: #ffffff !important;
  border-color: #a5b4fc !important;
  transform: translateX(-50%) scale(1.2);
}

.native-expand-btn.up {
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
}

.native-expand-btn.down {
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
}

.native-expand-btn.collapsed {
  background: #475569;
  border-color: #94a3b8;
  opacity: 0.85;
}

/* ==========================================================================
   WIDGET FLOTANTE DE EVENTOS & EFEMÉRIDES FAMILIARES (DESTACADO)
   ========================================================================== */
.floating-events-widget {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 990;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px 10px 12px;
  background: linear-gradient(135deg, rgba(10, 25, 47, 0.92) 0%, rgba(17, 34, 64, 0.96) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 9999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 0 20px rgba(212, 175, 55, 0.2);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-events-widget:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(212, 175, 55, 0.85);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(212, 175, 55, 0.4);
}

.floating-events-widget .floating-events-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25) 0%, rgba(180, 142, 30, 0.4) 100%);
  border: 1px solid rgba(212, 175, 55, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold, #D4AF37);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.3);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.floating-events-widget:hover .floating-events-icon-box {
  transform: rotate(-6deg) scale(1.08);
}

.floating-events-widget .floating-events-content {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.floating-events-widget .floating-events-eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent-gold, #D4AF37);
  font-weight: 700;
  font-family: var(--font-formal, inherit);
}

.floating-events-widget .floating-events-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.floating-events-widget .floating-events-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--accent-gold, #D4AF37);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 9999px;
  margin-left: 6px;
  white-space: nowrap;
}

.floating-events-widget .floating-events-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: pulseEventsDot 2s infinite ease-in-out;
}

@keyframes pulseEventsDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

@media (max-width: 768px) {
  .floating-events-widget {
    position: fixed !important;
    bottom: 100px !important;
    left: 12px !important;
    z-index: 1040 !important;
    padding: 6px 12px 6px 8px !important;
    gap: 8px !important;
    max-width: calc(100vw - 80px) !important;
  }
  .floating-events-widget .floating-events-icon-box {
    width: 32px !important;
    height: 32px !important;
  }
  .floating-events-widget .floating-events-icon-box svg {
    width: 17px !important;
    height: 17px !important;
  }
  .floating-events-widget .floating-events-title {
    font-size: 0.80rem !important;
  }
  .floating-events-widget .floating-events-eyebrow {
    font-size: 0.58rem !important;
  }
  .floating-events-widget .floating-events-badge {
    font-size: 0.68rem !important;
    padding: 2px 7px !important;
    margin-left: 2px !important;
  }
}

/* ==========================================================================
   BOTÓN "+ FAMILIAR" REDISEÑADO (INTEGRADO CON LA ESTÉTICA DE LA PÁGINA)
   ========================================================================== */
.btn-nav-add-member {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18) 0%, rgba(180, 142, 30, 0.32) 100%) !important;
  border: 1px solid rgba(212, 175, 55, 0.45) !important;
  color: #FCE79A !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: inline-flex !important;
  align-items: center !important;
  cursor: pointer !important;
}

.btn-nav-add-member:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.32) 0%, rgba(180, 142, 30, 0.5) 100%) !important;
  border-color: #D4AF37 !important;
  color: #FFFFFF !important;
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.35), 0 0 14px rgba(212, 175, 55, 0.25) !important;
  transform: translateY(-1px) !important;
}

/* Restricciones estrictas para el rol Visitante */
body.role-visitante #btnAddMember,
body.role-visitante #btnAddMemberMobile,
body.role-visitante .btn-nav-add-member,
body.role-visitante #floatingEventsWidget,
body.role-visitante a[href="mapa.html"],
body.role-visitante a[href="conectar.html"],
body.role-visitante a[href="eventos.html"],
body.role-visitante #btnOpenAdmin,
body.role-visitante #btnOpenAdminMobile {
  display: none !important;
}

/* Restricción: Botón Respaldo / Base de Datos exclusivo para Administrador */
body:not(.role-admin) #btnOpenData,
body:not(.role-admin) #btnOpenDataMobile,
body.role-visitante #btnOpenData,
body.role-visitante #btnOpenDataMobile,
body.role-familiar #btnOpenData,
body.role-familiar #btnOpenDataMobile {
  display: none !important;
}

/* ==========================================================================
   BANNER DE ANUNCIOS DESTACADOS EN LANDING PAGE
   ========================================================================== */
.landing-announcement-banner {
  background: rgba(212, 175, 55, 0.12);
  border-bottom: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--accent-gold, #D4AF37);
  padding: 10px 24px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  z-index: 1001;
  animation: fadeIn 0.4s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ==========================================================================
   CRÉDITO TRANSLÚCIDO DEL DESARROLLADOR (CENTRO INFERIOR DEL VIEWPORT)
   ========================================================================== */
.tree-developer-credit {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  background: rgba(10, 25, 47, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 9999px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  font-family: var(--font-body, system-ui, -apple-system, sans-serif);
  font-size: 0.74rem;
  letter-spacing: 0.35px;
  color: rgba(244, 235, 216, 0.7);
  user-select: none;
  pointer-events: auto;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-normal, 0.3s) cubic-bezier(0.16, 1, 0.3, 1);
}

.tree-developer-credit .credit-name {
  color: var(--accent-gold, #D4AF37);
  font-weight: 600;
}

.tree-developer-credit:hover {
  background: rgba(10, 25, 47, 0.78);
  border-color: rgba(212, 175, 55, 0.55);
  color: rgba(244, 235, 216, 0.95);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55), 0 0 16px rgba(212, 175, 55, 0.2);
  transform: translate(-50%, -2px);
}

@media (max-width: 768px) {
  .toast-container {
    top: 104px !important;
    bottom: auto !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: 90% !important;
    max-width: 340px !important;
    z-index: 2200 !important;
  }
  .tree-developer-credit {
    position: fixed !important;
    bottom: 8px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    font-size: 0.66rem !important;
    padding: 4px 12px !important;
    z-index: 920 !important;
    background: rgba(10, 25, 47, 0.88) !important;
    border: 1px solid rgba(212, 175, 55, 0.35) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5) !important;
    pointer-events: auto !important;
    white-space: nowrap !important;
  }
}

/* ==========================================================================
   CARTEL DE AGRADECIMIENTO AL INICIAR SESIÓN
   ========================================================================== */
.ack-modal-overlay {
  z-index: 2500 !important;
  background: rgba(6, 17, 34, 0.78) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.ack-modal-overlay.active {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.ack-card {
  max-width: 530px !important;
  width: 100% !important;
  background: linear-gradient(145deg, rgba(10, 25, 47, 0.96) 0%, rgba(13, 31, 58, 0.98) 100%) !important;
  border: 1px solid rgba(212, 175, 55, 0.42) !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 35px rgba(212, 175, 55, 0.2) !important;
  padding: 34px 28px 28px 28px !important;
  text-align: center !important;
  position: relative !important;
  overflow: hidden !important;
  transform: scale(0.92) translateY(14px) !important;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease !important;
}

.ack-modal-overlay.active .ack-card {
  transform: scale(1) translateY(0) !important;
}

.ack-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #D4AF37, #F4EBD8, #D4AF37, transparent);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
}

.ack-close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.22);
  color: var(--text-muted, #BFBFBF);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ack-close-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  color: #D4AF37;
  border-color: #D4AF37;
  transform: scale(1.08);
}

.ack-badge-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.ack-icon-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #D4AF37;
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.2);
}

.ack-badge-text {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #D4AF37;
}

.ack-title {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 700;
  color: #FDFDFD;
  margin: 0 0 10px 0;
  letter-spacing: 0.5px;
}

.ack-divider {
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #D4AF37, transparent);
  margin: 0 auto 18px auto;
}

.ack-message {
  font-family: var(--font-body);
  font-size: 0.98rem;
  line-height: 1.65;
  color: #F4EBD8;
  margin: 0 0 24px 0;
  padding: 0 8px;
  font-weight: 400;
}

.ack-highlight {
  color: #D4AF37;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.ack-actions {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.ack-confirm-btn {
  background: linear-gradient(135deg, #D4AF37 0%, #b89324 100%) !important;
  color: #0A192F !important;
  font-weight: 700 !important;
  font-size: 0.92rem !important;
  padding: 11px 26px !important;
  border-radius: 9999px !important;
  border: none !important;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.35) !important;
  transition: all 0.25s ease !important;
}

.ack-confirm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(212, 175, 55, 0.5) !important;
  filter: brightness(1.08);
}

[data-theme="light"] .ack-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%) !important;
  border-color: rgba(212, 175, 55, 0.5) !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15), 0 0 25px rgba(212, 175, 55, 0.2) !important;
}

[data-theme="light"] .ack-title {
  color: #0A192F;
}

[data-theme="light"] .ack-message {
  color: #334155;
}

[data-theme="light"] .ack-highlight {
  color: #b89324;
}

/* ==========================================================================
   MODAL DE COLABORACIÓN Y DONACIONES: "APOYÁ ESTE PROYECTO"
   ========================================================================== */
.donation-modal-overlay {
  z-index: 2600 !important;
  background: rgba(6, 17, 34, 0.82) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.donation-modal-overlay.active {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.donation-card {
  max-width: 480px !important;
  width: 100% !important;
  background: linear-gradient(145deg, rgba(10, 25, 47, 0.97) 0%, rgba(13, 31, 58, 0.98) 100%) !important;
  border: 1px solid rgba(212, 175, 55, 0.45) !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(212, 175, 55, 0.22) !important;
  padding: 32px 28px 26px 28px !important;
  text-align: center !important;
  position: relative !important;
  overflow: hidden !important;
  transform: scale(0.92) translateY(14px) !important;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease !important;
}

.donation-modal-overlay.active .donation-card {
  transform: scale(1) translateY(0) !important;
}

.donation-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #D4AF37, #F4EBD8, #D4AF37, transparent);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
}

.donation-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 5px 14px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 9999px;
  color: #D4AF37;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.donation-title {
  font-family: var(--font-heading, var(--font-formal));
  font-size: 1.65rem;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 10px 0;
  letter-spacing: 0.5px;
}

.donation-desc {
  font-family: var(--font-body);
  font-size: 0.90rem;
  line-height: 1.6;
  color: #E2E8F0;
  margin: 0 0 18px 0;
}

.donation-alias-box {
  background: rgba(6, 17, 34, 0.85);
  border: 1.5px dashed rgba(212, 175, 55, 0.45);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 16px 0;
  text-align: center;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.donation-alias-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.85);
  margin-bottom: 6px;
}

.donation-alias-value {
  display: block;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 1.35rem;
  font-weight: 800;
  color: #5EEAD4;
  letter-spacing: 1px;
  user-select: all;
  margin: 4px 0 8px 0;
  word-break: break-all;
  text-shadow: 0 0 12px rgba(94, 234, 212, 0.35);
}

.donation-alias-info {
  font-size: 0.80rem;
  color: #CBD5E1;
  line-height: 1.45;
}

.donation-copy-btn {
  background: linear-gradient(135deg, #D4AF37 0%, #C59B27 100%);
  color: #0A192F;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.4px;
  padding: 11px 26px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.38);
  transition: all 0.25s ease;
  width: 100%;
  max-width: 320px;
  margin-top: 6px;
}

.donation-copy-btn:hover {
  background: linear-gradient(135deg, #F5D77F 0%, #D4AF37 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(212, 175, 55, 0.55);
}

.donation-copy-btn.copied {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45);
}

.donation-copy-feedback {
  min-height: 22px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #34D399;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.donation-copy-feedback.show {
  opacity: 1;
}

[data-theme="light"] .donation-card {
  background: linear-gradient(145deg, #FFFFFF 0%, #F8FAFC 100%) !important;
  border-color: rgba(212, 175, 55, 0.5) !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12), 0 0 25px rgba(212, 175, 55, 0.18) !important;
}

[data-theme="light"] .donation-title {
  color: #0A192F;
}

[data-theme="light"] .donation-desc {
  color: #334155;
}

[data-theme="light"] .donation-alias-box {
  background: rgba(241, 245, 249, 0.9);
  border-color: rgba(212, 175, 55, 0.6);
}

[data-theme="light"] .donation-alias-value {
  color: #0D9488;
}

[data-theme="light"] .donation-alias-info {
  color: #475569;
}

/* ==========================================================================
   MODALES EN MOBILE: CARTEL DE AGRADECIMIENTO Y DONACIONES (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .ack-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100% !important;
    max-height: 100% !important;
    padding: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    z-index: 3000 !important;
  }

  .ack-card {
    width: 100% !important;
    max-width: min(390px, calc(100vw - 32px)) !important;
    margin: auto !important;
    padding: 24px 18px 20px 18px !important;
    border-radius: 18px !important;
    box-sizing: border-box !important;
    transform: scale(0.96) translateY(8px) !important;
  }

  .ack-modal-overlay.active .ack-card {
    transform: scale(1) translateY(0) !important;
  }

  .ack-close-btn {
    top: 10px !important;
    right: 12px !important;
    width: 30px !important;
    height: 30px !important;
    font-size: 13px !important;
  }

  .ack-badge-container {
    gap: 6px !important;
    margin-bottom: 8px !important;
  }

  .ack-icon-circle {
    width: 32px !important;
    height: 32px !important;
  }

  .ack-icon-circle svg {
    width: 18px !important;
    height: 18px !important;
  }

  .ack-badge-text {
    font-size: 0.65rem !important;
    letter-spacing: 1px !important;
  }

  .ack-title {
    font-size: 1.25rem !important;
    margin: 0 0 8px 0 !important;
    line-height: 1.25 !important;
  }

  .ack-divider {
    width: 40px !important;
    margin: 0 auto 12px auto !important;
  }

  .ack-message {
    font-size: 0.86rem !important;
    line-height: 1.55 !important;
    margin: 0 0 18px 0 !important;
    padding: 0 4px !important;
  }

  .ack-actions {
    margin-top: 6px !important;
  }

  .ack-confirm-btn {
    padding: 9px 24px !important;
    font-size: 0.86rem !important;
  }

  .donation-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100% !important;
    max-height: 100% !important;
    padding: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    z-index: 3000 !important;
  }

  .donation-card {
    width: 100% !important;
    max-width: min(390px, calc(100vw - 32px)) !important;
    margin: auto !important;
    padding: 24px 18px 20px 18px !important;
    border-radius: 18px !important;
    box-sizing: border-box !important;
    transform: scale(0.96) translateY(8px) !important;
  }

  .donation-modal-overlay.active .donation-card {
    transform: scale(1) translateY(0) !important;
  }

  .donation-title {
    font-size: 1.25rem !important;
    margin-bottom: 8px !important;
    line-height: 1.25 !important;
  }

  .donation-desc {
    font-size: 0.84rem !important;
    line-height: 1.5 !important;
    margin-bottom: 14px !important;
  }

  .donation-alias-box {
    padding: 10px 14px !important;
    margin-bottom: 14px !important;
  }

  .donation-alias-value {
    font-size: 0.95rem !important;
  }
}

/* ==========================================================================
   ARQUITECTURA Y ESTILOS MOBILE INTEGRALES (<= 768px)
   ========================================================================== */

/* Contenedor táctil del árbol */
.pan-zoom-container {
  touch-action: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

/* Botones Flotantes de Navegación del Árbol para Mobile */
.mobile-tree-controls {
  position: absolute;
  right: 14px;
  bottom: 50px;
  z-index: 95;
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 6px;
  border-radius: var(--radius-full);
  background: rgba(10, 25, 47, 0.90);
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 16px rgba(212, 175, 55, 0.2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

@media (max-width: 768px) {
  .mobile-tree-controls {
    display: flex !important;
    position: fixed !important;
    bottom: 42px !important;
    right: 12px !important;
    z-index: 1050 !important;
    pointer-events: auto !important;
  }

  .native-expand-btn {
    width: 28px !important;
    height: 28px !important;
    font-size: 14px !important;
  }
  .native-expand-btn::after {
    content: '' !important;
    position: absolute !important;
    top: -10px !important;
    bottom: -10px !important;
    left: -10px !important;
    right: -10px !important;
  }
  .native-expand-btn.up {
    top: -14px !important;
  }
  .native-expand-btn.down {
    bottom: -14px !important;
  }

  /* Ocultar minimapa GoJS en mobile para liberar 50% de la pantalla */
  .overview-container,
  .overview-fab {
    display: none !important;
  }

  /* Barra de Foco Genealógico (4 Generaciones) en mobile */
  .focus-breadcrumb-bar {
    top: 104px !important;
    padding: 6px 12px !important;
    gap: 8px !important;
    max-width: 96vw !important;
  }

  .focus-title {
    font-size: 0.74rem !important;
  }

  .focus-btn-action {
    padding: 4px 8px !important;
    font-size: 0.72rem !important;
  }

  /* ==================== DRAWER LATERAL DE PERFIL EN MOBILE ==================== */
  /* Se convierte en un panel de pantalla completa deslizable suavemente desde abajo */
  .side-drawer {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    z-index: 3500 !important;
    display: flex !important;
    flex-direction: column !important;
    background: rgba(10, 25, 47, 0.98) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    transform: translateY(100%) !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.85) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .side-drawer.open {
    transform: translateY(0) !important;
  }

  .drawer-header {
    padding: 14px 18px !important;
    background: rgba(6, 17, 34, 0.98) !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-shrink: 0 !important;
    z-index: 10 !important;
  }

  .drawer-header h2 {
    font-size: 1.2rem !important;
    color: #FDFDFD !important;
  }

  .drawer-close-btn {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    background: rgba(212, 175, 55, 0.12) !important;
    border: 1px solid rgba(212, 175, 55, 0.35) !important;
    color: var(--accent-gold, #D4AF37) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    cursor: pointer !important;
  }

  .drawer-body {
    padding: 16px 14px !important;
    padding-bottom: calc(36px + env(safe-area-inset-bottom, 20px)) !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    touch-action: pan-y !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .person-hero-card {
    padding: 16px 12px !important;
  }

  .person-hero-avatar {
    width: 76px !important;
    height: 76px !important;
    font-size: 26px !important;
  }

  .person-hero-name {
    font-size: 1.15rem !important;
  }

  .info-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .drawer-footer {
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 12px)) 14px !important;
    background: rgba(6, 17, 34, 0.98) !important;
    border-top: 1px solid rgba(212, 175, 55, 0.3) !important;
    display: flex !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    z-index: 20 !important;
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.8) !important;
  }

  .drawer-footer .btn {
    flex: 1 !important;
    min-height: 44px !important;
    font-size: 0.85rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
  }

  /* ==================== ÁRBOL DE ANTEPASADOS EN MOBILE ==================== */
  .ancestor-file-tree-drawer {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
    border: none !important;
    z-index: 3500 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    background: rgba(10, 25, 47, 0.98) !important;
    backdrop-filter: blur(24px) !important;
  }

  .ancestor-file-tree-drawer:not(.collapsed) {
    transform: translateX(0) !important;
  }

  .ancestor-tree-fab {
    bottom: 50px !important;
    left: 14px !important;
  }

  /* ==================== MODALES EN MOBILE ==================== */
  .modal-overlay:not(.ack-modal-overlay) {
    z-index: 6000 !important;
    padding: 0 !important;
    align-items: flex-end !important;
    justify-content: center !important;
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  .modal-overlay:not(.ack-modal-overlay) .modal-content {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    padding: 20px 16px 24px 16px !important;
    border-radius: 22px 22px 0 0 !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .modal-overlay:not(.ack-modal-overlay) .modal-content * {
    box-sizing: border-box !important;
  }

  .modal-overlay:not(.ack-modal-overlay) .modal-header {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
    box-sizing: border-box !important;
  }

  .modal-overlay:not(.ack-modal-overlay) .modal-header h3 {
    flex: 1 !important;
    min-width: 0 !important;
    font-size: 1.15rem !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    word-break: break-word !important;
  }

  .modal-overlay:not(.ack-modal-overlay) .modal-header .drawer-close-btn {
    flex-shrink: 0 !important;
    width: 36px !important;
    height: 36px !important;
    margin-left: auto !important;
  }

  .modal-overlay:not(.ack-modal-overlay) form {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .form-group {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .form-row {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 10px !important;
    box-sizing: border-box !important;
  }

  .form-control,
  select.form-control,
  input.form-control,
  textarea.form-control {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    font-size: 16px !important; /* Evita zoom automático en Safari iOS */
    padding: 10px 12px !important;
    text-overflow: ellipsis !important;
  }

  .input-with-icon input.form-control,
  .input-with-icon .form-control {
    padding-left: 44px !important;
    padding-right: 14px !important;
  }
  .input-with-icon input.form-control.input-password-toggleable,
  .input-with-icon .form-control.input-password-toggleable {
    padding-right: 48px !important;
  }

  select.form-control {
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    overflow: hidden !important;
  }

  select.form-control option {
    max-width: 100vw !important;
    white-space: normal !important;
  }

  .modal-translation-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .relations-edit-card {
    padding: 12px 10px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .link-child-wrapper,
  .link-spouse-wrapper {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .link-child-wrapper select,
  .link-spouse-wrapper select {
    width: 100% !important;
    max-width: 100% !important;
  }

  .link-child-wrapper .btn,
  .link-spouse-wrapper .btn {
    width: 100% !important;
  }

  .modal-actions {
    position: sticky !important;
    bottom: 0 !important;
    background: rgba(10, 25, 47, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(212, 175, 55, 0.35) !important;
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 8px)) 16px !important;
    margin-left: -16px !important;
    margin-right: -16px !important;
    margin-top: 24px !important;
    margin-bottom: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: calc(100% + 32px) !important;
    z-index: 100 !important;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.75) !important;
    box-sizing: border-box !important;
  }

  .modal-actions .btn {
    width: 100% !important;
    min-height: 48px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
  }

  .modal-actions .btn-primary {
    order: 1 !important;
    background: linear-gradient(135deg, #d4af37, #b89324) !important;
    color: #061122 !important;
    border: none !important;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4) !important;
  }

  .modal-actions .btn:not(.btn-primary) {
    order: 2 !important;
  }

  /* Ocultar widgets y controles flotantes del fondo cuando un modal esté activo */
  body.modal-open .floating-events-widget,
  body.modal-open .mobile-tree-controls,
  body.modal-open .tree-developer-credit,
  body.modal-open .ancestor-tree-fab,
  body:has(.modal-overlay.active) .floating-events-widget,
  body:has(.modal-overlay.active) .mobile-tree-controls,
  body:has(.modal-overlay.active) .tree-developer-credit,
  body:has(.modal-overlay.active) .ancestor-tree-fab {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    transform: translateY(30px) !important;
    transition: opacity 0.25s ease, transform 0.25s ease !important;
  }

  /* Crédito de desarrollador en mobile */
  .tree-developer-credit {
    position: fixed !important;
    bottom: 8px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    font-size: 0.66rem !important;
    padding: 4px 12px !important;
    z-index: 920 !important;
    pointer-events: auto !important;
  }
}

.mobile-control-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: rgba(10, 25, 47, 0.95);
  color: var(--accent-gold, #D4AF37);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  pointer-events: auto !important;
}

.mobile-control-btn svg {
  pointer-events: none;
}

.mobile-control-btn:active {
  transform: scale(0.90);
  background: rgba(212, 175, 55, 0.25);
  border-color: #D4AF37;
}

/* ==========================================================================
   NAVEGADOR DE PERSONAS EN MOBILE (Flechas ← / → entre tarjetas del árbol)
   ========================================================================== */
.mobile-person-nav {
  display: none; /* oculto por defecto, se muestra solo en mobile */
}

@media (max-width: 768px) {
  .mobile-person-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 42px !important;
    left: 12px !important;
    z-index: 1050 !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 8px !important;
    border-radius: 9999px !important;
    background: rgba(10, 25, 47, 0.90) !important;
    border: 1px solid rgba(212, 175, 55, 0.4) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 16px rgba(212, 175, 55, 0.2) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    pointer-events: auto !important;
  }

  .mobile-person-nav-btn {
    width: 34px !important;
    height: 34px !important;
    flex-shrink: 0 !important;
  }

  .mobile-person-nav-counter {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 44px;
    justify-content: center;
    font-family: var(--font-body, system-ui, sans-serif);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-gold, #D4AF37);
    letter-spacing: 0.5px;
    user-select: none;
    pointer-events: none;
  }

  .mobile-person-nav-counter .nav-sep {
    opacity: 0.55;
    margin: 0 1px;
    font-weight: 400;
  }
}

/* ==========================================================================
   ADAPTACIÓN COMPLETA DE NAVBAR Y ELEMENTOS DE NAVEGACIÓN EN MODO CLARO
   ========================================================================== */

/* Navbar principal en Desktop */
[data-theme="light"] .top-navbar {
  background: rgba(255, 255, 255, 0.94) !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.07) !important;
}

/* Marca / Logo NomenKocourek */
[data-theme="light"] .nav-site-brand span,
[data-theme="light"] .mobile-brand .brand-title-text {
  color: #7c5a10 !important;
  text-shadow: none !important;
}

[data-theme="light"] .nav-site-brand:hover span {
  color: #5c4208 !important;
}

/* Buscador en Modo Claro */
[data-theme="light"] .search-input-wrapper {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

[data-theme="light"] .search-input-wrapper:focus-within {
  border-color: #8c6615 !important;
  box-shadow: 0 0 0 3px rgba(140, 102, 21, 0.15) !important;
}

[data-theme="light"] .search-icon {
  color: #64748b !important;
}

[data-theme="light"] .search-input {
  color: #0f172a !important;
}

[data-theme="light"] .search-input::placeholder {
  color: #94a3b8 !important;
}

[data-theme="light"] .search-clear-btn {
  color: #94a3b8 !important;
}

[data-theme="light"] .search-clear-btn:hover {
  color: #0f172a !important;
}

/* Botón de Retorno a Foco Thiago */
[data-theme="light"] .btn-focus-mode {
  background: #fffbeb !important;
  border: 1px solid #fcd34d !important;
  color: #92400e !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(146, 64, 14, 0.08) !important;
}

[data-theme="light"] .btn-focus-mode:hover {
  background: #fef3c7 !important;
  border-color: #f59e0b !important;
  color: #78350f !important;
}

[data-theme="light"] .btn-focus-mode.active {
  background: #fde68a !important;
  border-color: #d97706 !important;
  color: #78350f !important;
  box-shadow: 0 0 10px rgba(217, 119, 6, 0.2) !important;
}

/* Botones Ghost en Navbar (Ocultar todo, Ver Todo, Idioma, Opciones) */
[data-theme="light"] .nav-actions .btn:not(.btn-nav-add-member):not(.btn-admin),
[data-theme="light"] .nav-actions .btn-ghost {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

[data-theme="light"] .nav-actions .btn:not(.btn-nav-add-member):not(.btn-admin):hover,
[data-theme="light"] .nav-actions .btn-ghost:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

/* Botón Destacado "+ Familiar" */
[data-theme="light"] .btn-nav-add-member,
[data-theme="light"] .nav-actions .btn-nav-add-member {
  background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%) !important;
  border: 1px solid #996515 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) !important;
  box-shadow: 0 2px 8px rgba(184, 134, 11, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}

[data-theme="light"] .btn-nav-add-member:hover,
[data-theme="light"] .nav-actions .btn-nav-add-member:hover {
  background: linear-gradient(135deg, #e0bc45 0%, #c49212 100%) !important;
  border-color: #805300 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(184, 134, 11, 0.4) !important;
  transform: translateY(-1px) !important;
}

[data-theme="light"] .btn-nav-add-member svg,
[data-theme="light"] .nav-actions .btn-nav-add-member svg {
  stroke: #ffffff !important;
}

/* Botón Panel /admin */
[data-theme="light"] .btn-admin,
[data-theme="light"] .nav-actions .btn-admin {
  background: #fff7ed !important;
  border: 1px solid #fed7aa !important;
  color: #9a3412 !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 2px rgba(154, 52, 18, 0.06) !important;
}

[data-theme="light"] .btn-admin:hover,
[data-theme="light"] .nav-actions .btn-admin:hover {
  background: #ffedd5 !important;
  border-color: #f97316 !important;
  color: #7c2d12 !important;
}

/* Menús Desplegables en Modo Claro (Opciones, Idiomas, Resultados de Búsqueda) */
[data-theme="light"] .dropdown-menu,
[data-theme="light"] .lang-dropdown-menu,
[data-theme="light"] .search-results-dropdown {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.04) !important;
}

[data-theme="light"] .dropdown-item-header {
  background: #f8fafc !important;
  border: 1px solid #f1f5f9 !important;
}

[data-theme="light"] .dropdown-divider {
  background: #e2e8f0 !important;
}

[data-theme="light"] .dropdown-item {
  color: #1e293b !important;
}

[data-theme="light"] .dropdown-item:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

[data-theme="light"] .dropdown-item-danger {
  color: #e11d48 !important;
}

[data-theme="light"] .dropdown-item-danger:hover {
  background: #ffe4e6 !important;
  color: #be123c !important;
}

[data-theme="light"] .lang-option-btn {
  color: #1e293b !important;
}

[data-theme="light"] .lang-option-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

[data-theme="light"] .lang-option-btn.active-lang {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-weight: 700 !important;
}

[data-theme="light"] .search-item {
  border-bottom: 1px solid #f1f5f9 !important;
}

[data-theme="light"] .search-item:hover,
[data-theme="light"] .search-item.highlighted {
  background: #f8fafc !important;
}

[data-theme="light"] .search-item-name {
  color: #0f172a !important;
}

[data-theme="light"] .search-item-meta {
  color: #64748b !important;
}

/* Botón flechita colapsar navbar */
[data-theme="light"] .navbar-toggle-btn {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-top: none !important;
  color: #64748b !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08) !important;
}

[data-theme="light"] .navbar-toggle-btn:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
}

/* Navbar Móvil en Modo Claro */
@media (max-width: 768px) {
  [data-theme="light"] #mobileNavbar {
    background: rgba(255, 255, 255, 0.96) !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06) !important;
  }

  [data-theme="light"] .btn-mobile-icon {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
  }

  [data-theme="light"] .btn-mobile-add {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%) !important;
    border-color: #996515 !important;
    color: #ffffff !important;
  }

  [data-theme="light"] .btn-mobile-add svg {
    stroke: #ffffff !important;
  }

  [data-theme="light"] .mobile-focus-btn {
    background: #fffbeb !important;
    border: 1px solid #fcd34d !important;
    color: #92400e !important;
  }

  [data-theme="light"] .mobile-navbar-toggle {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #64748b !important;
  }

  [data-theme="light"] .mobile-control-btn {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #7c5a10 !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1) !important;
  }
}

/* Widgets Flotantes Inferiores en Modo Claro */
[data-theme="light"] .floating-events-widget {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(212, 175, 55, 0.5) !important;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.1), 0 0 15px rgba(212, 175, 55, 0.15) !important;
}

[data-theme="light"] .floating-events-widget .floating-events-title {
  color: #0f172a !important;
}

[data-theme="light"] .floating-events-widget .floating-events-eyebrow {
  color: #8c6615 !important;
}

[data-theme="light"] .floating-events-widget .floating-events-icon-box {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(180, 142, 30, 0.3) 100%) !important;
  color: #7c5a10 !important;
  border-color: rgba(212, 175, 55, 0.6) !important;
}

[data-theme="light"] .floating-events-widget .floating-events-badge {
  background: rgba(212, 175, 55, 0.15) !important;
  color: #7c5a10 !important;
  border-color: rgba(212, 175, 55, 0.4) !important;
}

[data-theme="light"] .tree-developer-credit {
  background: rgba(255, 255, 255, 0.88) !important;
  border-color: #cbd5e1 !important;
  color: #64748b !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08) !important;
}

[data-theme="light"] .tree-developer-credit .credit-name {
  color: #7c5a10 !important;
}

[data-theme="light"] .overview-container {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1) !important;
}

[data-theme="light"] .overview-title {
  color: #0f172a !important;
}

/* ==========================================================================
   SISTEMA DE PERSONALIDAD Y CUESTIONARIO (TARJETA, DRAWER Y MODAL)
   ========================================================================== */

/* Mini-apartado de Personalidad en la Tarjeta del Árbol (native-person-card) */
.native-card-personality {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 3px;
  margin-top: 6px;
  width: 100%;
  padding-top: 5px;
  border-top: 1px dashed rgba(212, 175, 55, 0.35);
  max-width: 132px;
}

[data-theme="light"] .native-card-personality {
  border-top-color: rgba(140, 102, 21, 0.28);
}

.personality-mini-chip {
  font-size: 0.64rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 9999px;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--accent-gold, #D4AF37);
  max-width: 126px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1.25;
  transition: transform var(--transition-fast);
}

.personality-mini-chip:hover {
  transform: scale(1.05);
  border-color: var(--accent-gold, #D4AF37);
}

[data-theme="light"] .personality-mini-chip {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

.personality-mini-chip .chip-icon {
  font-size: 0.72rem;
  flex-shrink: 0;
}

.personality-mini-chip .chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personality-more-chip {
  font-size: 0.60rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1.2;
}

.personality-more-chip:hover {
  background: rgba(56, 189, 248, 0.28);
  transform: scale(1.08);
}

[data-theme="light"] .personality-more-chip {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

/* Modal del Cuestionario de Personalidad */
.personality-modal-overlay {
  z-index: 2500;
}

.personality-modal-card {
  max-width: 680px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 32px rgba(212, 175, 55, 0.22);
  animation: fadeIn 0.25s ease-out;
  padding: 0;
}

[data-theme="light"] .personality-modal-card {
  border-color: rgba(203, 213, 225, 0.9);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18), 0 0 25px rgba(212, 175, 55, 0.15);
  background: #ffffff;
}

.personality-modal-header {
  padding: 24px 28px 16px 28px;
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.12) 0%, rgba(10, 25, 47, 0) 100%);
  border-bottom: 1px solid var(--border-subtle);
}

[data-theme="light"] .personality-modal-header {
  background: linear-gradient(180deg, #fef9c3 0%, #ffffff 100%);
  border-bottom-color: #e2e8f0;
}

.personality-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: var(--accent-gold, #D4AF37);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

[data-theme="light"] .personality-badge {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

.personality-modal-title {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px 0;
}

.personality-modal-subtitle {
  font-size: 0.90rem;
  color: var(--text-secondary);
  margin: 0 0 14px 0;
  line-height: 1.5;
}

[data-theme="light"] .personality-modal-subtitle {
  color: #475569;
}

.personality-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

[data-theme="light"] .personality-status-bar {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.personality-hint-pending {
  font-size: 0.82rem;
  color: #f59e0b;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

[data-theme="light"] .personality-hint-pending {
  color: #b45309;
}

.personality-hint-success {
  font-size: 0.82rem;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

[data-theme="light"] .personality-hint-success {
  color: #047857;
}

.personality-counter-pill {
  font-size: 0.78rem;
  padding: 3px 12px;
  border-radius: 9999px;
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid rgba(212, 175, 55, 0.42);
  color: var(--accent-gold, #D4AF37);
  font-weight: 700;
  white-space: nowrap;
}

[data-theme="light"] .personality-counter-pill {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.personality-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
}

.personality-questions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.personality-q-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

[data-theme="light"] .personality-q-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.personality-q-card:focus-within,
.personality-q-card.answered {
  border-color: rgba(212, 175, 55, 0.65);
  background: rgba(212, 175, 55, 0.08);
}

[data-theme="light"] .personality-q-card:focus-within,
[data-theme="light"] .personality-q-card.answered {
  border-color: #f59e0b;
  background: #fffdf5;
}

.personality-q-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.personality-q-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.personality-q-label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  cursor: pointer;
  line-height: 1.35;
}

.personality-q-input {
  font-size: 0.84rem;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
}

.personality-modal-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 25, 47, 0.95);
}

[data-theme="light"] .personality-modal-footer {
  background: #f8fafc;
  border-top-color: #e2e8f0;
}

.personality-btn-skip {
  color: var(--text-secondary);
}

.personality-btn-save.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Apartado de Personalidad en el Drawer Lateral (Expediente Familiar) */
.drawer-personality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.drawer-personality-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

[data-theme="light"] .drawer-personality-item {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.drawer-personality-item:hover {
  border-color: var(--accent-primary);
  background: rgba(212, 175, 55, 0.06);
}

[data-theme="light"] .drawer-personality-item:hover {
  background: #fffdf5;
  border-color: #f59e0b;
}

.dp-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--text-secondary);
  font-weight: 600;
}

[data-theme="light"] .dp-header {
  color: #64748b;
}

.dp-icon {
  font-size: 0.95rem;
}

.dp-label {
  letter-spacing: 0.2px;
}

.dp-answer {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  padding-left: 20px;
}

[data-theme="light"] .dp-answer {
  color: #0f172a;
}

.drawer-personality-empty {
  text-align: center;
  padding: 18px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
}

[data-theme="light"] .drawer-personality-empty {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.drawer-personality-empty .empty-icon {
  font-size: 1.6rem;
  display: block;
  margin-bottom: 4px;
  opacity: 0.75;
}

.drawer-personality-empty .empty-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0 0 10px 0;
}

[data-theme="light"] .drawer-personality-empty .empty-text {
  color: #64748b;
}

/* Grilla en el Modal de Edición */
.edit-personality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.edit-personality-col {
  display: flex;
  flex-direction: column;
}

.edit-pq-input {
  font-size: 0.80rem !important;
  padding: 6px 10px !important;
}

/* Optimizaciones responsivas para teléfonos móviles */
@media (max-width: 640px) {
  .personality-modal-card {
    width: 96% !important;
    max-height: 94vh !important;
    border-radius: var(--radius-md) !important;
  }
  .personality-modal-header {
    padding: 16px 16px 12px 16px !important;
  }
  .personality-modal-title {
    font-size: 1.22rem !important;
    line-height: 1.3 !important;
  }
  .personality-modal-subtitle {
    font-size: 0.80rem !important;
    margin-bottom: 10px !important;
  }
  .personality-status-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    padding: 8px 10px !important;
  }
  .personality-counter-pill {
    align-self: flex-start !important;
  }
  .personality-modal-body {
    padding: 12px 14px !important;
  }
  .personality-questions-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .personality-modal-footer {
    padding: 12px 16px !important;
  }
  .personality-btn-skip,
  .personality-btn-save {
    font-size: 0.82rem !important;
    padding: 8px 12px !important;
  }
  .drawer-personality-grid {
    grid-template-columns: 1fr !important;
  }
  .edit-personality-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Animación de Realce Dorado para Búsqueda y Enfoque Directo */
@keyframes pulseCardGold {
  0% {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.85), 0 10px 25px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    box-shadow: 0 0 35px 12px rgba(212, 175, 55, 0.95), 0 15px 35px rgba(0, 0, 0, 0.7);
    transform: translate(-50%, -50%) scale(1.06);
    border-color: #fbbf24 !important;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0), 0 10px 25px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -50%) scale(1);
  }
}

.pulse-focused-card {
  animation: pulseCardGold 1.1s ease-in-out 2 !important;
  z-index: 100 !important;
}

/* ==========================================================================
   APARTADO DE REDES SOCIALES EN EL EXPEDIENTE (DRAWER)
   ========================================================================== */
.drawer-social-card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: var(--radius-md, 12px);
  padding: 12px 14px;
  margin-top: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.drawer-social-card:hover {
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

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

.drawer-social-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent-gold, #d4af37);
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-social-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (max-width: 480px) {
  .drawer-social-grid {
    grid-template-columns: 1fr;
  }
}

.drawer-social-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm, 8px);
  text-decoration: none;
  transition: all 0.2s ease;
  min-width: 0;
}

.drawer-social-item:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.35);
  transform: translateY(-1px);
}

.drawer-social-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.drawer-social-badge-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.drawer-social-badge-icon.ig {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}
.drawer-social-badge-icon.tw {
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.drawer-social-badge-icon.tt {
  background: #000;
  border: 1px solid rgba(37, 244, 238, 0.4);
}
.drawer-social-badge-icon.fb {
  background: #1877f2;
}

.drawer-social-item-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.drawer-social-netname {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  line-height: 1.1;
}

.drawer-social-handle {
  font-size: 0.68rem;
  color: var(--accent-primary, #38bdf8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.drawer-social-open-arrow {
  color: rgba(212, 175, 55, 0.7);
  font-size: 0.75rem;
  margin-left: 4px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.drawer-social-item:hover .drawer-social-open-arrow {
  color: #d4af37;
  transform: translate(2px, -2px);
}

.drawer-social-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 12px 8px;
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* ==================== SECCIÓN DE MATRIMONIOS Y PAREJAS EN DRAWER ==================== */
.drawer-marriages-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-marriages-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-union-card {
  background: var(--bg-surface-elevated, #1e293b);
  border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
  border-radius: var(--radius-md, 8px);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition-fast, 0.2s ease);
  position: relative;
}

.drawer-union-card:hover {
  border-color: rgba(212, 175, 55, 0.4);
  background: var(--bg-hover, rgba(255,255,255,0.04));
}

.drawer-union-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.drawer-union-partner-info {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.drawer-union-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-subtle, rgba(255,255,255,0.1));
  background: var(--bg-surface, #0f172a);
  flex-shrink: 0;
}

.drawer-union-monogram {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-primary, #38bdf8);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  flex-shrink: 0;
}

.drawer-union-partner-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.drawer-union-partner-name:hover {
  color: var(--accent-primary, #38bdf8);
  text-decoration: underline;
}

/* Badges de estado de unión */
.union-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.union-badge.married {
  background: rgba(212, 175, 55, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(212, 175, 55, 0.35);
}

.union-badge.divorced {
  background: rgba(244, 63, 94, 0.14);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.union-badge.partnership {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.union-badge.separated {
  background: rgba(249, 115, 22, 0.12);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.union-badge.coparents {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.drawer-union-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-secondary, #cbd5e1);
  padding-left: 46px;
}

.drawer-union-detail-row {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.35;
  flex-wrap: wrap;
}

.drawer-union-detail-label {
  color: var(--text-muted, #94a3b8);
  font-size: 0.73rem;
}

.drawer-union-detail-val {
  color: var(--text-primary, #f8fafc);
  font-weight: 600;
}

.drawer-union-notes {
  font-style: italic;
  font-size: 0.74rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 2px;
  line-height: 1.35;
}

.drawer-union-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
  padding-left: 46px;
}

.drawer-union-btn-edit {
  background: transparent;
  border: 1px solid var(--border-subtle, rgba(255,255,255,0.1));
  border-radius: var(--radius-sm, 6px);
  color: var(--accent-primary, #38bdf8);
  font-size: 0.72rem;
  padding: 3px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast, 0.2s ease);
}

.drawer-union-btn-edit:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--accent-primary, #38bdf8);
}

.drawer-union-btn-cert {
  background: transparent;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-sm, 6px);
  color: var(--accent-primary, #38bdf8);
  font-size: 0.72rem;
  padding: 3px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast, 0.2s ease);
}

.drawer-union-btn-cert:hover {
  background: rgba(56, 189, 248, 0.1);
}

/* ==========================================================================
   BANNER RECOMENDACIÓN PC (Mobile Only)
   ========================================================================== */
.mobile-desktop-hint {
  display: none; /* se muestra via JS solo en mobile */
}

@media (max-width: 768px) {
  .mobile-desktop-hint {
    position: fixed !important;
    bottom: 92px !important; /* encima de los controles de zoom/nav */
    left: 50% !important;
    transform: translateX(-50%) translateY(20px) !important;
    z-index: 1200 !important;
    width: calc(100vw - 32px) !important;
    max-width: 400px !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 14px 14px 14px 16px !important;
    border-radius: 16px !important;
    background: rgba(8, 20, 40, 0.96) !important;
    border: 1px solid rgba(212, 175, 55, 0.45) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.75), 0 0 20px rgba(212, 175, 55, 0.18) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .mobile-desktop-hint.hint-visible {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(0) !important;
    pointer-events: auto !important;
  }

  .mobile-desktop-hint-icon {
    font-size: 1.6rem !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
    margin-top: 2px !important;
  }

  .mobile-desktop-hint-body {
    flex: 1 !important;
    min-width: 0 !important;
  }

  .mobile-desktop-hint-title {
    font-family: var(--font-formal, 'Cinzel', serif) !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    color: var(--accent-gold, #D4AF37) !important;
    margin: 0 0 4px 0 !important;
    letter-spacing: 0.3px !important;
  }

  .mobile-desktop-hint-text {
    font-family: var(--font-body, system-ui, sans-serif) !important;
    font-size: 0.78rem !important;
    color: rgba(234, 230, 223, 0.85) !important;
    margin: 0 !important;
    line-height: 1.45 !important;
  }

  .mobile-desktop-hint-close {
    flex-shrink: 0 !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: rgba(212, 175, 55, 0.12) !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
    color: var(--accent-gold, #D4AF37) !important;
    font-size: 13px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding: 0 !important;
    line-height: 1 !important;
    transition: background 0.2s ease, border-color 0.2s ease !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .mobile-desktop-hint-close:active {
    background: rgba(212, 175, 55, 0.28) !important;
    border-color: #D4AF37 !important;
    transform: scale(0.9) !important;
  }
}

@keyframes hintSlideIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}






