/**
 * Estilos canónicos para la Calculadora de desarrollos de transmisión MTB
 * Fijate Tools • fijate.com
 */

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

  /* Colores temáticos base (Tema oscuro por defecto) */
  --bg-page: #0b0f17;
  --bg-card: #131b2a;
  --bg-card-hover: #192337;
  --bg-card-inner: #0e1522;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #38bdf8;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Acentos de transmisión */
  --color-a: #06b6d4;
  --color-a-glow: rgba(6, 182, 212, 0.2);
  --color-a-light: #67e8f9;

  --color-b: #f59e0b;
  --color-b-glow: rgba(245, 158, 11, 0.2);
  --color-b-light: #fcd34d;

  --color-climb: #10b981;
  --color-climb-bg: rgba(16, 185, 129, 0.12);
  --color-climb-border: rgba(16, 185, 129, 0.3);

  --color-sprint: #3b82f6;
  --color-sprint-bg: rgba(59, 130, 246, 0.12);
  --color-sprint-border: rgba(59, 130, 246, 0.3);

  --color-alert: #f43f5e;
  --color-alert-bg: rgba(244, 63, 94, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

/* Modo claro */
html[data-theme="light"] {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-card-inner: #f8fafc;
  --border-color: #e2e8f0;
  --border-focus: #0284c7;

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

  --color-a: #0891b2;
  --color-a-glow: rgba(8, 145, 178, 0.15);
  --color-a-light: #0e7490;

  --color-b: #d97706;
  --color-b-glow: rgba(217, 119, 6, 0.15);
  --color-b-light: #b45309;

  --color-climb: #059669;
  --color-climb-bg: rgba(5, 150, 105, 0.08);
  --color-climb-border: rgba(5, 150, 105, 0.25);

  --color-sprint: #2563eb;
  --color-sprint-bg: rgba(37, 99, 235, 0.08);
  --color-sprint-border: rgba(37, 99, 235, 0.25);

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

/* Reset y caja base */
*, *::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);
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.app-header-title,
.config-title,
.verdict-main-title,
.chart-title,
.table-title,
.seo-guide-title {
  font-family: var(--font-heading);
  letter-spacing: -0.015em;
  font-weight: 700;
}

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

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

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

/* Anuncios */
.tools-ad-banner-section {
  width: 100%;
  margin-bottom: 0.5rem;
}

.tools-ad-banner-placeholder {
  min-height: 90px;
  border-radius: var(--radius-md);
}

.tool-ad-sidebar {
  display: none;
  width: 300px;
  flex-shrink: 0;
}

@media (min-width: 1536px) {
  .tool-ad-sidebar {
    display: block;
  }
  .tool-ad-sidebar-inner {
    position: sticky;
    top: 5rem;
  }
  .tools-ad-sidebar-placeholder {
    width: 300px;
    min-height: 600px;
  }
}

/* ========================================================
   1. BARRA DE PREAJUSTES RÁPIDOS
   ======================================================== */
.quick-presets-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.875rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.quick-presets-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quick-presets-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.preset-pill {
  appearance: none;
  background: var(--bg-card-inner);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  min-height: 40px;
}

.preset-pill:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.preset-pill.active {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--color-a);
  color: var(--color-a-light);
  font-weight: 600;
}

.pill-badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
}

/* ========================================================
   2. PARÁMETROS GLOBALES (RUEDA Y CADENCIA)
   ======================================================== */
.global-params-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.global-params-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

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

.param-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.label-info-badge {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* Select canónico obligatorio */
.form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  height: 42px;
  min-height: 42px;
  padding: 0 40px 0 0.875rem;
  font-size: 0.875rem;
  font-family: var(--font-main);
  background-color: var(--bg-card-inner);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  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%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
}

.custom-wheel-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.form-input {
  height: 42px;
  min-height: 42px;
  padding: 0 0.875rem;
  font-size: 0.875rem;
  font-family: var(--font-main);
  background: var(--bg-card-inner);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 100%;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.input-suffix {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Control deslizante de cadencia */
.cadence-label-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cadence-current-val {
  font-size: 1.1rem;
  color: var(--text-main);
}

.cadence-current-val small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cadence-slider-wrap {
  margin: 0.5rem 0;
}

.form-slider {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  outline: none;
  appearance: none;
  cursor: pointer;
}

.form-slider::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-a);
  box-shadow: 0 0 10px var(--color-a-glow);
  cursor: pointer;
  transition: transform 0.1s;
}

.form-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.cadence-presets-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

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

.btn-cadence-chip {
  appearance: none;
  background: var(--bg-card-inner);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 40px;
  justify-content: center;
  transition: all 0.2s;
}

.btn-cadence-chip small {
  font-size: 0.65rem;
  font-weight: normal;
  color: var(--text-dim);
}

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

.btn-cadence-chip.active {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--color-a);
  color: var(--color-a-light);
}

.btn-cadence-chip.active small {
  color: var(--color-a-light);
}

/* ========================================================
   3. SELECTOR DUAL DE CONFIGURACIONES (A vs B)
   ======================================================== */
.dual-config-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

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

.config-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.config-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.config-card-a::before {
  background: linear-gradient(90deg, var(--color-a), #3b82f6);
}

.config-card-b::before {
  background: linear-gradient(90deg, var(--color-b), #ef4444);
}

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

.config-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.badge-a {
  background: var(--color-a-glow);
  color: var(--color-a-light);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-b {
  background: var(--color-b-glow);
  color: var(--color-b-light);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

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

.config-inputs-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

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

/* Selector de plato */
.chainring-selector-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.chainring-chips {
  display: flex;
  gap: 0.35rem;
  flex: 1 1 auto;
}

.btn-cr-chip {
  appearance: none;
  background: var(--bg-card-inner);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex: 1 1 0%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-cr-chip:hover {
  background: var(--bg-card-hover);
}

.config-card-a .btn-cr-chip.active {
  background: var(--color-a);
  border-color: var(--color-a);
  color: #0b0f17;
  font-weight: 700;
}

.config-card-b .btn-cr-chip.active {
  background: var(--color-b);
  border-color: var(--color-b);
  color: #0b0f17;
  font-weight: 700;
}

.chainring-custom-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 80px;
}

.chainring-custom-wrap .form-input {
  text-align: center;
  padding: 0 0.25rem;
  font-weight: 700;
}

/* Resumen métrico en tarjeta */
.config-summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  background: var(--bg-card-inner);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  border: 1px solid var(--border-color);
}

.summary-metric-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: center;
}

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

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

.highlight-subida {
  color: var(--color-climb);
}

.highlight-llano {
  color: var(--color-sprint);
}

/* ========================================================
   4. TARJETA DE VEREDICTO INTELIGENTE
   ======================================================== */
.verdict-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--shadow-md);
}

.verdict-banner-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.verdict-header-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.verdict-main-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.verdict-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

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

.verdict-card {
  background: var(--bg-card-inner);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.verdict-card-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.verdict-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.verdict-type-badge.climb {
  background: var(--color-climb-bg);
  color: var(--color-climb);
  border: 1px solid var(--color-climb-border);
}

.verdict-type-badge.sprint {
  background: var(--color-sprint-bg);
  color: var(--color-sprint);
  border: 1px solid var(--color-sprint-border);
}

.verdict-delta-tag {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.verdict-card-title {
  font-size: 1rem;
  color: var(--text-main);
  line-height: 1.35;
}

.verdict-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.verdict-mini-stats {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.78rem;
}

.v-mini-stat {
  display: flex;
  justify-content: space-between;
}

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

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

.verdict-global-recommendation {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.rec-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.rec-text {
  font-size: 0.875rem;
  color: var(--text-main);
  line-height: 1.45;
}

/* ========================================================
   5. GRÁFICO COMPARATIVO DE BARRAS DE AVANCE
   ======================================================== */
.chart-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
}

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

@media (min-width: 640px) {
  .chart-section-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

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

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

.chart-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
}

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

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-dot.dot-a {
  background: var(--color-a);
}

.legend-dot.dot-b {
  background: var(--color-b);
}

.gear-bars-container {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.gear-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  gap: 0.75rem;
}

.gear-label-col {
  display: flex;
  flex-direction: column;
}

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

.gear-label-sub {
  font-size: 0.65rem;
  color: var(--text-dim);
}

.gear-bars-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.bar-track {
  height: 22px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.5rem;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 48px;
}

.bar-fill.bar-a {
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.6), var(--color-a));
  color: #0b0f17;
}

.bar-fill.bar-b {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.6), var(--color-b));
  color: #0b0f17;
}

.bar-metric-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ========================================================
   6. TABLA MATRICIAL DE VELOCIDADES Y CADENCIA
   ======================================================== */
.table-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.table-section-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .table-section-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

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

.table-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.table-view-toggle {
  display: flex;
  background: var(--bg-card-inner);
  border-radius: var(--radius-sm);
  padding: 0.2rem;
  border: 1px solid var(--border-color);
}

.btn-toggle-view {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 36px;
}

.btn-toggle-view.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.table-responsive-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.gear-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
  text-align: left;
}

.gear-matrix-table th,
.gear-matrix-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.gear-matrix-table th {
  background: var(--bg-card-inner);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.gear-matrix-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.gear-matrix-table tbody tr:last-child td {
  border-bottom: none;
}

.col-marcha {
  font-weight: 700;
  color: var(--text-main);
}

.cog-pill {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
}

.val-a {
  color: var(--color-a-light);
  font-weight: 600;
}

.val-b {
  color: var(--color-b-light);
  font-weight: 600;
}

.diff-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
}

.diff-tag.softer {
  background: var(--color-climb-bg);
  color: var(--color-climb);
}

.diff-tag.harder {
  background: rgba(244, 63, 94, 0.12);
  color: var(--color-alert);
}

.diff-tag.equal {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}

/* ========================================================
   7. MODALES CANÓNICOS (SIN WINDOW.ALERT)
   ======================================================== */
.fijate-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 9999;
}

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

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

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

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

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

.fijate-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.glossary-term strong {
  color: var(--text-main);
  display: block;
  margin-bottom: 0.25rem;
}

.share-url-box {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.share-url-box .form-input {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
}

.copy-success-msg {
  color: var(--color-climb);
  font-weight: 600;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

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

.btn-modal-primary {
  appearance: none;
  background: var(--color-a);
  border: none;
  color: #0b0f17;
  font-weight: 700;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  min-height: 40px;
}

.btn-modal-secondary {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  min-height: 40px;
}

/* ========================================================
   8. AJUSTES RESPONSIVOS Y MÓVIL
   ======================================================== */
@media (max-width: 640px) {
  .tool-layout {
    padding: 0 0.75rem;
    margin: 1rem auto 2.5rem;
  }

  .config-card {
    padding: 1.15rem;
  }

  .gear-row {
    grid-template-columns: 55px 1fr;
    gap: 0.5rem;
  }

  .chainring-chips {
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  .chainring-custom-wrap {
    width: 100%;
    margin-top: 0.25rem;
  }
}
