/* ==========================================================================
   Guía pericial de enfermedades en perros y gatos por razas - Estilos
   ========================================================================== */

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

  /* Colores base tema oscuro por defecto */
  --bg-page: #0b0f17;
  --bg-card: #131b26;
  --bg-card-subtle: #192433;
  --bg-input: #0e1520;
  --border-color: #223247;
  --border-focus: #3b82f6;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --primary: #38bdf8;
  --primary-hover: #0ea5e9;
  --primary-subtle: rgba(56, 189, 248, 0.12);

  --accent-red: #ef4444;
  --accent-red-subtle: rgba(239, 68, 68, 0.15);
  --accent-yellow: #f59e0b;
  --accent-yellow-subtle: rgba(245, 158, 11, 0.15);
  --accent-green: #10b981;
  --accent-green-subtle: rgba(16, 185, 129, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #0284c7;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #94a3b8;

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

  --accent-red: #dc2626;
  --accent-red-subtle: rgba(220, 38, 38, 0.1);
  --accent-yellow: #d97706;
  --accent-yellow-subtle: rgba(217, 119, 6, 0.1);
  --accent-green: #059669;
  --accent-green-subtle: rgba(5, 150, 105, 0.1);

  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* --------------------------------------------------------------------------
   Reset & Contención Canónica
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

.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%;
}

/* --------------------------------------------------------------------------
   Hero / Intro de la herramienta
   -------------------------------------------------------------------------- */
.tool-intro-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-card);
}

.tool-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tag-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--bg-card-subtle);
  color: var(--primary);
  border: 1px solid var(--border-color);
}

.tool-main-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.tool-main-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 900px;
}

/* --------------------------------------------------------------------------
   Navegación de módulos (Tabs principales)
   -------------------------------------------------------------------------- */
.app-nav-tabs-wrapper {
  margin-bottom: 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.app-nav-tabs-list {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.app-nav-tab {
  appearance: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

.app-nav-tab.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

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

.app-tab-panel {
  display: none;
}

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

/* --------------------------------------------------------------------------
   Barra de control y filtros
   -------------------------------------------------------------------------- */
.controls-bar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
}

.species-switch-group {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  gap: 0.25rem;
}

.species-toggle-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.species-toggle-btn.active {
  background: var(--primary);
  color: #ffffff;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
}

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

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}

.form-control-input {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.9rem 0.6rem 2.6rem;
  font-family: var(--font-main);
  font-size: 0.92rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease;
}

.form-control-input:focus {
  border-color: var(--border-focus);
}

.form-select-control {
  appearance: none;
  min-height: 44px;
  padding: 0.6rem 2.5rem 0.6rem 1rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  background: var(--bg-input) url('data:image/svg+xml;utf8,<svg fill="%2394a3b8" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat right 0.75rem center;
  background-size: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  max-width: 100%;
  outline: none;
}

.form-select-control:focus {
  border-color: var(--border-focus);
}

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

.count-indicator {
  font-size: 0.85rem;
  color: var(--text-subtle);
  font-weight: 500;
  margin-left: auto;
}

/* --------------------------------------------------------------------------
   Grid de Razas
   -------------------------------------------------------------------------- */
.breeds-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.breed-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.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-card);
}

.breed-card:hover, .breed-card:focus {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  outline: none;
}

.breed-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

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

.breed-meta-pill {
  font-size: 0.78rem;
  color: var(--text-subtle);
  display: block;
  margin-top: 0.2rem;
}

.breed-risk-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.breed-risk-badge.badge-high {
  background: var(--accent-red-subtle);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.breed-risk-badge.badge-normal {
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.breed-desc-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.breed-predispositions-list {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.predispositions-caption {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-subtle);
  font-weight: 700;
  display: block;
  margin-bottom: 0.4rem;
}

.breed-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.breed-tag-pill {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.breed-tag-pill.risk-high {
  background: var(--accent-red-subtle);
  color: var(--accent-red);
}

.breed-tag-pill.risk-mod {
  background: var(--accent-yellow-subtle);
  color: var(--accent-yellow);
}

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

.btn-text-action {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
}

/* --------------------------------------------------------------------------
   Grid de Patologías
   -------------------------------------------------------------------------- */
.diseases-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.disease-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--shadow-card);
  position: relative;
}

.disease-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

.disease-card.danger::before {
  background: var(--accent-red);
}

.disease-card.warning::before {
  background: var(--accent-yellow);
}

.disease-card.info::before {
  background: var(--primary);
}

.disease-card:hover, .disease-card:focus {
  transform: translateY(-2px);
  border-color: var(--primary);
  outline: none;
}

.disease-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.species-badge {
  font-size: 0.75rem;
  color: var(--text-subtle);
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

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

.urgency-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.urgency-danger {
  background: var(--accent-red-subtle);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.urgency-warning {
  background: var(--accent-yellow-subtle);
  color: var(--accent-yellow);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.urgency-info {
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.disease-summary-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.9rem;
}

.disease-flags-preview {
  background: var(--bg-card-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
}

.flag-caption {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-red);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 0.2rem;
}

.flag-text {
  font-size: 0.82rem;
  color: var(--text-main);
  line-height: 1.4;
}

.disease-card-footer {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}

/* --------------------------------------------------------------------------
   Módulo de Triaje por Síntomas
   -------------------------------------------------------------------------- */
.triage-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
}

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

.step-number-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 0.25rem;
}

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

.step-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.triage-pet-selector-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.symptom-group-block {
  margin-bottom: 1.25rem;
}

.symptom-group-heading {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-subtle);
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.symptom-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.symptom-chip {
  appearance: none;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.84rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  line-height: 1.3;
  text-align: left;
}

.symptom-chip:hover {
  background: var(--bg-input);
  color: var(--text-main);
  border-color: var(--primary);
}

.symptom-chip.selected {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  font-weight: 600;
}

.symptom-chip.chip-red-flag.selected {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #ffffff;
}

.chip-alert-icon {
  font-size: 0.95rem;
}

/* Banner de Alerta Crítica (Red Flags) */
.triage-red-flag-container {
  margin-bottom: 1.5rem;
}

.red-flag-alert-box {
  background: rgba(239, 68, 68, 0.12);
  border: 2px solid var(--accent-red);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  animation: pulse-border 2s infinite ease-in-out;
}

@keyframes pulse-border {
  0%, 100% { border-color: var(--accent-red); }
  50% { border-color: rgba(239, 68, 68, 0.4); }
}

.alert-icon-big {
  font-size: 2rem;
  line-height: 1;
}

.alert-strong {
  font-size: 1rem;
  color: var(--accent-red);
  display: block;
  margin-bottom: 0.5rem;
}

.red-flags-detected-list {
  list-style: disc;
  margin-left: 1.25rem;
  color: var(--text-main);
  font-size: 0.88rem;
  margin-bottom: 0.65rem;
}

.alert-recommendation {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Resultados del triaje */
.triage-matches-header {
  margin-bottom: 1rem;
}

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

.matches-subtitle {
  font-size: 0.82rem;
  color: var(--text-subtle);
}

.triage-cards-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.triage-match-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}

.match-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.match-disease-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.breed-risk-chip {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-yellow);
  background: var(--accent-yellow-subtle);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-top: 0.2rem;
}

.match-summary {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.matched-symptoms-box {
  background: var(--bg-card-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
}

.matched-caption {
  font-size: 0.74rem;
  color: var(--text-subtle);
  display: block;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.matched-items-list {
  list-style: square;
  margin-left: 1.2rem;
  font-size: 0.82rem;
  color: var(--primary);
}

.btn-sm-primary {
  appearance: none;
  background: var(--primary);
  border: none;
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-sm-primary:hover {
  background: var(--primary-hover);
}

.triage-actions-bar {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

.btn-primary-large {
  appearance: none;
  background: var(--primary);
  border: none;
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-primary-large:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Módulo de Generador de Informe
   -------------------------------------------------------------------------- */
.report-workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.report-editor-card, .report-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-textarea {
  width: 100%;
  padding: 0.75rem;
  font-family: var(--font-main);
  font-size: 0.88rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  resize: vertical;
  min-height: 100px;
  outline: none;
}

.form-textarea:focus {
  border-color: var(--border-focus);
}

.report-preview-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn-secondary {
  appearance: none;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--bg-input);
  border-color: var(--primary);
}

.btn-success-state {
  background: var(--accent-green) !important;
  color: #ffffff !important;
  border-color: var(--accent-green) !important;
}

/* Hoja imprimible del informe */
.printable-report {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

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

.rep-subtitle {
  font-size: 0.78rem;
  color: var(--text-subtle);
}

.rep-brand-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
}

.report-grid-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 1.25rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.rep-field strong {
  color: var(--text-subtle);
}

.rep-field span {
  color: var(--text-main);
  font-weight: 500;
}

.report-vitals-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.rep-vital-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--primary);
}

.rep-vital-pill strong {
  color: var(--text-main);
}

.report-box-section {
  margin-bottom: 1rem;
}

.rep-box-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-subtle);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.rep-text-pre {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-family: var(--font-main);
  font-size: 0.85rem;
  color: var(--text-main);
  white-space: pre-wrap;
  line-height: 1.5;
}

.report-legal-notice {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
  font-size: 0.74rem;
  color: var(--text-subtle);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Modal Accesible de Detalle
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  animation: modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

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

.btn-close-modal {
  appearance: none;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

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

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Contenido dentro del modal */
.breed-modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.meta-metric-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
}

.metric-label {
  font-size: 0.72rem;
  color: var(--text-subtle);
  display: block;
  text-transform: uppercase;
}

.metric-val {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.breed-modal-section, .disease-modal-section {
  margin-bottom: 1.25rem;
}

.section-title-sm {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.45rem;
}

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

.breed-modal-dis-item {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-bottom: 0.65rem;
}

.dis-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.dis-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
}

.risk-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.risk-badge-danger {
  background: var(--accent-red-subtle);
  color: var(--accent-red);
}

.risk-badge-warning {
  background: var(--accent-yellow-subtle);
  color: var(--accent-yellow);
}

.dis-item-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.btn-action-link {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
}

.screenings-checklist, .diagnostics-list {
  list-style: disc;
  margin-left: 1.25rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.modal-urgency-banner {
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.banner-danger {
  background: var(--accent-red-subtle);
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
}

.banner-warning {
  background: var(--accent-yellow-subtle);
  border: 1px solid var(--accent-yellow);
  color: var(--accent-yellow);
}

.banner-info {
  background: var(--primary-subtle);
  border: 1px solid var(--primary);
  color: var(--primary);
}

.banner-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
}

.banner-desc {
  font-size: 0.82rem;
  color: var(--text-main);
}

.symptoms-columns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.symptom-col {
  background: var(--bg-card-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}

.critical-col {
  border-left: 3px solid var(--accent-red);
}

.early-col {
  border-left: 3px solid var(--primary);
}

.symptom-check-list {
  list-style: none;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.symptom-check-list li {
  margin-bottom: 0.4rem;
}

.red-flag-item {
  color: var(--accent-red);
  font-weight: 500;
}

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

.empty-state-card svg {
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Estilos de Impresión (@media print)
   -------------------------------------------------------------------------- */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .app-header,
  .fijate-footer,
  .tools-ad-banner-section,
  .tool-ad-sidebar,
  .app-nav-tabs-wrapper,
  .report-editor-card,
  .report-preview-actions,
  .seo-guide-section,
  .affiliate-section,
  .tool-intro-card {
    display: none !important;
  }

  .tool-layout {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .tool-with-sidebar {
    display: block !important;
  }

  .report-workspace-grid {
    grid-template-columns: 1fr !important;
  }

  .printable-report {
    border: 1px solid #000000 !important;
    background: #ffffff !important;
    padding: 1.5cm !important;
  }

  .rep-title, .rep-field span, .rep-text-pre {
    color: #000000 !important;
  }
}

/* --------------------------------------------------------------------------
   Media Queries Responsivas
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .report-workspace-grid {
    grid-template-columns: 1fr;
  }
  .symptoms-columns-grid {
    grid-template-columns: 1fr;
  }
  .breed-modal-meta-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .tool-main-title {
    font-size: 1.4rem;
  }
  .form-group-row {
    grid-template-columns: 1fr;
  }
  .report-grid-section {
    grid-template-columns: 1fr;
  }
  .app-nav-tab {
    padding: 0.5rem 0.85rem;
    font-size: 0.86rem;
  }
  .species-switch-group {
    width: 100%;
  }
  .species-toggle-btn {
    flex: 1;
    text-align: center;
  }
}
