/**
 * Fijate Tools - Cronología universal de la historia humana
 * Estilos institucionales canónicos y sistema visual interactivo
 */

:root {
  --font-main: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Paleta en modo oscuro (Midnight Slate) */
  --bg-primary: #0b0f17;
  --bg-card: #131b26;
  --bg-card-alt: #1a2433;
  --bg-card-hover: #1f2b3d;
  --bg-input: #0e141f;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #cbd5e1;

  /* Acentos cromáticos históricos */
  --accent-gold: #f59e0b;
  --accent-gold-dark: #b45309;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-cyan: #06b6d4;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition-fast: 0.18s ease;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-alt: #f1f5f9;
  --bg-card-hover: #e2e8f0;
  --bg-input: #ffffff;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: #2563eb;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #334155;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
}

/* Reset de contención según estándares de Fijate Tools */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.text-mono {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum' 1;
}

/* Layout institucional */
.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  box-sizing: border-box;
  flex: 1 0 auto;
  width: 100%;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Sidebar AdSense */
.tool-ad-sidebar {
  width: 300px;
  flex-shrink: 0;
}

/* ======================================================== */
/* HERO CARD Y MÉTRICAS                                     */
/* ======================================================== */
.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-blue), var(--accent-purple), var(--accent-emerald), var(--accent-cyan));
}

.hero-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.hero-icon-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-title-area {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.hero-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.hero-stat-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.6rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.stat-label {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ======================================================== */
/* NAVEGACIÓN POR PESTAÑAS                                  */
/* ======================================================== */
.tabs-nav-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
}

.tabs-nav {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  min-width: max-content;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  min-height: 40px;
}

.tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-card-alt);
}

.tab-btn.active {
  color: #ffffff;
  background: var(--accent-blue);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
}

.tab-content.active {
  display: flex;
}

/* ======================================================== */
/* CONTROLES DE FILTRO Y BÚSQUEDA                          */
/* ======================================================== */
.timeline-controls-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.search-omnibar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon-box {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-input-control {
  width: 100%;
  height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 2.5rem 0 2.8rem;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.92rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn-clear-search {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* Chips de épocas */
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip-btn {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chip-btn:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.chip-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  box-shadow: 0 0 0 1px var(--accent-gold);
}

/* Fila de selects de categoría y región */
.filters-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.75rem;
  align-items: flex-end;
}

.filter-dropdown-box {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.dropdown-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.input-select-control {
  width: 100%;
  height: 42px;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 2.5rem 0 0.85rem;
  font-family: var(--font-main);
  font-size: 0.88rem;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  cursor: pointer;
}

.input-select-control:focus {
  outline: none;
  border-color: var(--border-focus);
}

.btn-secondary-reset {
  height: 42px;
  padding: 0 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card-alt);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.btn-secondary-reset:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Barra de metadatos del feed */
.timeline-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0 0.25rem;
}

.results-counter {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.results-counter strong {
  color: var(--accent-gold);
}

.timeline-quick-jump {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.jump-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.jump-link:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

.jump-separator {
  color: var(--border-color);
}

/* ======================================================== */
/* LÍNEA DE TIEMPO VERTICAL DINÁMICA                        */
/* ======================================================== */
.timeline-feed-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-left: 1.75rem;
}

/* Línea central conectora */
.timeline-feed-wrapper::before {
  content: '';
  position: absolute;
  top: 1rem;
  bottom: 1rem;
  left: 0.65rem;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-gold), var(--accent-blue), var(--accent-purple), var(--accent-emerald), var(--accent-cyan));
  border-radius: 2px;
  opacity: 0.4;
}

/* Separadores de épocas */
.timeline-epoch-divider {
  position: relative;
  margin: 1.5rem 0 0.75rem -1.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
}

.epoch-divider-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.epoch-badge-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px currentColor;
}

.epoch-divider-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.epoch-divider-range {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-card-alt);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

/* Tarjeta individual de hito */
.milestone-item-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
}

.milestone-item-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-md);
}

/* Nodo / Bolita en la línea temporal */
.milestone-item-card::before {
  content: '';
  position: absolute;
  top: 1.4rem;
  left: -1.75rem;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--item-color, var(--accent-gold));
  box-shadow: 0 0 8px var(--item-color, var(--accent-gold));
  z-index: 2;
  transition: transform var(--transition-fast);
}

.milestone-item-card:hover::before {
  transform: translateX(-50%) scale(1.3);
  background: var(--item-color, var(--accent-gold));
}

.milestone-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.milestone-year-badge {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--item-color, var(--accent-gold));
  background: rgba(245, 158, 11, 0.1);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.milestone-tags-group {
  display: flex;
  gap: 0.35rem;
}

.tag-badge {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--bg-card-alt);
  color: var(--text-muted);
}

.milestone-card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.milestone-card-summary {
  font-size: 0.92rem;
  color: var(--text-light);
  line-height: 1.5;
}

.milestone-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 0.65rem;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-open-milestone {
  background: transparent;
  border: none;
  color: var(--accent-blue);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0;
}

.btn-open-milestone:hover {
  text-decoration: underline;
}

/* Estado de lista vacía */
.empty-feed-card {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
}

/* ======================================================== */
/* PESTAÑA 2: SINCRONIZADOR MUNDIAL                         */
/* ======================================================== */
.sync-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.panel-section-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.panel-section-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 0.35rem;
}

.sync-slider-container {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sync-year-display {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.sync-year-badge {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--accent-gold);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
}

.sync-epoch-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.sync-range-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sync-range-slider {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  accent-color: var(--accent-gold);
}

.sync-slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0 0.25rem;
}

.sync-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sync-chip-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sync-chip-btn.active {
  background: var(--accent-gold);
  color: #0b0f17;
  border-color: var(--accent-gold);
}

.sync-grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.sync-region-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color var(--transition-fast);
}

.sync-region-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.sync-region-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sync-region-icon {
  font-size: 1.15rem;
}

.sync-region-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.sync-region-content {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ======================================================== */
/* PESTAÑA 3: VIAJERO EN EL TIEMPO                         */
/* ======================================================== */
.life-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.life-epoch-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.life-epoch-btn {
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card-alt);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 40px;
}

.life-epoch-btn.active {
  background: var(--accent-purple);
  color: #ffffff;
  border-color: var(--accent-purple);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35);
}

.life-sheet-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.life-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.85rem;
}

.life-epoch-main-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
}

.life-epoch-tag {
  font-size: 0.84rem;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.1);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.life-indicators-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.life-indicator-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.life-indicator-item.full-width {
  grid-column: span 2;
}

.indicator-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.indicator-content {
  font-size: 0.92rem;
  color: var(--text-light);
  line-height: 1.5;
}

.indicator-risk {
  border-left: 3px solid #ef4444;
}

.indicator-risk .indicator-title-row {
  color: #ef4444;
}

/* ======================================================== */
/* PESTAÑA 5: PREGUNTAS FRECUENTES (FAQ ACORDEÓN)           */
/* ======================================================== */
.faq-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.faq-accordion-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-accordion-item {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.faq-accordion-item[open] {
  border-color: var(--border-focus);
}

.faq-accordion-question {
  padding: 1rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  user-select: none;
}

.faq-accordion-question::-webkit-details-marker {
  display: none;
}

.faq-icon-arrow {
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.faq-accordion-item[open] .faq-icon-arrow {
  transform: rotate(180deg);
  color: var(--accent-blue);
}

.faq-accordion-answer {
  padding: 0 1.25rem 1.15rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ======================================================== */
/* MODAL DE DETALLE ACCESIBLE                              */
/* ======================================================== */
.history-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.history-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.modal-year-badge {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--accent-gold);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}

.modal-epoch-tag, .modal-category-tag {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--bg-card-alt);
  color: var(--text-muted);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close-modal:hover {
  color: var(--text-main);
  background: var(--bg-card-alt);
}

.modal-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.modal-milestone-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.modal-milestone-summary {
  font-size: 1rem;
  color: var(--text-light);
  line-height: 1.5;
  font-weight: 500;
}

.modal-details-block {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.modal-block-heading {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-block-text {
  font-size: 0.92rem;
  color: var(--text-light);
  line-height: 1.6;
}

.modal-significance-box {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.9rem;
  color: var(--text-main);
}

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

.modal-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.modal-stat-item {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.modal-stat-item.full-span {
  grid-column: span 2;
}

.stat-meta-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-meta-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.modal-card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.btn-modal-action {
  height: 40px;
  padding: 0 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card-alt);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.btn-modal-action:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-modal-close-main {
  height: 40px;
  padding: 0 1.25rem;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent-blue);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.btn-modal-close-main:hover {
  opacity: 0.9;
}

/* ======================================================== */
/* RESPONSIVIDAD Y DISPOSITIVOS MÓVILES                     */
/* ======================================================== */
@media (max-width: 1024px) {
  .sync-grid-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .filters-row {
    grid-template-columns: 1fr;
  }

  .timeline-feed-wrapper {
    padding-left: 1.25rem;
  }

  .timeline-feed-wrapper::before {
    left: 0.35rem;
  }

  .milestone-item-card::before {
    left: -1.25rem;
    width: 10px;
    height: 10px;
  }

  .timeline-epoch-divider {
    margin-left: -1.25rem;
    padding: 0.75rem 1rem;
  }

  .sync-grid-container {
    grid-template-columns: 1fr;
  }

  .life-indicators-grid {
    grid-template-columns: 1fr;
  }

  .life-indicator-item.full-width {
    grid-column: span 1;
  }

  .modal-stats-grid {
    grid-template-columns: 1fr;
  }

  .modal-stat-item.full-span {
    grid-column: span 1;
  }
}
