/**
 * Hoja de estilos para Calculadora de mezcla de combustible para motores de 2 tiempos
 * fijate.com/tools/calculadora-mezcla-gasolina-aceite-2t/
 */

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

  /* Colores de tema claro */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #0284c7;

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

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;

  --accent-fuel: #d97706;
  --accent-oil-synthetic: #dc2626;
  --accent-oil-semi: #16a34a;
  --accent-oil-mineral: #2563eb;

  --color-success: #16a34a;
  --color-warning: #ea580c;
  --color-danger: #dc2626;

  --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.04);
  --radius-card: 16px;
  --radius-btn: 10px;
}

[data-theme="dark"],
html.dark {
  --bg-body: #0b0f17;
  --bg-card: #151d2c;
  --bg-card-subtle: #1c2638;
  --bg-input: #101725;
  --border-color: #243046;
  --border-focus: #38bdf8;

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

  --primary: #38bdf8;
  --primary-hover: #7dd3fc;
  --primary-light: rgba(56, 189, 248, 0.12);

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 20px -3px rgba(0, 0, 0, 0.5);
}

/* Base y contención canónica */
*, *::before, *::after {
  box-sizing: border-box;
}

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;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6,
.brand-title,
.section-title,
.block-title,
.faq-section-title,
.modal-title {
  font-family: var(--font-heading);
  letter-spacing: -0.015em;
  font-weight: 700;
  margin-top: 0;
}

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

/* Layout canónico */
.main-wrapper.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-card);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.intro-box {
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}

.lead-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

/* Bento Grid de cálculo y probeta */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  margin-bottom: 2.5rem;
}

.calc-col {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 1.5rem;
}

.block-title {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
  margin-bottom: 1.25rem;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 0.75rem;
}

.block-title svg {
  color: var(--primary);
  flex-shrink: 0;
}

/* Formularios y controles accesibles */
.form-group {
  margin-bottom: 1.25rem;
}

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

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.label-with-hint {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

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

.field-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  margin-bottom: 0;
}

/* Pills de modalidad */
.mode-pills {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-body);
  padding: 0.3rem;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border-color);
}

.mode-pill {
  flex: 1 1 0%;
  min-height: 40px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  padding: 0.4rem 0.6rem;
}

.mode-pill:hover {
  color: var(--text-main);
}

.mode-pill.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

/* Inputs de texto y números */
.input-unit-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.form-input {
  width: 100%;
  min-height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-btn);
  padding: 0.6rem 2.8rem 0.6rem 0.9rem;
  font-size: 1.05rem;
  color: var(--text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.unit-tag {
  position: absolute;
  right: 0.9rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* Desplegables Select canónicos */
.form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-btn);
  padding: 0.6rem 2.5rem 0.6rem 0.9rem;
  font-size: 0.9rem;
  font-family: var(--font-main);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  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.9rem center;
  background-size: 16px;
}

.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-light);
}

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

/* Quick chips */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.chip-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 32px;
}

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

.chip-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Custom ratio row */
.custom-ratio-row {
  display: flex;
  gap: 0.75rem;
}

.half-col {
  flex: 1 1 0%;
  min-width: 0;
}

/* Sección de costes */
.cost-toggle-section {
  margin-top: 1.25rem;
  border-top: 1px dashed var(--border-color);
  padding-top: 1rem;
}

.btn-toggle-costs {
  background: transparent;
  border: none;
  color: var(--primary);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  padding: 0;
}

.btn-toggle-costs:hover {
  text-decoration: underline;
}

.costs-drawer {
  margin-top: 0.75rem;
  background: var(--bg-card);
  padding: 0.9rem;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border-color);
}

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

/* KPI Hero Card */
.kpi-hero-card {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.08) 0%, rgba(220, 38, 38, 0.08) 100%);
  border: 1px solid rgba(2, 132, 199, 0.25);
  border-radius: var(--radius-btn);
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.kpi-hero-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.kpi-hero-value-box {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem;
}

.kpi-hero-num {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--accent-oil-synthetic);
  line-height: 1;
  transition: color 0.3s ease;
}

.kpi-hero-unit {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-muted);
}

.kpi-hero-subvalues {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.subval-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Visualizador de Probeta SVG */
.cylinder-visual-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.cylinder-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 220px;
}

.cylinder-svg {
  width: 100%;
  height: 240px;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.12));
}

.cylinder-base {
  fill: #94a3b8;
  opacity: 0.5;
}

.cylinder-glass {
  fill: rgba(226, 232, 240, 0.25);
  stroke: #94a3b8;
  stroke-width: 2;
}

.liquid-fill {
  transition: y 0.4s cubic-bezier(0.4, 0, 0.2, 1), height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.liquid-meniscus {
  transition: cy 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tick {
  stroke: #64748b;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.tick-text {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: #64748b;
  font-weight: 600;
}

.cylinder-lip {
  fill: none;
  stroke: #94a3b8;
  stroke-width: 2;
}

.cylinder-rim {
  fill: none;
  stroke: #94a3b8;
  stroke-width: 2;
}

.cylinder-legend {
  margin-top: 0.5rem;
  text-align: center;
}

.legend-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent-oil-synthetic);
  transition: background-color 0.3s;
}

.cylinder-ratio-tag {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Ficha de resumen técnico */
.mix-summary-stats {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-btn);
  padding: 1rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.stat-row:last-of-type {
  border-bottom: none;
}

.stat-name {
  color: var(--text-muted);
}

.stat-val {
  font-weight: 600;
  color: var(--text-main);
}

.cost-summary-box {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
}

.cost-kpi-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.cost-kpi-item {
  flex: 1 1 0%;
  background: var(--bg-card-subtle);
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  text-align: center;
}

.cost-sublabel {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.cost-amount {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.cost-amount.cost-highlight {
  color: var(--accent-fuel);
}

.summary-actions {
  margin-top: 1rem;
}

.btn-copy-recipe {
  width: 100%;
  min-height: 44px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-btn);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

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

.btn-copy-recipe:active {
  transform: translateY(1px);
}

/* Guía visual interactiva de bujías */
.spark-plug-section {
  margin-top: 2rem;
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}

.section-header-box {
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.section-title svg {
  color: var(--accent-fuel);
  flex-shrink: 0;
}

.section-subtext {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.plug-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.plug-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-btn);
  padding: 0.9rem 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 110px;
}

.plug-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.plug-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.plug-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin-bottom: 0.6rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(0, 0, 0, 0.15);
}

/* Estilos de avatars de bujía */
.plug-optimal {
  background: radial-gradient(circle at 35% 35%, #b45309, #78350f 80%);
}

.plug-flame-dot {
  width: 8px;
  height: 8px;
  background: #34d399;
  border-radius: 50%;
  position: absolute;
  bottom: 0;
  right: 0;
  border: 1px solid #ffffff;
}

.plug-carbon {
  background: radial-gradient(circle at 35% 35%, #334155, #0f172a 80%);
}

.plug-oily {
  background: radial-gradient(circle at 35% 35%, #475569, #020617 80%);
  box-shadow: inset 0 0 6px #38bdf8;
}

.plug-lean {
  background: radial-gradient(circle at 35% 35%, #ffffff, #cbd5e1 80%);
  border-color: #ef4444;
}

.plug-alert-icon {
  color: #ef4444;
  font-weight: 900;
  font-size: 1.1rem;
}

.plug-bridged {
  background: radial-gradient(circle at 35% 35%, #64748b, #1e293b 80%);
}

.plug-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.plug-status {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-good { color: var(--color-success); }
.status-warn { color: var(--color-warning); }
.status-danger { color: var(--color-danger); }
.status-bad { color: #8b5cf6; }

.plug-color-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Panel de detalle de bujía */
.plug-detail-panel {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-btn);
  padding: 1.25rem;
}

.plug-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.9rem;
  margin-bottom: 1rem;
}

.badge-diagnosis {
  display: inline-block;
  background: rgba(22, 163, 74, 0.15);
  color: var(--color-success);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.diag-title {
  font-size: 1.1rem;
  margin: 0;
  color: var(--text-main);
}

.diag-risk-level {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.diag-body-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.diag-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.9rem;
}

.diag-heading {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}

.diag-info-card p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Tabla técnica de fabricantes */
.table-section {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-btn);
  margin-top: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: var(--bg-card-subtle);
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: var(--bg-card-subtle);
}

.font-bold {
  font-weight: 700;
}

.btn-table-apply {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 32px;
}

.btn-table-apply:hover {
  background: var(--primary);
  color: #ffffff;
}

/* Consejos prácticos de taller */
.tips-section {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}

.tips-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.tip-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-btn);
  padding: 1.15rem;
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.tip-icon {
  background: var(--bg-card);
  color: var(--accent-fuel);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.tip-title {
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  color: var(--text-main);
}

.tip-text p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Acordeón FAQ */
.faq-section {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}

.faq-section-title {
  font-size: 1.25rem;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

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

.faq-item[open] {
  border-color: var(--primary);
}

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

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

.faq-icon {
  color: var(--text-muted);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.faq-item[open] .faq-icon {
  transform: rotate(180deg);
  color: var(--primary);
}

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

.faq-answer p {
  margin: 0;
}

/* Modal accesible (sin window.alert) */
.app-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  transition: opacity 0.2s;
}

.app-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  text-align: center;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.75rem;
}

.modal-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.modal-title {
  font-size: 1.2rem;
  margin: 0;
  color: var(--text-main);
}

.modal-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.btn-modal-close {
  width: 100%;
  min-height: 42px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-btn);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

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

/* Utilidades */
.d-none {
  display: none !important;
}

/* Responsividad móvil y pantallas intermedias */
@media (max-width: 900px) {
  .calc-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .plug-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .diag-body-grid {
    grid-template-columns: 1fr;
  }

  .tips-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .card-main {
    padding: 1.15rem;
  }

  .calc-col {
    padding: 1.15rem;
  }

  .mode-pills {
    flex-direction: column;
  }

  .plug-cards-grid {
    grid-template-columns: 1fr;
  }

  .kpi-hero-num {
    font-size: 2.25rem;
  }

  .cost-fields-grid {
    grid-template-columns: 1fr;
  }
}
