/* ==========================================================================
   Fijate Tools - Calculadora de purines, estiércoles y límite de nitratos (RD 1051/2022)
   Estilos corporativos accesibles, responsive, temas claro/oscuro y plantilla de impresión A4
   ========================================================================== */

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

  /* Paleta cromática agrícola institucional */
  --color-primary: #15803d;
  --color-primary-hover: #166534;
  --color-primary-light: rgba(22, 163, 74, 0.12);
  --color-accent: #0284c7;

  /* Semáforos RAG de cumplimiento legal */
  --rag-green: #16a34a;
  --rag-green-bg: rgba(22, 163, 74, 0.12);
  --rag-green-border: rgba(22, 163, 74, 0.35);

  --rag-amber: #d97706;
  --rag-amber-bg: rgba(217, 119, 6, 0.12);
  --rag-amber-border: rgba(217, 119, 6, 0.35);

  --rag-red: #dc2626;
  --rag-red-bg: rgba(220, 38, 38, 0.12);
  --rag-red-border: rgba(220, 38, 38, 0.35);

  /* Tema claro por defecto */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #16a34a;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

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

[data-theme="dark"] {
  --bg-body: #0b0f17;
  --bg-card: #131b26;
  --bg-card-subtle: #1a2332;
  --bg-input: #101620;
  --border-color: #243042;
  --border-focus: #22c55e;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-inverse: #0b0f17;

  --rag-green-bg: rgba(34, 197, 94, 0.16);
  --rag-amber-bg: rgba(245, 158, 11, 0.16);
  --rag-red-bg: rgba(239, 68, 68, 0.18);
}

/* Contención global y layout canónico */
html {
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: inherit;
}

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

/* Barra de navegación de suite agraria */
.suite-nav-strip {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 1rem;
}

.suite-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.suite-nav-inner::-webkit-scrollbar {
  display: none;
}

.suite-nav-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.suite-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.suite-link-item {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-main);
  text-decoration: none;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  transition: all 0.15s ease;
}

.suite-link-item:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.suite-link-item.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
}

/* Layout principal de herramienta con barra lateral */
.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%;
}

/* Tarjeta principal contenedora */
.card-main {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  margin-bottom: 2rem;
}

/* Hero header */
.hero-header {
  margin-bottom: 1.75rem;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 9999px;
  margin-bottom: 0.6rem;
}

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

.hero-subtitle {
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}

/* Presets rápidos */
.presets-strip {
  margin-bottom: 1.5rem;
  padding: 0.85rem 1rem;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.presets-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.presets-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preset-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.preset-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.preset-btn.active {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 700;
}

/* Cuadrícula de calculadora (formulario vs resultados) */
.calc-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.15fr;
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 992px) {
  .calc-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Secciones de formulario */
.section-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.section-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.box-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

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

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.form-hint {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  min-height: 40px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.92rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

/* Select canónico con flecha SVG */
.form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0.55rem 2.5rem 0.55rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-input);
  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='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 16px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.9rem;
  appearance: none;
  -webkit-appearance: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

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

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

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

@media (max-width: 600px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Switch y checkbox accesibles */
.toggle-switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.toggle-switch-text {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
}

.toggle-switch-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: block;
}

.toggle-input {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* Radio buttons de modo */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.radio-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.86rem;
}

.radio-item input[type="radio"] {
  margin-top: 0.2rem;
  accent-color: var(--color-primary);
}

.radio-item strong {
  display: block;
  color: var(--text-main);
}

.radio-item span {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Panel de Resultados y Semáforos
   ========================================================================== */
.results-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Tarjeta Semáforo Legal RAG */
.status-card {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all 0.25s ease;
}

.status-card.status-conforme {
  background: var(--rag-green-bg);
  border-color: var(--rag-green-border);
  color: var(--rag-green);
}

.status-card.status-alerta {
  background: var(--rag-amber-bg);
  border-color: var(--rag-amber-border);
  color: var(--rag-amber);
}

.status-card.status-infraccion {
  background: var(--rag-red-bg);
  border-color: var(--rag-red-border);
  color: var(--rag-red);
}

.status-header {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.status-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
}

.status-info {
  flex: 1;
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.badge-success { background: var(--rag-green); color: #fff; }
.badge-warning { background: var(--rag-amber); color: #fff; }
.badge-danger { background: var(--rag-red); color: #fff; }

.status-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 0.35rem 0;
  color: var(--text-main);
}

.status-subtitle {
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0;
  color: var(--text-main);
}

.gauge-track {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 9999px;
  margin-top: 0.85rem;
  overflow: hidden;
}

.gauge-bar {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.status-conforme .gauge-bar { background: var(--rag-green); }
.status-alerta .gauge-bar { background: var(--rag-amber); }
.status-infraccion .gauge-bar { background: var(--rag-red); }

/* Cuadrícula de KPIs */
.kpis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

@media (max-width: 600px) {
  .kpis-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

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

.kpi-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.kpi-value-box {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.kpi-val {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
}

.kpi-unit {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

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

/* Tabla de balance de unidades fertilizantes */
.table-uf {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.table-uf th, .table-uf td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table-uf th {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-card-subtle);
}

.table-uf td strong {
  color: var(--text-main);
  font-family: var(--font-mono);
}

/* Barras de cobertura nutricional del cultivo */
.coverage-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.coverage-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.coverage-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 600;
}

.coverage-bar-track {
  width: 100%;
  height: 8px;
  background: var(--border-color);
  border-radius: 9999px;
  overflow: hidden;
}

.coverage-bar-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.badge-deficit {
  color: #ea580c;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-equilibrado {
  color: #16a34a;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-superavit {
  color: #0284c7;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Tarjeta de Ahorro en Fertilizante Mineral */
.card-savings {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.08) 0%, rgba(2, 132, 199, 0.08) 100%);
  border: 1px solid var(--rag-green-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.savings-total-box {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-color);
}

.savings-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.savings-amount {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--color-primary);
}

.savings-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  font-size: 0.82rem;
}

.savings-item strong {
  font-family: var(--font-mono);
  color: var(--text-main);
}

/* Lista de recomendaciones técnicas */
.list-recs {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.rec-card {
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--border-color);
  background: var(--bg-card);
  font-size: 0.84rem;
}

.rec-peligro {
  border-left-color: var(--rag-red);
  background: var(--rag-red-bg);
}

.rec-aviso {
  border-left-color: var(--rag-amber);
  background: var(--rag-amber-bg);
}

.rec-exito {
  border-left-color: var(--rag-green);
  background: var(--rag-green-bg);
}

.rec-norma, .rec-agronomia, .rec-legal {
  border-left-color: var(--color-accent);
  background: var(--bg-card-subtle);
}

.rec-title {
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: var(--text-main);
}

.rec-text {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Botón de acción principal (CUE) */
.btn-action-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 1.25rem;
  background: var(--color-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.btn-action-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.5rem 1rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

/* ==========================================================================
   Modales accesibles (Sin window.alert)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 850px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-main);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
}

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

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

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

/* Estilos de documento CUE dentro del modal */
.cue-document {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-main);
}

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

.cue-doc-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 0.25rem 0;
}

.cue-doc-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cue-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
}

.cue-section {
  margin-bottom: 1.25rem;
}

.cue-section-heading {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.25rem;
}

.cue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  margin-bottom: 0.5rem;
}

.cue-table th, .cue-table td {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border-color);
}

.cue-table th {
  background: var(--bg-card-subtle);
  font-weight: 700;
}

.cue-verdict {
  padding: 0.6rem;
  border-radius: var(--radius-sm);
}

.cue-verdict-conforme { background: var(--rag-green-bg); color: var(--rag-green); }
.cue-verdict-alerta { background: var(--rag-amber-bg); color: var(--rag-amber); }
.cue-verdict-infraccion { background: var(--rag-red-bg); color: var(--rag-red); }

.cue-highlight-box {
  background: var(--color-primary-light);
  border: 1px solid var(--rag-green-border);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  margin-top: 0.5rem;
}

.cue-footer-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
  padding-top: 1rem;
}

.signature-line {
  margin-top: 3.5rem;
  border-top: 1px solid var(--border-color);
}

/* Toast feedback flotante */
.toast-msg {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================================================
   Guía Agronómica y Preguntas Frecuentes SEO
   ========================================================================== */
.guide-container {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}

.guide-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0 0 1rem 0;
  color: var(--text-main);
}

.guide-prose {
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.guide-prose p {
  margin-bottom: 1rem;
}

.guide-prose h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 1.5rem 0 0.5rem 0;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

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

.faq-question {
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-size: 0.96rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-main);
}

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

.faq-question:after {
  content: "+";
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-question:after {
  content: "−";
}

.faq-answer {
  padding: 0 1.25rem 1.25rem 1.25rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* ==========================================================================
   Modo Impresión A4 para Inspección / CUE
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .app-header,
  .suite-nav-strip,
  .tools-ad-banner-section,
  .tool-ad-sidebar,
  .fijate-footer,
  .form-panel,
  .presets-strip,
  .modal-overlay,
  .guide-container,
  .related-tools-section,
  .affiliate-showcase-container {
    display: none !important;
  }

  .tool-layout, .card-main {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* Si el modal CUE estaba abierto durante print, imprimir exclusivamente el documento */
  .modal-overlay:has(#modal-cue[style*="display: flex"]),
  #modal-cue[style*="display: flex"] {
    display: block !important;
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
  }

  .modal-dialog {
    max-width: 100% !important;
    border: none !important;
    box-shadow: none !important;
  }

  .modal-header, .modal-footer {
    display: none !important;
  }

  .cue-document {
    font-size: 10pt;
  }

  .cue-table th, .cue-table td {
    border-color: #000000 !important;
  }
}
