/* ==========================================================================
   Enciclopedia del trastorno de pica e ingestión inusual
   Fijate Tools - Hojas de estilo oficiales
   ========================================================================== */

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

  /* Modo oscuro canónico (Midnight Slate) Dark-First */
  --bg-body: #0b0f17;
  --bg-card: #111827;
  --bg-card-subtle: #1e293b;
  --bg-card-hover: #1f293d;
  --bg-input: #0f172a;
  --border-color: #334155;
  --border-subtle: #1e293b;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-glow: rgba(2, 132, 199, 0.25);

  --accent-teal: #14b8a6;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-emerald: #10b981;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

[data-theme="light"] {
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-card-hover: #e2e8f0;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-subtle: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #94a3b8;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   Estructura general y Contención
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  margin-top: 0;
  font-weight: 700;
  line-height: 1.25;
}

.text-mono {
  font-family: var(--font-mono);
}

/* Layout Canónico */
.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%;
}

/* Banner de alerta médica de cabecera */
.medical-emergency-bar {
  background: linear-gradient(90deg, rgba(244, 63, 94, 0.15), rgba(245, 158, 11, 0.12));
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.emergency-bar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.emergency-bar-left svg {
  color: var(--accent-rose);
  flex-shrink: 0;
}

.emergency-bar-text {
  font-size: 0.92rem;
  color: var(--text-main);
}

.emergency-bar-text strong {
  display: block;
  font-size: 0.98rem;
  color: var(--accent-rose);
}

.btn-emergency-call {
  background-color: var(--accent-rose);
  color: #ffffff;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
  min-height: 40px;
}

.btn-emergency-call:hover {
  background-color: #e11d48;
  transform: translateY(-1px);
}

/* Hero Section */
.pica-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  background: var(--primary-glow);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.hero-main-title {
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 900px;
  margin-bottom: 1.25rem;
}

.hero-kpis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
}

.hero-kpi-item {
  display: flex;
  flex-direction: column;
}

.hero-kpi-num {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: #38bdf8;
}

.hero-kpi-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Pestañas de Navegación */
.nav-tabs-wrapper {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-height: 44px;
}

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

.nav-tab-btn.active {
  color: #38bdf8;
  background: var(--bg-card);
  border-bottom: 2px solid #38bdf8;
  margin-bottom: -2px;
}

/* Paneles de Contenido */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.25s ease-in-out;
}

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

/* ==========================================================================
   Pestaña 1: Catálogo de Pica
   ========================================================================== */
.catalog-controls-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-input-wrap {
  position: relative;
  width: 100%;
}

.search-input-wrap svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1rem;
  min-height: 44px;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  border-color: #38bdf8;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.filter-group-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 0.25rem;
  font-weight: 600;
}

.pill-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.pill-btn:hover {
  background: var(--bg-card-hover);
  border-color: #38bdf8;
}

.pill-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.catalog-stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding: 0 0.25rem;
}

/* Rejilla de Tarjetas */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.pica-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  outline: none;
}

.pica-card:hover, .pica-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #38bdf8;
}

.pica-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.pica-icon {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.pica-title-wrap {
  flex: 1;
  min-width: 0;
}

.pica-card-title {
  font-size: 1.15rem;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pica-card-substance {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: block;
}

.pica-card-etymology {
  font-size: 0.82rem;
  color: var(--text-light);
  margin: 0 0 0.75rem 0;
}

.pica-card-snippet {
  font-size: 0.88rem;
  color: var(--text-main);
  background: var(--bg-card-subtle);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  flex: 1;
}

.pica-card-snippet strong {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  letter-spacing: 0.04em;
}

.pica-card-snippet p {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.pica-tag {
  color: var(--text-muted);
}

.btn-text-action {
  background: none;
  border: none;
  color: #38bdf8;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
}

/* Badges de Riesgo */
.risk-badge {
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-risk-low {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-risk-medium {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-risk-high {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-risk-critical {
  background: #dc2626;
  color: #ffffff;
  border: 1px solid #b91c1c;
  animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* Empty state */
.empty-state-card {
  grid-column: 1 / -1;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 3rem 1.5rem;
  text-align: center;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

/* ==========================================================================
   Pestaña 2: Evaluador Clínico DSM-5
   ========================================================================== */
.evaluator-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.evaluator-intro-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.evaluator-intro-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.evaluator-form {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.form-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: -0.25rem;
}

.form-select, .form-input {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  outline: none;
}

.form-select option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  min-height: 44px;
}

.checkbox-card:hover {
  background: var(--bg-card-hover);
  border-color: #38bdf8;
}

.checkbox-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 0.15rem;
  cursor: pointer;
}

.form-actions-row {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
}

.btn {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: #0284c7;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #0369a1;
}

.btn-secondary {
  background-color: var(--bg-card-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

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

/* Tarjeta de Resultado del Evaluador */
.evaluator-result-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-top: 1rem;
  box-shadow: var(--shadow-lg);
  border-left: 6px solid #38bdf8;
}

.evaluator-result-card.result-low {
  border-left-color: #10b981;
}

.evaluator-result-card.result-medium {
  border-left-color: #f59e0b;
}

.evaluator-result-card.result-high {
  border-left-color: #f43f5e;
}

.evaluator-result-card.result-critical {
  border-left-color: #dc2626;
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.08), var(--bg-card));
}

.result-card-header {
  margin-bottom: 1.25rem;
}

.result-badge {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.result-title {
  font-size: 1.35rem;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
}

.urgent-alert-banner {
  background: rgba(220, 38, 38, 0.2);
  border: 1px solid rgba(220, 38, 38, 0.5);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  color: #fecaca;
  margin-bottom: 1.25rem;
}

.urgent-alert-banner svg {
  color: #f87171;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.urgent-alert-banner p {
  margin: 0.25rem 0 0 0;
  color: #fee2e2;
  font-size: 0.92rem;
}

.result-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.result-summary-item {
  display: flex;
  flex-direction: column;
}

.summary-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-val {
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 0.15rem;
}

.result-section-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  margin-bottom: 1rem;
}

.result-section-heading {
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.result-bullet-list {
  margin: 0;
  padding-left: 1.4rem;
  font-size: 0.92rem;
}

.result-bullet-list li {
  margin-bottom: 0.4rem;
}

.result-footer-disclaimer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Pestaña 3: Atlas Anatómico de Bezoares
   ========================================================================== */
.anatomy-layout-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .anatomy-layout-grid {
    grid-template-columns: 1fr;
  }
}

.anatomy-sidebar-nav {
  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.6rem;
}

.anatomy-sidebar-nav h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.anatomy-zone-item {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  text-align: left;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.2s ease;
  min-height: 48px;
  display: flex;
  flex-direction: column;
}

.anatomy-zone-item:hover {
  background: var(--bg-card-hover);
  border-color: #38bdf8;
}

.anatomy-zone-item.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.anatomy-zone-item strong {
  font-size: 0.95rem;
}

.anatomy-zone-item span {
  font-size: 0.8rem;
  opacity: 0.85;
}

.anatomy-card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.anatomy-pill-tag {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.anatomy-zone-title {
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
}

.anatomy-zone-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.anatomy-zone-desc {
  font-size: 1rem;
  color: var(--text-main);
  line-height: 1.6;
}

.anatomy-risks-box {
  background: var(--bg-card-subtle);
  border-left: 4px solid var(--accent-rose);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.anatomy-risks-box h4 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--accent-rose);
}

.anatomy-risks-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.92rem;
}

.anatomy-risks-list li {
  margin-bottom: 0.35rem;
}

.anatomy-related-box h4 {
  font-size: 0.95rem;
  margin-bottom: 0.65rem;
}

.anatomy-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-pica-link {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.tag-pica-link:hover {
  border-color: #38bdf8;
  color: #38bdf8;
  background: var(--bg-card-hover);
}

/* ==========================================================================
   Pestaña 4: Casos Históricos y Récords
   ========================================================================== */
.historical-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
}

.historical-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
}

.historical-card-badge {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--primary-glow);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.historical-card-name {
  font-size: 1.3rem;
  margin-bottom: 0.15rem;
  padding-right: 6rem;
}

.historical-card-years {
  font-size: 0.82rem;
  color: var(--text-light);
  display: block;
}

.historical-card-title {
  font-size: 1.05rem;
  color: #38bdf8;
  margin-top: 0.25rem;
  margin-bottom: 0;
}

.historical-summary {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.historical-feats-box {
  background: var(--bg-card-subtle);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.historical-feats-box strong {
  display: block;
  margin-bottom: 0.35rem;
}

.historical-feats-box ul {
  margin: 0;
  padding-left: 1.25rem;
}

.historical-feats-box li {
  margin-bottom: 0.25rem;
}

.historical-bio-box {
  font-size: 0.9rem;
  line-height: 1.5;
}

.historical-curiosity-box {
  font-size: 0.85rem;
  color: var(--accent-amber);
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

/* ==========================================================================
   Modales Canónicos
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 760px;
  max-height: 88vh;
  overflow-y: auto;
  z-index: 9999;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 1.75rem;
}

.modal-container.active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.btn-close-modal {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-close-modal:hover {
  background: var(--bg-card-hover);
  color: #ffffff;
}

.modal-pica-hero {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
}

.modal-pica-title-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.modal-pica-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.modal-pica-heading {
  font-size: 1.5rem;
  margin-bottom: 0.2rem;
}

.modal-pica-substance {
  font-size: 1rem;
  color: var(--text-muted);
}

.modal-pica-etymology {
  font-size: 0.85rem;
  color: var(--text-light);
}

.modal-badge {
  margin-left: auto;
}

.modal-pica-content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.modal-section-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
}

.modal-section-box.alert-box-warning {
  border-left: 4px solid var(--accent-rose);
}

.modal-section-box.success-box {
  border-left: 4px solid var(--accent-emerald);
}

.modal-section-box.curiosity-box {
  border-left: 4px solid var(--accent-amber);
}

.section-box-title {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-box-text {
  font-size: 0.92rem;
  margin: 0;
  line-height: 1.55;
}

.modal-actions-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
}

/* ==========================================================================
   Sección Educativa y SEO Acordeones
   ========================================================================== */
.edu-guide-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}

.edu-guide-section h2 {
  font-size: 1.45rem;
  margin-bottom: 0.75rem;
}

.edu-guide-intro {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.edu-accordions-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.edu-accordion {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card-subtle);
  overflow: hidden;
}

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

.edu-accordion summary::-webkit-details-marker {
  display: none;
}

.edu-accordion summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.edu-accordion[open] summary::after {
  content: '−';
  transform: rotate(180deg);
}

.edu-accordion-body {
  padding: 0 1.25rem 1.25rem 1.25rem;
  font-size: 0.95rem;
  color: var(--text-main);
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  line-height: 1.6;
}

/* Estilos de Impresión */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .app-header,
  .fijate-footer,
  .tools-ad-banner-section,
  .tool-ad-sidebar,
  .nav-tabs-wrapper,
  .catalog-controls-card,
  .medical-emergency-bar,
  .form-actions-row,
  .result-footer-disclaimer button,
  .affiliate-showcase-section,
  .edu-guide-section {
    display: none !important;
  }
  .tool-layout, .tool-with-sidebar, .tool-main-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }
  .evaluator-result-card {
    border: 1px solid #000000 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .tool-layout {
    padding: 0 0.75rem;
    margin: 1rem auto 2rem;
  }
  .hero-main-title {
    font-size: 1.45rem;
  }
  .hero-kpis-grid {
    grid-template-columns: 1fr 1fr;
  }
  .catalog-grid {
    grid-template-columns: 1fr;
  }
  .pica-card-title {
    white-space: normal;
  }
  .historical-grid {
    grid-template-columns: 1fr;
  }
  .modal-container {
    width: 95%;
    padding: 1.25rem;
  }
  .emergency-bar-left {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn-emergency-call {
    width: 100%;
    justify-content: center;
  }
}

