/* 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;
  }
}

/* Editorial Palette — warm cream + market green */
:root {
  --bg: #F4EFE6;
  --bg-subtle: #FBF7EE;
  --card-bg: #FFFDF7;
  --text: #16130E;
  --text-secondary: #3C3830;
  --text-tertiary: #807A6D;
  --text-faint: #B8B1A2;
  --accent: #1F6B4A;
  --accent-light: #E6EDE6;
  --accent-dark: #174F36;
  --green: #1F6B4A;
  --green-bg: #E6EDE6;
  --red: #B8452E;
  --red-bg: #F3E2DB;
  --border: #CEC5B0;
  --border-light: #E2DBCB;
  --highlight: #E9C46A;
  --radius: 14px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 0 rgba(22,19,14,.04);
  --shadow: 0 1px 0 rgba(22,19,14,.04), 0 4px 16px rgba(22,19,14,.04);
  --shadow-lg: 0 8px 32px rgba(22,19,14,.08);
  --display: 'Instrument Serif', 'Newsreader', Georgia, serif;
  --font: 'Inter Tight', 'Google Sans', 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Google Sans Mono', 'Geist Mono', 'SF Mono', 'Fira Code', monospace;
  --tracking-display: -0.03em;
  --tracking-body: -0.005em;
  --tracking-mono: 0.04em;
  --blue: #1F6B4A;
  --yellow: #E9C46A;
}

[data-theme="light"] {
  --bg: #F4EFE6;
  --bg-subtle: #FBF7EE;
  --card-bg: #FFFDF7;
  --text: #16130E;
  --text-secondary: #3C3830;
  --text-tertiary: #807A6D;
  --text-faint: #B8B1A2;
  --accent: #1F6B4A;
  --accent-light: #E6EDE6;
  --accent-dark: #174F36;
  --green: #1F6B4A;
  --green-bg: #E6EDE6;
  --red: #B8452E;
  --red-bg: #F3E2DB;
  --border: #CEC5B0;
  --border-light: #E2DBCB;
  --highlight: #E9C46A;
  --shadow-sm: 0 1px 0 rgba(22,19,14,.04);
  --shadow: 0 1px 0 rgba(22,19,14,.04), 0 4px 16px rgba(22,19,14,.04);
  --shadow-lg: 0 8px 32px rgba(22,19,14,.08);
}

[data-theme="dark"] {
  --bg: #14120F;
  --bg-subtle: #1C1915;
  --card-bg: #201C17;
  --text: #EDE6D3;
  --text-secondary: #C4BDAA;
  --text-tertiary: #8A8372;
  --text-faint: #5E5849;
  --accent: #4FAE82;
  --accent-light: #1E2C24;
  --accent-dark: #3E9670;
  --green: #4FAE82;
  --green-bg: #1E2C24;
  --red: #D46A52;
  --red-bg: #2E1C15;
  --border: #3A3630;
  --border-light: #2C2822;
  --highlight: #E9C46A;
  --shadow-sm: 0 1px 0 rgba(0,0,0,0.4);
  --shadow: 0 1px 0 rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  letter-spacing: var(--tracking-body);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

/* Editorial typography polish */
h1, h2, h3, h4, h5 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: var(--tracking-display);
  color: var(--text);
}
h1 em, h2 em, h3 em, h4 em, h5 em {
  font-style: italic;
  color: var(--accent);
}

/* Tabular numbers everywhere rates/amounts appear */
.lecap-ticker, .rate-value, .num, .value-primary,
.lecap-table td, .soberanos-table td, .cer-table td, .ons-table td,
.product-rate, .product-value, .tna-value, .tir-value {
  font-variant-numeric: tabular-nums;
}

/* 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; }
}

/* News Ticker */
.news-ticker {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-light);
  overflow: hidden;
  white-space: nowrap;
  height: 30px;
  display: none;
  align-items: center;
  position: relative;
}
.news-ticker-close {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  font-size: 0.7rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  line-height: 1;
  padding: 0;
  transition: background 0.15s;
}
.news-ticker-close:hover { color: var(--accent); border-color: var(--accent); }
.news-ticker-track {
  display: inline-flex;
  gap: 0;
  animation: tickerScroll 200s linear infinite;
  will-change: transform;
}
.news-ticker-track:hover { animation-play-state: paused; }
.news-ticker-item {
  display: inline-flex;
  align-items: center;
  padding: 0 32px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
  font-weight: 500;
}
.news-ticker-item:hover { color: var(--accent); }
/* hover handled above */
.news-ticker-item::before {
  content: '>';
  margin-right: 6px;
  font-size: 0.6rem;
  color: var(--accent);
  font-weight: 700;
}
.news-ticker-source {
  font-weight: 700;
  color: var(--accent);
  margin-right: 6px;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
[data-theme="dark"] .news-ticker {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-light);
}

/* 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;
}

/* Calculator modal: mono + tabular-nums for all numeric cells;
   compact heading inside modal body; tidy inputs */
.mundo-modal-body h3,
.mundo-modal-header h3 {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: var(--tracking-display);
}
.mundo-modal-body h4 {
  font-family: var(--font-mono) !important;
  font-size: 0.7rem !important;
  font-weight: 500 !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary) !important;
  margin: 16px 0 8px !important;
}
.mundo-modal-body table {
  font-family: var(--font);
}
.mundo-modal-body table tbody td,
.mundo-modal-body table tfoot td {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
}
.mundo-modal-body table tbody td:first-child,
.mundo-modal-body table tfoot td:first-child {
  font-family: var(--font);
}
.mundo-modal-body table thead th {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  font-weight: 500;
}
.mundo-modal-body input[type="number"] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.mundo-modal-body [id$="-calc-tir"],
.mundo-modal-body [id$="-calc-duration"] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.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: 200px;
  position: relative;
}
.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-family: var(--display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.02em;
  cursor: pointer;
}
.logo em, .logo i {
  font-style: italic;
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.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; }
}

/* Inflación / Comparador */
.inflacion-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.inflacion-toggles {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  width: 320px;
  max-height: 70vh;
  overflow-y: auto;
}
.inflacion-chart-col {
  flex: 1;
  min-width: 0;
}
@media (max-width: 900px) {
  .inflacion-layout {
    flex-direction: column;
  }
  .inflacion-toggles {
    width: 100%;
    max-height: none;
  }
}
.infl-cat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.infl-cat-header {
  padding: 5px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  align-self: flex-start;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.infl-cat-header.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.infl-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.infl-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 3px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.infl-chip.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--text);
}
.infl-chip:hover {
  border-color: var(--accent);
}
.infl-chip-logo {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.infl-chip-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.infl-chip-fallback {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.45rem;
  font-weight: 700;
  color: #fff;
}
.infl-chip-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inflacion-row {
  margin-bottom: 2px;
}
.inflacion-row .chart-bar {
  justify-content: space-between;
  padding: 0 8px;
  min-width: 80px;
}
.inflacion-baseline {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}
.chart-bar-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
@media (max-width: 640px) {
  .infl-chip-name { max-width: 80px; }
  .chart-bar-label { font-size: 0.5rem; }
}

/* 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);
}

/* 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-family: var(--display);
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: var(--tracking-display);
  line-height: 1.05;
  margin-bottom: 8px;
  color: var(--text);
  text-transform: none;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero p {
  color: var(--text-tertiary);
  font-size: 0.85rem;
  max-width: 520px;
  line-height: 1.5;
}

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

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

.section h2 {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 4px;
  letter-spacing: var(--tracking-display);
  text-transform: none;
  color: var(--text);
}
.section h2 em {
  font-style: italic;
  color: var(--accent);
}

.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: 32px auto 0;
  padding: 40px 24px 48px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-light);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.foot-brand {
  max-width: 280px;
}
.foot-logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.foot-logo em {
  font-style: italic;
  color: var(--text-tertiary);
  font-size: 0.8rem;
}
.foot-brand p {
  color: var(--text-tertiary);
  line-height: 1.5;
  font-size: 0.75rem;
  margin: 0;
}
.footer h6 {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  margin: 0 0 10px;
  font-weight: 500;
}
.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer ul a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.78rem;
  transition: color 0.15s;
}
.footer ul a:hover {
  color: var(--accent);
}
.foot-sign {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .foot-brand { grid-column: 1 / -1; }
  .foot-sign { flex-direction: column; gap: 8px; }
}
.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;
}

/* ─── Earnings Proposals ─── */

/* Proposal 1: Timeline horizontal */
.earnings-timeline {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.earnings-day-card {
  min-width: 200px;
  max-width: 240px;
  flex-shrink: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.earnings-day-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.earnings-day-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.earnings-day-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.earnings-day-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.earnings-day-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: contain;
  background: var(--border-light);
}
.earnings-day-item-fallback {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.earnings-day-ticker {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}
.earnings-day-time {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-left: auto;
}

/* 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);
}
.dolar-bank-badge {
  font-size: 0.55rem;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-tertiary);
  margin-left: 4px;
  vertical-align: middle;
}
.dolar-variation {
  font-size: 0.65rem;
  font-weight: 600;
  margin-left: 4px;
}
.dolar-variation.up { color: var(--green); }
.dolar-variation.down { color: var(--red); }
.dolar-closed-badge {
  background: var(--red-bg, rgba(239, 68, 68, 0.12));
  color: var(--red, #ef4444);
}
.dolar-24x7-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}
.dolar-24x7-toggle input { cursor: pointer; accent-color: var(--accent); }
.dolar-24x7-toggle:hover { border-color: var(--accent); }

@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;
}

/* ─── Financial Term Tooltips ─── */
.fin-term {
  border-bottom: 1px dotted var(--text-tertiary);
  cursor: help;
  white-space: nowrap;
}

.fin-tooltip {
  position: fixed;
  background: var(--text);
  color: var(--card-bg);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: normal;
  width: max-content;
  max-width: 260px;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 10000;
  box-shadow: var(--shadow);
}

.fin-tooltip.visible {
  opacity: 1;
  visibility: visible;
}

.fin-tooltip-arrow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
}

.fin-tooltip-arrow.arrow-down {
  bottom: -10px;
  border-top-color: var(--text);
}

.fin-tooltip-arrow.arrow-up {
  top: -10px;
  border-bottom-color: var(--text);
}

@media (max-width: 640px) {
  .fin-tooltip {
    max-width: 200px;
    font-size: 0.68rem;
  }
}
