/* Outfit — fonte variável, alojada localmente (funciona offline) */
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../assets/fonts/outfit-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../assets/fonts/outfit-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #071019;
  --bg-2: #0b1520;
  /* vidro escuro (como nos mockups): painéis azul-profundo translúcidos */
  --card: rgba(13, 24, 36, 0.55);
  --card-solid: #0e1926;
  --card-border: rgba(126, 200, 219, 0.12);
  --glass-blur: 18px;
  --glass-hi: rgba(160, 220, 235, 0.05); /* brilho superior interno, frio e subtil */

  /* ---------- Liquid Glass ----------
     O vidro não é "fundo translúcido + borda". São três coisas ao mesmo tempo:
     1. o fundo é desfocado E saturado (o vidro amplifica a cor por trás);
     2. o bordo apanha luz — claro em cima, escuro em baixo, nunca uniforme;
     3. há um reflexo especular que escorre do topo e desaparece a meio.
     Estes tokens definem as três, para toda a app usar a mesma receita. */
  --lg-blur: 24px;
  --lg-sat: 190%;
  --lg-bright: 1.06;
  /* reflexo que desce do topo da peça */
  --lg-sheen: linear-gradient(
    177deg,
    rgba(255, 255, 255, 0.11) 0%,
    rgba(255, 255, 255, 0.035) 26%,
    rgba(255, 255, 255, 0) 52%
  );
  /* bordo: o topo apanha a luz, a base recebe a sombra do que está por baixo */
  --lg-rim-top: rgba(255, 255, 255, 0.16);
  --lg-rim-all: rgba(255, 255, 255, 0.045);
  --lg-rim-bottom: rgba(0, 0, 0, 0.26);
  /* profundidade tingida: o halo teal do fundo a atravessar o vidro.
     É o que dá ao cartão da Assinatura o ar de peça e não de caixa. */
  --lg-tint: linear-gradient(
    162deg,
    rgba(47, 230, 184, 0.07) 0%,
    rgba(47, 230, 184, 0.02) 34%,
    rgba(0, 0, 0, 0.06) 100%
  );
  --lg-cast: 0 8px 30px rgba(0, 0, 0, 0.3);
  --lg-cast-lift: 0 16px 44px rgba(0, 0, 0, 0.38);
  --glow-teal: 0 0 26px rgba(47, 230, 184, 0.16); /* halo dos destaques */
  --teal: #2fe6b8;
  --teal-dim: rgba(47, 230, 184, 0.35);
  /* acentos dos atalhos — cada área da app tem a sua cor */
  --blue: #5ab6f0;
  --gold: #f0b45a;
  --violet: #a98bf0;
  --red: #e35a5a;
  --red-dim: rgba(227, 90, 90, 0.35);
  --text: #f2f4f8;
  --text-dim: #9aa1b2;
  /* era #6b7284 = 3,67:1 sobre o cartão, abaixo do mínimo de 4,5 da WCAG AA.
     Este passa nas três superfícies (cartão 5,11 · fundo 5,32 · modal 4,92)
     e continua bem mais apagado que --text-dim, por isso a hierarquia mantém-se. */
  --text-faint: #838a9c;
  --radius: 20px;
  --nav-h: 86px;
  --safe-top: 50px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #05060a;
  color: var(--text);
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

button, input, textarea { font-family: inherit; }

.hidden { display: none !important; }

/* ---------- splash ---------- */
.splash {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.5s ease;
}
.splash-logo {
  width: 190px;
  height: auto;
  display: block;
  animation: pop 0.9s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.splash.fade-out { opacity: 0; pointer-events: none; }

/* ---------- device frame (iPhone) ---------- */
.device-stage {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 800px at 50% -10%, #141a29 0%, #05060a 60%);
}
.device {
  position: relative;
  width: 390px;
  height: 844px;
  max-height: calc(100dvh - 24px);
  border-radius: 54px;
  padding: 12px;
  background: linear-gradient(155deg, #2a2f3a, #0c0e14 55%, #1a1d26);
  box-shadow:
    0 0 0 2px #000,
    0 30px 70px rgba(0,0,0,0.65),
    inset 0 0 2px 2px rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.device-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 44px;
  overflow: hidden;
  background: var(--bg);
  /* creates a containing block so descendant position:fixed elements
     anchor to the phone screen instead of the browser viewport */
  transform: translateZ(0);
  isolation: isolate;
}
/* fundo como nos mockups: navy profundo com halo teal a vir de cima */
.device-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(90% 46% at 50% -8%, rgba(31, 190, 160, 0.16), transparent 70%),
    radial-gradient(55% 36% at 8% 30%, rgba(20, 120, 140, 0.1), transparent 72%),
    linear-gradient(180deg, #0a1a22 0%, #071019 45%, #060b13 100%);
}
.device-island {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 122px;
  height: 34px;
  background: #000;
  border-radius: 20px;
  z-index: 300;
  pointer-events: none;
}

/* ---------- app shell ---------- */
.app {
  width: 100%;
  height: 100%;
  background: transparent; /* deixa passar os brilhos ambiente */
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.view { display: none; flex: 1; flex-direction: column; height: 100%; min-height: 0; }
.view.active { display: flex; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 8px) 20px 8px;
  gap: 12px;
}
.topbar h1 {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  flex: 1;
}
.icon-btn {
  background: none;
  border: none;
  color: var(--teal);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-btn svg { width: 24px; height: 24px; }
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #3a4a63, #1c2434);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}
.drawer-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  font-size: 19px;
  font-weight: 700;
  text-transform: uppercase;
}

.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px calc(var(--nav-h) + 40px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* keep children at their natural height so the container scrolls
   instead of squishing (and clipping) them */
.scroll > * { flex-shrink: 0; }

/* Superfície de vidro — usada por todos os cartões e painéis.
   Translúcida + desfoque do que está por trás + contorno luminoso
   e um brilho interno no topo (como a luz a bater no rebordo do vidro). */
.card,
.stat-chip,
.stat-tile,
.fixed-row,
.bank-row,
.holding-row,
.badge,
.settings-list,
.plan-card,
.sim-banner {
  /* o reflexo por cima do tom da peça — duas camadas, não uma cor chapada */
  background: var(--lg-sheen), var(--card);
  backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat)) brightness(var(--lg-bright));
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat)) brightness(var(--lg-bright));
  border: 1px solid transparent;
  box-shadow:
    inset 0 1px 0 var(--lg-rim-top),
    inset 0 0 0 1px var(--lg-rim-all),
    inset 0 -1px 0 var(--lg-rim-bottom),
    var(--lg-cast);
}

.card {
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: left;
}

.card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 6px;
}
.card-label .bar {
  width: 3px;
  height: 16px;
  background: var(--teal);
  border-radius: 2px;
  display: inline-block;
}
.big-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.growth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 6px;
  font-size: 13px;
  color: var(--text-dim);
}
.pct-up { color: var(--teal); font-weight: 600; }
.pct-down { color: var(--red); font-weight: 600; }

/* donut */
.donut-card { align-items: center; }
.donut-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 8px auto 4px;
}
.donut-svg { width: 100%; height: 100%; }
.donut-svg circle { transition: stroke-dasharray 0.6s ease; }
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.donut-caption { color: var(--text-dim); font-size: 13px; }
.donut-total { font-size: 26px; font-weight: 800; margin-top: 2px; letter-spacing: -0.3px; }
.donut-tag {
  position: absolute;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-2);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
}
.tag-top { top: 4px; right: 6px; }
.tag-bottom { bottom: 8px; left: 4px; }

.legend { display: flex; gap: 20px; margin-top: 8px; justify-content: center; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-teal { background: var(--teal); }
.dot-red { background: var(--red); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.list-card h3 { margin: 0 0 10px; font-size: 15px; font-weight: 500; }
.list-teal { border-color: var(--teal-dim); }
.list-red { border-color: var(--red-dim); }
.mini-list { display: flex; flex-direction: column; }
.mini-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; gap: 6px; }
.mini-row .name { display: flex; align-items: center; gap: 6px; color: var(--text); }
.mini-row .dot { flex-shrink: 0; width: 11px; height: 11px; }
.mini-row > span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.list-teal .dot { background: var(--teal); }
.list-red .dot { background: var(--red); }
.empty-hint { color: var(--text-faint); font-size: 12px; }

.ia-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--text);
}
.ia-card h2 { margin: 0 0 6px; font-size: 19px; font-weight: 500; }
.ia-card p { margin: 0; color: var(--text-dim); font-size: 13px; line-height: 1.4; }
.ia-card .chev { width: 22px; height: 22px; color: var(--teal); flex-shrink: 0; }

/* ---------- scanner de faturas ---------- */
.hidden-input { display: none; }
.scan-card {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  padding: 14px 16px;
  color: var(--text);
  border-color: var(--teal-dim);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(47, 230, 184, 0.07), transparent 60%),
    var(--card);
}
.scan-ic {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(47, 230, 184, 0.12);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.scan-ic svg { width: 21px; height: 21px; }
.scan-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; text-align: left; min-width: 0; }
.scan-title { font-size: 15px; font-weight: 600; }
.scan-sub { font-size: 12px; color: var(--text-dim); }
.scan-card .chev { width: 18px; height: 18px; color: var(--text-faint); flex-shrink: 0; }

.scan-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 6px 0 2px; }
.scan-preview {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--card-border);
}
.scan-spinner { display: flex; gap: 5px; }

/* ---------- despesas fixas ---------- */
.fixed-total {
  margin-left: auto;
  margin-right: 8px;
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.fixed-list { display: flex; flex-direction: column; gap: 8px; }
.fixed-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 11px 12px;
}
.fixed-day {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.fixed-info { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fixed-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fixed-next { font-size: 11px; color: var(--text-faint); }
.fixed-amount { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fixed-del {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
}
.fixed-del:hover { color: var(--red); }
.tag-fix {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-faint);
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 1px 4px;
  margin-left: 5px;
}

/* ---------- open banking ---------- */
.banks-list { display: flex; flex-direction: column; gap: 8px; }
.bank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 11px 12px;
}
.bank-logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.bank-info { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bank-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bank-iban { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.bank-bal { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ob-note {
  margin: 2px 0 0;
  font-size: 10px;
  color: var(--text-faint);
  line-height: 1.4;
}
.bank-picker { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 2px; }
.bank-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--bg-2);
  border: 1.5px solid var(--card-border);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text);
  text-align: left;
}
.bank-opt:hover { border-color: var(--teal-dim); }
.bank-opt-name { font-size: 14px; font-weight: 600; }

.asset-picker { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 2px; max-height: 300px; overflow-y: auto; }
.asset-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--bg-2);
  border: 1.5px solid var(--card-border);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text);
  text-align: left;
}
.asset-opt:hover { border-color: var(--teal-dim); }
.asset-logo {
  min-width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-size: 9px;
  letter-spacing: -0.3px;
  font-weight: 800;
  color: #06231b;
  background: linear-gradient(135deg, #2fe6b8, #1fb894);
  flex-shrink: 0;
  white-space: nowrap;
}
.asset-opt-info { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.asset-opt-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-opt-meta { font-size: 11px; color: var(--text-faint); }
.asset-opt-price { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0; }
.asset-opt-price.pending { color: var(--text-faint); font-weight: 500; }

/* mercados — lista de ativos reais, tipo "watchlist" de bolsa/XTB */
.market-list { display: flex; flex-direction: column; gap: 8px; }
.market-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 11px 12px;
  cursor: pointer;
  color: var(--text);
  text-align: left;
}
.market-row:hover, .market-row:active { border-color: var(--teal-dim); }
.market-info { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.market-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.market-meta { font-size: 11px; color: var(--text-faint); }
.market-price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.market-price-val { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.market-day-pct { font-size: 11px; font-weight: 600; }
.market-day-pct.pending { color: var(--text-faint); font-weight: 500; }

.link-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--teal);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0 2px;
  text-align: center;
}

.holding-sell-btn {
  margin-top: 2px;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.holding-sell-btn:hover, .holding-sell-btn:active { color: var(--red); }
.consent-box {
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 14px;
  margin: 8px 0 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.consent-brand {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}
.consent-list { list-style: none; margin: 2px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.consent-list li {
  position: relative;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text);
}
.consent-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 3px;
  width: 4px;
  height: 8px;
  border: solid var(--teal);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.consent-no { color: var(--teal) !important; font-weight: 600; }
.consent-legal { font-size: 10px; color: var(--text-faint); line-height: 1.4; margin: 6px 0 0; }
.bank-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 8px 0; }
.bank-done h3 { margin: 4px 0 0; }
.bank-done-ic {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(47, 230, 184, 0.14);
  border: 1px solid var(--teal-dim);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}
.bank-done-ic-erro {
  background: rgba(227, 90, 90, 0.14);
  border-color: var(--red-dim);
  color: var(--red);
}

/* ---------- bloqueios por plano ---------- */
.feature-lock {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: 0;
}
.lock-card {
  background: var(--card);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  border: 1px solid rgba(47, 230, 184, 0.25);
  box-shadow: var(--glow-teal), inset 0 1px 0 var(--glass-hi);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 300px;
}
.lock-ic {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(47, 230, 184, 0.1);
  border: 1px solid var(--teal-dim);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lock-ic svg { width: 26px; height: 26px; }
.lock-card h3 { margin: 2px 0 0; font-size: 17px; letter-spacing: -0.02em; }
.lock-card p { margin: 0 0 6px; font-size: 13px; line-height: 1.55; color: var(--text-dim); }
.lock-card .btn-primary { padding: 11px 26px; }

.lock-pill {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--teal);
  background: rgba(47, 230, 184, 0.1);
  border: 1px solid var(--teal-dim);
  border-radius: 999px;
  padding: 2px 7px;
  margin-left: 6px;
  vertical-align: middle;
}
.upsell-note {
  margin: 2px 0 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--teal);
  background: rgba(47, 230, 184, 0.08);
  border: 1px solid var(--teal-dim);
  border-radius: 10px;
  padding: 9px 12px;
}
.hist-hint { cursor: pointer; color: var(--teal) !important; margin-top: 4px; display: block; }
.coach-locked { cursor: pointer; opacity: 0.8; }

/* pagamento por menores — "os pais oferecem" */
.family-banner {
  font-size: 12px;
  line-height: 1.5;
  color: var(--teal);
  background: rgba(47, 230, 184, 0.08);
  border: 1px solid var(--teal-dim);
  border-radius: 14px;
  padding: 11px 14px;
  margin-bottom: 12px;
}
.family-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 9px 12px;
  margin-top: 12px;
}
.parent-emoji { font-size: 34px; display: block; text-align: center; margin-bottom: 6px; }
.parent-message {
  width: 100%;
  resize: none;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  margin: 10px 0 4px;
  box-sizing: border-box;
}
.parent-actions { display: flex; gap: 10px; margin-top: 8px; }
.parent-actions .btn-secondary, .parent-actions .btn-primary { flex: 1; }
.parent-hint { text-align: center; color: var(--text-faint); font-size: 11px; margin: 12px 0 6px; }
.parent-done-btn {
  width: 100%;
  background: none;
  border: 1px solid var(--teal-dim);
  color: var(--teal);
  border-radius: 20px;
  padding: 11px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.parent-back-btn {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-faint);
  padding: 12px 0 2px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.coach-locked p { color: var(--text-dim); }

/* ---------- foguinho (streak diário) ---------- */
.streak-flame {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 130, 60, 0.1);
  border: 1px solid rgba(255, 140, 70, 0.28);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: 999px;
  padding: 6px 11px 6px 8px;
  cursor: pointer;
  color: #ffb45c;
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(255, 110, 50, 0.14), inset 0 1px 0 var(--glass-hi);
}
.streak-flame svg {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 0 5px rgba(255, 120, 50, 0.5));
}

.streak-modal { text-align: center; }
.streak-hero { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px; }
.streak-big-flame {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 0 18px rgba(255, 110, 50, 0.45));
  animation: flamePulse 1.8s ease-in-out infinite;
}
@keyframes flamePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}
.streak-num {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffb45c, #ff5e3a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}
.streak-lbl { font-size: 13px; color: var(--text-dim); }
.streak-coach { margin: 10px 0 2px; font-size: 13px; line-height: 1.5; color: var(--text); }
.streak-best-row { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.streak-best-row strong { color: #ffb45c; }

/* ---------- coach / round-up / simulador ---------- */
.coach-card { padding: 15px 18px; border-color: var(--teal-dim); }
.coach-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--teal);
}
.coach-label svg { width: 12px; height: 12px; }
.coach-label-logo { width: 13px; height: 13px; object-fit: contain; }
.coach-card p, .roundup-card p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.roundup-card { padding: 15px 18px; }
.roundup-btn {
  margin-top: 12px;
  width: 100%;
  padding: 11px 0;
  font-size: 13px;
}
.roundup-btn:disabled { opacity: 0.55; cursor: default; }

.streak-chip {
  font-size: 11px;
  font-weight: 700;
  color: #ffb457;
  background: rgba(255, 180, 87, 0.1);
  border: 1px solid rgba(255, 180, 87, 0.3);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
  margin-left: auto;
  margin-right: 8px;
}

.sim-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(47, 230, 184, 0.07);
  border: 1px solid var(--teal-dim);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-dim);
}
.sim-banner strong { color: var(--teal); font-weight: 700; }
.sim-banner svg { width: 18px; height: 18px; color: var(--teal); flex-shrink: 0; margin-top: 1px; }
.sim-cash {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-dim);
}
.sim-cash strong { color: var(--text); font-variant-numeric: tabular-nums; }
.sim-cash-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--teal);
  background: rgba(47, 230, 184, 0.1);
  border-radius: 6px;
  padding: 2px 6px;
  margin-left: 4px;
}
.modal-hint { margin: 2px 0 4px; font-size: 12px; color: var(--text-dim); }

.holding-cost { display: block; font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.holding-val {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.holding-val .holding-pct { font-size: 11px; font-weight: 600; }

.goal-coach {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--card-border);
  font-size: 12px;
  color: var(--teal);
  line-height: 1.4;
}

/* conquistas (perfil) */
.badges-count { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.badges-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 11px 12px;
  min-width: 0;
}
.badge.locked { opacity: 0.45; }
.badge-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: rgba(47, 230, 184, 0.14);
  color: var(--teal);
  border: 1px solid var(--teal-dim);
}
.badge.locked .badge-dot { background: var(--bg-2); color: var(--text-faint); border-color: var(--card-border); }
.badge-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.badge-label { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-desc { font-size: 10px; color: var(--text-faint); line-height: 1.3; }

.stat-row { display: flex; justify-content: space-between; align-items: flex-start; }
.stat-right { text-align: right; }
.area-svg { width: 100%; height: 90px; margin-top: 12px; }

/* ficha de ativo — estilo "app Bolsa" (nome, preço grande, gráfico) */
.markets-tab { border-color: rgba(88, 156, 255, 0.28); }
.asset-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.asset-detail-logo { width: 44px; height: 44px; font-size: 13px; border-radius: 14px; }
.asset-detail-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.asset-detail-name { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-detail-type { font-size: 12px; color: var(--text-faint); }
.asset-detail-price { font-size: 32px; font-weight: 800; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.asset-detail-pct { font-size: 14px; font-weight: 600; margin-top: 2px; }
.asset-detail-note { font-size: 11px; color: var(--text-faint); margin: 10px 0 0; }
.asset-candles { height: 110px; }
.asset-detail-range { display: flex; gap: 6px; margin-top: 10px; }
.range-btn {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  color: var(--text-faint);
  border-radius: 10px;
  padding: 7px 0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.range-btn.active { background: rgba(47, 230, 184, 0.14); border-color: var(--teal-dim); color: var(--teal); }
.days-row { display: flex; justify-content: space-between; color: var(--text-faint); font-size: 11px; margin-top: 4px; }

.section-title { margin: 4px 4px 0; font-weight: 600; font-size: 15px; }
.teal-text { color: var(--teal); }

.holdings-list { display: flex; flex-direction: column; gap: 10px; }
.holding-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 12px 16px;
}
.holding-logo {
  min-width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
  background: linear-gradient(135deg, #2fe6b8, #1fb894);
  color: #06231b; font-size: 11px; letter-spacing: -0.3px; font-weight: 800;
  flex-shrink: 0; overflow: hidden; white-space: nowrap;
}
.holding-name { flex: 1; font-size: 15px; }
.holding-pct { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 4px; }

/* poupança goals */
.goal-card { margin-bottom: 12px; }
.goal-top { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 8px; }
.goal-amount { color: var(--text-dim); font-size: 13px; }
.progress-track { height: 8px; background: #232838; border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--teal); border-radius: 6px; transition: width 0.5s ease; }

/* ---------- chat ---------- */
.chat-topbar { gap: 10px; }
.chat-heading { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.chat-ia-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  background: linear-gradient(135deg, rgba(47, 230, 184, 0.22), rgba(47, 230, 184, 0.05));
  border: 1px solid var(--teal-dim);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.chat-ia-badge svg { width: 17px; height: 17px; }
.chat-ia-logo { width: 19px; height: 19px; object-fit: contain; }
.chat-heading-text { display: flex; flex-direction: column; min-width: 0; }
.chat-heading-text h1 { flex: none; font-size: 19px; line-height: 1.2; }
.chat-subtitle { font-size: 12px; color: var(--text-faint); }

.chat-scroll { padding-bottom: calc(var(--nav-h) + 68px); } /* 90 incluía a linha da quota, que saiu */
.chat-messages { display: flex; flex-direction: column; gap: 16px; padding-top: 6px; }
.msg {
  position: relative;
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
}
.msg.user {
  align-self: flex-end;
  background: rgba(47, 230, 184, 0.14);
  border: 1px solid rgba(47, 230, 184, 0.3);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: inset 0 1px 0 var(--glass-hi);
  border-bottom-right-radius: 4px;
}
.msg.bot {
  align-self: flex-start;
  margin-left: 34px;
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: inset 0 1px 0 var(--glass-hi);
  border-bottom-left-radius: 4px;
}
/* Mesmo disco do cabeçalho "Advanzis IA": vidro teal com borda, não um
   círculo branco. Eram dois tratamentos diferentes para a mesma marca. */
.msg.bot::before {
  content: "";
  position: absolute;
  left: -34px;
  bottom: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background:
    url("../assets/logo.png") no-repeat center / 15px 15px,
    linear-gradient(135deg, rgba(47, 230, 184, 0.22), rgba(47, 230, 184, 0.05));
  border: 1px solid var(--teal-dim);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.msg .highlight { color: var(--teal); font-weight: 600; }
.tool-note { color: var(--teal); font-size: 13px; font-weight: 600; }
.msg.typing { display: flex; gap: 5px; align-items: center; }
.dot-typing {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  animation: dotPulse 1.2s infinite ease-in-out;
}
.dot-typing:nth-child(2) { animation-delay: 0.2s; }
.dot-typing:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
.msg-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  color: var(--text-faint);
  font-size: 12px;
  cursor: pointer;
}
.msg-link svg { width: 14px; height: 14px; }

.chat-suggestions {
  display: flex;
  gap: 8px;
  padding: 0 16px 8px;
  overflow-x: auto;
}
.chat-suggestions.hidden { display: none; }
.chip-suggest {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: inset 0 1px 0 var(--glass-hi);
  cursor: pointer;
}
.chip-suggest:active { border-color: var(--teal-dim); color: var(--teal); }

.chat-input-row {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(0deg, var(--bg) 60%, transparent);
}
.chat-input-row input {
  flex: 1;
  background: var(--card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--card-border);
  box-shadow: inset 0 1px 0 var(--glass-hi);
  border-radius: 20px;
  padding: 12px 18px;
  color: var(--text);
  font-size: 16px; /* <16px faz o iOS dar zoom ao focar */
  outline: none;
}
.chat-input-row input:focus { border-color: var(--teal-dim); }
.send-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--teal);
  color: #06231b;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.send-btn svg { width: 20px; height: 20px; }

/* ---------- bottom nav ---------- */
/* barra flutuante em pílula, ao estilo da Buddy — margens laterais, cantos
   redondos e destaque arredondado no separador ativo. */
.bottom-nav {
  position: fixed;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  left: 12px;
  right: 12px;
  height: 66px;
  border-radius: 30px;
  /* A barra flutua por cima do conteúdo que passa por baixo dela — é aqui que
     o material se lê melhor, porque há sempre algo em movimento atrás. */
  background: var(--lg-sheen), rgba(14, 17, 26, 0.6);
  backdrop-filter: blur(34px) saturate(200%) brightness(1.08);
  -webkit-backdrop-filter: blur(34px) saturate(200%) brightness(1.08);
  border: 1px solid transparent;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3),
    0 12px 36px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: stretch;
  padding: 8px 6px;
  z-index: 20;
}
.nav-btn {
  position: relative;
  flex: 1;
  background: none;
  border: none;
  color: var(--text-faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  padding: 0;
  min-width: 0;
  transition: color 0.2s ease;
}
/* destaque em pílula por trás do separador ativo (como a Buddy) */
.nav-btn:not(.nav-center)::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: transparent;
  transition: background 0.2s ease;
  z-index: 0;
}
.nav-btn svg,
.nav-btn .nb-lbl { position: relative; z-index: 1; }
.nav-btn svg { width: 22px; height: 22px; }
.nb-lbl { font-size: 9px; letter-spacing: 0.2px; }
.nav-btn.active { color: var(--teal); }
.nav-btn.active .nb-lbl { font-weight: 700; }
.nav-btn.active:not(.nav-center)::before { background: rgba(47, 230, 184, 0.14); }

/* botão central da IA — só o logo, sem fundo, alinhado com os outros ícones */
.nav-ia {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-ia svg { width: 24px; height: 24px; }
.nav-ia-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  transition: transform 0.2s ease;
}
.nav-center.active .nav-ia-logo { transform: scale(1.06); }
/* rótulo "Advanzis IA" por baixo do logo */
.nb-lbl-ia {
  color: var(--teal);
  font-weight: 600;
}
.nav-center.active .nb-lbl-ia { font-weight: 700; }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  /* menos escurecimento, mais desfoque: o que está por trás deve sentir-se,
     não desaparecer — é o que separa vidro de uma cortina preta */
  background: rgba(5, 7, 12, 0.42);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
/* modal em vidro — mais opaco que os cartões, para o texto ler bem */
.modal {
  /* Fica mais opaco do que os cartões de propósito: um modal é para ler, e
     texto sobre fundo em movimento cansa. O vidro lê-se no bordo, não no meio. */
  background: var(--lg-sheen), rgba(24, 28, 40, 0.76);
  backdrop-filter: blur(40px) saturate(190%) brightness(1.05);
  -webkit-backdrop-filter: blur(40px) saturate(190%) brightness(1.05);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3),
    0 24px 64px rgba(0, 0, 0, 0.55);
}
.modal h3 { margin: 0 0 10px; }
.modal label { font-size: 12px; color: var(--text-dim); margin-top: 10px; }
.modal input {
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 16px; /* <16px faz o iOS dar zoom ao focar */
  outline: none;
}
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.btn-secondary, .btn-primary {
  flex: 1;
  padding: 11px 0;
  border-radius: 14px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-secondary { background: var(--bg-2); color: var(--text-dim); border: 1px solid var(--card-border); }
.btn-primary { background: var(--teal); color: #06231b; }

/* ---------- hub ---------- */
.hub-greet {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.hub-greet-hi {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hub-greet-date { font-size: 12px; color: var(--text-faint); }

/* cartão de saldo em destaque — sóbrio, com brilho teal muito subtil */
.hero-card {
  background:
    radial-gradient(140% 120% at 100% 0%, rgba(47, 230, 184, 0.08) 0%, transparent 55%),
    var(--card);
  border-color: rgba(47, 230, 184, 0.28);
  box-shadow: var(--glow-teal), inset 0 1px 0 var(--glass-hi);
  padding: 20px 20px 18px;
}
.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.hero-label {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.hero-week {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
  white-space: nowrap;
}
.hero-week.neg { color: var(--red); }
.wk-arrow { font-size: 13px; line-height: 1; }
.hero-value {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  margin: 8px 0 18px;
}

/* gráfico semanal — barras finas e sóbrias, com linha de base */
.hub-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  align-items: end;
  position: relative;
}
.hub-chart::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  height: 1px;
  background: var(--card-border);
}
.hc-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.hc-track {
  width: 100%;
  max-width: 9px;
  height: 64px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.hc-bar {
  width: 100%;
  border-radius: 6px;
  min-height: 3px;
  transition: height 0.4s ease;
}
.hc-bar.pos { background: var(--teal); }
.hc-bar.neg { background: var(--red); }
.hc-bar.zero { background: #2a3040; }
.hc-day {
  font-size: 11px;
  /* era --text-faint: 3,82:1 sobre o cartão, abaixo do mínimo de 4,5 da WCAG.
     O dia de hoje continua a distinguir-se pelo branco e pelo peso. */
  color: var(--text-dim);
  letter-spacing: 0.3px;
}
.hc-col.today .hc-day { color: var(--text); font-weight: 700; }
.hc-col.today .hc-bar.zero { background: rgba(47, 230, 184, 0.3); }
.hub-chart-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  padding: 22px 8px 16px;
}

/* estatísticas rápidas — sóbrias, números tabulares */
.hub-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.hub-stats-2 { grid-template-columns: repeat(2, 1fr); }
.sc-value .sc-pct { font-size: 12px; font-weight: 600; margin-left: 4px; }
.stat-chip {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 13px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  min-width: 0;
}
.sc-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}
.sc-label svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--teal); }
.stat-chip.red .sc-label svg { color: var(--red); }
.stat-chip.blue .sc-label svg { color: var(--text-dim); }
.sc-value {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* cartão único com os atalhos, linhas divididas (estilo "Connected Accounts") */
.quick-list { display: flex; flex-direction: column; padding: 4px 6px; }
.quick-list .nav-row + .nav-row { border-top: 1px solid var(--card-border); }

/* atalhos — ícones neutros e discretos */
.nav-row {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  color: var(--text);
  padding: 15px 16px;
  text-decoration: none;
}
/* dentro do cartão único (.quick-list), a linha em si não tem fundo/borda
   próprios — é o <button> nativo que precisa do reset. */
.quick-list .nav-row {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font: inherit;
}
.nav-ic {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-ic svg { width: 20px; height: 20px; }
.nav-ic-logo { width: 20px; height: 20px; object-fit: contain; }

/* cada atalho tem a cor da sua área — o ícone dá a pista antes de se ler o texto */
.nav-ic.teal   { color: var(--teal);   background: rgba(47, 230, 184, 0.10); border-color: rgba(47, 230, 184, 0.26); }
.nav-ic.blue   { color: var(--blue);   background: rgba(90, 182, 240, 0.10); border-color: rgba(90, 182, 240, 0.26); }
.nav-ic.gold   { color: var(--gold);   background: rgba(240, 180, 90, 0.10); border-color: rgba(240, 180, 90, 0.26); }
.nav-ic.violet { color: var(--violet); background: rgba(169, 139, 240, 0.10); border-color: rgba(169, 139, 240, 0.26); }

/* ao tocar, sobe a saturação da própria cor — não passa tudo a verde */
.nav-row:active .nav-ic.teal,   .nav-row:hover .nav-ic.teal   { color: var(--teal);   background: rgba(47, 230, 184, 0.20);  border-color: rgba(47, 230, 184, 0.5); }
.nav-row:active .nav-ic.blue,   .nav-row:hover .nav-ic.blue   { color: var(--blue);   background: rgba(90, 182, 240, 0.20);  border-color: rgba(90, 182, 240, 0.5); }
.nav-row:active .nav-ic.gold,   .nav-row:hover .nav-ic.gold   { color: var(--gold);   background: rgba(240, 180, 90, 0.20);  border-color: rgba(240, 180, 90, 0.5); }
.nav-row:active .nav-ic.violet, .nav-row:hover .nav-ic.violet { color: var(--violet); background: rgba(169, 139, 240, 0.20); border-color: rgba(169, 139, 240, 0.5); }
/* atalhos sem cor atribuída mantêm o comportamento antigo */
.nav-row:active .nav-ic,
.nav-row:hover .nav-ic { border-color: var(--teal-dim); color: var(--teal); }
.nav-row:hover .chev { color: var(--text-dim); }
.nav-txt {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
}
.nav-title { font-size: 15px; font-weight: 600; letter-spacing: -0.2px; }
.nav-sub { font-size: 12px; color: var(--text-dim); }
.nav-row .chev { width: 18px; height: 18px; color: var(--text-faint); flex-shrink: 0; }

/* ---------- list add buttons ---------- */
.list-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.list-card-head h3 { margin: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 4px 0; }
.section-head .section-title { margin: 0; }
.mini-add-btn {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--text-faint);
  background: transparent;
  color: var(--text-faint);
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.mini-add-btn:hover { border-color: var(--teal); color: var(--teal); }

/* ---------- drawer ---------- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 150;
  display: flex;
}
.drawer {
  width: 78%;
  max-width: 300px;
  height: 100%;
  background: rgba(16, 20, 30, 0.75);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 32px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.drawer-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(145deg, #3a4a63, #1c2434);
  margin-bottom: 12px;
}
.drawer-name { font-size: 15px; font-weight: 600; margin-bottom: 24px; }
.drawer-list { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.drawer-item {
  background: none;
  border: none;
  color: var(--text-dim);
  text-align: left;
  padding: 14px 4px;
  font-size: 15px;
  cursor: pointer;
  border-bottom: 1px solid var(--card-border);
}
.drawer-item:hover { color: var(--teal); }
.drawer-logout { color: var(--red); margin-top: auto; border-bottom: none; }

/* ---------- auth ---------- */
.auth-shell { justify-content: stretch; }
.auth-view { padding: 0 28px 40px; justify-content: space-between; }

.auth-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
  padding-top: 40px;
}
.welcome-logo { width: 150px; height: auto; display: block; }
.welcome-title { font-size: 30px; font-weight: 600; margin: 0; }
.welcome-tagline { color: var(--text-dim); font-size: 15px; line-height: 1.5; max-width: 320px; margin: 0; }
.auth-actions { display: flex; flex-direction: column; gap: 12px; padding-bottom: 20px; }

.auth-view .topbar { padding-left: 0; padding-right: 0; }
.topbar-spacer { width: 40px; flex-shrink: 0; }

.auth-form { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.auth-form label { font-size: 13px; color: var(--text-dim); margin-top: 12px; }
.auth-form input {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 13px 16px;
  color: var(--text);
  font-size: 16px; /* <16px faz o iOS dar zoom ao focar */
  outline: none;
}
.auth-form input:focus { border-color: var(--teal-dim); }
.auth-submit { margin-top: 22px; padding: 14px 0; }
.auth-switch { text-align: center; color: var(--text-dim); font-size: 13px; margin-top: 18px; }
.auth-switch a { color: var(--teal); text-decoration: none; font-weight: 600; }
.auth-error {
  color: var(--red);
  font-size: 13px;
  background: rgba(227,90,90,0.1);
  border: 1px solid var(--red-dim);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 6px 0 0;
}

.auth-scroll { padding: 0; gap: 0; }
.auth-scroll .auth-form { margin-top: 4px; padding-bottom: 12px; }

.password-field { position: relative; display: flex; }
.password-field input { flex: 1; padding-right: 44px; }
.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  background: none;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.password-toggle svg { width: 20px; height: 20px; }
.password-toggle.active { color: var(--teal); }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.45;
  cursor: pointer;
}
.checkbox-row input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--teal); flex-shrink: 0; }
.checkbox-row a { color: var(--teal); text-decoration: none; font-weight: 600; }
.checkbox-row.inline { margin-top: 0; align-items: center; }

/* login hero + options */
.auth-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 8px 0 18px;
}
.auth-hero-logo { width: 92px; height: auto; display: block; margin-bottom: 4px; }
.auth-hero-title { font-size: 22px; font-weight: 600; margin: 0; }
.auth-hero-sub { color: var(--text-dim); font-size: 14px; line-height: 1.45; margin: 0; max-width: 280px; }

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  gap: 12px;
}
.forgot-link { color: var(--teal); text-decoration: none; font-size: 13px; font-weight: 600; white-space: nowrap; }

.static-modal { max-width: 380px; max-height: 80vh; }
.static-modal-body {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
  max-height: 50vh;
  overflow-y: auto;
  margin-top: 4px;
}
.static-modal-body p { margin: 0 0 12px; }

/* ---------- planos (signup) ---------- */
.plans-sub {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  margin: 2px 0 14px;
}
.plan-card {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  margin-bottom: 14px;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.plan-card.popular {
  border-color: rgba(47, 230, 184, 0.4);
  box-shadow: var(--glow-teal), inset 0 1px 0 var(--glass-hi);
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(47, 230, 184, 0.06), transparent 60%),
    var(--card);
}
.plan-card.selected {
  border-color: var(--teal);
  box-shadow: 0 0 30px rgba(47, 230, 184, 0.26), inset 0 1px 0 var(--glass-hi);
}
.plan-badge {
  position: absolute;
  top: -9px;
  right: 16px;
  background: var(--teal);
  color: #06231b;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.plan-check {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--card-border);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.plan-card.selected .plan-check {
  border-color: var(--teal);
  background: var(--teal);
}
.plan-card.selected .plan-check::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #06231b;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.plan-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-right: 28px;
}
.plan-name { font-size: 17px; font-weight: 700; }
.plan-price {
  margin-left: auto;
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--teal);
  white-space: nowrap;
}
.plan-price small { font-size: 11px; color: var(--text-dim); font-weight: 500; }
.plan-tag { display: block; font-size: 12px; color: var(--text-dim); margin: 4px 0 12px; }
.plan-feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plan-feats li {
  position: relative;
  padding-left: 24px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.35;
}
.plan-feats li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid var(--teal);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.plans-note { text-align: center; color: var(--text-faint); font-size: 12px; margin-top: 14px; }

/* opções de plano no perfil (modal) */
.profile-plan {
  margin-top: 4px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.profile-plan.paid { color: var(--teal); border-color: var(--teal-dim); background: rgba(47, 230, 184, 0.08); }
.plan-options { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; }
.plan-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--bg-2);
  border: 1.5px solid var(--card-border);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--text);
  text-align: left;
}
.plan-opt.selected { border-color: var(--teal); }
.po-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.po-name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.po-tag { font-size: 9px; font-weight: 700; color: #06231b; background: var(--teal); padding: 1px 6px; border-radius: 999px; }
.po-price { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.po-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--card-border);
  flex-shrink: 0;
  position: relative;
}
.plan-opt.selected .po-check { border-color: var(--teal); background: var(--teal); }
.plan-opt.selected .po-check::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #06231b;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- profile ---------- */
.profile-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 8px 0 4px;
}
.profile-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2fe6b8, #22c9e0);
  color: #06231b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.profile-name { font-size: 19px; font-weight: 600; }
.profile-email { font-size: 14px; color: var(--text-dim); }

.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-tile {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.stat-tile-value { font-size: 15px; font-weight: 600; }
.stat-tile-label { font-size: 12px; color: var(--text-dim); }

.settings-list {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 18px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--card-border);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  box-sizing: border-box;
}
.settings-list .settings-row:last-child { border-bottom: none; }
.settings-icon {
  width: 24px;
  height: 24px;
  color: var(--teal);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-icon svg { width: 22px; height: 22px; }
.settings-label { flex: 1; }
.settings-chev { width: 18px; height: 18px; color: var(--text-faint); flex-shrink: 0; }

.btn-danger {
  width: 100%;
  padding: 14px 0;
  border-radius: 14px;
  border: 1px solid var(--red-dim);
  background: rgba(227,90,90,0.1);
  color: var(--red);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}

/* ---------- real phone: go fullscreen, drop the fake bezel ---------- */
@media (max-width: 460px) {
  :root { --safe-top: max(22px, env(safe-area-inset-top, 22px)); }
  .device-stage {
    padding: 0;
    background: var(--bg);
    min-height: 100vh;
    min-height: 100dvh;
  }
  .device {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    background: var(--bg);
    flex-shrink: 1;
  }
  .device-screen { border-radius: 0; }
  .device-island { display: none; }
}

/* ---------- Aprender: percurso de lições ---------- */
.learn-hero { display: flex; flex-direction: column; gap: 12px; }
.learn-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.learn-badge { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.learn-level {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--teal);
  background: rgba(47, 230, 184, 0.12);
  border: 1px solid var(--teal-dim);
  border-radius: 999px;
  padding: 3px 10px;
}
.learn-xp-val { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.learn-hero-note { font-size: 12px; color: var(--text-dim); line-height: 1.4; }

.learn-module { margin-top: 20px; }
.learn-module-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: 0 4px 8px; }
.learn-module-head .section-title { margin: 0; }
.learn-module-sub { margin: 2px 0 0; font-size: 11px; color: var(--text-faint); line-height: 1.35; }
.learn-module-count {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 3px 9px;
}

.lesson-list { display: flex; flex-direction: column; padding: 4px 6px; }
.lesson-list .lesson-row + .lesson-row { border-top: 1px solid var(--card-border); }
.lesson-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 12px;
  background: none;
  border: none;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}
.lesson-row:disabled { cursor: default; }
.lesson-ic {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lesson-ic svg { width: 17px; height: 17px; }
.lesson-row.done .lesson-ic { background: rgba(47, 230, 184, 0.16); color: var(--teal); }
.lesson-row.open .lesson-ic { background: rgba(47, 230, 184, 0.1); color: var(--teal); }
.lesson-row.locked .lesson-ic { background: rgba(255, 255, 255, 0.04); color: var(--text-faint); }
/* Não é "trancada" por ordem — é a lição de amanhã, esperando a vaga diária. */
.lesson-row.espera .lesson-ic { background: rgba(240, 180, 90, 0.14); color: var(--gold); }
.lesson-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.lesson-name { font-size: 14px; font-weight: 600; }
.lesson-row.locked .lesson-name { color: var(--text-faint); font-weight: 500; }
.lesson-meta { font-size: 11px; color: var(--text-faint); }
.lesson-flag {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--teal);
  background: rgba(47, 230, 184, 0.12);
  border-radius: 999px;
  padding: 3px 8px;
}
.lesson-flag.espera { color: var(--gold); background: rgba(240, 180, 90, 0.14); }
.lesson-row .chev { width: 18px; height: 18px; color: var(--text-faint); flex-shrink: 0; }

/* ---------- modal da lição ---------- */
.lesson-modal { max-width: 380px; max-height: 84vh; overflow-y: auto; }
.lesson-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.lesson-module-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--teal);
}
.lesson-close-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lesson-close-btn svg { width: 14px; height: 14px; }
#lesson-title { font-size: 19px; line-height: 1.25; margin: 0 0 12px; }
.lesson-body { font-size: 13px; line-height: 1.6; color: var(--text-dim); }
.lesson-body p { margin: 0 0 12px; }
.lesson-body strong { color: var(--text); font-weight: 700; }
.lesson-body em { color: var(--text); font-style: italic; }
.lesson-body .lesson-tip {
  margin-top: 14px;
  padding: 11px 13px;
  background: rgba(47, 230, 184, 0.08);
  border: 1px solid var(--teal-dim);
  border-radius: 14px;
  font-size: 12px;
  color: var(--text);
}
.lesson-body .lesson-tip strong { color: var(--teal); }

/* ---------- quiz ---------- */
.quiz-step {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.quiz-q { font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--text); margin: 0 0 14px; }
.quiz-opts { display: flex; flex-direction: column; gap: 8px; }
/* Verdadeiro/Falso lado a lado — distingue-se à vista de escolha múltipla,
   é a parte visível da variedade pedida para o quiz não ser sempre igual. */
.quiz-opts-vf { flex-direction: row; }
.quiz-opt-vf { text-align: center; font-weight: 700; }
.quiz-opt {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  line-height: 1.35;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.quiz-opt:not(:disabled):hover { border-color: var(--teal-dim); }
.quiz-opt:disabled { cursor: default; opacity: 0.55; }
.quiz-opt.right {
  opacity: 1;
  background: rgba(47, 230, 184, 0.12);
  border-color: var(--teal);
  color: var(--text);
  font-weight: 600;
}
.quiz-opt.wrong {
  opacity: 1;
  background: rgba(227, 90, 90, 0.12);
  border-color: var(--red);
}
.quiz-feedback {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
}
.quiz-feedback.ok { background: rgba(47, 230, 184, 0.08); border: 1px solid var(--teal-dim); }
.quiz-feedback.no { background: rgba(227, 90, 90, 0.08); border: 1px solid var(--red-dim); }
.quiz-feedback strong { color: var(--text); }
.quiz-feedback.ok strong { color: var(--teal); }
.quiz-feedback.no strong { color: var(--red); }

.quiz-result { text-align: center; padding: 8px 0 4px; }
.quiz-result-emoji { font-size: 40px; line-height: 1; margin-bottom: 10px; }
.quiz-result-score { font-size: 19px; font-weight: 800; color: var(--text); }
.quiz-result.ok .quiz-result-score { color: var(--teal); }
.quiz-result-msg { font-size: 13px; line-height: 1.5; color: var(--text-dim); margin: 8px 0 0; }
.quiz-result-msg strong { color: var(--teal); }

/* ---------- origem dos preços (declarada, nunca escondida) ---------- */
.quote-source {
  margin: 0 4px 6px;
  font-size: 11px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 6px;
}
.quote-source::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.quote-source.ok { color: var(--text-faint); }
.quote-source.ok::before { background: var(--teal); }
.quote-source.warn { color: #e8b866; }
.quote-source.warn::before { background: #e8b866; }

/* ---------- cartão de entrada para a Plataforma ---------- */
.platform-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 12px;
  padding: 18px 20px 20px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(47, 230, 184, 0.13), rgba(13, 24, 36, 0.6));
  border: 1px solid var(--teal-dim);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  box-shadow: var(--glow-teal);
}
.pc-glow {
  position: absolute;
  top: -46px;
  right: -32px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 230, 184, 0.3), transparent 70%);
  pointer-events: none;
}
.pc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pc-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--teal);
}
.pc-ext { width: 16px; height: 16px; color: var(--teal); flex-shrink: 0; }
.pc-title { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; margin-top: 2px; }
.pc-sub { font-size: 12px; line-height: 1.45; color: var(--text-dim); }
.pc-cta {
  align-self: flex-start;
  margin-top: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--teal);
  color: #06231b;
  font-size: 12px;
  font-weight: 700;
}

/* ---------- onboarding ---------- */
.onb {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 10, 16, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.onb.hidden { display: none; }
.onb-card {
  width: 100%;
  max-width: 350px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px 22px 22px;
  border-radius: var(--radius);
  background: rgba(24, 28, 40, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 24px 70px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
}
.onb-dots { display: flex; gap: 6px; margin-bottom: 20px; }
.onb-dot {
  height: 3px;
  flex: 1;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.3s ease;
}
.onb-dot.on { background: var(--teal); }

.onb-step { display: none; }
.onb-step.active { display: block; animation: onbIn 0.28s ease; }
@keyframes onbIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.onb-logo { width: 54px; height: 54px; object-fit: contain; margin-bottom: 14px; }
.onb-kicker {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 7px;
}
.onb-title { font-size: 21px; font-weight: 700; line-height: 1.25; margin: 0 0 8px; letter-spacing: -0.3px; }
.onb-text { font-size: 13px; line-height: 1.55; color: var(--text-dim); margin: 0 0 16px; }
.onb-note { font-size: 11px; color: var(--text-faint); margin: 12px 0 0; line-height: 1.4; }

.onb-amt { position: relative; }
.onb-amt input {
  width: 100%;
  padding: 13px 34px 13px 14px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  color: var(--text);
  font: inherit;
  font-size: 19px;
  font-weight: 700;
  outline: none;
  font-variant-numeric: tabular-nums;
}
.onb-amt input:focus { border-color: var(--teal-dim); }
.onb-cur { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-size: 17px; font-weight: 600; }

.onb-chips { display: flex; gap: 7px; margin-top: 10px; }
.onb-chip {
  flex: 1;
  padding: 8px 0;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.onb-chip:hover { border-color: var(--teal-dim); color: var(--teal); }

.onb-fixed { display: flex; flex-direction: column; gap: 8px; }
.onb-fx {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  cursor: pointer;
}
.onb-fx.on { background: rgba(47, 230, 184, 0.09); border-color: var(--teal-dim); }
.onb-fx-check {
  width: 21px;
  height: 21px;
  border-radius: 6px;
  border: 1.5px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: transparent;
}
.onb-fx-check svg { width: 12px; height: 12px; }
.onb-fx.on .onb-fx-check { background: var(--teal); border-color: var(--teal); color: #06231b; }
.onb-fx-label { flex: 1; font-size: 13px; font-weight: 600; }
.onb-fx-amt { display: flex; align-items: center; gap: 3px; flex-shrink: 0; color: var(--text-faint); font-size: 13px; }
.onb-fx-amt input {
  width: 48px;
  padding: 5px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--card-border);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  outline: none;
  font-variant-numeric: tabular-nums;
}
.onb-fx-amt input:focus { border-color: var(--teal-dim); }

.onb-fixed-custom:empty { display: none; margin: 0; }
.onb-fixed-custom { margin-top: 8px; }
.onb-fixed-custom .onb-fx-amt { font-weight: 600; }
.onb-fixed-add {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
}
.onb-fixed-add input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}
.onb-fixed-add input[type="text"]:focus { border-color: var(--teal-dim); }
.onb-fixed-add-amt { flex-shrink: 0; width: 72px; }
.onb-fixed-add-amt input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 26px 10px 10px;
  font-size: 13px;
  font-weight: 600;
}
.onb-fixed-add-amt .onb-cur { right: 10px; font-size: 13px; }
.onb-fx-add-btn {
  flex-shrink: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  color: var(--teal);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.onb-fx-add-btn:hover { border-color: var(--teal-dim); }

.onb-goals { display: flex; flex-wrap: wrap; gap: 8px; }
.onb-goal {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.onb-goal.on { background: rgba(47, 230, 184, 0.12); border-color: var(--teal); color: var(--text); }
.onb-goal-target { font-size: 11px; color: var(--text-faint); font-weight: 700; }
.onb-goal.on .onb-goal-target { color: var(--teal); }
.onb-goal-custom { margin-top: 12px; display: flex; flex-direction: column; gap: 9px; }
.onb-goal-custom.hidden { display: none; }
.onb-goal-custom input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.onb-goal-custom input[type="text"]:focus { border-color: var(--teal-dim); }
.onb-goal-custom .onb-amt input { font-size: 15px; }

.onb-actions { display: flex; align-items: center; gap: 10px; margin-top: 22px; }
.onb-skip {
  padding: 11px 16px;
  border-radius: 14px;
  background: none;
  border: none;
  color: var(--text-faint);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.onb-skip:hover { color: var(--text-dim); }
.onb-skip.hidden { display: none; }
.onb-next { flex: 1; }

/* ============================================================
   PASSAGEM VISUAL — profundidade, resposta ao toque e movimento
   ============================================================ */

/* ---------- 1. entrada dos ecrãs ---------- */
/* Os ecrãs apareciam de repente. Uma subida curta dá a sensação de
   navegação em vez de troca de página. */
.view.active > .scroll,
.view.active > .topbar {
  animation: viewIn 0.34s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}
.view.active > .topbar { animation-duration: 0.26s; }
.view.active > .scroll { animation-delay: 0.03s; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 2. resposta ao toque ---------- */
/* Sem isto a app parece uma imagem. Com isto, parece que reage. */
.nav-row,
.card.nav-row,
.stat-chip,
.lesson-row,
.market-row,
.settings-row,
.platform-card,
.onb-goal,
.onb-fx,
.quiz-opt,
.chip-suggest,
.plan-opt {
  transition: transform 0.13s ease, background-color 0.18s ease, border-color 0.18s ease;
}
.nav-row:active,
.card.nav-row:active,
.stat-chip:active,
.lesson-row:not(:disabled):active,
.market-row:active,
.settings-row:active,
.onb-goal:active,
.onb-fx:active,
.quiz-opt:not(:disabled):active,
.chip-suggest:active,
.plan-opt:active {
  transform: scale(0.975);
}
.platform-card:active { transform: scale(0.985); }

.btn-primary,
.btn-secondary,
.mini-add-btn,
.icon-btn,
.onb-chip,
.range-btn,
.holding-sell-btn {
  transition: transform 0.12s ease, filter 0.18s ease, background-color 0.18s ease;
}
.btn-primary:active,
.btn-secondary:active,
.onb-chip:active,
.range-btn:active,
.holding-sell-btn:active { transform: scale(0.96); }
.btn-primary:active { filter: brightness(0.92); }
.mini-add-btn:active,
.icon-btn:active { transform: scale(0.9); }

/* o botão central da barra responde de forma mais contida */
.nav-btn { transition: transform 0.13s ease; }
.nav-btn:active { transform: scale(0.92); }
.nav-center:active { transform: scale(0.94); }

/* ---------- 3. gráfico semanal ---------- */
/* Os dias sem movimento eram traços de 3px — o gráfico parecia partido.
   Um carril visível mostra 7 espaços, com os que têm valor preenchidos. */
.hc-track {
  background: rgba(255, 255, 255, 0.045);
  border-radius: 6px;
  overflow: hidden;
}
.hc-bar.zero { background: rgba(255, 255, 255, 0.07); }
.hc-col.today .hc-track { background: rgba(47, 230, 184, 0.09); }
.hc-bar.pos { box-shadow: 0 0 10px rgba(47, 230, 184, 0.35); }
.hc-bar.neg { box-shadow: 0 0 10px rgba(227, 90, 90, 0.3); }
/* barras a crescer quando o ecrã abre */
.view.active .hc-bar { animation: barGrow 0.5s cubic-bezier(0.22, 0.9, 0.3, 1) both; }
@keyframes barGrow { from { transform: scaleY(0.05); } to { transform: none; } }
.hc-bar { transform-origin: bottom; }

/* ---------- 4. progresso ---------- */
.progress-track { position: relative; }
.progress-fill { position: relative; overflow: hidden; }
/* brilho subtil no topo da barra preenchida */
.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0 0 50% 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent);
}

/* ---------- 5. cartões com mais profundidade ----------
   Esta regra vinha de antes do Liquid Glass e estava a anular o bordo
   iluminado em todos os .card — por isso o material só se via nas listas.
   Agora acrescenta a profundidade tingida (o halo teal do fundo a atravessar
   o vidro) por cima do bordo, em vez de o substituir. */
.card {
  background:
    var(--lg-tint),
    var(--lg-sheen),
    var(--card);
  box-shadow:
    inset 0 1px 0 var(--lg-rim-top),
    inset 0 0 0 1px var(--lg-rim-all),
    inset 0 -1px 0 var(--lg-rim-bottom),
    var(--lg-cast);
}

/* ---------- 6. avatares e chips ---------- */
.avatar { transition: transform 0.13s ease, box-shadow 0.2s ease; }
.avatar:active { transform: scale(0.92); }

/* ---------- 7. modais a entrar ---------- */
.modal-overlay:not(.hidden) { animation: fadeIn 0.2s ease both; }
.modal-overlay:not(.hidden) > .modal { animation: modalIn 0.28s cubic-bezier(0.22, 0.9, 0.3, 1) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* ---------- 8. listas a aparecer em cascata ---------- */
.quick-grid .qt,
.lesson-list .lesson-row {
  animation: rowIn 0.3s ease both;
}
.quick-grid .qt:nth-child(1), .lesson-list .lesson-row:nth-child(1) { animation-delay: 0.03s; }
.quick-grid .qt:nth-child(2), .lesson-list .lesson-row:nth-child(2) { animation-delay: 0.07s; }
.quick-grid .qt:nth-child(3), .lesson-list .lesson-row:nth-child(3) { animation-delay: 0.11s; }
.quick-grid .qt:nth-child(4), .lesson-list .lesson-row:nth-child(4) { animation-delay: 0.15s; }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 9. respeitar quem prefere menos movimento ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- gráfico semanal bidirecional (substitui o de barras só para cima) ---------- */
/* a antiga linha de base ficava presa ao fundo — agora a referência é o zero */
.hub-chart::before { content: none; }

.hc-track {
  width: 100%;
  max-width: 11px;
  height: 66px;
  display: flex;
  flex-direction: column;
  background: none;
  overflow: visible;
}
.hc-half { flex: 1; display: flex; width: 100%; }
.hc-half.up { align-items: flex-end; }
.hc-half.down { align-items: flex-start; }
.hc-zero {
  height: 1px;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.hc-col.today .hc-zero { background: var(--teal-dim); }

.hc-bar { width: 100%; min-height: 0; }
.hc-bar.pos {
  background: var(--teal);
  border-radius: 6px 4px 1px 1px;
  transform-origin: bottom;
  box-shadow: 0 0 12px rgba(47, 230, 184, 0.35);
}
.hc-bar.neg {
  background: var(--red);
  border-radius: 1px 1px 4px 4px;
  transform-origin: top;
  box-shadow: 0 0 12px rgba(227, 90, 90, 0.3);
}
.view.active .hc-bar.pos,
.view.active .hc-bar.neg { animation: barGrow 0.5s cubic-bezier(0.22, 0.9, 0.3, 1) both; }
.hc-col:nth-child(2) .hc-bar { animation-delay: 0.04s; }
.hc-col:nth-child(3) .hc-bar { animation-delay: 0.08s; }
.hc-col:nth-child(4) .hc-bar { animation-delay: 0.12s; }
.hc-col:nth-child(5) .hc-bar { animation-delay: 0.16s; }
.hc-col:nth-child(6) .hc-bar { animation-delay: 0.2s; }
.hc-col:nth-child(7) .hc-bar { animation-delay: 0.24s; }

/* correções ao gráfico bidirecional */
/* 1. a coluna de hoje herdava um fundo do desenho antigo (barra só para cima) */
.hc-col.today .hc-track { background: none; }
/* 2. a linha do zero era um segmento por coluna — passa a ser contínua.
      33px = metade dos 66px de altura do carril, medidos do topo do gráfico. */
.hc-zero { background: none; }
.hub-chart::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 33px;
  height: 1px;
  background: rgba(255, 255, 255, 0.09);
  z-index: 0;
}
/* 3. marcar o dia de hoje pela etiqueta e por um ponto, não por uma banda */
.hc-col.today::after {
  content: "";
  position: absolute;
  bottom: -3px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--teal);
}

/* ---------- correção: cartões de grelha a transbordar ---------- */
/* Itens de grelha têm min-width:auto por omissão, por isso não encolhiam abaixo
   do conteúdo — o cartão dos gastos saía 44px fora do ecrã e criava scroll
   horizontal nas Finanças. */
.two-col { min-width: 0; }
.two-col > * { min-width: 0; }
.list-card-head { min-width: 0; gap: 8px; }
.list-card-head h3 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-row { min-width: 0; }
.mini-row .name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-row > span:last-child { flex-shrink: 0; }

/* as sugestões do chat deslizam na horizontal em vez de transbordar */
.chat-suggestions {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chat-suggestions::-webkit-scrollbar { display: none; }
.chip-suggest { flex-shrink: 0; }

/* ---------- orçamentos por categoria ---------- */
.budget-alert {
  margin: 0 0 14px;
  padding: 12px 15px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-dim);
}
.budget-alert.hidden { display: none; }
.budget-alert strong { display: block; margin-bottom: 2px; }
.budget-alert.near { background: rgba(232, 184, 102, 0.1); border: 1px solid rgba(232, 184, 102, 0.3); }
.budget-alert.near strong { color: #e8b866; }
.budget-alert.over { background: rgba(227, 90, 90, 0.1); border: 1px solid var(--red-dim); }
.budget-alert.over strong { color: var(--red); }

.budget-card { display: flex; flex-direction: column; padding: 6px 8px; }
.budget-card .budget-row + .budget-row { border-top: 1px solid var(--card-border); }
.budget-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  padding: 13px 12px;
  background: none;
  border: none;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  min-width: 0;
}
.br-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.br-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.br-ic { width: 16px; height: 16px; color: var(--text-dim); flex-shrink: 0; }
.br-nums { font-size: 13px; color: var(--text-dim); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.br-nums b { color: var(--text); font-weight: 700; }
.br-lim { font-size: 12px; }
.br-track {
  display: block;
  height: 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.br-fill { display: block; height: 100%; border-radius: 6px; transition: width 0.5s cubic-bezier(0.22, 0.9, 0.3, 1); }
.br-fill.ok { background: var(--teal); }
.br-fill.near { background: #e8b866; }
.br-fill.over { background: var(--red); }
.br-foot { font-size: 11px; color: var(--text-faint); }
.br-foot.near { color: #e8b866; }
.br-foot.over { color: var(--red); font-weight: 600; }

.budget-add {
  margin: 4px 6px 6px;
  padding: 10px 0;
  border-radius: 10px;
  background: none;
  border: 1px dashed var(--card-border);
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.budget-add:hover { border-color: var(--teal-dim); color: var(--teal); }

.budget-empty {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border: 1px dashed var(--card-border);
  background: none;
  font: inherit;
  color: var(--text);
}
.be-title { font-size: 15px; font-weight: 700; }
.be-sub { font-size: 12px; color: var(--text-dim); line-height: 1.45; }
.be-cta {
  align-self: flex-start;
  margin-top: 8px;
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(47, 230, 184, 0.14);
  border: 1px solid var(--teal-dim);
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
}

/* ---------- escolher categoria ---------- */
.cat-picker { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.cat-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.13s ease, border-color 0.18s ease, background-color 0.18s ease;
}
.cat-opt svg { width: 14px; height: 14px; flex-shrink: 0; }
.cat-opt:not(:disabled):active { transform: scale(0.96); }
.cat-opt.on { background: rgba(47, 230, 184, 0.13); border-color: var(--teal); color: var(--text); }
.cat-opt:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---------- estado da Advanzis IA (nunca degradar em silêncio) ---------- */
.ai-status {
  margin: 0 14px 10px;
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(232, 184, 102, 0.1);
  border: 1px solid rgba(232, 184, 102, 0.32);
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}
.ai-status.hidden { display: none; }
.ai-status strong { font-size: 13px; font-weight: 700; color: #e8b866; line-height: 1.3; }
.ai-status span { font-size: 12px; line-height: 1.45; color: var(--text-dim); }

/* ---------- nota de demonstração ----------
   Regra do projeto: o que é simulado é declarado no próprio ecrã. Simulação
   declarada lê-se como decisão de engenharia; escondida, lê-se como falha. */
.demo-note {
  display: block;
  margin: 12px 0 0;
  padding: 11px 13px;
  border-radius: 10px;
  background: rgba(126, 200, 219, 0.06);
  border: 1px solid rgba(126, 200, 219, 0.2);
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-dim);
}
.demo-note strong {
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: #7ec8db;
}

/* ---------- quota diária da IA (plano Free) ---------- */
/* Fixa logo acima da caixa de escrita, como as sugestões — se ficasse no fluxo
   normal cairia por baixo delas, que são position:fixed. */
/* ---------- avisos no painel inicial ---------- */
.hub-alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.hub-alerts.hidden { display: none; }
.alert-card {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: var(--card);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  overflow: hidden;
  animation: rowIn 0.32s ease both;
}
.alert-card.bad { border-color: var(--red-dim); background: rgba(227, 90, 90, 0.08); }
.alert-card.warn { border-color: rgba(232, 184, 102, 0.32); background: rgba(232, 184, 102, 0.07); }
.alert-card.good { border-color: var(--teal-dim); background: rgba(47, 230, 184, 0.07); }
.alert-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 6px 11px 14px;
  background: none;
  border: none;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}
.alert-title { font-size: 13px; font-weight: 700; line-height: 1.3; }
.alert-card.bad .alert-title { color: var(--red); }
.alert-card.warn .alert-title { color: #e8b866; }
.alert-card.good .alert-title { color: var(--teal); }
.alert-body { font-size: 12px; line-height: 1.4; color: var(--text-dim); }
.alert-x {
  flex-shrink: 0;
  width: 38px;
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12px;
}
.alert-x svg { width: 14px; height: 14px; }
.alert-x:hover { color: var(--text); }

/* ---------- definição de notificações ---------- */
.notif-row { cursor: default; gap: 12px; }
.notif-txt { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.notif-state { font-size: 11px; color: var(--text-faint); line-height: 1.3; }
.notif-btn {
  flex-shrink: 0;
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(47, 230, 184, 0.13);
  border: 1px solid var(--teal-dim);
  color: var(--teal);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.notif-btn:active { transform: scale(0.95); }
.notif-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--card-border);
  color: var(--text-faint);
}
.notif-demo-note { margin: 8px 12px 4px; }

/* ---------- subscrições detetadas ---------- */
.subs-card { padding: 0; overflow: hidden; }
.subs-head {
  padding: 16px 18px 14px;
  background: linear-gradient(145deg, rgba(232, 184, 102, 0.12), transparent);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.subs-head-val {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #e8b866;
  font-variant-numeric: tabular-nums;
}
.subs-head-lbl { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 18px;
}
.sub-row + .sub-row { border-top: 1px solid var(--card-border); }
.sub-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sub-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sub-meta { font-size: 11px; color: var(--text-faint); }
.sub-nums { text-align: right; flex-shrink: 0; }
.sub-month { display: block; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sub-month small { font-size: 10px; font-weight: 500; color: var(--text-faint); }
.sub-year { display: block; font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.subs-empty { display: block; padding: 4px 4px 0; line-height: 1.5; }

/* ---------- desafios da semana ---------- */
.ch-head { margin-bottom: 8px; }
.ch-left {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 3px 9px;
  margin-left: auto;
}
.ch-card { display: flex; flex-direction: column; padding: 4px 8px; }
.ch-card .ch-row + .ch-row { border-top: 1px solid var(--card-border); }
.ch-row { display: flex; flex-direction: column; gap: 6px; padding: 13px 10px; }
.ch-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ch-name { font-size: 14px; font-weight: 700; }
.ch-row.won .ch-name { color: var(--teal); }
.ch-row.lost .ch-name { color: var(--text-dim); }
.ch-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
}
.ch-badge.won { background: rgba(47, 230, 184, 0.16); border-color: var(--teal-dim); color: var(--teal); }
.ch-badge.lost { background: rgba(227, 90, 90, 0.12); border-color: var(--red-dim); color: var(--red); }
.ch-desc { font-size: 12px; line-height: 1.4; color: var(--text-dim); }
.ch-row.won .ch-desc, .ch-row.lost .ch-desc { opacity: 0.6; }
.ch-track { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.ch-fill {
  height: 100%;
  border-radius: 6px;
  background: var(--teal);
  transition: width 0.5s cubic-bezier(0.22, 0.9, 0.3, 1);
}
.ch-fill.won { background: var(--teal); box-shadow: 0 0 10px rgba(47, 230, 184, 0.4); }
.ch-fill.lost { background: var(--red); }
.ch-foot { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.ch-row.lost .ch-foot { color: var(--red); }

/* ---------- juntar a um objetivo ---------- */
.goal-add-row { display: flex; gap: 7px; margin-top: 12px; flex-wrap: wrap; }
.goal-add-chip {
  flex: 1;
  min-width: 56px;
  padding: 8px 0;
  border-radius: 999px;
  background: rgba(47, 230, 184, 0.12);
  border: 1px solid var(--teal-dim);
  color: var(--teal);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.18s ease;
}
.goal-add-chip:active { transform: scale(0.94); }
.goal-add-chip.other {
  flex: 1.4;
  background: none;
  border-color: var(--card-border);
  color: var(--text-dim);
  font-weight: 600;
}
.goal-add-chip.other:hover { border-color: var(--teal-dim); color: var(--teal); }
.goal-done {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--teal);
  text-align: center;
}

/* ---------- confirmação flutuante ---------- */
.save-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 16px);
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 11px 18px;
  border-radius: 14px;
  background: rgba(24, 28, 40, 0.94);
  border: 1px solid var(--teal-dim);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-align: center;
  animation: toastIn 0.28s cubic-bezier(0.22, 0.9, 0.3, 1) both;
  pointer-events: none;
  max-width: calc(100% - 32px);
}
.save-toast.hidden { display: none; }
.save-toast strong { font-size: 13px; font-weight: 700; color: var(--teal); }
.save-toast span { font-size: 11px; color: var(--text-dim); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- barra com 4 itens ---------- */
/* Os botões já são flex:1, por isso a barra distribui-se sozinha. O logo da IA
   deixa de estar no centro exato — é o custo de ter um item a mais. */
.nav-4 .nb-lbl { font-size: 9px; }
.nav-4 .nav-btn svg { width: 21px; height: 21px; }

/* ponto de aviso na barra */
.nb-dot {
  position: absolute;
  top: 11px;
  right: 50%;
  margin-right: -16px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px rgba(47, 230, 184, 0.8);
  z-index: 2;
}
.nb-dot.hidden { display: none; }

/* ---------- ecrã dos desafios ---------- */
.ch-hero { display: flex; flex-direction: column; gap: 12px; }
.ch-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ch-hero-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.ch-hero-left {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--teal);
  background: rgba(47, 230, 184, 0.12);
  border: 1px solid var(--teal-dim);
  border-radius: 999px;
  padding: 3px 10px;
}
.ch-hero-xp { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.ch-hero-note { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.ch-explain {
  margin: 16px 4px 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-faint);
}

/* ---------- barra com 5 itens ---------- */
/* Com 5 botões o logo da Advanzis volta ao centro exato (3.º de 5). */
.nav-5 .nb-lbl { font-size: 9px; letter-spacing: 0; }
.nav-5 .nav-btn svg { width: 20px; height: 20px; }
.nav-5 .nav-ia-logo { width: 27px; height: 27px; }
.nav-5 .nb-dot { margin-right: -14px; top: 10px; }

/* ---------- ranking ---------- */
.rk-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.rk-hero-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.rk-hero-xp {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--teal);
  background: rgba(47, 230, 184, 0.12);
  border: 1px solid var(--teal-dim);
  border-radius: 999px;
  padding: 5px 13px;
}

/* pódio */
.rk-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 8px;
  margin: 18px 0 14px;
}
.rk-pod {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px 0;
  border-radius: 14px 16px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--card-border);
  border-bottom: none;
  animation: podIn 0.45s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}
@keyframes podIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.rk-pod.p1 { padding-top: 18px; background: linear-gradient(180deg, rgba(47, 230, 184, 0.18), rgba(47, 230, 184, 0.04)); border-color: var(--teal-dim); }
.rk-pod.p2 { animation-delay: 0.06s; }
.rk-pod.p3 { animation-delay: 0.12s; }
.rk-pod.me { box-shadow: inset 0 0 0 1px var(--teal); }
.rk-pod-av {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.rk-pod.p1 .rk-pod-av { background: var(--teal); color: #06231b; border-color: var(--teal); width: 48px; height: 48px; font-size: 15px; }
.rk-pod-name {
  font-size: 12px;
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rk-pod-xp { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.rk-pod-base {
  margin-top: 6px;
  width: 100%;
  text-align: center;
  font-size: 19px;
  font-weight: 800;
  color: var(--text-faint);
  padding: 6px 0 10px;
}
.rk-pod.p1 .rk-pod-base { padding-bottom: 26px; color: var(--teal); }
.rk-pod.p2 .rk-pod-base { padding-bottom: 16px; }
.rk-pod.p3 .rk-pod-base { padding-bottom: 8px; }

/* lista a partir do 4.º */
.rk-card { display: flex; flex-direction: column; padding: 4px 8px; }
.rk-card .rk-row + .rk-row { border-top: 1px solid var(--card-border); }
.rk-row { display: flex; align-items: center; gap: 11px; padding: 11px 8px; }
.rk-row.me { background: rgba(47, 230, 184, 0.07); border-radius: 14px; }
.rk-place {
  width: 20px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.rk-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
}
.rk-row.me .rk-av { background: var(--teal); color: #06231b; border-color: var(--teal); }
.rk-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rk-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rk-name em { font-style: normal; color: var(--teal); font-weight: 700; }
.rk-meta { font-size: 11px; color: var(--text-faint); }
.rk-xp { flex-shrink: 0; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rk-xp small { font-size: 9px; font-weight: 600; color: var(--text-faint); margin-left: 2px; }

/* sozinho na tabela */
.rk-solo { display: flex; flex-direction: column; gap: 5px; margin-top: 16px; }
.rk-solo-title { font-size: 15px; font-weight: 700; }
.rk-solo-sub { font-size: 12px; line-height: 1.5; color: var(--text-dim); }
.rk-note { margin-top: 18px; }

/* ---------- investimentos: mais informação por posição ---------- */
.invest-gain { font-size: 12px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.invest-day {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--card-border);
}
.invest-day.hidden { display: none; }
.id-k { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.5px; }
.id-v { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

.hr-rich .holding-name { gap: 1px; }
.hr-weight { display: block; font-size: 10px; color: var(--text-faint); margin-top: 1px; }
.hr-day { display: block; font-size: 10px; font-weight: 600; margin-top: 1px; font-variant-numeric: tabular-nums; }

/* ---------- distribuição da carteira ---------- */
.invest-alloc { margin-top: 12px; }
.invest-alloc.hidden { display: none; }
.alloc-bar {
  display: flex;
  height: 9px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}
.alloc-bar span { display: block; height: 100%; transition: width 0.5s cubic-bezier(0.22, 0.9, 0.3, 1); }
.alloc-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 9px; padding: 0 2px; }
.alloc-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-dim); }
.alloc-item i { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.alloc-item b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- últimas operações ---------- */
.invest-log { margin-top: 18px; }
.invest-log.hidden { display: none; }
.log-card { display: flex; flex-direction: column; padding: 4px 8px; }
.log-card .tl-row + .tl-row { border-top: 1px solid var(--card-border); }
.tl-row { display: flex; align-items: center; gap: 11px; padding: 10px 8px; }
.tl-badge {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}
.tl-badge.c { background: rgba(47, 230, 184, 0.16); color: var(--teal); }
.tl-badge.v { background: rgba(227, 90, 90, 0.16); color: var(--red); }
.tl-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tl-t { font-size: 13px; font-weight: 700; }
.tl-d { font-size: 10px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.tl-a { flex-shrink: 0; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- investimentos mais enxutos (lição da Trading 212) ----------
   Eles redesenharam a carteira em cartões separados, os utilizadores
   revoltaram-se por desperdiçar espaço, e reverteram. Aqui: menos blocos,
   linhas compactas, e o secundário recolhido. */
.sim-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0 4px;
  font-size: 11px;
  color: var(--text-faint);
}
.sim-line svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--teal); }
.sim-line strong { color: var(--teal); font-weight: 700; }

.slim-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 14px 0 4px;
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.13s ease, border-color 0.18s ease;
}
.slim-row:active { transform: scale(0.98); }
.slim-row:hover { border-color: var(--teal-dim); }
.slim-row > svg:first-child { width: 17px; height: 17px; color: var(--teal); flex-shrink: 0; }
.slim-row span { flex: 1; text-align: left; }
.slim-row .chev { width: 17px; height: 17px; color: var(--text-faint); flex-shrink: 0; }

/* extrato recolhível */
.log-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 11px 4px 9px;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.log-toggle > span:first-child { flex: 1; text-align: left; color: var(--teal); }
.log-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 2px 8px;
}
.log-chev {
  width: 17px;
  height: 17px;
  color: var(--text-faint);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.log-toggle.open .log-chev { transform: rotate(180deg); }
.log-card.hidden { display: none; }

/* ---------- poupança: progresso e comparação mensal ---------- */
.pace-zero { color: var(--text-faint); font-weight: 600; }

.savings-progress {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}
.savings-progress.hidden { display: none; }
.sp-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.sp-txt { font-size: 12px; color: var(--text-dim); }
.sp-pct { font-size: 15px; font-weight: 800; color: var(--teal); font-variant-numeric: tabular-nums; }

.savings-month {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
}
.savings-month.hidden { display: none; }
.sm-k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); }
.sm-v { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sm-n { font-size: 11px; color: var(--text-faint); margin-left: auto; }

.savings-log { margin-top: 18px; }
.savings-log.hidden { display: none; }
.savings-log .tl-badge.c { font-size: 14px; }

/* ---------- plano do objetivo: quanto guardar por dia / por semana ---------- */
.goal-plan {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(47, 230, 184, 0.07);
  border: 1px solid var(--teal-dim);
}
.goal-plan.late { background: rgba(232, 184, 102, 0.08); border-color: rgba(232, 184, 102, 0.32); }
.gp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 9px;
  line-height: 1.35;
}
.gp-change {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.gp-rates { display: flex; align-items: center; gap: 12px; }
.gp-rate { display: flex; flex-direction: column; gap: 1px; }
.gp-rate b { font-size: 19px; font-weight: 800; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }
.gp-rate small { font-size: 10px; color: var(--text-faint); }
.gp-sep { width: 1px; align-self: stretch; background: var(--card-border); }
.gp-days {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  padding: 3px 9px;
  flex-shrink: 0;
}
.gp-state { display: block; margin-top: 9px; font-size: 11px; font-weight: 600; }
.gp-state.ok { color: var(--teal); }
.gp-state.late { color: #e8b866; }
.gp-state.new { color: var(--text-faint); font-weight: 500; }

.goal-plan-empty {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 1px dashed var(--card-border);
  font: inherit;
  color: var(--text);
  transition: border-color 0.18s ease;
}
.goal-plan-empty:hover { border-color: var(--teal-dim); }
.gp-empty-t { font-size: 13px; font-weight: 700; color: var(--teal); }
.gp-empty-s { font-size: 11px; color: var(--text-dim); line-height: 1.4; }

/* ============================================================
   PERFIL — redesenho
   Antes: avatar chapado a flutuar no fundo, três caixas iguais,
   e sete cartões de conquistas a ocupar meio ecrã.
   ============================================================ */

/* ---------- cabeçalho num cartão, com profundidade ---------- */
.profile-card {
  position: relative;
  margin-bottom: 16px;
  padding: 26px 20px 18px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(47, 230, 184, 0.14), rgba(13, 24, 36, 0.6) 55%);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  overflow: hidden;
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 8px 28px rgba(0, 0, 0, 0.28);
}
.profile-card::before {
  content: "";
  position: absolute;
  top: -70px;
  right: -50px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 230, 184, 0.22), transparent 70%);
  pointer-events: none;
}
.profile-card .profile-head { position: relative; z-index: 1; padding: 0; gap: 5px; }

/* avatar com anel, mais contido */
.profile-card .profile-avatar {
  width: 72px;
  height: 72px;
  font-size: 25px;
  margin-bottom: 10px;
  box-shadow: 0 0 0 4px rgba(47, 230, 184, 0.16), 0 6px 20px rgba(47, 230, 184, 0.28);
}
.profile-card .profile-name { font-size: 19px; font-weight: 700; letter-spacing: -0.3px; }
.profile-card .profile-email { font-size: 12px; }

/* ---------- nível e XP ---------- */
.profile-level {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--card-border);
}
.pl-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pl-lvl { font-size: 14px; font-weight: 700; color: var(--teal); }
.pl-xp { font-size: 12px; font-weight: 700; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.pl-note { margin-top: 7px; font-size: 11px; color: var(--text-faint); }

/* ---------- estatísticas mais leves ---------- */
.profile-stats { gap: 8px; }
.stat-tile { padding: 13px 10px; }
.stat-tile-value { font-size: 15px; font-weight: 800; letter-spacing: -0.3px; }
.stat-tile-label { font-size: 10px; letter-spacing: 0.3px; }

/* ---------- conquistas: faixa de medalhas ---------- */
.badges-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 4px 8px;
  margin: 0 -4px;
  scrollbar-width: none;
}
.badges-strip::-webkit-scrollbar { display: none; }
.badges-strip .badge {
  flex: 0 0 auto;
  width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  cursor: pointer;
  transition: transform 0.13s ease;
}
.badges-strip .badge:active { transform: scale(0.93); }
.badge-medal {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, rgba(47, 230, 184, 0.22), rgba(47, 230, 184, 0.05));
  border: 1px solid var(--teal-dim);
  color: var(--teal);
  box-shadow: 0 4px 14px rgba(47, 230, 184, 0.18);
}
.badge-medal svg { width: 23px; height: 23px; }
.badge-tick {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--teal);
  color: #06231b;
  border: 2px solid var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.badge-tick svg { width: 10px; height: 10px; }
.badges-strip .badge.locked .badge-medal {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--card-border);
  border-style: dashed;
  color: var(--text-faint);
  box-shadow: none;
}
.badges-strip .badge-label {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  color: var(--text-dim);
}
.badges-strip .badge.locked .badge-label { color: var(--text-faint); font-weight: 500; }

.badges-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  background: rgba(47, 230, 184, 0.12);
  border: 1px solid var(--teal-dim);
  border-radius: 999px;
  padding: 3px 10px;
}

/* ---------- terminar sessão: menos gritante ---------- */
#profile-logout-btn {
  width: 100%;
  margin-top: 22px;
  padding: 13px 0;
  border-radius: 14px;
  background: none;
  border: 1px solid var(--red-dim);
  color: var(--red);
  font-size: 14px;
  font-weight: 600;
}
#profile-logout-btn:active { transform: scale(0.98); background: rgba(227, 90, 90, 0.08); }

/* ---------- foto de perfil ---------- */
.avatar.has-photo,
.profile-avatar.has-photo {
  background-size: cover;
  background-position: center;
  color: transparent;
  font-size: 0;
}
.profile-card .profile-avatar {
  position: relative;
  border: none;
  padding: 0;
  cursor: pointer;
  overflow: visible;
  transition: transform 0.13s ease;
}
.profile-card .profile-avatar:active { transform: scale(0.94); }
.avatar-cam {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 2px solid var(--bg);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.avatar-cam svg { width: 13px; height: 13px; }
.photo-remove {
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: none;
  border: 1px solid var(--card-border);
  color: var(--text-faint);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.photo-remove:hover { color: var(--red); border-color: var(--red-dim); }
.photo-remove.hidden { display: none; }

/* ---------- assinatura ---------- */
.sub-card { display: flex; flex-direction: column; }
.sub-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sub-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-faint);
}
.sub-name { display: block; font-size: 21px; font-weight: 800; letter-spacing: -0.3px; margin-top: 2px; }
.sub-price {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--teal);
  background: rgba(47, 230, 184, 0.12);
  border: 1px solid var(--teal-dim);
  border-radius: 999px;
  padding: 6px 13px;
}
.sub-state {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-dim);
}
.sub-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.sub-state.on { color: var(--teal); }
.sub-state.on .sub-dot { background: var(--teal); box-shadow: 0 0 8px rgba(47, 230, 184, 0.7); }

.sub-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.sub-list li {
  position: relative;
  padding-left: 22px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}
.sub-list li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 6px;
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  transform: rotate(-45deg);
}
.sub-actions { display: flex; gap: 9px; margin-top: 18px; }
.sub-actions .btn-primary { flex: 1; }
.sub-cancel {
  flex-shrink: 0;
  padding: 11px 16px;
  border-radius: 14px;
  background: none;
  border: 1px solid var(--card-border);
  color: var(--text-faint);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.sub-cancel:hover { color: var(--red); border-color: var(--red-dim); }
.sub-demo { margin-top: 14px; }

/* as iniciais do perfil vivem num span próprio, para o ícone da câmara sobreviver */
.avatar-initials { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.profile-avatar.has-photo .avatar-initials { display: none; }

/* ---------- Finanças: barra do saldo em vez do donut ----------
   O donut tinha 291px e repetia o saldo mesmo por cima dele. */
.balance-split { margin-top: 16px; }
.balance-split.hidden { display: none; }
.bs-bar {
  height: 8px;
  border-radius: 6px;
  background: var(--teal);
  overflow: hidden;
  display: flex;
  justify-content: flex-end;
}
.bs-spent {
  display: block;
  height: 100%;
  background: var(--red);
  border-radius: 0 5px 5px 0;
  transition: width 0.5s cubic-bezier(0.22, 0.9, 0.3, 1);
}
.bs-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 9px;
  font-size: 11px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.bs-legend span { display: flex; align-items: center; gap: 5px; }
.bs-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.bs-dot.teal { background: var(--teal); }
.bs-dot.red { background: var(--red); }
.bs-pct { margin-left: auto; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

.balance-trend {
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--card-border);
  font-size: 11px;
  color: var(--text-dim);
}
.balance-trend.hidden { display: none; }
.balance-trend .pct-up,
.balance-trend .pct-down { font-weight: 700; }

/* ---------- movimentos numa lista só ----------
   Em duas colunas a 375px sobravam 75px para o nome e cortava
   "Supermercado", "Explicações" e "Telemóvel fixa". */
.mov-actions { display: flex; gap: 7px; margin-left: auto; }
.mov-add {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--bg-2);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.18s ease;
}
.mov-add:active { transform: scale(0.94); }
.mov-add.inc { color: var(--teal); }
.mov-add.inc:hover { border-color: var(--teal-dim); }
.mov-add.exp { color: var(--red); }
.mov-add.exp:hover { border-color: var(--red-dim); }

.mov-card { padding: 4px 8px; display: flex; flex-direction: column; }
.mov-card .mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 8px;
  font-size: 13px;
}
.mov-card .mini-row + .mini-row { border-top: 1px solid var(--card-border); }
.mov-card .mini-row .name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mov-card .mini-row .dot { flex-shrink: 0; }
.mov-card .empty-hint { padding: 12px 8px; display: block; }

/* Sem as classes list-teal/list-red, os pontos ficaram sem cor e deixou de se
   distinguir rendimento de gasto. A cor passa a vir da lista a que pertencem,
   e o valor ganha sinal. */
#income-list .mini-row .dot { background: var(--teal); }
#expense-list .mini-row .dot { background: var(--red); }
#income-list .mini-row > span:last-child { color: var(--teal); }
#income-list .mini-row > span:last-child::before { content: "+"; }
#expense-list .mini-row > span:last-child { color: var(--red); }
#expense-list .mini-row > span:last-child::before { content: "−"; }
/* separador entre a última entrada e o primeiro gasto */
#expense-list .mini-row:first-child { border-top: 1px solid var(--card-border); }

/* ---------- automatismos: repetir num toque ---------- */


/* orçamentos automáticos */
.be-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.be-alt {
  padding: 7px 15px;
  border-radius: 999px;
  background: none;
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.be-alt:hover { border-color: var(--teal-dim); color: var(--teal); }
.budget-empty .be-cta { border: none; cursor: pointer; font: inherit; }

/* marcar recorrente como fixa */
.sub-fix {
  align-self: flex-start;
  margin-top: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(47, 230, 184, 0.12);
  border: 1px solid var(--teal-dim);
  color: var(--teal);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.sub-fix:active { transform: scale(0.95); }

/* ---------- poupança automática ---------- */
.auto-save { margin-top: 12px; }
.auto-save.hidden { display: none; }
.as-card { transition: border-color 0.2s ease; }
.as-card.on { border-color: var(--teal-dim); background: rgba(47, 230, 184, 0.06); }
.as-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.as-title { display: block; font-size: 15px; font-weight: 700; }
.as-sub { display: block; font-size: 12px; color: var(--text-dim); margin-top: 2px; line-height: 1.4; }
.as-switch {
  flex-shrink: 0;
  width: 46px;
  height: 27px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--card-border);
  padding: 2px;
  cursor: pointer;
  transition: background 0.22s ease, border-color 0.22s ease;
}
.as-switch span {
  display: block;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: transform 0.22s cubic-bezier(0.22, 0.9, 0.3, 1), background 0.22s ease;
}
.as-switch.on { background: rgba(47, 230, 184, 0.24); border-color: var(--teal); }
.as-switch.on span { transform: translateX(19px); background: var(--teal); }
.as-controls { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.as-pcts { display: flex; gap: 6px; }
.as-pct {
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.as-pct.on { background: rgba(47, 230, 184, 0.16); border-color: var(--teal); color: var(--teal); }
.as-goal {
  flex: 1;
  min-width: 120px;
  padding: 7px 11px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  outline: none;
}

/* os avisos passaram para debaixo do saldo — precisam de respiro em cima */
.hub-alerts { margin-top: 14px; margin-bottom: 0; }

/* disponível negativo: puseste de lado mais do que entrou */
.big-value.negativo,
.hero-value.negativo { color: var(--red); }

/* ============================================================
   CABEÇALHO DO INÍCIO — redesenho
   Antes: roda de definições no canto mais destacado (para a ação
   menos usada), a abrir uma gaveta que só duplicava navegação.
   Agora: avatar → saudação → série, como nas apps de banca.
   ============================================================ */
.hub-topbar {
  align-items: center;
  gap: 13px;
  padding-bottom: 14px;
}
.hub-avatar {
  width: 44px;
  height: 44px;
  font-size: 15px;
  box-shadow: 0 0 0 3px rgba(47, 230, 184, 0.12);
}
.hub-greet { gap: 1px; }
.hub-greet-hi {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.hub-greet-date {
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* série: mais contida, mas mantém o laranja — é a convenção universal
   para sequências (Duolingo, Snapchat) e lê-se de imediato */
.streak-flame {
  padding: 5px 10px 5px 7px;
  background: rgba(255, 130, 60, 0.12);
  border-color: rgba(255, 140, 70, 0.3);
}
.streak-flame svg { width: 16px; height: 16px; }
.streak-flame span { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ============================================================
   REFINAMENTO VISUAL
   Base: escalas de tipo (9–30) e de cantos (6/10/14/20/pill).
   Antes havia 18 tamanhos de letra e 13 raios diferentes — muitos
   separados por meio pixel, o que se lê como desleixo sem se saber
   porquê.
   ============================================================ */

/* ---- títulos de secção: um só tratamento ----
   Havia 8 a teal e 5 a branco, sem regra. Unificados num tom sóbrio,
   com um marcador teal — assim o acento fica reservado para o que
   importa (números e ações) em vez de estar em todo o lado. */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 4px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.section-title::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--teal);
  flex-shrink: 0;
}
/* a classe teal-text deixa de pintar títulos: o marcador já faz esse papel */
.section-title.teal-text { color: var(--text-dim); }

/* ---- hierarquia dos cartões ----
   Todos tinham o mesmo peso. O cartão principal de cada ecrã passa a
   ler-se como principal. */
.hero-card,
.highlight-card {
  border-radius: 20px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.2),
    inset 0 0 0 1px var(--lg-rim-all),
    inset 0 -1px 0 var(--lg-rim-bottom),
    var(--lg-cast-lift);
}

/* ---- números: o que o utilizador vem ver ---- */
.big-value,
.hero-value {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
}

/* ---- ritmo vertical mais claro entre secções ---- */
.scroll > .section-head,
.scroll > .section-title { margin-top: 8px; }

/* ==========================================================================
   Liquid Glass — degradação e acessibilidade
   O material assenta em backdrop-filter. Onde não existe, ou onde o
   utilizador pediu para não haver transparência, o texto tem de continuar
   legível — senão trocava-se legibilidade por efeito, que é mau negócio.
   ========================================================================== */

/* 1. Navegadores sem backdrop-filter (e o modo de leitura de alguns).
      Sem isto, o fundo translúcido deixa o texto em cima de qualquer coisa. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card,
  .fixed-row,
  .bank-row,
  .holding-row,
  .badge,
  .settings-list,
  .plan-card,
  .sim-banner,
  .qt {
    background: var(--lg-sheen), var(--card-solid);
  }
  .bottom-nav { background: var(--lg-sheen), #0e1119; }
  .modal { background: var(--lg-sheen), #181c28; }
  .modal-overlay { background: rgba(5, 7, 12, 0.82); }
}

/* 2. Quem pediu menos transparência no sistema (iOS/macOS: "Reduzir
      transparência"). Mantém-se o bordo iluminado, perde-se o desfoque. */
@media (prefers-reduced-transparency: reduce) {
  .card,
  .fixed-row,
  .bank-row,
  .holding-row,
  .badge,
  .settings-list,
  .plan-card,
  .sim-banner,
  .qt,
  .bottom-nav,
  .modal,
  .modal-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .card,
  .fixed-row,
  .bank-row,
  .holding-row,
  .badge,
  .settings-list,
  .plan-card,
  .sim-banner,
  .qt {
    background: var(--card-solid);
  }
  .bottom-nav { background: #0e1119; }
  .modal { background: #181c28; }
  .modal-overlay { background: rgba(5, 7, 12, 0.9); }
}

/* 3. Contraste elevado: o bordo subtil do vidro deixa de chegar. */
@media (prefers-contrast: more) {
  .card,
  .fixed-row,
  .bank-row,
  .holding-row,
  .badge,
  .settings-list,
  .plan-card,
  .sim-banner,
  .qt,
  .bottom-nav,
  .modal {
    border-color: rgba(255, 255, 255, 0.4);
  }
}

/* ==========================================================================
   Acesso rápido — mosaicos
   Era uma lista de quatro linhas iguais com setas: ocupava meio ecrã para
   dizer apenas "há aqui quatro sítios". Passa a levar um número real em
   cada um, com a cor da área a fazer de pista.
   ========================================================================== */
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.qt {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px;
  border-radius: 14px;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  background: var(--lg-tint), var(--lg-sheen), var(--card);
  backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat)) brightness(var(--lg-bright));
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat)) brightness(var(--lg-bright));
  border: 1px solid transparent;
  box-shadow:
    inset 0 1px 0 var(--lg-rim-top),
    inset 0 0 0 1px var(--lg-rim-all),
    inset 0 -1px 0 var(--lg-rim-bottom),
    var(--lg-cast);
  transition: transform 0.14s ease, box-shadow 0.2s ease;
}
.qt:active { transform: scale(0.975); }
.qt-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.qt-ic {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid transparent;
}
.qt-ic svg { width: 16px; height: 16px; }
.qt-ic.teal   { color: var(--teal);   background: rgba(47, 230, 184, 0.12);  border-color: rgba(47, 230, 184, 0.28); }
.qt-ic.blue   { color: var(--blue);   background: rgba(90, 182, 240, 0.12);  border-color: rgba(90, 182, 240, 0.28); }
.qt-ic.gold   { color: var(--gold);   background: rgba(240, 180, 90, 0.12);  border-color: rgba(240, 180, 90, 0.28); }
.qt-ic.violet { color: var(--violet); background: rgba(169, 139, 240, 0.12); border-color: rgba(169, 139, 240, 0.28); }
.qt-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: -0.01em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qt-value {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.qt-sub {
  font-size: 11px;
  color: var(--text-dim);
  /* um nome de objetivo muito comprido quebrava o mosaico em quatro linhas */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* variação do investimento: cor só quando há sinal */
.qt-sub.up { color: var(--teal); }
.qt-sub.down { color: var(--red); }
/* barra de progresso do percurso */
.qt-bar {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  margin-top: 9px;
  overflow: hidden;
}
.qt-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--violet);
  width: 0;
  transition: width 0.5s ease;
}

/* ==========================================================================
   Made in Portugal
   Pequeno, centrado e no fundo do ecrã — presente sem competir com o
   logótipo nem com os botões.
   ========================================================================== */
.pt-selo {
  margin: 0;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* arranque: o logótipo continua ao centro, o selo desce até ao fundo */
.splash { flex-direction: column; }
.splash .splash-logo { margin-top: auto; }
.splash .pt-selo {
  margin-top: auto;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  animation: ptEntra 0.7s ease 0.35s both;
}
@keyframes ptEntra {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

/* boas-vindas: por baixo dos botões, encostado ao fundo */
#view-welcome .pt-selo { padding-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  .splash .pt-selo { animation: none; }
}

/* ==========================================================================
   Notícias financeiras
   ========================================================================== */
/* o mosaico das notícias ocupa a linha toda — é o quinto, ficaria sozinho */
.qt-wide { grid-column: 1 / -1; }

.nt-fonte {
  font-size: 11.5px;
  color: var(--text-dim);
  padding: 2px 4px 0;
  display: flex;
  align-items: center;
  gap: 7px;
}
.nt-fonte::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal); flex-shrink: 0;
}
.nt-fonte.cache::before { background: var(--gold); }
.nt-fonte.offline::before { background: var(--red); }

.seg-tabs { display: flex; gap: 6px; margin: 12px 0 4px; }
.seg-tab {
  flex: 1; padding: 8px 6px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--card-border);
  font: inherit; font-size: 12px; font-weight: 600; color: var(--text-dim);
  cursor: pointer; transition: color .12s, border-color .12s, background .12s;
}
.seg-tab.on { color: var(--teal); background: rgba(47,230,184,.12); border-color: var(--teal-dim); }

.nt-lista { display: flex; flex-direction: column; margin-top: 10px; }

/* ---- manchete ----
   Uma notícia em destaque, como a primeira página de um jornal. Sem isto,
   48 títulos com o mesmo peso não davam ao olho por onde começar. */
.nt-manchete {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 20px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  background: var(--lg-tint), var(--lg-sheen), var(--card);
  backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat)) brightness(var(--lg-bright));
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat)) brightness(var(--lg-bright));
  border: 1px solid transparent;
  box-shadow:
    inset 0 1px 0 var(--lg-rim-top),
    inset 0 0 0 1px var(--lg-rim-all),
    inset 0 -1px 0 var(--lg-rim-bottom),
    var(--lg-cast);
  transition: transform 0.13s ease;
}
.nt-manchete:active { transform: scale(0.985); }
.nt-mancheteTopo { display: flex; align-items: center; gap: 9px; }
.nt-fonteNome {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-dim);
}
.nt-mancheteTitulo {
  font-size: 19px; font-weight: 700; line-height: 1.28; letter-spacing: -0.025em;
}
.nt-mancheteData { font-size: 11.5px; color: var(--text-faint); }

/* ---- separador de dia ---- */
.nt-dia {
  display: flex; align-items: center; gap: 11px;
  margin: 24px 2px 10px;
}
.nt-dia span {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-dim); flex-shrink: 0;
}
.nt-dia i { flex: 1; height: 1px; background: var(--card-border); }

/* ---- coluna do dia ----
   Um bloco só, com fios a separar as notícias. Antes cada uma era um cartão
   a flutuar sozinho, e 48 cartões seguidos leem-se como ruído. */
.nt-coluna {
  border-radius: 14px;
  overflow: hidden;
  background: var(--lg-sheen), var(--card);
  backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
  border: 1px solid transparent;
  box-shadow:
    inset 0 1px 0 var(--lg-rim-top),
    inset 0 0 0 1px var(--lg-rim-all),
    inset 0 -1px 0 var(--lg-rim-bottom),
    var(--lg-cast);
}
.nt-linha {
  display: flex; flex-direction: column; gap: 5px;
  padding: 14px 16px;
  text-decoration: none; color: var(--text);
}
.nt-linha + .nt-linha { border-top: 1px solid var(--card-border); }
.nt-linha:active { background: rgba(255, 255, 255, 0.03); }
.nt-linhaTitulo { font-size: 14px; font-weight: 600; line-height: 1.42; letter-spacing: -0.01em; }
.nt-linhaMeta {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--text-dim);
}
.nt-ponto {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal); flex-shrink: 0;
}
.nt-ponto.mundo { background: var(--blue); }

.nt-vazio { padding: 26px 4px; text-align: center; font-size: 13.5px; color: var(--text-dim); }

/* lição acabada de sair */
.lesson-novo {
  font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold); background: rgba(240,180,90,.14);
  border: 1px solid rgba(240,180,90,.3);
  padding: 2px 7px; border-radius: 999px; margin-left: 8px; flex-shrink: 0;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  }
@media (prefers-reduced-transparency: reduce) {
  }
@media (prefers-contrast: more) {
  }


/* ---------- rodapé do chat ----------
   Um só bloco fixo: sugestões, quota e caixa de escrita empilhadas pelo
   browser. Antes eram três `fixed` com distâncias à mão — a quota e as
   sugestões sobrepunham-se 16px assim que o texto da quota cresceu. */
.chat-footer {
  position: fixed;
  bottom: var(--nav-h);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  z-index: 15;
}

/* ==========================================================================
   Espaço de anúncio (plano Free)
   Marcador declarado, não um anúncio a fingir. Discreto de propósito: um
   anúncio agressivo numa app de literacia financeira para jovens seria
   contraditório com o que a app ensina.
   ========================================================================== */
.ad-slot {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px dashed var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ad-slot.hidden { display: none; }
.ad-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ad-lbl {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-faint);
}
.ad-x {
  font: inherit; font-size: 11px; font-weight: 600;
  color: var(--teal); background: none; border: none; cursor: pointer; padding: 2px 0;
}
.ad-corpo { font-size: 13px; color: var(--text-dim); margin: 2px 0 0; }
.ad-nota { font-size: 10.5px; color: var(--text-faint); margin: 0; }

/* ---------- banco: total consolidado e estado da sincronização ---------- */
.bank-total {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 12px 14px; margin-bottom: 10px;
  border-radius: 10px;
  background: rgba(47, 230, 184, 0.08);
  border: 1px solid var(--teal-dim);
}
.bank-total span { font-size: 12px; color: var(--text-dim); }
.bank-total strong { font-size: 17px; font-weight: 700; color: var(--teal); font-variant-numeric: tabular-nums; }
.bank-sinc { font-size: 11px; color: var(--teal); margin: 0 0 10px; }
.bank-sinc.off { color: var(--text-faint); }

/* ---------- desligar conta bancária ---------- */
.bank-x {
  width: 28px; height: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer;
  color: var(--text-faint); border-radius: 8px;
  transition: color 0.12s ease, background 0.12s ease;
}
.bank-x svg { width: 15px; height: 15px; }
.bank-x:hover { color: var(--red); background: rgba(227, 90, 90, 0.1); }
.dbm-iban { font-size: 12px; color: var(--text-faint); }

/* ---------- movimentos: encolher a lista ---------- */
.mov-toggle {
  width: 100%;
  margin-top: 4px;
  padding: 9px 0 2px;
  border: none;
  border-top: 1px solid var(--card-border);
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.mov-toggle.hidden { display: none; }
.mov-toggle::after {
  content: "";
  width: 7px; height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.16s ease;
}
.mov-toggle.aberto::after { transform: rotate(-135deg) translateY(-2px); }

/* ---------- movimentos mais compactos ----------
   Cada linha tinha 39px de altura mais 10px de intervalo: 8 movimentos
   ocupavam dois terços do ecrã. Fios finos em vez de espaço em branco —
   mesma leitura, quase metade da altura. */
.mov-card .mini-row { padding: 8px 8px; }
.mov-card .mini-row + .mini-row { border-top: 1px solid var(--card-border); }
/* fio a separar rendimentos de gastos */
.mov-card #expense-list { border-top: 1px solid var(--card-border); }
.mov-card #expense-list:empty { border-top: none; }

/* ---------------- subscrição ----------------
   Substituiu um modal com três botões e "Guardar". O fluxo tem três passos —
   escolher, confirmar, feito — para se parecer com uma subscrição a sério em
   vez de um interruptor. */
.sb-nota {
  margin: 0;
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(240, 180, 90, 0.10);
  border: 1px solid rgba(240, 180, 90, 0.28);
  color: var(--gold);
  font-size: 13px;
  line-height: 1.45;
}

/* alternador mensal / anual */
.sb-ciclo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
}
.sb-ciclo button {
  border: 0;
  background: none;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.sb-ciclo button.on {
  background: rgba(47, 230, 184, 0.14);
  color: var(--teal);
  box-shadow: inset 0 0 0 1px rgba(47, 230, 184, 0.3);
}
.sb-desc {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--teal);
  color: #06231b;
}

/* cartões dos planos */
.sb-card { position: relative; } /* o espaçamento vem do gap do .scroll */
.sb-destaque { box-shadow: inset 0 0 0 1px var(--teal-dim), var(--glow-teal); }
.sb-eatual { opacity: 0.86; }
.sb-selo {
  position: absolute;
  top: -9px;
  left: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--teal);
  color: #06231b;
}
.sb-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
}
.sb-nome { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.sb-preco { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.sb-preco small { font-size: 12px; font-weight: 500; color: var(--text-dim); }
.sb-poupa { display: block; font-size: 12px; color: var(--teal); margin-bottom: 8px; }
.sb-lista { list-style: none; margin: 12px 0 16px; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.sb-lista li {
  position: relative;
  padding-left: 22px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text-dim);
}
.sb-lista li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--teal);
  font-weight: 700;
  font-size: 12px;
}
.sb-cta { width: 100%; }
.sb-atual {
  display: block;
  text-align: center;
  padding: 11px;
  border-radius: 14px;
  border: 1px dashed var(--card-border);
  color: var(--text-faint);
  font-size: 13.5px;
  font-weight: 600;
}

/* passo de confirmação */
.sb-h { font-size: 20px; font-weight: 700; letter-spacing: -0.025em; margin: 0 0 10px; }
.sb-p { font-size: 13.5px; line-height: 1.5; color: var(--text-dim); margin: 0 0 12px; }
.sb-mini { font-size: 12px; }
.sb-linha {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14px;
}
.sb-linha span:first-child { color: var(--text-dim); }
.sb-linha span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.sb-total { border-bottom: 0; font-size: 16px; }
.sb-total span:last-child { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.sb-pagamento {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px dashed var(--card-border);
}
.sb-pag-label { font-size: 13.5px; color: var(--text-dim); }
.sb-pag-valor { font-size: 13px; color: var(--text-faint); }
.sb-confirmar { width: 100%; margin-top: 14px; }
.sb-voltar {
  width: 100%;
  margin-top: 10px;
  background: none;
  border: 0;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px;
  cursor: pointer;
}

/* passo final */
.sb-feito { text-align: center; }
.sb-feito .sb-lista { text-align: left; }
.sb-tick {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 4px auto 14px;
  border-radius: 999px;
  background: rgba(47, 230, 184, 0.14);
  border: 1px solid var(--teal-dim);
  color: var(--teal);
  font-size: 24px;
  font-weight: 700;
}

/* nota do preço anual, nos cartões do registo */
.plan-anual {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--teal);
}
.plan-anual.hidden { display: none; }

/* O alternador no ecrã de registo: `.auth-scroll` tem `gap: 0`, ao contrário
   do `.scroll` das vistas da app, por isso aqui a margem é precisa. */
.auth-scroll .sb-ciclo { margin: 0 0 14px; }

/* ---- quiz: fila de repetição ----
   As perguntas erradas voltam ao fim da fila, por isso "Pergunta 2 de 3"
   deixou de fazer sentido — o que conta é quantas já estão dominadas. */
.quiz-step { display: flex; align-items: center; gap: 8px; }
.quiz-revisita {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(240, 180, 90, 0.16);
  border: 1px solid rgba(240, 180, 90, 0.3);
  color: var(--gold);
}
.quiz-barra {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 8px 0 14px;
}
.quiz-barra i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--teal);
  transition: width 0.25s ease;
}
@media (prefers-reduced-motion: reduce) { .quiz-barra i { transition: none; } }
.quiz-result-nota {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-faint);
}

/* etiqueta de plano nas linhas de definições */
.settings-sub { display: block; font-size: 11px; color: var(--text-faint); margin-top: 1px; }
.settings-sub.bloqueado { color: var(--gold); font-weight: 600; }


/* ---- extrato mensal (aberto pelo coach) ---- */
.coach-extrato {
  margin-top: 10px;
  background: none;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 7px 14px;
  color: var(--teal);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.coach-extrato:hover { border-color: var(--teal-dim); }
.coach-extrato.hidden { display: none; }

.extrato-modal { text-align: left; max-height: 82vh; overflow-y: auto; }
.extrato-topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ex-titulo { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px; }
.ex-frase { font-size: 13.5px; line-height: 1.5; color: var(--text-dim); margin: 0 0 16px; }
.ex-bloco { border: 1px solid var(--card-border); border-radius: 14px; padding: 4px 14px; margin-bottom: 18px; }
.ex-linha {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0; font-size: 13.5px; color: var(--text-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.ex-linha:last-child { border-bottom: 0; }
.ex-linha span:last-child { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.ex-pos { color: var(--teal) !important; }
.ex-neg { color: var(--red) !important; }
.ex-seccao {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-faint); margin: 18px 0 9px;
}
.ex-cat { margin-bottom: 11px; }
.ex-cat-topo { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 5px; }
.ex-cat-topo span:last-child { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.ex-barra { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.ex-barra i { display: block; height: 100%; border-radius: 999px; background: var(--teal); }
.ex-nota { font-size: 13px; color: var(--text-dim); margin: 0; }
.ex-nota strong { color: var(--text); }

/* ---- marco da série (substituiu a grelha SEG..DOM) ---- */
.streak-marco {
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 13px 15px;
  margin: 4px 0 14px;
}
.sm-topo {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 9px;
}
.sm-alvo { color: #ffb45c; font-size: 13px; letter-spacing: -0.01em; text-transform: none; }
.sm-barra { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.sm-barra i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffb45c, #ff5e3a);
  transition: width 0.3s ease;
}
@media (prefers-reduced-motion: reduce) { .sm-barra i { transition: none; } }
.sm-falta { font-size: 12.5px; color: var(--text-dim); margin-top: 8px; }

/* ---- apagar movimentos ----
   A lista era só de leitura: uma vez registado, um movimento ficava para
   sempre. O × é explícito e confirma, para não se apagar sem querer. */
.mov-fim { display: flex; align-items: center; gap: 8px; }
.mov-del {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-faint);
  cursor: pointer;
  padding: 0;
}
.mov-del svg { width: 13px; height: 13px; }
.mov-del:hover { background: rgba(227, 90, 90, 0.16); color: var(--red); }
.mov-del:active { transform: scale(0.9); }

/* ---------------- comportar-se como app, não como site ----------------
   Estes detalhes são o que separa "site no ecrã principal" de "app". Cada um
   corrige um tique de browser que denuncia a origem web. */

/* 1. O flash cinzento a cada toque. Nenhuma app nativa faz isto. */
* { -webkit-tap-highlight-color: transparent; }

/* 2. O ressalto elástico ao puxar além do fim, que mostra o fundo do browser. */
html, body {
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

/* 3. Carregar sem largar seleciona texto ou abre o menu de partilha do iOS.
      Desligado na interface; continua ligado onde é preciso copiar. */
body {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.msg,
.analise-texto,
.ex-frase,
.lesson-body,
input,
textarea {
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
}

/* ---- foco de teclado ----
   Não havia nenhum: dava para percorrer a app toda com Tab sem nunca ver
   onde se estava (a plataforma já tinha isto, a app não). :focus-visible só
   aparece na navegação por teclado — no rato/toque continua sem anel. */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 6px;
}
.nav-btn:focus-visible,
.range-btn:focus-visible,
.password-toggle:focus-visible {
  outline-offset: -2px;
}

/* Relatórios: o mesmo gráfico bidirecional do resumo semanal do Início,
   mas com 6 meses em vez de 7 dias. */
.rel-chart { grid-template-columns: repeat(6, 1fr); margin-bottom: 4px; }

/* O .btn-danger tem width:100% para o "Terminar sessão" sozinho no Perfil;
   dentro de uma fila de botões de modal comia o espaço todo e esmagava o
   "Cancelar" (acontecia também no "Apagar" dos orçamentos). */
.modal-actions .btn-danger { flex: 1; width: auto; padding: 11px 0; margin-top: 0; font-size: 14px; }

/* Apagar conta: a vermelho, para não se confundir com as outras linhas. */
.settings-row-perigo .settings-label,
.settings-row-perigo .settings-icon { color: var(--red); }

/* Compras automáticas (investimento recorrente no simulador) */
/* O passo do valor vive num div dentro do modal: sem isto o campo ficava
   com a largura natural, mais estreito que o do modal de venda. */
#holding-step-amount { display: flex; flex-direction: column; gap: 6px; }
.modal .rec-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.rec-toggle input { width: 18px; height: 18px; accent-color: var(--teal); flex-shrink: 0; margin: 0; }
.rec-hint { margin-top: 4px; }
.recorrentes-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.rec-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
}
.rec-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.rec-nome { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-meta { font-size: 12px; color: var(--text-dim); }
.rec-erro { font-size: 12px; color: var(--gold); }

/* ---- movimentos por categoria ---- */
.mov-card .mini-row[data-mov-abrir] { cursor: pointer; }
.mov-por-cat {
  width: 100%;
  margin-top: 4px;
  padding: 10px 8px 6px;
  border: none;
  border-top: 1px solid var(--card-border);
  background: none;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--teal);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mov-por-cat.hidden { display: none; }
.mov-por-cat .mpc-txt { display: flex; align-items: center; gap: 7px; }
.mov-por-cat svg { width: 15px; height: 15px; flex-shrink: 0; }

.mc-mes { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.mc-mes-nome { font-size: 16px; font-weight: 700; }
.mc-seta {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  color: var(--text);
  cursor: pointer;
}
.mc-seta svg { width: 16px; height: 16px; }
.mc-seta:disabled { opacity: 0.3; cursor: default; }
.mc-vazio { display: block; text-align: center; padding: 24px 0; }
.mc-destaque { font-size: 13px; color: var(--text-dim); margin: -6px 0 14px; line-height: 1.45; }
.mc-destaque strong { color: var(--text); }

.mc-lista { padding: 4px 6px; display: flex; flex-direction: column; }
.mc-grupo + .mc-grupo { border-top: 1px solid var(--card-border); }
.mc-cat {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 6px;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mc-ic {
  width: 34px; height: 34px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: rgba(47, 230, 184, 0.1);
  color: var(--teal);
}
.mc-ic svg { width: 17px; height: 17px; }
.mc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.mc-topo { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.mc-nome { font-weight: 600; }
.mc-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.mc-barra { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.mc-barra i { display: block; height: 100%; border-radius: 999px; background: var(--teal); }
.mc-meta { font-size: 11.5px; color: var(--text-faint); }
.mc-chev { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-faint); transition: transform 0.16s ease; }
.mc-grupo.aberta .mc-chev { transform: rotate(180deg); }

.mc-itens { display: flex; flex-direction: column; padding: 0 0 8px 45px; }
.mc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 6px;
  background: none;
  border: none;
  border-top: 1px solid var(--card-border);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
}
.mc-item:hover { background: rgba(255, 255, 255, 0.03); }
.mc-item-data { flex-shrink: 0; width: 38px; font-size: 11.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.mc-item-nome { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mc-item-valor { flex-shrink: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .mc-chev { transition: none; }
}

/* ---- simulador: valor recomendado ---- */
.sim-limite { margin: 6px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--text-faint); }
.sim-limite:empty { display: none; }
.holding-limite { color: var(--teal); }
.hr-antigo { display: block; font-size: 10px; color: var(--gold); margin-top: 2px; }

/* ---- documentos legais (Termos, Privacidade, Segurança) ---- */
.static-modal-body .legal-data { font-size: 11px; color: var(--text-faint); margin: 0 0 10px; }
.static-modal-body h4 { font-size: 13.5px; font-weight: 700; color: var(--text); margin: 16px 0 6px; }
.static-modal-body ul,
.static-modal-body ol { margin: 4px 0 8px; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.static-modal-body li { line-height: 1.45; }

/* =====================================================================
   VERSÃO SITE — a mesma app no browser de qualquer computador ou tablet.
   Sem a moldura do iPhone: a app ocupa a janela. A moldura continua
   disponível para apresentações com ?moldura no endereço (classe
   .modo-moldura no <html>).
   ===================================================================== */
@media (min-width: 461px) {
  html:not(.modo-moldura) {
    --safe-top: 22px;
  }
  html:not(.modo-moldura) .device-stage {
    padding: 0;
    background: var(--bg);
  }
  html:not(.modo-moldura) .device {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    background: var(--bg);
    flex-shrink: 1;
  }
  html:not(.modo-moldura) .device-screen { border-radius: 0; }
  html:not(.modo-moldura) .device-island { display: none; }

  /* conteúdo numa coluna legível, centrada; a barra de deslocamento fica na
     borda da janela, como num site */
  html:not(.modo-moldura) #app .topbar,
  html:not(.modo-moldura) #app .scroll {
    padding-left: max(16px, calc((100% - 680px) / 2));
    padding-right: max(16px, calc((100% - 680px) / 2));
  }
  html:not(.modo-moldura) #auth .auth-view {
    width: 100%;
    max-width: 460px;
    margin-inline: auto;
  }
  html:not(.modo-moldura) .bottom-nav {
    left: 50%;
    right: auto;
    width: min(560px, calc(100% - 24px));
    transform: translateX(-50%);
  }
}

/* computador: a barra de baixo passa a menu lateral */
@media (min-width: 900px) {
  html:not(.modo-moldura) {
    --lado: 252px;
    --nav-h: 24px;
  }
  html:not(.modo-moldura) #app { padding-left: var(--lado); }
  html:not(.modo-moldura) #app .topbar,
  html:not(.modo-moldura) #app .scroll {
    padding-left: max(24px, calc((100% - 760px) / 2));
    padding-right: max(24px, calc((100% - 760px) / 2));
  }
  html:not(.modo-moldura) .bottom-nav {
    top: 16px;
    bottom: 16px;
    left: 16px;
    right: auto;
    width: calc(var(--lado) - 32px);
    height: auto;
    transform: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding: 18px 12px;
    border-radius: 26px;
  }
  html:not(.modo-moldura) .bottom-nav::before {
    content: "Advanzis";
    display: flex;
    align-items: center;
    height: 40px;
    padding-left: 44px;
    margin: 0 4px 14px;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    background: url("../assets/logo.png") left center / 32px auto no-repeat;
  }
  html:not(.modo-moldura) .nav-btn {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    height: 48px;
    padding: 0 14px;
  }
  html:not(.modo-moldura) .nav-btn::before { border-radius: 14px; }
  html:not(.modo-moldura) .nav-btn svg { width: 21px; height: 21px; }
  html:not(.modo-moldura) .nb-lbl { font-size: 14.5px; letter-spacing: 0; }
  html:not(.modo-moldura) .nav-ia-logo { width: 23px; height: 23px; }
  html:not(.modo-moldura) .nb-dot { position: static; margin: 0 0 0 auto; }
  /* a IA fica em último no menu, separada, como atalho principal */
  html:not(.modo-moldura) .nav-center {
    order: 10;
    margin-top: auto;
    background: rgba(47, 230, 184, 0.08);
    border: 1px solid rgba(47, 230, 184, 0.2);
    border-radius: 14px;
  }

  /* elementos fixos centrados na área do conteúdo, não na janela toda */
  html:not(.modo-moldura) .chat-footer,
  html:not(.modo-moldura) .save-toast {
    left: calc(var(--lado) + (100% - var(--lado)) / 2);
  }
  html:not(.modo-moldura) .chat-footer { max-width: min(760px, calc(100% - var(--lado) - 48px)); }
}
