/**
 * Cronología de la Tierra y la Vida - Estilos Canónicos y Avanzados
 * Fijate Tools • Tema oscuro / claro compatible con header.css
 */

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

  /* Paleta Base Tema Oscuro */
  --bg-deep: #07090e;
  --bg-surface: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(56, 189, 248, 0.3);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #cbd5e1; /* Garantizado legible, nunca oscuro ilegible */
  --text-dim: #64748b;

  --accent-cyan: #38bdf8;
  --accent-blue: #3b82f6;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;

  /* Colores geológicos oficiales */
  --eon-hadean: #ea580c;
  --eon-archean: #d97706;
  --eon-proterozoic: #059669;
  --eon-phanerozoic: #2563eb;
}

[data-theme="light"] {
  --bg-deep: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #f1f5f9;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-accent: rgba(2, 132, 199, 0.35);

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

  --accent-cyan: #0284c7;
  --accent-blue: #1d4ed8;
}

/* Reset y Contenedor Principal */
*, *::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-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  width: 100%;
}

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

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
}

/* Banner superior y Hero */
.chrono-hero-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.75));
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.chrono-hero-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15), transparent 70%);
  pointer-events: none;
}

.hero-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--accent-cyan);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: lowercase;
  margin-bottom: 0.75rem;
}

.hero-meta-badge::first-letter {
  text-transform: uppercase;
}

.hero-main-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 2.5vw, 2.1rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero-tagline {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 800px;
  line-height: 1.6;
}

/* Barra de control y navegación de pestañas */
.chrono-tabs-bar {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.35rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.view-tab-btn {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  min-height: 42px;
  transition: all 0.2s ease;
}

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

.view-tab-btn.active {
  background: var(--accent-cyan);
  color: #07090e;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.25);
}

/* Paneles de Pestañas */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ==========================================================================
   PESTAÑA 1: CRONOGRAMA INTERACTIVO
   ========================================================================== */

.filter-toolbar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-and-toggles-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.search-input-box {
  flex: 1 1 280px;
  position: relative;
}

.search-input-box svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-input-box input {
  width: 100%;
  height: 42px;
  padding: 0 1rem 0 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-input-box input:focus {
  border-color: var(--accent-cyan);
}

.toolbar-actions-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-tool-action {
  height: 42px;
  padding: 0 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-tool-action:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.btn-tool-action.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

/* Fila de Filtros Taxonómicos */
.filter-chips-row {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}

.filter-chip {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-height: 34px;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.filter-chip.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 700;
}

/* Separadores de Eón */
.eon-separator-card {
  border-left: 4px solid var(--accent-cyan);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 2rem 0 1.25rem;
  backdrop-filter: blur(8px);
}

.eon-separator-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.eon-separator-badge {
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
}

.eon-separator-span {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.eon-separator-summary {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Tarjetas de Entrada de la Línea de Tiempo */
.timeline-cards-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.timeline-cards-list::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--border-subtle);
  z-index: 0;
}

.timeline-entry-card {
  display: flex;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.25rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.timeline-entry-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  background: var(--bg-card-hover);
}

.card-timeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 24px;
}

.node-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  border: 3px solid var(--bg-surface);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  margin-top: 4px;
}

.is-geological .node-dot {
  background: var(--accent-amber);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

.card-content-wrap {
  flex: 1 1 0%;
  min-width: 0;
}

.card-top-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.6rem;
}

.card-mya-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
}

.is-geological .card-mya-tag {
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.1);
}

.card-period-tag {
  font-size: 0.75rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-dim);
}

.badge-spain {
  font-size: 0.75rem;
  font-weight: 600;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.card-main-grid {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.card-thumb-box {
  width: 110px;
  height: 90px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000000;
  border: 1px solid var(--border-subtle);
}

.card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.timeline-entry-card:hover .card-thumb-img {
  transform: scale(1.05);
}

.card-text-box {
  flex: 1 1 0%;
  min-width: 0;
}

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

.card-title.scientific-name {
  font-style: italic;
}

.card-subtitle {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.card-description {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.6rem;
}

.card-innovation-pill {
  font-size: 0.78rem;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  border-left: 3px solid var(--accent-cyan);
  padding: 0.35rem 0.6rem;
  border-radius: 0 4px 4px 0;
  line-height: 1.4;
}

.card-footer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.6rem;
}

.btn-card-inspect {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-heading);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-card-inspect:hover {
  background: rgba(56, 189, 248, 0.12);
}

/* ==========================================================================
   PESTAÑA 2: RELOJ CÓSMICO DE 24 HORAS
   ========================================================================== */

.clock-view-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1.5rem;
  align-items: center;
}

.clock-canvas-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

#cosmic-clock-canvas {
  width: 100%;
  max-width: 440px;
  height: 440px;
  touch-action: none;
}

.clock-controls-bar {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  width: 100%;
  max-width: 440px;
  justify-content: center;
}

.btn-clock-action {
  flex: 1 1 auto;
  height: 44px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-clock-action.primary {
  background: var(--accent-cyan);
  color: #07090e;
}

.btn-clock-action.primary:hover {
  background: #7dd3fc;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.btn-clock-action.secondary {
  background: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-clock-action.secondary:hover {
  background: var(--bg-card-hover);
}

.clock-sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.clock-status-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.25rem;
}

.status-label-small {
  font-size: 0.75rem;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.clock-digital-big {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.clock-mya-big {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin: 0.4rem 0 0.6rem;
}

.clock-eon-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  border: 1px solid;
}

.clock-milestone-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8));
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.25rem;
}

.milestone-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-amber);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.milestone-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.milestone-time-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
}

.milestone-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.clock-legend-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.25rem;
}

.legend-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.legend-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ==========================================================================
   PESTAÑA 3: LAS 5 GRANDES EXTINCIONES MASIVAS
   ========================================================================== */

.extinctions-view-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chart-canvas-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

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

.chart-sub-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
}

#extinctions-chart-canvas {
  width: 100%;
  height: 260px;
}

.extinctions-grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.extinction-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.extinction-card:hover {
  transform: translateY(-2px);
  border-color: rgba(239, 68, 68, 0.4);
}

.extinction-card.is-anthropocene {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, var(--bg-surface), rgba(245, 158, 11, 0.05));
}

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

.extinction-number {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.extinction-card.is-anthropocene .extinction-number {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
}

.extinction-mya {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.extinction-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.extinction-loss-stat {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.loss-number {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 800;
  color: #ef4444;
}

.extinction-card.is-anthropocene .loss-number {
  font-size: 1.2rem;
  color: #f59e0b;
}

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

.extinction-causes, .extinction-affected, .extinction-recovery {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ==========================================================================
   MODAL CIENTÍFICO 360° (Sin alerts)
   ========================================================================== */

.scientific-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(8px);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.scientific-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.scientific-modal-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(0.96);
  width: 90%;
  max-width: 780px;
  max-height: 88vh;
  background: #0f172a;
  border: 1px solid var(--border-accent);
  border-radius: 18px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.25s ease;
  overflow: hidden;
}

.scientific-modal-container.is-open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.modal-header-bar {
  display: flex;
  justify-content: flex-end;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.9);
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
  display: inline-flex;
  transition: all 0.15s ease;
}

.btn-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.scientific-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
}

.modal-species-header {
  margin-bottom: 1.25rem;
}

.modal-period-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.modal-scientific-name {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.2;
}

.modal-common-name {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.modal-species-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: flex-start;
}

.modal-image-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal-image-frame {
  width: 100%;
  height: 240px;
  border-radius: 12px;
  overflow: hidden;
  background: #000000;
  border: 1px solid var(--border-subtle);
}

.modal-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-image-caption {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.3;
}

.modal-details-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-box {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.9rem;
}

.detail-box-title {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.detail-box-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.highlight-text {
  color: var(--accent-cyan);
  font-weight: 500;
}

.detail-stats-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.stat-cell {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
}

.stat-cell-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-heading);
  text-transform: uppercase;
}

.stat-cell-value {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 0.15rem;
}

.modal-atmosphere-panel {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: 10px;
  padding: 0.85rem;
}

.atmosphere-panel-title {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 0.6rem;
}

.atmosphere-stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.atm-item {
  text-align: center;
}

.atm-val {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.atm-lbl {
  display: block;
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.specimen-tag, .extinction-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ==========================================================================
   ADAPTACIÓN RESPONSIVA Y MÓVIL CANÓNICA (generales.md)
   ========================================================================== */

@media (max-width: 1024px) {
  .clock-view-grid {
    grid-template-columns: 1fr;
  }
  .clock-sidebar-panel {
    max-width: 440px;
    margin: 0 auto;
    width: 100%;
  }
  .modal-species-grid {
    grid-template-columns: 1fr;
  }
  .modal-image-frame {
    height: 180px;
  }
}

@media (max-width: 768px) {
  .tool-layout {
    margin: 0.75rem auto 2rem;
    padding: 0 0.75rem;
  }

  .chrono-hero-card {
    padding: 1.25rem;
  }

  .hero-main-title {
    font-size: 1.35rem;
  }

  .search-and-toggles-row {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-actions-group {
    width: 100%;
  }

  .btn-tool-action {
    flex: 1 1 auto;
    justify-content: center;
  }

  .card-main-grid {
    flex-direction: column;
  }

  .card-thumb-box {
    width: 100%;
    height: 140px;
  }

  #cosmic-clock-canvas {
    height: 320px;
  }

  .atmosphere-stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .scientific-modal-container {
    width: 95%;
    max-height: 92vh;
  }

  .scientific-modal-body {
    padding: 1rem;
  }
}
