/* ==========================================================================
   Calculadora de FTP, potencia W/kg y zonas Coggan - Estilos Canónicos
   Fijate Tools - Salud y deporte
   ========================================================================== */

/* 1. Variables de diseño y tokens semánticos */
:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Tema oscuro por defecto (Midnight Slate) */
  --bg-page: #0b0f17;
  --bg-card: #131b26;
  --bg-card-hover: #182332;
  --bg-elevated: #1e2c3f;
  --bg-input: #0e1622;
  --bg-input-focus: #152233;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-focus: #38bdf8;

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

  /* Colores de acento ciclista */
  --color-primary: #38bdf8;
  --color-primary-dark: #0284c7;
  --color-accent: #f59e0b;
  --color-emerald: #10b981;
  --color-violet: #8b5cf6;
  --color-rose: #f43f5e;
  --color-orange: #f97316;

  /* Colores de las 7 zonas de Coggan */
  --z1-color: #64748b;
  --z2-color: #0284c7;
  --z3-color: #0d9488;
  --z-sweetspot: #06b6d4;
  --z4-color: #eab308;
  --z5-color: #f97316;
  --z6-color: #ef4444;
  --z7-color: #a855f7;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* Tema claro conmutado por #btn-theme-toggle */
body.light-theme {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-elevated: #e2e8f0;
  --bg-input: #f8fafc;
  --bg-input-focus: #ffffff;

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);
  --border-focus: #0284c7;

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

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

/* 2. Contención y reset global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

.mono {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum' on, 'zero' on;
}

/* Enlaces limpios */
a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* 3. Layout principal y compatibilidad con sidebar AdSense */
.tool-layout {
  max-width: 1200px;
  width: 100%;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  flex: 1 0 auto;
}

.tool-with-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 100%;
}

@media (min-width: 1536px) {
  .tool-with-sidebar {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
  }
}

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

.tool-ad-sidebar {
  display: none;
}

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

/* 4. Tarjeta principal contenedora */
.card-main {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

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

/* Hero informativo */
.tool-hero-box {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, rgba(16, 185, 129, 0.05) 50%, rgba(245, 158, 11, 0.05) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}

.hero-tagline {
  color: var(--text-main);
  font-size: 0.98rem;
  line-height: 1.6;
  margin-bottom: 0.85rem;
}

.hero-tagline strong {
  color: var(--color-primary);
}

.quick-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid transparent;
}
.pill-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.pill-sky     { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border-color: rgba(56, 189, 248, 0.3); }
.pill-amber   { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }
.pill-violet  { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border-color: rgba(139, 92, 246, 0.3); }
.pill-rose    { background: rgba(244, 63, 94, 0.15); color: #fb7185; border-color: rgba(244, 63, 94, 0.3); }

/* 5. Cuadrícula interactiva principal */
.tool-grid-setup {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 960px) {
  .tool-grid-setup {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: stretch;
  }
}

.setup-card, .summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

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

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

.btn-text-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.btn-text-action:hover {
  background: var(--bg-elevated);
  color: var(--color-primary);
}

/* Formularios y controles */
.form-flow {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-row-dual {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 480px) {
  .form-row-dual {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.input-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.label-helper, .unit-tag {
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--text-muted);
}

.label-with-aside {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.badge-status-auto {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-primary);
  background: rgba(56, 189, 248, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  white-space: nowrap;
}

/* Segmented control (Hombre / Mujer, Modos) */
.segmented-control {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
  width: 100%;
}

.segment-btn {
  flex: 1 1 0%;
  min-width: 0;
  height: 38px;
  min-height: 38px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.segment-btn.active {
  background: var(--color-primary);
  color: #0b0f17;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(56, 189, 248, 0.3);
}

/* Inputs y Selects */
.form-input, .form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 42px;
  min-height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  border-radius: var(--radius-md);
  padding: 0 0.85rem;
  font-size: 0.95rem;
  font-family: var(--font-main);
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.form-select {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  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='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

.form-select option {
  background-color: #131b26;
  color: #f1f5f9;
}
body.light-theme .form-select option {
  background-color: #ffffff;
  color: #0f172a;
}

/* Wrapper con sufijo */
.input-unit-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-unit-wrapper .form-input {
  padding-right: 3rem;
}

.input-suffix {
  position: absolute;
  right: 0.85rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  pointer-events: none;
}

/* Deslizador + input numérico combo */
.slider-input-combo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.form-range {
  flex: 1 1 0%;
  min-width: 0;
  accent-color: var(--color-primary);
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 9999px;
  outline: none;
  cursor: pointer;
}

.combo-number {
  flex: 0 0 115px;
  width: 115px;
}

.combo-number .form-input {
  font-family: var(--font-mono);
  font-weight: 700;
}

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

/* Paneles dinámicos por método */
.method-dynamic-box {
  border-top: 1px dashed var(--border-subtle);
  padding-top: 0.85rem;
}

.method-panel {
  display: none;
}
.method-panel.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 6. Panel de Diagnóstico y Métricas (Summary) */
.ftp-hero-metric {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, rgba(16, 185, 129, 0.08) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ftp-metric-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.85rem;
}

@media (min-width: 480px) {
  .ftp-metric-split {
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
  }
}

.metric-top-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.metric-main-val {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.metric-main-val .val-number {
  font-size: 2.35rem;
  font-weight: 800;
  line-height: 1;
  color: var(--color-primary);
}

.metric-main-val .val-unit {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-muted);
}

.metric-formula-calc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.metric-wkg-val {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  margin: 0.2rem 0;
}

.metric-wkg-val .val-number {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1;
  color: #34d399;
}

.metric-wkg-val .val-unit {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
}

.badge-level-pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.16);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.metric-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Mini métricas */
.metrics-mini-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

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

.mini-metric-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mini-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
}

.mini-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* Termómetro / Barra visual de W/kg */
.wkg-gauge-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem 1.65rem;
  position: relative;
}

.gauge-labels-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.gauge-track-bar {
  display: flex;
  height: 12px;
  border-radius: 9999px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  position: relative;
}

.gauge-segment {
  height: 100%;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
}

.gauge-segment.lvl-1 { background: #64748b; }
.gauge-segment.lvl-2 { background: #0284c7; }
.gauge-segment.lvl-3 { background: #10b981; }
.gauge-segment.lvl-4 { background: #f59e0b; }
.gauge-segment.lvl-5 { background: #ef4444; }
.gauge-segment.lvl-6 { background: #8b5cf6; }

.gauge-pointer-wrapper {
  position: absolute;
  bottom: 0.25rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.gauge-pointer-arrow {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 7px solid var(--color-primary);
}

.gauge-pointer-badge {
  background: var(--color-primary);
  color: #0b0f17;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* 7. Navegación por pestañas */
.tool-tabs-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.35rem;
}

@media (min-width: 768px) {
  .tool-tabs-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  height: 44px;
  min-height: 40px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 0 0.5rem;
  text-align: center;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

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

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
}
.tab-panel.active {
  display: flex;
  animation: fadeIn 0.25s ease-out;
}

.section-intro {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

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

.section-lead {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* 8. Tarjetas de las 7 Zonas de Coggan */
.zones-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.zone-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 5px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.zone-card:hover {
  transform: translateX(3px);
  border-color: var(--border-strong);
}

.zone-card.z1 { border-left-color: var(--z1-color); }
.zone-card.z2 { border-left-color: var(--z2-color); }
.zone-card.z3 { border-left-color: var(--z3-color); }
.zone-card.z-sweetspot { border-left-color: var(--z-sweetspot); }
.zone-card.z4 { border-left-color: var(--z4-color); }
.zone-card.z5 { border-left-color: var(--z5-color); }
.zone-card.z6 { border-left-color: var(--z6-color); }
.zone-card.z7 { border-left-color: var(--z7-color); }

.zone-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.zone-tag-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.zone-chip {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  color: #fff;
}
.zone-chip.z1 { background: var(--z1-color); }
.zone-chip.z2 { background: var(--z2-color); }
.zone-chip.z3 { background: var(--z3-color); }
.zone-chip.z-sweetspot { background: var(--z-sweetspot); }
.zone-chip.z4 { background: var(--z4-color); color: #000; }
.zone-chip.z5 { background: var(--z5-color); }
.zone-chip.z6 { background: var(--z6-color); }
.zone-chip.z7 { background: var(--z7-color); }

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

.zone-watts-range {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.zone-pct-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 0.35rem;
}

.zone-details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-subtle);
  padding-top: 0.6rem;
}

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

.zone-detail-item strong {
  color: var(--text-main);
}

.btn-zone-expand {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-self: flex-start;
  margin-top: 0.2rem;
}
.btn-zone-expand:hover {
  background: rgba(56, 189, 248, 0.1);
}

/* 9. Calculador puntual a la carta */
.point-calculator-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.point-calc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.calc-subheading {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

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

.intensity-display-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.85rem;
  text-align: center;
}
.intensity-display-badge span {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-primary);
}
.intensity-display-badge small {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.point-calc-results-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

@media (min-width: 640px) {
  .point-calc-results-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.calc-res-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.res-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.res-val {
  font-size: 1.15rem;
  font-weight: 800;
}

.res-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--color-primary);
}

/* 10. Tablas de datos comparativas (W/kg y Exportación) */
.table-responsive-box {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.data-table-comparison, .data-table-zones {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.data-table-comparison th, .data-table-zones th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table-comparison td, .data-table-zones td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  white-space: nowrap;
}

.data-table-comparison tr:last-child td, .data-table-zones tr:last-child td {
  border-bottom: none;
}

.data-table-comparison tr:hover, .data-table-zones tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.data-table-comparison tr.row-user-current {
  background: rgba(56, 189, 248, 0.12);
  font-weight: 700;
}
.data-table-comparison tr.row-user-current td {
  color: var(--color-primary);
}

.badge-current-user {
  background: var(--color-primary);
  color: #0b0f17;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  margin-left: 0.4rem;
}

/* 11. Simulador de puertos (Física real) */
.preset-climbs-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

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

.preset-chips-scroll {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.climb-chip {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.climb-chip:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.climb-chip.active {
  background: var(--color-primary);
  color: #0b0f17;
  font-weight: 700;
  border-color: var(--color-primary);
}

.climb-simulator-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .climb-simulator-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: stretch;
  }
}

.climb-setup-box, .climb-results-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.physics-fine-tuning {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-top: 0.25rem;
}

/* Resultados de escalada */
.climb-hero-result {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(245, 158, 11, 0.08) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.climb-main-kpis {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.res-mini-tag {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.res-big-val {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-primary);
}
.res-big-val small {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.res-sub-val {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.climb-effort-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Desglose apilado de fuerzas */
.forces-breakdown-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.forces-header-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
}

.forces-stacked-bar {
  display: flex;
  height: 16px;
  border-radius: 9999px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.bar-slice {
  height: 100%;
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.3s ease;
}

.slice-gravity { background: #ef4444; }
.slice-rolling { background: #f59e0b; color: #000; }
.slice-aero    { background: #38bdf8; color: #000; }

.forces-legend-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

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

.force-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.force-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-gravity { background: #ef4444; }
.dot-rolling { background: #f59e0b; }
.dot-aero    { background: #38bdf8; }

/* Comparador de ahorro de peso */
.weight-savings-card {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.weight-save-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: #34d399;
}

.weight-save-stats-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.82rem;
}

.save-label {
  color: var(--text-muted);
}

.save-val {
  font-weight: 700;
  margin-left: 0.3rem;
}

.text-emerald {
  color: #34d399;
}

/* 12. Pestaña de ciclocomputadores y exportación */
.export-actions-bar {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

@media (min-width: 768px) {
  .export-actions-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.export-actions-left {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-action-primary, .btn-action-secondary {
  height: 40px;
  min-height: 40px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 1rem;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
}

.btn-action-primary {
  background: var(--color-primary);
  color: #0b0f17;
  font-weight: 700;
}
.btn-action-primary:hover {
  background: #7dd3fc;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
}

.btn-action-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}
.btn-action-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.export-device-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.device-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.device-select {
  width: auto;
  min-width: 190px;
  height: 38px;
}

.device-instructions-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.inst-steps-list {
  padding-left: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.inst-steps-list li strong {
  color: var(--text-main);
}

/* 13. Sección FAQ pedagógica */
.tool-faq-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

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

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

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

.faq-question {
  padding: 0.95rem 1.15rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 2.5rem;
}

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

.faq-question::after {
  content: '+';
  position: absolute;
  right: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  color: var(--color-primary);
  font-weight: 700;
  transition: transform var(--transition-fast);
}

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

.faq-answer {
  padding: 0 1.15rem 1.15rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.6;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
}

.faq-answer p + p {
  margin-top: 0.6rem;
}

/* Callout informativo */
.info-callout-card {
  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;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.callout-icon {
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

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

.callout-text {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* 14. Modales canónicos y accesibles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay[hidden] {
  display: none !important;
}

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

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

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

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

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}
.btn-modal-close:hover {
  background: var(--bg-elevated);
  color: var(--text-main);
}

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

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

.btn-primary {
  height: 40px;
  min-height: 40px;
  background: var(--color-primary);
  color: #0b0f17;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0 1.25rem;
  cursor: pointer;
  transition: var(--transition-fast);
}
.btn-primary:hover {
  background: #7dd3fc;
}

.text-center { text-align: center; }
.justify-center { justify-content: center; }
.text-right { text-align: right; }

.feedback-icon-box {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}
.feedback-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

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

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .app-header, .tools-ad-banner-section, .tool-ad-sidebar, .amazon-affiliate-showcase,
  .fijate-footer, .tool-tabs-nav, .point-calculator-card, .btn-action-primary,
  .btn-action-secondary, .export-actions-bar, .modal-overlay {
    display: none !important;
  }
  .tool-layout {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
  .card-main {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .print-sheet {
    display: block !important;
    padding: 20px !important;
    font-size: 11pt !important;
  }
  .print-header {
    border-bottom: 2px solid #000;
    padding-bottom: 8px;
    margin-bottom: 15px;
  }
  .print-header h2 {
    font-size: 16pt;
    margin-bottom: 4px;
  }
  .print-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    font-size: 10pt;
  }
  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 9.5pt;
  }
  .print-table th, .print-table td {
    border: 1px solid #ccc;
    padding: 6px 8px;
    text-align: left;
  }
  .print-table th {
    background: #f0f0f0 !important;
  }
  .print-footer-note {
    font-size: 8pt;
    color: #666;
  }
}
