/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Material Design Palette — Stitch-inspired */
:root {
  --bg: #f0f4f9;
  --bg-subtle: #e8ecf1;
  --card-bg: #ffffff;
  --text: #1d1b20;
  --text-secondary: #49454f;
  --text-tertiary: #79747e;
  --accent: #0b57d0;
  --accent-light: #d3e3fd;
  --accent-dark: #0842a0;
  --green: #1e8e3e;
  --green-bg: #e6f4ea;
  --red: #d93025;
  --red-bg: #fce8e6;
  --border: #c4c7c5;
  --border-light: #e1e3e1;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --font: 'Google Sans', 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Google Sans Mono', 'Geist Mono', 'SF Mono', 'Fira Code', monospace;
  --blue: #1a73e8;
  --yellow: #f9ab00;
}

[data-theme="light"] {
  --bg: #f0f4f9;
  --bg-subtle: #e8ecf1;
  --card-bg: #ffffff;
  --text: #1d1b20;
  --text-secondary: #49454f;
  --text-tertiary: #79747e;
  --accent: #0b57d0;
  --accent-light: #d3e3fd;
  --accent-dark: #0842a0;
  --green: #1e8e3e;
  --green-bg: #e6f4ea;
  --red: #d93025;
  --red-bg: #fce8e6;
  --border: #c4c7c5;
  --border-light: #e1e3e1;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

[data-theme="dark"] {
  --bg: #1b1b1f;
  --bg-subtle: #2b2b30;
  --card-bg: #2d2d32;
  --text: #e6e1e5;
  --text-secondary: #c4c0c8;
  --text-tertiary: #938f96;
  --accent: #a8c7fa;
  --accent-light: #1a2740;
  --accent-dark: #7cacf8;
  --green: #81c995;
  --green-bg: #1a2e1f;
  --red: #f28b82;
  --red-bg: #3c2020;
  --border: #444449;
  --border-light: #3a3a3f;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 2px 6px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

/* Cotizaciones Strip */
.cotizaciones-strip {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-light);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cotizaciones-strip::-webkit-scrollbar { display: none; }
.cotizaciones-strip.loaded { display: flex; }
.cotizaciones-strip-inner {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  justify-content: center;
}
.cotiz-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 20px;
  border-right: 1px solid var(--border-light);
  min-width: 0;
  flex-shrink: 0;
}
.cotiz-item:last-child { border-right: none; }
.cotiz-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.cotiz-price {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
@media (max-width: 600px) {
  .cotizaciones-strip-inner { justify-content: flex-start; }
  .cotiz-item { padding: 4px 12px; }
  .cotiz-price { font-size: 0.7rem; }
}

/* Mundo Detail Modal */
.mundo-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}
.mundo-modal {
  background: var(--card-bg);
  border-radius: 28px;
  border: 1px solid var(--border-light);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  position: relative;
}
.mundo-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.mundo-modal-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mundo-modal-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.mundo-modal-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.mundo-modal-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.mundo-modal-price {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  font-family: var(--font);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.mundo-modal-change {
  font-size: 0.85rem;
  font-weight: 600;
}
.mundo-modal-date {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  height: 14px;
  visibility: visible;
}
.mundo-modal-date:empty {
  visibility: hidden;
}
.mundo-modal-tabs {
  display: flex;
  gap: 4px;
}
.mundo-range-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.mundo-range-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.mundo-range-btn:hover:not(.active) {
  background: var(--border);
}
.mundo-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  margin-left: 8px;
}
.mundo-modal-close:hover { color: var(--text); }
.mundo-modal-body {
  padding: 16px 20px 20px;
  min-height: 220px;
  position: relative;
}
#mundo-detail-chart {
  display: block;
  width: 100% !important;
  height: 260px !important;
  max-height: 40vh;
}
.mundo-modal-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-tertiary);
  font-size: 0.85rem;
  display: none;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-left {
  flex: 1;
  display: flex;
  align-items: center;
}

.header-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.logo {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.04em;
  cursor: pointer;
}

.currency-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-subtle);
  border-radius: 24px;
  padding: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  flex: 0 1 auto;
  min-width: 0;
}
.currency-tabs::-webkit-scrollbar { display: none; }

.currency-tab {
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 20px;
  width: auto;
  text-align: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.currency-tab.active {
  background: var(--card-bg);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.currency-tab.disabled {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}
.currency-tab[data-soon]::after {
  content: 'soon';
  position: absolute;
  top: -6px;
  right: -4px;
  font-size: 0.45rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--accent);
  color: #fff;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.3;
}

.chart-wrapper {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chart-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chart-logo {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}
.chart-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
.chart-bar-wrap {
  flex: 1;
  min-width: 0;
}
.chart-bar {
  height: 18px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  min-width: 50px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.chart-row:first-child .chart-bar {
  height: 22px;
  border-radius: 6px;
}
.chart-value {
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.chart-row:first-child .chart-value {
  font-size: 0.72rem;
}

/* Vertical Chart */
.vchart {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 4px;
  padding: 20px 12px 12px;
  min-height: 280px;
  overflow: hidden;
}
.vchart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.vchart-value {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
  font-family: var(--font-mono);
}
.vchart-bar-wrap {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.vchart-bar {
  width: 80%;
  max-width: 40px;
  border-radius: 8px 8px 4px 4px;
  transition: height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.vchart-name {
  font-size: 0.55rem;
  font-weight: 500;
  color: var(--text-tertiary);
  text-align: center;
  line-height: 1.2;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vchart .chart-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 0.5rem;
}
@media (max-width: 640px) {
  .vchart { gap: 4px; min-height: 220px; }
  .vchart-bar-wrap { height: 140px; }
  .vchart-col { min-width: 40px; }
  .vchart-name { font-size: 0.5rem; max-width: 44px; }
  .vchart .chart-logo { width: 24px; height: 24px; }
}

/* LECAP Table */
.lecap-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: var(--card-bg);
}
.lecap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  white-space: nowrap;
  table-layout: fixed;
}
.lecap-table thead {
  background: var(--bg-subtle);
  color: var(--accent);
}
.lecap-table th {
  padding: 8px 12px;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: right;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.lecap-table th:hover, .soberanos-table th:hover, .cer-table th:hover { color: rgba(255,255,255,0.7); }
[data-theme="dark"] .lecap-table th:hover, [data-theme="dark"] .soberanos-table th:hover, [data-theme="dark"] .cer-table th:hover { color: rgba(255,255,255,0.7); }
.lecap-table th .sort-arrow, .soberanos-table th .sort-arrow, .cer-table th .sort-arrow { font-size: 0.6rem; margin-left: 3px; opacity: 0.4; }
.lecap-table th .sort-arrow.active, .soberanos-table th .sort-arrow.active, .cer-table th .sort-arrow.active { opacity: 1; color: var(--accent); }
.calc-hint { font-size: 0.75rem; color: var(--text-tertiary); margin-bottom: 8px; }
.calc-hint span { background: var(--accent-light); color: var(--accent); padding: 2px 6px; border-radius: 4px; font-size: 0.7rem; }
.lecap-table th:first-child { text-align: left; }
.lecap-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-light);
  text-align: right;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.lecap-table td:first-child {
  text-align: left;
  font-weight: 600;
}
/* Column widths */
.lecap-table .col-ticker { width: 18%; }
.lecap-table .col-precio { width: 11%; }
.lecap-table .col-pago { width: 13%; }
.lecap-table .col-dias { width: 7%; }
.lecap-table .col-vto { width: 14%; }
.lecap-table .col-tna { width: 12%; }
.lecap-table .col-tem { width: 12%; }
.lecap-table .col-tir { width: 13%; }
.lecap-table tbody tr {
  background: var(--card-bg);
}
.lecap-table tbody tr:hover {
  background: var(--bg-subtle);
}
.lecap-table tbody tr:last-child td {
  border-bottom: none;
}
.lecap-table .lecap-ticker {
  font-weight: 700;
  color: var(--accent);
}
.lecap-table .lecap-tir,
.soberanos-table .lecap-tir {
  font-weight: 700;
  color: var(--green);
}
.lecap-table .lecap-tna {
  font-weight: 600;
}
.lecap-table .lecap-tem {
  font-weight: 600;
}
.lecap-type-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}
.lecap-type-badge.lecap { background: var(--green-bg); color: var(--green); }
.lecap-type-badge.boncap { background: var(--accent-light); color: var(--accent); }
[data-theme="dark"] .lecap-type-badge.lecap { background: var(--green-bg); color: var(--green); }
[data-theme="dark"] .lecap-type-badge.boncap { background: var(--accent-light); color: var(--accent); }
.lecap-table .highlighted-row td {
  background: rgba(59, 130, 246, 0.06);
}
[data-theme="dark"] .lecap-table .highlighted-row td {
  background: rgba(59, 130, 246, 0.1);
}

/* Scatter Plot */
.scatter-plot {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-top: 8px;
  height: 420px;
}

.spread-positive { color: #ef4444; font-weight: 600; }
.spread-negative { color: var(--green); font-weight: 600; }

/* Soberanos Table */
.soberanos-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border-light); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--card-bg); }
.soberanos-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; white-space: nowrap; table-layout: fixed; }
.soberanos-table thead { background: var(--bg-subtle); color: var(--accent); }
.soberanos-table th { padding: 8px 12px; font-weight: 600; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; text-align: right; }
.soberanos-table th:first-child, .soberanos-table th:nth-child(2) { text-align: left; }
.soberanos-table td { padding: 7px 12px; border-bottom: 1px solid var(--border-light); text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.soberanos-table td:first-child, .soberanos-table td:nth-child(2) { text-align: left; }
.soberanos-table tbody tr { background: var(--card-bg); }
.soberanos-table tbody tr:hover { background: var(--bg-subtle); }
.soberanos-table tbody tr:last-child td { border-bottom: none; }
.soberano-ticker { font-weight: 700; color: var(--accent); margin-right: 6px; }
.soberano-ley { font-size: 0.6rem; padding: 2px 6px; border-radius: 4px; font-weight: 600; vertical-align: middle; }
.soberano-ley.ley-local { background: #fef7e0; color: #b06000; }
.soberano-ley.ley-ny { background: var(--accent-light); color: var(--accent); }
[data-theme="dark"] .soberano-ley.ley-local { background: #3a3000; color: #ffd600; }
[data-theme="dark"] .soberano-ley.ley-ny { background: var(--accent-light); color: var(--accent); }
.soberano-ytm { font-weight: 700; }

.admin-link {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  transition: all 0.15s;
  font-weight: 500;
}

.admin-link:hover {
  border-color: var(--text);
}

/* Operations Modal */
.ops-modal { max-width: 480px; }
.ops-summary {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px;
  background: var(--bg-subtle);
  border-radius: 4px;
  border: 1px solid var(--border);
}
.ops-summary-item { flex: 1; text-align: center; }
.ops-label { display: block; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary); font-weight: 600; margin-bottom: 2px; }
.ops-value { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-bottom: 16px;
}
.ops-table th {
  text-align: left;
  padding: 6px 8px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
}
.ops-table td { padding: 6px 8px; border-bottom: 1px solid var(--border-light); }
.ops-buy td:nth-child(2) { color: var(--green); font-weight: 600; }
.ops-sell td:nth-child(2) { color: var(--red); font-weight: 600; }
.ops-add-section {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.ops-type-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.ops-type-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  background: var(--card-bg);
  color: var(--text-secondary);
  transition: all 0.15s;
}
.ops-type-buy.active { background: rgba(0, 210, 106, 0.15); border-color: var(--green); color: var(--green); }
.ops-type-sell.active { background: rgba(255, 59, 59, 0.15); border-color: var(--red); color: var(--red); }
.ops-type-btn:hover { border-color: var(--text-secondary); }
.ops-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.ops-field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.ops-field input {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  box-sizing: border-box;
}
.ops-badge {
  display: inline-block;
  font-size: 0.6rem;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-subtle);
  color: var(--text-tertiary);
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}
@media (max-width: 600px) {
  .ops-form-row { grid-template-columns: 1fr 1fr; }
  .ops-summary { flex-wrap: wrap; }
}

/* Theme Toggle */
/* Accessibility / Read Aloud Toggle */

.theme-toggle {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  transition: all 0.15s;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.theme-toggle:hover {
  background: var(--border);
  color: var(--text);
}

[data-theme="dark"] .theme-toggle {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text);
}
[data-theme="dark"] .theme-toggle:hover {
  background: var(--border);
  border-color: var(--text-tertiary);
}

/* Show sun in dark mode, moon in light mode */
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: inline-block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline-block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.icon-sun { display: none; }
.icon-moon { display: inline-block; }

.theme-toggle svg,
.flag svg,
.icon-logo,
.icon-hint {
  display: inline-block;
  vertical-align: middle;
}

/* Subnav */
.subnav {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.subnav-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.subnav-inner::-webkit-scrollbar { display: none; }

.subnav-tab {
  text-decoration: none;
  padding: 10px 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.subnav-tab:hover:not(.active):not(.disabled) {
  color: var(--text-secondary);
}

.subnav-tab.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.subnav-tab.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.subnav-tab:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Hero */
.hero {
  max-width: 780px;
  margin: 0 auto;
  padding: 16px 24px 8px;
}

.hero h1 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-bottom: 4px;
  color: var(--text);
  text-transform: none;
}

.hero p {
  color: var(--text-tertiary);
  font-size: 0.75rem;
  max-width: 480px;
  line-height: 1.4;
}

/* Container */
.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* Sections */
.section {
  margin-top: 20px;
}

.section h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
  letter-spacing: 0.03em;
  text-transform: none;
  color: var(--text);
}

.section-desc {
  color: var(--text-tertiary);
  font-size: 0.72rem;
  margin-bottom: 12px;
}
.section-source {
  color: var(--text-tertiary);
  font-size: 0.7rem;
  margin-top: 16px;
}
.section-source a {
  color: var(--text-secondary);
  text-decoration: none;
}
.section-source a:hover {
  color: var(--accent);
}
.source-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  vertical-align: -4px;
  margin-right: 2px;
}

.risk-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

/* Card List */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Fund Card */
.fund-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.fund-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.fund-card.highlighted {
  border-color: var(--accent);
  background: var(--accent-light);
}

.fund-card.promoted {
  border: 1.5px solid var(--accent);
}


/* Logo */
.fund-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.65rem;
  flex-shrink: 0;
  overflow: hidden;
}

.fund-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

/* Info */
.fund-info {
  flex: 1;
  min-width: 0;
}

.fund-name {
  font-weight: 650;
  font-size: 0.9rem;
  letter-spacing: -0.015em;
}

.fund-entity {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 1px;
}

.fund-description {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.4;
}

.fund-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.tag {
  font-size: 0.65rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.tag.type {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.tag.limit {
  background: var(--red-bg);
  color: var(--red);
}

.tag.limit.no-limit {
  background: var(--green-bg);
  color: var(--green);
}

.tag.category {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.tag.billetera {
  background: var(--red-bg);
  color: var(--red);
}

/* Rate */
.fund-rate {
  text-align: right;
  flex-shrink: 0;
  min-width: 100px;
}

.rate-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: -0.03em;
  font-family: var(--font-mono);
  line-height: 1;
}

.rate-label {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.rate-date {
  font-size: 0.63rem;
  color: var(--text-tertiary);
  margin-top: 1px;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-tertiary);
  font-size: 0.82rem;
}

.loading-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-bottom: 10px;
}

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

/* Footer */
.footer {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border);
}

.footer p + p { margin-top: 4px; }
.visit-counter { margin-bottom: 12px; font-size: 1.1rem; font-weight: 600; color: var(--accent); letter-spacing: 0.02em; }

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #d4d4d8;
  border-radius: 11px;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* Buttons */
.btn {
  padding: 10px 24px;
  border: none;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover { opacity: 0.85; }

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
}

.btn-danger:hover { background: #fee2e2; }

.btn-sm {
  padding: 4px 10px;
  font-size: 0.72rem;
}

/* Compare Page */
.compare-selectors {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.compare-select-group {
  flex: 1;
  min-width: 200px;
}

.compare-select-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.compare-select-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: var(--font);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
}

.compare-select-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Mundo Monitor */
.mundo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.mundo-col {
  display: contents;
}
.mundo-group-header {
  grid-column: 1 / -1;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 8px 12px 4px;
}
.mundo-group-header:first-child {
  padding-top: 6px;
}
.mundo-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--card-bg);
  cursor: pointer;
  transition: background 0.1s;
}
.mundo-card:hover {
  background: var(--hover-bg, rgba(255,255,255,0.03));
}
.mundo-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.7;
}
.mundo-info {
  flex: 1;
  min-width: 0;
}
.mundo-name {
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mundo-group-tag { display: none; }
.mundo-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font);
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.mundo-spark {
  flex-shrink: 0;
  width: 60px;
  height: 24px;
}
.mundo-spark canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.spark-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: sparkPulse 1.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sparkPulse {
  0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.3; transform: translate(-50%, -50%) scale(1.8); }
}
.mundo-change {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 50px;
  justify-content: flex-end;
}
.mundo-arrow {
  font-size: 0.55rem;
}

/* Mundo Mobile — single column, larger fonts */
@media (max-width: 600px) {
  .mundo-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
  }
  .mundo-col {
    display: contents;
  }
  .mundo-card {
    padding: 10px 14px;
    gap: 10px;
  }
  .mundo-icon {
    font-size: 1.1rem;
  }
  .mundo-info {
    flex: 1;
    min-width: 0;
  }
  .mundo-name {
    font-size: 0.72rem;
  }
  .mundo-price {
    font-size: 1.1rem;
  }
  .mundo-spark {
    flex: 0 0 auto;
    width: 108px;
    height: 28px;
  }
  .mundo-change {
    font-size: 0.8rem;
    min-width: 52px;
  }
  .mundo-arrow {
    font-size: 0.5rem;
  }
  .mundo-group-header {
    padding: 10px 14px 4px;
    font-size: 0.6rem;
    border: none;
    grid-column: 1 / -1;
  }
}

/* Hot US Movers */
.hot-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 18px 0 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.hot-subtitle {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-secondary);
}
.hot-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.hot-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  min-width: 260px;
  flex-shrink: 0;
}
.hot-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.hot-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border-light);
}
.hot-logo-fallback {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--border-light);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.hot-info {
  flex: 1;
  min-width: 0;
}
.hot-symbol {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.hot-name {
  font-size: 0.7rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.hot-right {
  text-align: right;
  flex-shrink: 0;
}
.hot-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font);
}
.hot-change {
  font-size: 0.85rem;
  font-weight: 600;
}

/* Soon badge */
.soon-badge {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--red);
  color: #fff;
  padding: 1px 4px;
  border-radius: 3px;
  vertical-align: super;
  margin-left: 2px;
}
.admin-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

#chart-container {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.compare-details {
  margin-top: 24px;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.compare-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--bg-subtle);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.compare-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.compare-table td:first-child {
  font-family: var(--font);
  font-weight: 500;
  color: var(--text-secondary);
}

/* Focus styles */
.fund-card:focus-visible,
.mundo-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.currency-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 6px;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mundo-range-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Smooth section transitions */
[role="tabpanel"] {
  animation: fadeIn 0.2s ease-out;
}

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

/* Selection color */
::selection {
  background: var(--accent);
  color: #fff;
}

/* Responsive */
@media (max-width: 640px) {
  .header-inner {
    padding: 8px 12px;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .header-inner::-webkit-scrollbar { display: none; }
  .logo { font-size: 0.8rem; white-space: nowrap; flex-shrink: 0; }
  .currency-tabs { flex-shrink: 0; gap: 0; padding: 2px; }
  .currency-tab { padding: 4px 8px; font-size: 0.65rem; width: auto; min-width: 0; }
  .currency-tab .flag { display: none; }
  .admin-link { display: none; }
  .subnav-inner { padding: 0 16px; gap: 16px; }
  .subnav-tab { font-size: 0.75rem; padding: 8px 0; }
  .hero { padding: 16px 16px 8px; }
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: 0.78rem; }
  .container { padding: 0 16px 60px; }
  .fund-card {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }
  .fund-logo { width: 32px; height: 32px; border-radius: 8px; font-size: 0.6rem; }
  .fund-logo img { border-radius: 8px; }
  .fund-name { font-size: 0.8rem; }
  .fund-entity { font-size: 0.68rem; }
  .fund-tags { gap: 3px; margin-top: 3px; }
  .tag { font-size: 0.58rem; padding: 1px 5px; }
  .rate-date { display: none; }
  .rate-label { font-size: 0.6rem; }
  .fund-rate {
    text-align: right;
    min-width: 70px;
  }
  .rate-value { font-size: 1.1rem; }
  .card-list .fund-card:first-child { padding: 14px 16px; }
  .card-list .fund-card:first-child .rate-value { font-size: 1.3rem; }
  .card-list .fund-card:first-child .fund-logo { width: 40px; height: 40px; }
  .card-list .fund-card:first-child .fund-name { font-size: 0.88rem; }
  /* Tables mobile - keep all columns, shrink font, allow horizontal scroll */
  .lecap-table, .soberanos-table, .cer-table { table-layout: auto; font-size: 0.65rem; white-space: nowrap; }
  .lecap-table th, .soberanos-table th, .cer-table th { padding: 6px 6px; font-size: 0.58rem; }
  .lecap-table td, .soberanos-table td, .cer-table td { padding: 5px 6px; }
  .lecap-type-badge { font-size: 0.5rem; padding: 1px 4px; margin-left: 4px; }
  .scatter-plot { height: 280px; }
  .footer { padding: 24px 16px 40px; }
}

/* ─── BCRA Section ──────────────────────────────────────────────────────────── */
.bcra-category { margin-bottom: 28px; }
.bcra-cat-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin: 0 0 10px 0;
}
.bcra-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.bcra-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.bcra-card:hover { border-color: var(--accent); background: var(--bg-hover); }
.bcra-card-nombre {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.3;
}
.bcra-card-valor {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.bcra-card-valor.bcra-null { color: var(--text-tertiary); font-size: 1rem; }
.bcra-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.bcra-card-fecha {
  font-size: 0.7rem;
  color: var(--text-tertiary);
}
.bcra-card-unidad {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}
@media (max-width: 600px) {
  .bcra-cards { grid-template-columns: repeat(2, 1fr); }
  .bcra-card-valor { font-size: 1.05rem; }
}

/* ─── BCRA Subnav ──────────────────────────────────────────────────────────── */
.bcra-subnav {
  display: flex;
  gap: 4px;
  padding: 12px 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.bcra-tab {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px 6px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  transition: color 0.15s, background 0.15s;
  position: relative;
  bottom: -1px;
}
.bcra-tab:hover { color: var(--text); background: var(--bg-subtle); }
.bcra-tab.active {
  color: var(--accent);
  background: var(--bg);
  border-color: var(--border);
  border-bottom-color: var(--bg);
}
.bcra-cards-otras { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.bcra-camb-card .bcra-card-nombre { font-size: 0.76rem; }

/* ─── Dolar ─── */
.dolar-best-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  margin-bottom: 24px;
  align-items: stretch;
}
.dolar-spread-card {
  border-top: 3px solid var(--yellow);
  padding: 10px 14px;
  min-width: 120px;
}
.dolar-spread-card .dolar-best-price {
  font-size: 1.2rem;
}
.dolar-spread-card .dolar-best-exchange {
  font-size: 0.72rem;
}
@media (max-width: 640px) {
  .dolar-best-grid {
    grid-template-columns: 1fr 1fr;
  }
  .dolar-spread-card {
    grid-column: 1 / -1;
  }
}
.dolar-best-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.dolar-best-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.dolar-best-card.best-buy::before { background: var(--green); }
.dolar-best-card.best-sell::before { background: var(--accent); }
.dolar-best-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.dolar-best-card.best-buy .dolar-best-label { color: var(--green); }
.dolar-best-card.best-sell .dolar-best-label { color: var(--accent); }
.dolar-best-exchange {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.dolar-best-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
  line-height: 1.2;
}
.dolar-best-diff {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.dolar-tipos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 24px;
}
.dolar-tipo-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: box-shadow 0.15s;
}
.dolar-tipo-card:hover { box-shadow: var(--shadow); }
.dolar-tipo-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.dolar-tipo-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.dolar-tipo-prices {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.dolar-tipo-col {
  flex: 1;
}
.dolar-tipo-label {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.dolar-tipo-value {
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text);
}

/* Exchange table */
.dolar-exchange-section {
  margin-top: 8px;
}
.dolar-exchange-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.dolar-exchange-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.dolar-coin-toggle {
  display: flex;
  gap: 2px;
  background: var(--bg-subtle);
  border-radius: 6px;
  padding: 2px;
}
.dolar-coin-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.dolar-coin-btn:hover { color: var(--text); }
.dolar-coin-btn.active {
  background: var(--card-bg);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.dolar-sort-toggle {
  display: flex;
  gap: 2px;
  background: var(--bg-subtle);
  border-radius: 6px;
  padding: 2px;
}
.dolar-sort-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.dolar-sort-btn:hover { color: var(--text); }
.dolar-sort-btn.active {
  background: var(--card-bg);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.dolar-exchange-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.dolar-exchange-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
}
.dolar-exchange-table th.col-right { text-align: right; }
.dolar-exchange-table td {
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
}
.dolar-exchange-table tr:last-child td { border-bottom: none; }
.dolar-exchange-table tr:hover td { background: var(--bg-subtle); }
.dolar-exchange-table .col-right {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 500;
}
.dolar-exchange-name {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dolar-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.dolar-rank.rank-1 { background: var(--green); }
.dolar-rank.rank-2 { background: var(--accent); }
.dolar-rank.rank-3 { background: var(--yellow); color: #000; }
.dolar-rank.rank-other { background: var(--bg-subtle); color: var(--text-tertiary); }
.dolar-best-tag {
  font-size: 0.6rem;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  background: var(--green-bg);
  color: var(--green);
}

@media (max-width: 640px) {
  .dolar-tipos-grid { grid-template-columns: repeat(2, 1fr); }
  .dolar-exchange-table { font-size: 0.78rem; }
  .dolar-exchange-table th, .dolar-exchange-table td { padding: 8px 10px; }
}

/* ─── PIX ─── */
.pix-best-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  margin-bottom: 24px;
  align-items: stretch;
}
@media (max-width: 640px) {
  .pix-best-grid { grid-template-columns: 1fr 1fr; }
  .pix-best-grid .dolar-spread-card { grid-column: 1 / -1; }
}
.pix-provider-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.pix-provider-link:hover {
  background: var(--accent);
  color: #fff;
}
