/* "Dólar hoy" page (web/ratesPage.ts). Same "Tesoro Turquesa" palette as the app (src/theme.tsx):
   navy-to-teal header, green only for the best option (with navy text: white on #22C55E fails contrast). */
:root {
  color-scheme: light dark;
  --bg: #f0fdff; --card: #ffffff; --line: #e2eef3; --text: #082f49; --muted: #4b6b7f; --accent: #0e7490;
  --hero-a: #082f49; --hero-b: #0b6480; --hero-text: #ffffff; --hero-muted: #bae6fd; --hero-glass: rgba(255, 255, 255, 0.10);
  --best-a: #22c55e; --best-b: #4ade80; --best-text: #082f49; --best-note: #0b3a2a; --best-line: transparent;
  --shadow: 0 4px 14px rgba(8, 47, 73, 0.07); --best-shadow: 0 10px 24px rgba(34, 197, 94, 0.30);
  --chip: transparent; --warn: #b54708; --pill-bg: #e0f4fd;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #061c2c; --card: #0a2a40; --line: #123b57; --text: #f0fdff; --muted: #8fb5c9; --accent: #7dd3fc;
    --hero-a: #0b6480; --hero-b: #061c2c; --hero-text: #f0fdff; --hero-glass: rgba(10, 42, 64, 0.65);
    --best-a: rgba(34, 197, 94, 0.22); --best-b: rgba(14, 116, 144, 0.18); --best-text: #f0fdff; --best-note: #86efac; --best-line: rgba(34, 197, 94, 0.5);
    --shadow: none; --best-shadow: 0 0 30px rgba(34, 197, 94, 0.20);
    --chip: #ffffff; --warn: #ffb86b; --pill-bg: #123b57;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); }
a:focus-visible { outline: 3px solid var(--best-a); outline-offset: 3px; border-radius: 8px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 1; background: var(--card); padding: 8px 12px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header: the app's gradient, rounded at the bottom; the best cards overlap its edge. */
.hero { background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); color: var(--hero-text); border-radius: 0 0 32px 32px; padding: 16px 0 72px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 18px; }
.brand img { border-radius: 10px; }
.pill { color: var(--hero-text); text-decoration: none; font-weight: 800; font-size: 14px; padding: 8px 14px; border-radius: 999px; background: var(--hero-glass); border: 1px solid rgba(186, 230, 253, 0.35); }
.live { margin: 36px 0 4px; color: var(--hero-muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.25); }
h1 { margin: 0 0 24px; font-size: clamp(30px, 6vw, 46px); line-height: 1.1; font-weight: 900; letter-spacing: -0.02em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--hero-glass); border: 1px solid rgba(186, 230, 253, 0.22); border-radius: 18px; padding: 14px 16px; }
.stat p { margin: 0; }
.stat-label { font-size: 13px; font-weight: 700; color: var(--hero-muted); }
.stat-value { font-size: clamp(28px, 5vw, 36px); font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.stat-note { font-size: 12px; color: var(--hero-muted); }
.tabs { display: inline-flex; gap: 4px; margin-top: 20px; padding: 4px; border-radius: 14px; background: var(--hero-glass); border: 1px solid rgba(186, 230, 253, 0.25); }
.tabs a { color: var(--hero-text); text-decoration: none; font-weight: 800; padding: 8px 18px; border-radius: 10px; }
.tabs a:hover { background: rgba(255, 255, 255, 0.14); }

/* Best options: green, the only green on the page. */
.bests { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: -48px; }
.best { background: linear-gradient(135deg, var(--best-a), var(--best-b)); color: var(--best-text); border: 1px solid var(--best-line); border-radius: 22px; padding: 16px 18px; box-shadow: var(--best-shadow); }
.best p { margin: 0; }
.best-tag { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; color: var(--best-note); }
.best-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 6px; }
.best-value { font-size: 36px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; text-align: right; }
.best-value small { display: block; font-size: 12px; font-weight: 600; color: var(--best-note); margin-top: 4px; }
.best-note { font-size: 13px; font-weight: 600; color: var(--best-note); }

/* Logos: drawn for light backgrounds, so they sit on a white chip (or their own brand color). */
.logo { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 10px; padding: 4px 8px; background: var(--chip); }
.best .logo, .rank .logo { background-color: #ffffff; }
.logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.logo-sm { width: 96px; height: 34px; }
.logo-lg { width: 132px; height: 46px; }
.initials { background: #98a2b3; color: #ffffff; font-weight: 800; font-size: 13px; width: 34px; }

/* Rankings: a real table, laid out as the app's cards. */
.block { margin-top: 36px; }
h2 { font-size: 22px; font-weight: 900; margin: 0 0 4px; }
.intro { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.rank { width: 100%; border-collapse: separate; border-spacing: 0 10px; }
.rank thead th { font-size: 12px; font-weight: 700; color: var(--muted); text-align: left; padding: 0 12px; }
.rank tbody td, .rank tbody th { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px; text-align: left; font-weight: 400; }
.rank tbody tr { box-shadow: var(--shadow); border-radius: 18px; }
.rank tbody tr > :first-child { border-left: 1px solid var(--line); border-radius: 18px 0 0 18px; }
.rank tbody tr > :last-child { border-right: 1px solid var(--line); border-radius: 0 18px 18px 0; }
.pos { width: 44px; }
td.pos { font-weight: 800; color: var(--accent); }
.who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.name { font-weight: 700; font-size: 15px; }
.meta { flex-basis: 100%; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.trend, .gap { white-space: nowrap; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 17px; }
.num.strong { font-weight: 900; font-size: 19px; }
.label { display: none; }
.tag { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 800; color: var(--accent); background: var(--pill-bg); border-radius: 6px; padding: 1px 6px; vertical-align: middle; }
.tag-warn { color: var(--warn); }
.dim { opacity: 0.55; }

/* Links that should read as text: the brand in the header and bank names in the tables. */
.brand { color: var(--hero-text); text-decoration: none; }
a.name { color: var(--text); text-decoration: none; }
a.name:hover { text-decoration: underline; }
.best-note a { color: inherit; }

/* Bank page (/banco/<id>). */
.bank-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.bank-title h1 { margin: 0; }
.bank-title .logo { background-color: #ffffff; }
.panel { margin-top: -48px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); }
.panel h2 { font-size: 19px; }
.others { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.others a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 700; font-size: 14px; }
.others .logo { background-color: #ffffff; }
.days { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.days th, .days td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.days thead th { font-size: 12px; color: var(--muted); font-weight: 700; }
.days tbody tr:last-child > * { border-bottom: 0; }
.days tbody th { font-weight: 700; }

/* App promo. */
.promo { margin-top: 40px; background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); color: var(--hero-text); border-radius: 24px; padding: 24px; }
.promo h2 { color: var(--hero-text); }
.promo ul { margin: 12px 0 20px; padding-left: 20px; color: var(--hero-muted); }
.promo li { margin: 4px 0; }
.cta { display: inline-block; background: linear-gradient(135deg, #22c55e, #4ade80); color: #082f49; font-weight: 900; text-decoration: none; padding: 12px 20px; border-radius: 14px; }

.fine { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 28px 0 0; }
footer { padding: 20px 16px 48px; }
footer nav { display: flex; gap: 18px; font-size: 14px; }

/* Phones: each row becomes a card with labeled numbers under the bank. */
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 10px; border-radius: 14px; }
  .stat-value { font-size: 24px; }
  .stat-note { font-size: 11px; line-height: 1.3; }
  .rank thead { display: none; }
  .rank, .rank tbody { display: block; }
  .rank tbody tr { display: grid; grid-template-columns: 32px 1fr 1fr; margin-bottom: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
  .rank tbody td, .rank tbody th { border: 0 !important; border-radius: 0 !important; background: transparent; padding: 10px 12px; }
  .rank td.pos { grid-row: span 2; padding-right: 0; }
  .rank .who { grid-column: 2 / 4; }
  .num { text-align: left !important; padding-top: 0 !important; }
  .label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); }
}
