/**
 * Estilos para el Monitor de Comisiones de Bitcoin y Estado de la Red (Mempool Tracker)
 * Fijate Tools • Suite Canónica de Herramientas Web
 */

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

  /* Tema Oscuro (Midnight Slate oficial) */
  --bg-page: #0b0f17;
  --bg-card: #111827;
  --bg-card-subtle: #161f30;
  --bg-card-hover: #1e293b;
  --border-card: #1f2937;
  --border-card-hover: #374151;
  --border-card-focus: #f59e0b;
  --border-color: #1f2937;
  --bg-input: #111827;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  /* Colores de marca y estado */
  --primary-color: #f59e0b;
  --primary-light: rgba(245, 158, 11, 0.15);
  --btc-gold: #f59e0b;
  --btc-gold-glow: rgba(245, 158, 11, 0.2);
  --btc-gold-hover: #d97706;
  
  --priority-high: #ef4444;
  --priority-high-bg: rgba(239, 68, 68, 0.12);
  --priority-high-border: rgba(239, 68, 68, 0.35);

  --priority-medium: #f59e0b;
  --priority-medium-bg: rgba(245, 158, 11, 0.12);
  --priority-medium-border: rgba(245, 158, 11, 0.4);

  --priority-low: #0284c7;
  --priority-low-bg: rgba(2, 132, 199, 0.12);
  --priority-low-border: rgba(2, 132, 199, 0.35);

  --priority-eco: #10b981;
  --priority-eco-bg: rgba(16, 185, 129, 0.12);
  --priority-eco-border: rgba(16, 185, 129, 0.35);

  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;

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

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(245, 158, 11, 0.25);
}

[data-theme="light"], body.light-theme {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-card-hover: #e2e8f0;
  --border-card: #e2e8f0;
  --border-card-hover: #cbd5e1;
  --border-card-focus: #d97706;
  --border-color: #e2e8f0;
  --bg-input: #f1f5f9;

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

  --primary-color: #d97706;
  --primary-light: rgba(217, 119, 6, 0.12);
  --btc-gold: #d97706;
  --btc-gold-glow: rgba(217, 119, 6, 0.15);

  --priority-high-bg: rgba(239, 68, 68, 0.08);
  --priority-high-border: rgba(239, 68, 68, 0.25);

  --priority-medium-bg: rgba(245, 158, 11, 0.08);
  --priority-medium-border: rgba(245, 158, 11, 0.3);

  --priority-low-bg: rgba(2, 132, 199, 0.08);
  --priority-low-border: rgba(2, 132, 199, 0.25);

  --priority-eco-bg: rgba(16, 185, 129, 0.08);
  --priority-eco-border: rgba(16, 185, 129, 0.25);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(217, 119, 6, 0.15);
}

/* Reset y estructura 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.55;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Tipografías de titulares */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
}

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

/* Estructura del contenido principal */
.tool-main-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Barra de estado en vivo superior */
.live-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.pulse-dot {
  width: 10px;
  height: 10px;
  background-color: #10b981;
  border-radius: 50%;
  position: relative;
  display: inline-block;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid #10b981;
  animation: pulse-ring 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  opacity: 0.8;
}

@keyframes pulse-ring {
  0% { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

.btc-price-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.9rem;
}

.btc-badge {
  background-color: var(--btc-gold);
  color: #000000;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.btc-price-display-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btc-price {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
}

.btc-price-sec {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-light);
}

.btn-edit-price {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-edit-price:hover {
  color: var(--btc-gold);
  background-color: var(--bg-card-hover);
}

.badge-price-custom {
  font-size: 0.65rem;
  font-weight: 700;
  background-color: rgba(245, 158, 11, 0.2);
  color: var(--btc-gold);
  border: 1px solid var(--btc-gold);
  border-radius: 9999px;
  padding: 0.1rem 0.4rem;
  text-transform: uppercase;
}

.btc-price-edit-form {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.input-price-edit {
  width: 90px;
  height: 28px;
  background-color: var(--bg-card);
  border: 1px solid var(--btc-gold);
  border-radius: 4px;
  padding: 0 0.4rem;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
}

.btn-price-apply {
  background-color: var(--btc-gold);
  color: #000000;
  border: none;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
}

.btn-price-cancel {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.btn-restore-live-price {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 9999px;
  color: var(--btc-gold);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-restore-live-price:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--btc-gold);
}

.currency-toggle-group {
  display: inline-flex;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 2px;
}

.btn-currency {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 36px;
}

.btn-currency.active {
  background-color: var(--btc-gold);
  color: #000000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.refresh-action-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background-color: var(--bg-card-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.85rem;
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
  transition: all 0.2s ease;
}

.btn-refresh:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-card-hover);
}

.btn-refresh.is-spinning .refresh-icon {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.countdown-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-light);
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: 9999px;
  padding: 0.25rem 0.5rem;
}

/* Tarjetas y secciones canónicas */
.section-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.subsection-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

/* Botones de información para modales */
.btn-info-modal {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  min-height: 40px;
  transition: all 0.15s ease;
}

.btn-info-modal:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--btc-gold);
}

/* ==========================================================================
   SECCIÓN 1: Semáforo de comisiones (Tarjetas de prioridad)
   ========================================================================== */
.fee-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 992px) {
  .fee-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .fee-cards-grid {
    grid-template-columns: 1fr;
  }
}

.fee-card {
  background-color: var(--bg-card-subtle);
  border: 2px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  position: relative;
  user-select: none;
}

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

.fee-card:focus-visible {
  border-color: var(--btc-gold);
  box-shadow: 0 0 0 3px var(--btc-gold-glow);
}

.fee-card.is-selected {
  border-color: var(--btc-gold) !important;
  background-color: var(--bg-card);
  box-shadow: var(--shadow-glow);
}

.fee-card__header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.priority-badge {
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  width: fit-content;
}

.badge-high {
  background-color: var(--priority-high-bg);
  border: 1px solid var(--priority-high-border);
  color: var(--priority-high);
}

.badge-medium {
  background-color: var(--priority-medium-bg);
  border: 1px solid var(--priority-medium-border);
  color: var(--priority-medium);
}

.badge-low {
  background-color: var(--priority-low-bg);
  border: 1px solid var(--priority-low-border);
  color: var(--priority-low);
}

.badge-eco {
  background-color: var(--priority-eco-bg);
  border: 1px solid var(--priority-eco-border);
  color: var(--priority-eco);
}

.eta-time {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.fee-rate-display {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.fee-rate-val {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
}

.fee-rate-unit {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.fee-cost-fiat {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--btc-gold);
  margin-top: 0.25rem;
}

.fee-card__footer {
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.35;
  border-top: 1px solid var(--border-card);
  padding-top: 0.65rem;
}

/* ==========================================================================
   SECCIÓN 2: Calculadora por tipo de transacción
   ========================================================================== */
.calculator-workspace {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 960px) {
  .calculator-workspace {
    grid-template-columns: 1fr;
  }
}

.calc-form-pane {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.form-sublabel {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.35rem;
}

.tx-types-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tx-type-option {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.tx-type-option:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-card-hover);
}

.tx-type-option.is-active {
  background-color: var(--bg-card);
  border-color: var(--btc-gold);
  box-shadow: 0 0 0 1px var(--btc-gold);
}

.tx-type-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.tx-type-name {
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--text-main);
}

.tx-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}

.badge-save {
  background-color: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-max-save {
  background-color: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-legacy {
  background-color: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  border: 1px solid var(--border-card);
}

.badge-custom {
  background-color: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.tx-type-desc {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.custom-tx-fields {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.form-input {
  width: 100%;
  height: 42px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0 0.75rem;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  outline: none;
}

.form-input:focus {
  border-color: var(--btc-gold);
}

.slider-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--btc-gold);
  font-size: 0.85rem;
}

.form-range {
  width: 100%;
  accent-color: var(--btc-gold);
  cursor: pointer;
  height: 6px;
}

.header-actions-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-reset-defaults {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  font-size: 0.775rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  min-height: 40px;
  transition: all 0.15s ease;
}

.btn-reset-defaults:hover {
  background-color: var(--bg-card-hover);
  color: var(--btc-gold);
  border-color: var(--btc-gold);
}

.rate-adjustment-bar {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rate-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.btn-sync-network-rate {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 1px solid var(--border-card);
  border-radius: 4px;
  padding: 0.2rem 0.55rem;
  color: var(--btc-gold);
  font-size: 0.725rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sync-network-rate:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--btc-gold);
}

.rate-origin-label {
  font-size: 0.75rem;
  color: var(--text-light);
  font-style: italic;
}

.rate-stepper-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-step {
  width: 44px;
  height: 44px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-step:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--btc-gold);
}

.rate-input-container {
  flex: 1 1 0%;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
}

.rate-input {
  width: 100%;
  height: 44px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0 4rem 0 0.85rem;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  outline: none;
}

.rate-input:focus {
  border-color: var(--btc-gold);
}

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

/* Columna derecha: Tarjeta de resultados */
.calc-result-pane {
  position: sticky;
  top: 1.5rem;
}

.result-card {
  background: linear-gradient(145deg, var(--bg-card-subtle), var(--bg-card));
  border: 2px solid var(--btc-gold);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-glow);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.result-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-format-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #000000;
  background-color: var(--btc-gold);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.result-hero-amount {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5rem 0;
}

.hero-fiat {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
}

.hero-sats {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--btc-gold);
  margin-top: 0.35rem;
}

.hero-btc {
  font-family: var(--font-mono);
  font-size: 0.825rem;
  color: var(--text-light);
  margin-top: 0.2rem;
}

.result-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  gap: 0.5rem;
}

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

.row-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-main);
  text-align: right;
}

.row-saving {
  border-top: 1px dashed var(--border-card);
  padding-top: 0.45rem;
  margin-top: 0.2rem;
}

.text-success {
  color: #10b981 !important;
  font-weight: 700;
}

.btn-modal-action {
  width: 100%;
  min-height: 42px;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.775rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  transition: all 0.15s ease;
}

.btn-modal-action:hover {
  background-color: var(--bg-card-hover);
  color: var(--btc-gold);
  border-color: var(--border-card-hover);
}

/* ==========================================================================
   SECCIÓN 3: Termómetro de congestión de la Mempool
   ========================================================================== */
.mempool-status-badge {
  font-size: 0.775rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}

.badge-status-low {
  background-color: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status-normal {
  background-color: rgba(245, 158, 11, 0.15);
  color: var(--btc-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-status-high {
  background-color: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.mempool-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .mempool-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .mempool-metrics-grid {
    grid-template-columns: 1fr;
  }
}

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

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

.metric-val {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
}

.metric-sub {
  font-size: 0.725rem;
  color: var(--text-light);
}

/* Termómetro visual */
.mempool-gauge-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.g-label {
  color: var(--text-muted);
  font-weight: 600;
}

.g-status-text {
  font-weight: 700;
  color: var(--btc-gold);
}

.gauge-bar-track {
  width: 100%;
  height: 14px;
  background-color: var(--bg-card);
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid var(--border-card);
}

.gauge-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #f59e0b 50%, #ef4444 100%);
  border-radius: 9999px;
  transition: width 0.6s ease;
}

.gauge-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-light);
  font-family: var(--font-mono);
}

/* Histograma de Mempool */
.histogram-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.histogram-bars-container {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 130px;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1rem;
  overflow-x: auto;
}

.histogram-bar-col {
  flex: 1 1 0%;
  min-width: 38px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 0.35rem;
}

.histogram-bar {
  width: 100%;
  background-color: var(--btc-gold);
  border-radius: 4px 4px 0 0;
  transition: height 0.4s ease;
  min-height: 4px;
  position: relative;
}

.histogram-bar-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-light);
  white-space: nowrap;
}

.histogram-bar-vmb {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
}

.histogram-loading {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.85rem;
}

/* ==========================================================================
   SECCIÓN 4: Visualizador de bloques
   ========================================================================== */
.blocks-tabs-switch {
  display: inline-flex;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 3px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 38px;
}

.tab-btn.active {
  background-color: var(--btc-gold);
  color: #000000;
}

.blocks-stream-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 1024px) {
  .blocks-stream-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .blocks-stream-grid {
    grid-template-columns: 1fr;
  }
}

.block-card {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: all 0.2s ease;
}

.block-card:hover {
  border-color: var(--border-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.block-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 0.5rem;
}

.block-height {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.block-time-ago {
  font-size: 0.725rem;
  color: var(--text-light);
}

.block-pool-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
  width: fit-content;
}

.block-stats-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.75rem;
}

.block-stat-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

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

.block-fee-pill {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--btc-gold);
}

.blocks-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 0;
  color: var(--text-light);
  font-size: 0.875rem;
}

/* ==========================================================================
   SECCIÓN 5: Ajuste de dificultad
   ========================================================================== */
.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .difficulty-grid {
    grid-template-columns: 1fr;
  }
}

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

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

.diff-val {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.text-diff {
  color: var(--btc-gold);
}

.diff-progress-track {
  width: 100%;
  height: 8px;
  background-color: var(--bg-card);
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid var(--border-card);
  margin: 0.2rem 0;
}

.diff-progress-fill {
  height: 100%;
  background-color: var(--btc-gold);
  border-radius: 9999px;
  transition: width 0.5s ease;
}

.diff-sub {
  font-size: 0.725rem;
  color: var(--text-light);
}

/* ==========================================================================
   SECCIÓN 6: FAQ y Modales
   ========================================================================== */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.faq-item:hover {
  border-color: var(--border-card-hover);
}

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

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

.faq-question::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--btc-gold);
  transition: transform 0.2s ease;
}

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

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

.faq-answer code {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--btc-gold);
  display: inline-block;
  margin: 0.35rem 0;
}

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

.modal-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: translateY(15px);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.is-active .modal-content {
  transform: translateY(0);
}

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

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

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

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

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

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

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

.modal-highlight-box {
  background-color: var(--bg-card-subtle);
  border-left: 4px solid var(--btc-gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
}

.method-card {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.method-card h4 {
  font-size: 0.925rem;
  color: var(--btc-gold);
}

.modal-table-wrap {
  overflow-x: auto;
}

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

.modal-table th, .modal-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-card);
}

.modal-table th {
  color: var(--text-muted);
  font-weight: 600;
  background-color: var(--bg-card-subtle);
}

.modal-subnote {
  font-size: 0.775rem;
  color: var(--text-light);
  font-style: italic;
}

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

.btn-primary {
  background-color: var(--btc-gold);
  color: #000000;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.55rem 1.5rem;
  min-height: 42px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary:hover {
  background-color: var(--btc-gold-hover);
}

/* ==========================================================================
   Adaptaciones Responsivas y Móvil (Directivas Canónicas)
   ========================================================================== */
@media (max-width: 640px) {
  .section-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
  }

  .live-status-bar {
    padding: 0.75rem 1rem;
    flex-direction: column;
    align-items: stretch;
  }

  .status-indicator, .btc-price-chip, .refresh-action-group {
    justify-content: center;
  }

  .btn-refresh {
    width: 100%;
    justify-content: center;
  }

  .hero-fiat {
    font-size: 2.25rem;
  }
}
