/**
 * Estimador de autonomía y desnivel para e-MTB - Estilos canónicos
 * fijate.com - Midnight Slate theme con soporte claro y oscuro
 */

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

  /* Paleta Midnight Slate (Oscuro por defecto) */
  --bg-app: #0b0f17;
  --bg-card: #111827;
  --bg-card-sub: #172033;
  --bg-input: #1e293b;
  --border-color: #27354f;
  --border-focus: #0284c7;

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

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-rgb: 2, 132, 199;

  --accent-eco: #10b981;
  --accent-tour: #0ea5e9;
  --accent-emtb: #8b5cf6;
  --accent-boost: #f97316;
  --accent-danger: #ef4444;
  --accent-warning: #f59e0b;

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

[data-theme="light"],
body.light-theme {
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-sub: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #cbd5e1;
  --border-focus: #0284c7;

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

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

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

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

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

h1, h2, h3, h4, h5, h6,
.brand-title,
.section-box-title,
.telemetry-big-percent,
.seo-guide-title {
  font-family: var(--font-heading);
}

.mono,
.stat-card-value,
.range-val,
.climb-big-val,
.badge-pill {
  font-family: var(--font-mono);
}

/* Layout de la herramienta */
.main-wrapper.tool-layout {
  max-width: 1240px;
  width: 100%;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  flex: 1;
}

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

.tool-main-content {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.card-main {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}

/* Pestañas de modo de estimación */
.emtb-tabs-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  background: var(--bg-card-sub);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.emtb-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  min-height: 42px;
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.emtb-tab-btn:hover {
  color: var(--text-main);
  background: rgba(var(--primary-rgb), 0.08);
}

.emtb-tab-btn.active {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.35);
}

/* Cuadrícula de 2 columnas (Formulario + Resultados) */
.emtb-grid-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem;
  align-items: start;
}

/* Secciones del formulario */
.emtb-section-box {
  background: var(--bg-card-sub);
  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;
}

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

.badge-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  background: rgba(var(--primary-rgb), 0.15);
  color: var(--primary);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  border-radius: var(--radius-full);
}

/* Chips de preajustes rápidos */
.preset-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.chip-btn {
  flex: 1 1 0%;
  min-width: 60px;
  min-height: 38px;
  padding: 0.4rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
}

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

.chip-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.3);
}

/* Controles de rango */
.input-range-wrapper {
  margin-bottom: 1rem;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.range-val {
  font-weight: 700;
  color: var(--primary);
}

.custom-range {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  accent-color: var(--primary);
}

/* Form inputs & selects */
.two-cols-compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.two-cols-compact:last-child {
  margin-bottom: 0;
}

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

.form-group-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.custom-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0.55rem 2.5rem 0.55rem 0.75rem;
  font-family: var(--font-main);
  font-size: 0.86rem;
  color: var(--text-main);
  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='%2394a3b8' 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;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

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

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

.input-with-unit {
  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;
}

.input-with-unit:focus-within {
  border-color: var(--border-focus);
}

.custom-input {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  min-height: 42px;
  padding: 0.55rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  background: transparent;
  border: none;
  outline: none;
}

.input-unit {
  padding: 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.1);
  border-left: 1px solid var(--border-color);
  height: 42px;
  display: flex;
  align-items: center;
}

.field-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.3;
}

/* Modos de asistencia (Radio Cards) */
.assist-modes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.75rem;
  min-height: 72px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.mode-card:hover {
  border-color: rgba(var(--primary-rgb), 0.5);
  transform: translateY(-1px);
}

.mode-card.active {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
  box-shadow: 0 0 0 1px var(--primary);
}

.mode-tag {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.35rem;
}

.tag-eco { background: rgba(16, 185, 129, 0.18); color: var(--accent-eco); }
.tag-tour { background: rgba(14, 165, 233, 0.18); color: var(--accent-tour); }
.tag-emtb { background: rgba(139, 92, 246, 0.18); color: var(--accent-emtb); }
.tag-boost { background: rgba(249, 115, 22, 0.18); color: var(--accent-boost); }

.mode-assist-factor {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.mode-subtext {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Display de peso total */
.weight-total-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  margin-bottom: 0.85rem;
}

.weight-total-display strong {
  color: var(--text-main);
  font-size: 0.95rem;
}

/* Acordeón de ajustes avanzados */
.emtb-accordion {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  min-height: 44px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: color 0.2s ease;
}

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

.accordion-summary > span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.accordion-summary:hover {
  color: var(--text-main);
}

.chevron-icon {
  transition: transform 0.25s ease;
}

.emtb-accordion[open] .chevron-icon {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 1.1rem;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.1);
}

/* Telemetría y Batería SVG Card */
.battery-telemetry-card {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  margin-bottom: 1.25rem;
}

.battery-telemetry-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.telemetry-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
}

.telemetry-big-percent {
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
}

.battery-status-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-full);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.battery-status-pill.safe {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-eco);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.battery-status-pill.safe .status-dot { background: var(--accent-eco); }

.battery-status-pill.tight {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.battery-status-pill.tight .status-dot { background: var(--accent-warning); }

.battery-status-pill.empty {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.battery-status-pill.empty .status-dot { background: var(--accent-danger); }

/* SVG Batería */
.svg-battery-wrapper {
  margin: 0.5rem 0 1.25rem;
  width: 100%;
}

.svg-battery {
  width: 100%;
  height: auto;
  max-height: 90px;
  display: block;
}

.bat-shell {
  fill: var(--bg-input);
  stroke: var(--border-color);
  stroke-width: 3;
}

.bat-terminal {
  fill: var(--border-color);
}

.bat-fill {
  transition: width 0.35s ease, fill 0.35s ease;
}

.bat-fill.safe { fill: var(--accent-eco); filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.4)); }
.bat-fill.tight { fill: var(--accent-warning); filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.4)); }
.bat-fill.empty { fill: var(--accent-danger); filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.4)); }

.bat-grid-line {
  stroke: rgba(0, 0, 0, 0.3);
  stroke-width: 2;
  stroke-dasharray: 4 3;
}

.bat-text {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  fill: #ffffff;
  text-anchor: middle;
  dominant-baseline: middle;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Alerta de corte */
.cutoff-alert-box {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-sm);
  color: var(--accent-danger);
  margin-bottom: 1rem;
}

.cutoff-text-wrap strong {
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.2rem;
}

.cutoff-text-wrap p {
  font-size: 0.82rem;
  color: var(--text-main);
}

/* Cuadrícula de estadísticas */
.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

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

.stat-card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.stat-card-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.stat-card-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Perfil altimétrico SVG */
.elevation-profile-card,
.max-range-display-card,
.compare-modes-card,
.efficiency-tips-card {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.svg-profile-container {
  width: 100%;
  overflow: hidden;
}

.svg-elevation {
  width: 100%;
  height: auto;
  display: block;
}

.grid-alt-line {
  stroke: var(--border-color);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.svg-axis-label {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--text-dim);
}

.svg-marker-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  fill: var(--accent-danger);
  text-anchor: middle;
}

/* Perfiles de alcance máximo */
.profiles-range-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.range-profile-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
}

.range-profile-box.highlight-mix {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-color);
}

.profile-icon {
  font-size: 1.25rem;
}

.profile-header strong {
  display: block;
  font-size: 0.86rem;
}

.profile-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
  display: block;
}

.profile-metrics .metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.profile-metrics .metric-row strong {
  color: var(--text-main);
}

/* Banner de subida vertical pura */
.pure-climb-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  background: rgba(var(--primary-rgb), 0.12);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  border-radius: var(--radius-sm);
}

.climb-icon {
  font-size: 1.8rem;
}

.climb-content strong {
  font-size: 0.86rem;
  display: block;
  margin-bottom: 0.2rem;
}

.climb-big-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  display: block;
  margin-bottom: 0.2rem;
}

.climb-desc {
  font-size: 0.74rem;
  color: var(--text-dim);
}

/* Tabla comparativa de modos */
.table-responsive-wrapper {
  overflow-x: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.emtb-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.emtb-compare-table th {
  padding: 0.65rem 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-color);
  background: var(--bg-card);
  white-space: nowrap;
}

.emtb-compare-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  white-space: nowrap;
}

.emtb-compare-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Consejos dinámicos de ahorro */
.tips-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tip-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.45;
}

.tip-item.warning {
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid var(--accent-warning);
  color: var(--text-main);
}

.tip-item.danger {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--accent-danger);
  color: var(--text-main);
}

.tip-item.info, .tip-item.tip {
  background: rgba(var(--primary-rgb), 0.1);
  border-left: 3px solid var(--primary);
  color: var(--text-main);
}

.tip-title {
  font-weight: 700;
  display: block;
  margin-bottom: 0.15rem;
}

/* Fila de botones de acción */
.actions-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.btn-action-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 0.85rem;
  min-height: 42px;
  font-family: var(--font-main);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
}

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

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

.modal-card-sm {
  max-width: 440px;
}

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

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

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  min-height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.modal-body {
  padding: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.modal-body h4 {
  color: var(--text-main);
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  font-size: 0.98rem;
}

.modal-body h4:first-child {
  margin-top: 0;
}

.modal-body p {
  margin-bottom: 0.75rem;
}

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

.btn-primary-action {
  padding: 0.65rem 1.5rem;
  min-height: 42px;
  background: var(--primary);
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease;
}

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

/* Sección SEO */
.seo-guide-section {
  margin-top: 2.5rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.seo-guide-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.seo-guide-text {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.seo-subheading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.seo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  margin-bottom: 1.5rem;
}

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

.seo-table th {
  background: var(--bg-card-sub);
  color: var(--text-muted);
  font-weight: 700;
}

.seo-table td {
  color: var(--text-main);
}

.seo-list {
  padding-left: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.seo-list li {
  margin-bottom: 0.5rem;
}

.seo-list strong {
  color: var(--text-main);
}

/* Estilos de impresión A4 */
@media print {
  .app-header,
  .tools-ad-banner-section,
  .tool-ad-sidebar,
  .emtb-tabs-nav,
  .preset-chips-row,
  .input-range-wrapper,
  .actions-row,
  .fijate-footer {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

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

  .card-main,
  .battery-telemetry-card,
  .elevation-profile-card,
  .seo-guide-section {
    border: 1px solid #cccccc !important;
    box-shadow: none !important;
    background: #ffffff !important;
    color: #000000 !important;
    page-break-inside: avoid;
  }

  .telemetry-big-percent,
  .stat-card-value {
    color: #000000 !important;
  }
}

/* Adaptación móvil y tablet (Responsive) */
@media (max-width: 992px) {
  .emtb-grid-layout {
    grid-template-columns: 1fr;
  }

  .profiles-range-grid {
    grid-template-columns: 1fr;
  }
}

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

  .emtb-tabs-nav {
    grid-template-columns: 1fr;
  }

  .two-cols-compact {
    grid-template-columns: 1fr;
  }

  .assist-modes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .actions-row {
    grid-template-columns: 1fr;
  }

  .pure-climb-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}
