/* ==========================================================================
   Calculadora de riesgo cardiovascular SCORE2 / SCORE2-OP (ESC 2021 España)
   Fijate Tools • Paleta Midnight Slate y Salud Cardiovascular
   ========================================================================== */

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

  /* Paleta semántica Midnight Slate / Cardio */
  --bg-body: #0b0f17;
  --bg-surface: #111827;
  --bg-card: #162032;
  --bg-input: #0e1624;
  --bg-input-focus: #152238;
  --border-color: #24344d;
  --border-focus: #3b82f6;

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

  --primary-color: #ef4444;
  --primary-hover: #dc2626;
  --primary-light: rgba(239, 68, 68, 0.15);

  --accent-cardio: #f43f5e;
  --accent-blue: #38bdf8;

  /* Semáforo ESC */
  --risk-low: #10b981;
  --risk-low-bg: rgba(16, 185, 129, 0.15);
  --risk-mod: #eab308;
  --risk-mod-bg: rgba(234, 179, 8, 0.15);
  --risk-high: #f97316;
  --risk-high-bg: rgba(249, 115, 22, 0.15);
  --risk-veryhigh: #ef4444;
  --risk-veryhigh-bg: rgba(239, 68, 68, 0.2);

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.45);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

[data-theme="light"],
body.light-theme {
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #f1f5f9;
  --bg-input: #ffffff;
  --bg-input-focus: #ffffff;
  --border-color: #cbd5e1;
  --border-focus: #2563eb;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --primary-color: #dc2626;
  --primary-hover: #b91c1c;
  --primary-light: rgba(220, 38, 38, 0.1);

  --risk-low: #059669;
  --risk-low-bg: #ecfdf5;
  --risk-mod: #d97706;
  --risk-mod-bg: #fffbeb;
  --risk-high: #ea580c;
  --risk-high-bg: #fff7ed;
  --risk-veryhigh: #dc2626;
  --risk-veryhigh-bg: #fef2f2;

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

/* Reset y base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

h1, h2, h3, h4, h5, h6,
.brand-title,
.section-title,
.hero-title,
.metric-title {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

.mono,
.risk-number,
.stat-val,
code {
  font-family: var(--font-mono);
}

/* Layout Canónico */
.tool-layout {
  max-width: 1200px;
  width: 100%;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  flex: 1 0 auto;
}

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

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

/* Sidebar Publicitaria Desktop */
.tool-ad-sidebar {
  width: 300px;
  flex-shrink: 0;
  display: none;
}

@media (min-width: 1536px) {
  .tool-ad-sidebar {
    display: block;
  }
}

.ad-sticky-box {
  position: sticky;
  top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.ad-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ad-unit-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* Tarjeta principal */
.card-main {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (max-width: 640px) {
  .card-main {
    padding: 1.25rem 1rem;
    gap: 1.5rem;
  }
}

/* Banner superior informativo */
.tool-notice-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  font-size: 0.875rem;
  color: var(--text-main);
}

.tool-notice-icon {
  flex-shrink: 0;
  color: var(--accent-blue);
  margin-top: 0.15rem;
}

.tool-notice-text p {
  margin: 0;
}

.tool-notice-text strong {
  color: var(--accent-blue);
}

/* Workspace en 2 columnas */
.score-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

@media (min-width: 992px) {
  .score-workspace {
    grid-template-columns: 460px 1fr;
    align-items: stretch;
  }
}

/* Columna de Formulario */
.form-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

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

.panel-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-reset-form {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.825rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.btn-reset-form:hover {
  color: var(--text-main);
  background: var(--bg-surface);
}

/* Grupos y Campos de Formulario */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

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

.label-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* Tabs de selección táctil (Hombre/Mujer, Fumador/No) */
.toggle-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  background: var(--bg-input);
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.toggle-option {
  position: relative;
}

.toggle-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.toggle-option input[type="radio"]:checked + .toggle-label {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-focus);
}

.toggle-option input[type="radio"]:focus-visible + .toggle-label {
  outline: 2px solid var(--border-focus);
}

/* Selector de unidades */
.unit-switch-box {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.unit-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
}

.unit-btn.active {
  background: var(--border-focus);
  color: #ffffff;
  border-color: var(--border-focus);
}

/* Inputs numéricos con sufijo en flexbox */
.input-suffix-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s ease;
  min-height: 42px;
}

.input-suffix-wrapper:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input-suffix-wrapper input[type="number"] {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  height: 42px;
  background: transparent;
  border: none;
  outline: none;
  padding: 0 0.85rem;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 1rem;
}

.input-suffix {
  padding: 0 0.85rem;
  font-size: 0.825rem;
  color: var(--text-dim);
  font-weight: 500;
  user-select: none;
  white-space: nowrap;
}

/* Slider de apoyo táctil */
.range-slider-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.range-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-input);
  accent-color: var(--primary-color);
  cursor: pointer;
}

/* Colesterol no-HDL automático */
.non-hdl-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.non-hdl-val {
  font-weight: 700;
  color: var(--text-main);
}

/* Columna de Resultados */
.results-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Tarjeta Principal de Riesgo con Gauge */
.risk-hero-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.risk-hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-accent, var(--border-color));
}

.risk-hero-card.level-low {
  --card-accent: var(--risk-low);
  border-color: rgba(16, 185, 129, 0.4);
}
.risk-hero-card.level-mod {
  --card-accent: var(--risk-mod);
  border-color: rgba(234, 179, 8, 0.4);
}
.risk-hero-card.level-high {
  --card-accent: var(--risk-high);
  border-color: rgba(249, 115, 22, 0.4);
}
.risk-hero-card.level-veryhigh {
  --card-accent: var(--risk-veryhigh);
  border-color: rgba(239, 68, 68, 0.5);
}

/* Gauge semicircular SVG */
.gauge-container {
  width: 220px;
  height: 120px;
  position: relative;
  margin: 0 auto;
}

.gauge-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.gauge-bg {
  fill: none;
  stroke: var(--bg-input);
  stroke-width: 14;
  stroke-linecap: round;
}

.gauge-fill {
  fill: none;
  stroke-width: 14;
  stroke-linecap: round;
  transition: stroke-dasharray 0.6s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s ease;
}

.gauge-needle {
  transform-origin: 100px 95px;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-center-val {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.risk-number {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
}

.risk-percent-sign {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-muted);
}

.risk-timeframe {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: capitalize;
}

.badge-low {
  background: var(--risk-low-bg);
  color: var(--risk-low);
  border: 1px solid var(--risk-low);
}
.badge-mod {
  background: var(--risk-mod-bg);
  color: var(--risk-mod);
  border: 1px solid var(--risk-mod);
}
.badge-high {
  background: var(--risk-high-bg);
  color: var(--risk-high);
  border: 1px solid var(--risk-high);
}
.badge-veryhigh {
  background: var(--risk-veryhigh-bg);
  color: var(--risk-veryhigh);
  border: 1px solid var(--risk-veryhigh);
}

.risk-explanation {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.45;
}

/* Simulador "Qué pasaría si..." */
.whatif-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.whatif-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

@media (min-width: 640px) {
  .whatif-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.whatif-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.whatif-card-header {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.whatif-benefit-val {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--risk-low);
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.whatif-benefit-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.3;
}

/* Cuadrícula Cromática Oficial ESC */
.chart-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.chart-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

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

.chart-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-subtext {
  font-size: 0.825rem;
  color: var(--text-muted);
}

.chart-scroll-wrapper {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.esc-matrix-table {
  width: 100%;
  min-width: 580px;
  border-collapse: separate;
  border-spacing: 3px;
  font-size: 0.775rem;
  user-select: none;
}

.esc-matrix-table th {
  padding: 0.4rem 0.25rem;
  text-align: center;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-radius: 4px;
}

.esc-matrix-table th.side-header {
  text-align: right;
  padding-right: 0.5rem;
  width: 75px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.matrix-cell {
  position: relative;
  text-align: center;
  vertical-align: middle;
  padding: 0.55rem 0.25rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.matrix-cell:hover {
  transform: scale(1.08);
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.matrix-cell.cell-active {
  box-shadow: 0 0 0 3px #ffffff, 0 0 12px rgba(255, 255, 255, 0.8);
  transform: scale(1.12);
  z-index: 20;
  animation: pulse-border 1.8s infinite;
}

@keyframes pulse-border {
  0%, 100% {
    box-shadow: 0 0 0 3px #ffffff, 0 0 12px rgba(255, 255, 255, 0.8);
  }
  50% {
    box-shadow: 0 0 0 4px var(--accent-blue), 0 0 18px var(--accent-blue);
  }
}

.matrix-cell.color-green-1 { background-color: #059669; }
.matrix-cell.color-green-2 { background-color: #10b981; }
.matrix-cell.color-yellow-1 { background-color: #d97706; color: #ffffff; }
.matrix-cell.color-yellow-2 { background-color: #eab308; color: #1e293b; }
.matrix-cell.color-orange-1 { background-color: #ea580c; }
.matrix-cell.color-orange-2 { background-color: #f97316; }
.matrix-cell.color-red-1 { background-color: #dc2626; }
.matrix-cell.color-red-2 { background-color: #ef4444; }
.matrix-cell.color-red-dark { background-color: #991b1b; }

/* Leyenda de la cuadrícula */
.matrix-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-box {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

/* Objetivos Terapéuticos ESC 2021 */
.targets-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.targets-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.targets-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .targets-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.target-card-header {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.target-card-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.target-card-detail {
  font-size: 0.775rem;
  color: var(--text-dim);
  line-height: 1.35;
}

/* Botones de acción inferior */
.action-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.btn-primary-action {
  flex: 1 1 200px;
  min-height: 44px;
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background-color 0.2s ease;
}

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

.btn-secondary-action {
  flex: 1 1 160px;
  min-height: 44px;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

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

/* Modales canónicos */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

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

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

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

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease;
}

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

.modal-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.modal-content strong {
  color: var(--text-main);
}

.modal-content ul {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Hoja oficial de impresión A4 (.print-sheet) */
.print-sheet {
  display: none;
}

@media print {
  /* Ocultar interfaz interactiva */
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
  }

  .app-header,
  .tools-ad-banner-section,
  .tool-ad-sidebar,
  .card-main,
  .fijate-footer,
  .modal-overlay {
    display: none !important;
  }

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

  /* Mostrar hoja imprimible A4 */
  .print-sheet {
    display: block !important;
    max-width: 210mm;
    margin: 0 auto;
    padding: 15mm;
    background: #ffffff;
    color: #111827;
    font-family: var(--font-main);
  }

  .print-header {
    border-bottom: 2px solid #000000;
    padding-bottom: 8mm;
    margin-bottom: 8mm;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
  }

  .print-title {
    font-size: 16pt;
    font-weight: 800;
    color: #000000;
  }

  .print-subtitle {
    font-size: 10pt;
    color: #4b5563;
    margin-top: 2mm;
  }

  .print-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4mm;
    margin-bottom: 8mm;
    border: 1px solid #d1d5db;
    padding: 4mm;
  }

  .print-meta-item {
    font-size: 9pt;
  }

  .print-result-box {
    border: 2px solid #000000;
    padding: 6mm;
    text-align: center;
    margin-bottom: 8mm;
    background: #f9fafb;
  }

  .print-result-score {
    font-size: 28pt;
    font-weight: 800;
    font-family: var(--font-mono);
  }

  .print-result-level {
    font-size: 13pt;
    font-weight: 700;
    margin-top: 2mm;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8mm;
    font-size: 9pt;
  }

  .print-table th,
  .print-table td {
    border: 1px solid #9ca3af;
    padding: 3mm 4mm;
    text-align: left;
  }

  .print-table th {
    background: #e5e7eb;
    font-weight: 700;
  }

  .print-footer-legal {
    font-size: 8pt;
    color: #6b7280;
    border-top: 1px solid #d1d5db;
    padding-top: 4mm;
    margin-top: 10mm;
    line-height: 1.4;
  }

  .print-signature-space {
    margin-top: 12mm;
    display: flex;
    justify-content: space-between;
  }

  .signature-box {
    width: 70mm;
    border-top: 1px solid #000000;
    text-align: center;
    padding-top: 2mm;
    font-size: 9pt;
  }
}
