/* ============================================================
   BolsoExtra.pt — Folha de estilos personalizada
   Complementa o Tailwind CSS (via CDN). Mobile-first, dark mode,
   micro-interações e animações suaves. Sem tooltips: tudo visível.
   ============================================================ */

/* ---------- Variáveis de tema ---------- */
:root {
  --bx-brand: #0052FF;
  --bx-brand-dark: #1E40AF;
  --bx-surface: #F8FAFC;
  --bx-ink: #0F172A;
  --bx-muted: #64748B;
  --bx-card: #FFFFFF;
  --bx-input-focus: #E2E8F0; /* fundo cinzento do campo em foco */
  --bx-border: rgba(100, 116, 139, 0.16);
  --bx-shadow: 0 10px 30px -12px rgba(2, 6, 23, 0.14);
  --bx-shadow-lg: 0 24px 60px -20px rgba(2, 6, 23, 0.25);
  --bx-header-h: 72px;
}

.dark {
  --bx-surface: #0B1220;
  --bx-ink: #E2E8F0;
  --bx-muted: #94A3B8;
  --bx-card: #111C33;
  --bx-input-focus: #1E293B;
  --bx-border: rgba(148, 163, 184, 0.18);
  --bx-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.5);
  --bx-shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.65);
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background-color: var(--bx-surface);
  color: var(--bx-ink);
  font-feature-settings: "cv02", "cv03", "cv11";
  transition: background-color .35s ease, color .35s ease;
}

section[id] { scroll-margin-top: calc(var(--bx-header-h) + 16px); }

::selection { background: rgba(0, 82, 255, .22); }

/* Scrollbar discreta e moderna */
* { scrollbar-width: thin; scrollbar-color: rgba(100,116,139,.45) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0,82,255,.55), rgba(6,182,212,.55));
  border-radius: 999px; border: 2px solid transparent; background-clip: padding-box;
}

:focus-visible {
  outline: 2px solid var(--bx-brand);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--bx-brand); color: #fff; padding: .6rem 1rem; border-radius: 0 0 .6rem 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- Utilitários de marca ---------- */
.text-gradient {
  background: linear-gradient(92deg, #0052FF 0%, #06B6D4 55%, #8B5CF6 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}

.bg-grid {
  background-image:
    linear-gradient(rgba(100,116,139,.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100,116,139,.09) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 55%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 55%, transparent 100%);
}

.card-bx {
  background: var(--bx-card);
  border: 1px solid var(--bx-border);
  border-radius: 1.1rem;
  box-shadow: var(--bx-shadow);
  transition: transform .28s cubic-bezier(.16,1,.3,1), box-shadow .28s ease, border-color .28s ease;
}
.card-bx:hover {
  transform: translateY(-4px);
  box-shadow: var(--bx-shadow-lg);
  border-color: rgba(0, 82, 255, .35);
}

.glass {
  background: color-mix(in srgb, var(--bx-card) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
}

/* ---------- Header ---------- */
#site-header { transition: box-shadow .3s ease, background-color .3s ease; }
#site-header.scrolled { box-shadow: var(--bx-shadow); }

.nav-link {
  position: relative; padding: .45rem .1rem; font-weight: 500; color: var(--bx-muted);
  transition: color .2s ease;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 100%;
  border-radius: 2px; background: linear-gradient(90deg, #0052FF, #06B6D4);
  transform: scaleX(0); transform-origin: left; transition: transform .25s cubic-bezier(.16,1,.3,1);
}
.nav-link:hover, .nav-link.active { color: var(--bx-ink); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

/* ---------- Hero ---------- */
.hero-blob {
  position: absolute; border-radius: 999px; filter: blur(70px); opacity: .5;
  animation: blob-float 14s ease-in-out infinite; pointer-events: none;
}
.dark .hero-blob { opacity: .38; }

@keyframes blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(28px, -26px) scale(1.08); }
  66% { transform: translate(-22px, 18px) scale(.94); }
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .55); }
  70% { box-shadow: 0 0 0 9px rgba(16, 185, 129, 0); }
}
.live-dot { animation: pulse-dot 1.8s ease-out infinite; }

/* ---------- Badges de estado de dados ---------- */
.badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .7rem; font-weight: 700; letter-spacing: .02em; border-radius: 999px; padding: .28rem .65rem; }
.badge-live { background: rgba(16,185,129,.13); color: #059669; }
.dark .badge-live { color: #34D399; }
.badge-fallback { background: rgba(245,158,11,.14); color: #B45309; }
.dark .badge-fallback { color: #FBBF24; }
.badge-est { background: rgba(0,82,255,.1); color: var(--bx-brand); }
.dark .badge-est { color: #7DB0FF; }

/* Tendência — regra fixa do site: VERDE na subida, VERMELHO na descida */
.delta-up-good { color: #10B981; }
.delta-down-bad { color: #EF4444; }

/* Sparkline dentro de um span colorido herda a cor dele (ex.: cripto verde/vermelha
   pela tendência de 7 dias); sem pai colorido mantém o azul da marca (Euribor) */
.delta-up-good .sparkline, .delta-down-bad .sparkline { color: inherit; }

/* ---------- Skeletons (loading) ---------- */
.skeleton {
  border-radius: .9rem; background: rgba(100,116,139,.14);
  background-image: linear-gradient(90deg, transparent 0%, rgba(148,163,184,.22) 45%, transparent 90%);
  background-size: 220% 100%; animation: bx-shimmer 1.5s ease-in-out infinite;
}
@keyframes bx-shimmer { from { background-position: 160% 0; } to { background-position: -60% 0; } }

/* ---------- Animação de revelação ao scroll ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .65s ease, transform .65s cubic-bezier(.16,1,.3,1); }
.reveal.revealed { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: .08s; } .reveal-delay-2 { transition-delay: .16s; } .reveal-delay-3 { transition-delay: .24s; }

/* ---------- Tabela de bancos ---------- */
.table-bx { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .875rem; }
.table-bx thead th {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bx-card) 92%, transparent);
  backdrop-filter: blur(6px);
  text-align: left; font-weight: 700; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--bx-muted); padding: .8rem 1rem; border-bottom: 2px solid var(--bx-border);
  white-space: nowrap;
}
.table-bx tbody td { padding: .85rem 1rem; border-bottom: 1px solid var(--bx-border); vertical-align: middle; }
.table-bx tbody tr { transition: background-color .18s ease; }
.table-bx tbody tr:hover { background: rgba(0, 82, 255, .05); }
.dark .table-bx tbody tr:hover { background: rgba(96, 165, 250, .07); }

/* Full-bleed (ex.: tabela de bancos): folga extra nas colunas encostadas ao bordo do card */
.table-edges thead th:first-child, .table-edges tbody td:first-child { padding-left: 1.75rem; }
.table-edges thead th:last-child, .table-edges tbody td:last-child { padding-right: 1.75rem; }

/* ---------- Tabs dos simuladores ---------- */
.sim-tab {
  position: relative; padding: .6rem 1.05rem; border-radius: .8rem; font-weight: 600; font-size: .85rem;
  color: var(--bx-muted); transition: all .22s ease; white-space: nowrap;
}
.sim-tab:hover { color: var(--bx-ink); background: rgba(0,82,255,.07); }
.sim-tab[aria-selected="true"] {
  color: #fff; background: linear-gradient(120deg, #0052FF, #1E40AF);
  box-shadow: 0 10px 24px -10px rgba(0, 82, 255, .55);
}

/* ---------- Formulários ---------- */
.bx-label { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .78rem; font-weight: 600; color: var(--bx-muted); margin-bottom: .35rem; }
.bx-input {
  width: 100%; border-radius: .75rem; border: none;
  background: color-mix(in srgb, var(--bx-muted) 11%, transparent);
  color: var(--bx-ink); padding: .66rem .9rem; font-size: .9rem; font-weight: 600;
  caret-color: inherit;
  transition: background .2s ease, box-shadow .2s ease;
}
.bx-input:hover { background: color-mix(in srgb, var(--bx-muted) 16%, transparent); }
.bx-input:focus { background: var(--bx-input-focus); outline: none; }
.bx-input::placeholder { color: color-mix(in srgb, var(--bx-muted) 60%, transparent); font-weight: 500; opacity: 1; }
/* Grupos de escolha direta — substituem dropdowns/selects */
.seg-group { display: flex; flex-wrap: wrap; gap: .4rem; }
.seg-group.seg-col { flex-direction: column; align-items: stretch; }
.seg-btn {
  border: none; cursor: pointer; border-radius: .75rem;
  background: color-mix(in srgb, var(--bx-muted) 11%, transparent);
  color: var(--bx-ink); padding: .52rem .78rem; font-size: .78rem; font-weight: 700;
  line-height: 1.25; text-align: left;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .12s ease;
}
.seg-btn:hover { background: color-mix(in srgb, var(--bx-muted) 18%, transparent); }
.seg-btn:active { transform: scale(.97); }
.seg-btn.active {
  background: linear-gradient(120deg, #0052FF, #1E40AF); color: #fff;
  box-shadow: 0 2px 10px rgba(0, 82, 255, .28);
}
.seg-btn:focus-visible { outline: 2px solid var(--bx-brand); outline-offset: 2px; }
/* T144: escolhas curtas dos grupos horizontais («6 meses»/«12 meses», Eur 6M…) com o texto centrado — o grupo em coluna (.seg-col) tem etiquetas longas que se partem em 2 linhas e mantém o alinhamento à esquerda */
.seg-group:not(.seg-col) .seg-btn { text-align: center; }
/* Grelha de bancos alinhada — Simulador de Depósitos: células iguais, taxa alinhada à direita */
.seg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
/* Em telemóveis estreitos a grelha passa a lista de uma coluna — zero nomes cortados */
@media (max-width: 479px) { .seg-grid { grid-template-columns: 1fr; } }
.seg-bank { display: flex; align-items: center; gap: .35rem; padding: .5rem .5rem; font-size: .72rem; min-width: 0; }
.seg-bank .bank-rank { flex: none; min-width: .8rem; font-size: .58rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--bx-muted); opacity: .65; }
.seg-bank .bank-name { flex: 1 1 auto; min-width: 0; font-size: .7rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg-bank .bank-ast { flex: none; font-weight: 800; color: var(--bx-brand); }
.seg-bank .bank-rate { flex: none; font-weight: 800; font-variant-numeric: tabular-nums; }
.seg-bank.active .bank-rank, .seg-bank.active .bank-rate { color: rgba(255, 255, 255, .85); }
.seg-bank.active .bank-ast { color: rgba(255, 255, 255, .9); }

/* Leitura fixa dos gráficos — substitui o balão flutuante do Chart.js:
   uma linha discreta e estável sob o gráfico, que ganha cor da marca com o hover. */
.chart-readout { min-height: 1rem; font-size: .7rem; font-weight: 600; line-height: 1.4; color: color-mix(in srgb, var(--bx-muted) 78%, transparent); transition: color .15s ease; }
.chart-readout.is-active { color: var(--bx-brand); }

/* Esconde as setas nativas (spinners) dos campos numéricos — visual mais limpo */
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

input[type="range"].bx-range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: linear-gradient(90deg, #0052FF, #06B6D4); cursor: pointer; }
input[type="range"].bx-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 19px; height: 19px; border-radius: 999px; background: #fff;
  border: 3px solid var(--bx-brand); box-shadow: 0 2px 8px rgba(0,82,255,.4); transition: transform .15s ease;
}
input[type="range"].bx-range::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"].bx-range::-moz-range-thumb { width: 15px; height: 15px; border-radius: 999px; background: #fff; border: 3px solid var(--bx-brand); box-shadow: 0 2px 8px rgba(0,82,255,.4); }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: linear-gradient(120deg, #0052FF, #1E40AF); color: #fff; font-weight: 700;
  border-radius: .8rem; padding: .72rem 1.5rem; font-size: .92rem;
  box-shadow: 0 12px 28px -10px rgba(0, 82, 255, .55);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -12px rgba(0, 82, 255, .65); filter: brightness(1.06); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 700; border-radius: .8rem; padding: .7rem 1.35rem; font-size: .92rem;
  border: 1.5px solid var(--bx-border); color: var(--bx-ink); background: transparent;
  transition: all .2s ease;
}
.btn-ghost:hover { border-color: var(--bx-brand); color: var(--bx-brand); background: rgba(0,82,255,.06); transform: translateY(-2px); }

/* ---------- Espaços publicitários AdSense ---------- */
.ad-slot {
  border: 2px dashed rgba(100, 116, 139, .35); border-radius: 1rem;
  background: repeating-linear-gradient(-45deg, rgba(100,116,139,.05) 0 12px, transparent 12px 24px);
  min-height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .3rem; padding: .8rem; text-align: center;
}
.ad-slot .ad-label { font-size: .62rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--bx-muted); }
.ad-slot .ad-box { font-size: .74rem; font-weight: 600; color: var(--bx-muted); }

/* ---------- Cards de widgets ---------- */
.widget-value { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.sparkline { color: var(--bx-brand); }

/* ---------- Toast ---------- */
#toast-root { position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 90; display: flex; flex-direction: column; gap: .6rem; max-width: min(360px, calc(100vw - 2rem)); }
.toast {
  display: flex; align-items: flex-start; gap: .6rem; padding: .8rem 1rem; border-radius: .85rem;
  background: var(--bx-card); border: 1px solid var(--bx-border); box-shadow: var(--bx-shadow-lg);
  font-size: .84rem; font-weight: 500; color: var(--bx-ink);
  animation: toast-in .3s cubic-bezier(.16,1,.3,1);
}
.toast.leaving { animation: toast-out .25s ease forwards; }
.toast .toast-dot { width: 9px; height: 9px; border-radius: 999px; margin-top: .35rem; flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* ---------- Cookie banner + modal RGPD ---------- */
#cookie-banner {
  position: fixed; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom, 0px)); z-index: 95;
  transform: translateX(-50%) translateY(140%);
  width: min(920px, calc(100vw - 1.5rem));
  transition: transform .45s cubic-bezier(.16,1,.3,1);
}
#cookie-banner.show { transform: translateX(-50%) translateY(0); }

#cookie-modal { z-index: 99; }
.cookie-switch { position: relative; display: inline-flex; width: 44px; height: 24px; flex: none; }
.cookie-switch input { opacity: 0; width: 100%; height: 100%; position: absolute; cursor: pointer; margin: 0; }
.cookie-switch .knob {
  width: 100%; height: 100%; border-radius: 999px; background: rgba(100,116,139,.35); transition: background .2s ease;
}
.cookie-switch .knob::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 999px;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); transition: transform .22s cubic-bezier(.16,1,.3,1);
}
.cookie-switch input:checked + .knob { background: var(--bx-brand); }
.cookie-switch input:checked + .knob::before { transform: translateX(20px); }
.cookie-switch input:disabled + .knob { opacity: .55; }

/* ---------- Back to top ---------- */
#to-top { transition: opacity .25s ease, transform .25s ease; opacity: 0; pointer-events: none; transform: translateY(10px); }
#to-top.show { opacity: 1; pointer-events: auto; transform: none; }

/* ---------- Footer sticky-safe ---------- */
.site-footer { margin-top: auto; }
.footer-link { color: var(--bx-muted); font-size: .86rem; transition: color .2s ease, transform .2s ease; display: inline-block; }
.footer-link:hover { color: var(--bx-brand); transform: translateX(3px); }

/* ---------- Corretoras ---------- */
.affiliate-cta {
  background: linear-gradient(120deg, #0052FF, #06B6D4);
  color: #fff; font-weight: 800; border-radius: .8rem; padding: .8rem 1.4rem;
  display: inline-flex; align-items: center; gap: .55rem; font-size: .92rem;
  box-shadow: 0 14px 30px -12px rgba(0, 82, 255, .6);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.affiliate-cta:hover { transform: translateY(-2px) scale(1.015); filter: brightness(1.07); box-shadow: 0 20px 38px -14px rgba(0,82,255,.7); }

.pros-cons li { display: flex; gap: .5rem; align-items: flex-start; font-size: .84rem; line-height: 1.45; }
.pros-cons li::before { font-weight: 800; flex: none; }
.pros-list li::before { content: "+"; color: #10B981; }
.cons-list li::before { content: "–"; color: #EF4444; }

/* ---------- Impressão ---------- */
@media print {
  #site-header, #cookie-banner, #to-top, .ad-slot, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsivo fino ---------- */
@media (max-width: 640px) {
  .table-bx { font-size: .8rem; }
  .table-bx thead th, .table-bx tbody td { padding: .6rem .7rem; }
  .table-edges thead th:first-child, .table-edges tbody td:first-child { padding-left: 1.25rem; }
  .table-edges thead th:last-child, .table-edges tbody td:last-child { padding-right: 1.25rem; }
}

/* ---------- Guarda anual (aviso automático de dados do ano anterior) ---------- */
.aviso-anual {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin: 1rem 1rem 0;
  padding: .65rem .9rem;
  border: 1px solid rgba(251, 191, 36, .45);
  border-radius: .75rem;
  background: rgba(254, 243, 199, .85);
  color: #78350F;
  font-size: .8rem;
  line-height: 1.45;
}
.dark .aviso-anual {
  border-color: rgba(251, 191, 36, .3);
  background: rgba(120, 53, 15, .25);
  color: #FCD34D;
}
.aviso-anual-texto { flex: 1 1 auto; }
.aviso-anual-fechar {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 .1rem;
  cursor: pointer;
  opacity: .7;
}
.aviso-anual-fechar:hover { opacity: 1; }

/* ---------- T88: leitura & orientação (guias) ---------- */
/* Barra de progresso de leitura (topo; criada pelo main.js nos guias) */
#bx-progresso {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 70;
  background: linear-gradient(90deg, #0052FF, #06B6D4);
  pointer-events: none;
  transition: width .12s linear;
}

/* Botão «Partilhar» na linha da data dos guias */
#bx-partilhar {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-left: .35rem;
  padding: .3rem .7rem;
  border: 1px solid var(--bx-border);
  border-radius: .65rem;
  background: var(--bx-card);
  color: var(--bx-muted);
  font: 700 .72rem/1 Inter, system-ui, sans-serif;
  cursor: pointer;
  vertical-align: middle;
  transition: color .2s ease, border-color .2s ease, transform .15s ease;
}
#bx-partilhar:hover {
  color: var(--bx-brand);
  border-color: rgba(0, 82, 255, .5);
  transform: translateY(-1px);
}
#bx-partilhar svg { flex: 0 0 auto; }

/* Item ativo do menu mobile (o desktop usa .nav-link.active que já existia) */
.bx-item-ativa { background: rgba(0, 82, 255, .09); color: var(--bx-brand); }
.dark .bx-item-ativa { background: rgba(0, 82, 255, .22); color: #93B8FF; }

/* Sumário «Neste guia» (criado pelo main.js a partir dos h2 do artigo) */
.bx-sumario { margin-top: 2rem; margin-bottom: 2rem; }
.bx-sumario summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  cursor: pointer;
  font-weight: 700;
  font-size: .875rem;
  color: var(--bx-ink);
  list-style: none;
}
.bx-sumario summary::-webkit-details-marker { display: none; }
.bx-sumario summary::after {
  content: "+";
  flex: 0 0 auto;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--bx-muted);
  transition: transform .2s ease;
}
.bx-sumario[open] summary::after { transform: rotate(45deg); }
.bx-sum-count {
  padding: .18rem .55rem;
  border-radius: 999px;
  background: rgba(0, 82, 255, .09);
  color: var(--bx-brand);
  font-size: .66rem;
  font-weight: 700;
}
.dark .bx-sum-count { background: rgba(0, 82, 255, .22); color: #93B8FF; }
.bx-sum-list { margin: .9rem 0 0; padding: 0; list-style: none; counter-reset: bxsum; }
.bx-sum-list li { counter-increment: bxsum; }
.bx-sum-list a {
  display: flex;
  gap: .6rem;
  padding: .4rem 0;
  font-size: .8rem;
  line-height: 1.45;
  color: var(--bx-muted);
  transition: color .15s ease;
}
.bx-sum-list a::before {
  content: counter(bxsum, decimal-leading-zero);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: .66rem;
  padding-top: .12rem;
  color: var(--bx-muted);
  opacity: .7;
}
.bx-sum-list a:hover,
.bx-sum-list a.ativo { color: var(--bx-brand); }
.dark .bx-sum-list a:hover,
.dark .bx-sum-list a.ativo { color: #93B8FF; }
.bx-sum-list a.ativo { font-weight: 600; }
/* guias com secções numeradas («1. …»): o sumário usa os números do próprio
   guia — esconde os contadores 01/02/03 para não duplicar */
.bx-sum-sem-contador { counter-reset: none; }
.bx-sum-sem-contador a::before { content: none; }
/* os h2 do artigo ganham âncoras T88 — o header fixo não os tapa */
main h2[id] { scroll-margin-top: calc(var(--bx-header-h) + 20px); }




/* ---------- T94 — Âncoras partilháveis (link por secção) ---------- */
main h2 .bx-anc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  margin-left: 0.45rem;
  border-radius: 0.5rem;
  vertical-align: middle;
  flex-shrink: 0;
  color: #94a3b8;
  background: transparent;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease;
  cursor: pointer;
}
main h2:hover .bx-anc,
main h2 .bx-anc:focus-visible {
  opacity: 0.6;
}
main h2 .bx-anc:hover {
  opacity: 1;
  color: #0052FF;
  background: rgba(0, 82, 255, 0.1);
}
.dark main h2 .bx-anc:hover {
  color: #3D78F2;
  background: rgba(61, 120, 242, 0.16);
}
@media (hover: none) {
  main h2 .bx-anc {
    opacity: 0.45;
  }
}


/* ---------- T95 — Otimização mobile ---------- */
/* iOS faz ZOOM automático em campos com fonte <16px ao tocar — mata o zoom */
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px !important; }
  /* alvos de toque ≥44px (Apple HIG): tabs do simulador, segmentos, partilhar */
  .sim-tab, .seg-btn { min-height: 44px; }
  #bx-partilhar { min-height: 44px; min-width: 44px; }
  #bx-install-fab { min-width: 48px; min-height: 48px; }
  .btn-ghost, .btn-primary { min-height: 40px; }
}
/* hit-area das âncoras T94: ~38px sem alterar o visual (qualquer ecrã) */
main h2 .bx-anc { position: relative; }
main h2 .bx-anc::after { content: ''; position: absolute; inset: -8px; }
/* render mais rápido: secções pesadas abaixo da dobra, sem gráficos dentro */
#bancos, #corretoras, #faq {
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
}
