/* ==========================================================================
   Kyvero — identidade visual (camada por cima de style.css e theme.css)
   Azul-marinho, branco e verde-turquesa: menu e rodapé em marinho, botões em turquesa com texto marinho, cartões brancos de cantos largos e sombras suaves,
   página inicial clara com faixas diagonais. Só muda cores, cantos e a página pública; a estrutura das páginas é a de theme.css.
   Contraste: texto marinho sobre turquesa 9:1; ligações (#0a7c78) sobre branco 5:1; texto do menu sobre marinho 9:1.
   ========================================================================== */

/* Plus Jakarta Sans (SIL Open Font License 1.1, ver assets/fonts/OFL-PlusJakartaSans.txt), servida pelo próprio site. Fonte variável (pesos 400 a 800);
   o latim alargado só se descarrega se a página tiver esses caracteres. A Nunito fica como recurso (e na área de gestão). */
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/assets/fonts/jakarta-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/assets/fonts/jakarta-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; }

/* ---------- Tokens (claro) ---------- */
:root {
  --font: "Plus Jakarta Sans", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --navy: #0b1f3a; --navy-2: #102a4c; --mint: #1bdcae; --mint-2: #12c79c; --teal: #0e9f94;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f7fafc;
  --surface-3: #eef3f8;
  --border: #e3e9f1;
  --border-strong: #c9d3e0;
  --text: #0b1f3a;
  --text-2: #3a4a63;
  --muted: #586780;

  --primary: #0a7c78;
  --primary-hover: #086864;
  --primary-soft: #e0f7f1;
  --primary-solid: #1bdcae;
  --primary-solid-hover: #12c79c;
  --primary-ink: #06263d;
  --accent: #0b1f3a;
  --accent-ink: #ffffff;
  --accent-soft: #e6ecf5;

  --pos: #0fb58f;
  --pos-text: #067a5f;
  --pos-soft: #dcf6ee;
  --info: #1f8fd0;

  --grid: #e9eef4;
  --focus: 0 0 0 3px rgba(27, 220, 174, .4);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --row-line: #e9eef4;
  --shadow-card: 0 1px 2px rgba(11, 31, 58, .05), 0 8px 24px rgba(11, 31, 58, .05);
  --shadow: 0 1px 2px rgba(11, 31, 58, .06), 0 8px 24px rgba(11, 31, 58, .06);
  --shadow-sm: 0 1px 2px rgba(11, 31, 58, .08);

  --sidebar-bg: #0b1f3a;
  --sidebar-text: #b9c6da;
  --sidebar-caption: #93a4bd;
  --sidebar-hover: rgba(255, 255, 255, .07);
  --sb-mark: #2ee6b8; --sb-brand2: #ffffff;
  --c1: #0ea596; --c2: #0b3f66; --c3: #f7b84b; --c4: #f06548; --c5: #2f9be0; --c6: #6c63d9; --c7: #ef8a3c; --c8: #7b8ba3; --c9: #a9d9d2;
}

/* ---------- Tokens (escuro): marinho profundo, o turquesa mantém-se ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #071526; --surface: #0e2238; --surface-2: #122840; --surface-3: #173049; --border: #1f3a56; --border-strong: #2c4a6a;
    --text: #e8eef6; --text-2: #b8c6d8; --muted: #93a4bd;
    --primary: #3fe3bd; --primary-hover: #6bedd0; --primary-soft: #0f3a40; --primary-solid: #1bdcae; --primary-solid-hover: #3fe3bd; --primary-ink: #06263d;
    --accent: #1bdcae; --accent-ink: #06263d; --accent-soft: #0f3a40;
    --pos: #1bdcae; --pos-text: #4fe6c3; --pos-soft: #0f3a37;
    --grid: #1f3a56; --row-line: #1f3a56; --card-line: var(--border); --shadow-card: 0 1px 2px rgba(0, 0, 0, .4);
    --sidebar-bg: #081a30; --sidebar-text: #b0bfd4; --sidebar-caption: #8da0ba;
    --c1: #2fd9c0; --c2: #6fa8e0; --c9: #2d5f6e;
  }
}
:root[data-theme="dark"] {
  --bg: #071526; --surface: #0e2238; --surface-2: #122840; --surface-3: #173049; --border: #1f3a56; --border-strong: #2c4a6a;
  --text: #e8eef6; --text-2: #b8c6d8; --muted: #93a4bd;
  --primary: #3fe3bd; --primary-hover: #6bedd0; --primary-soft: #0f3a40; --primary-solid: #1bdcae; --primary-solid-hover: #3fe3bd; --primary-ink: #06263d;
  --accent: #1bdcae; --accent-ink: #06263d; --accent-soft: #0f3a40;
  --pos: #1bdcae; --pos-text: #4fe6c3; --pos-soft: #0f3a37;
  --grid: #1f3a56; --row-line: #1f3a56; --card-line: var(--border); --shadow-card: 0 1px 2px rgba(0, 0, 0, .4);
  --sidebar-bg: #081a30; --sidebar-text: #b0bfd4; --sidebar-caption: #8da0ba;
  --c1: #2fd9c0; --c2: #6fa8e0; --c9: #2d5f6e;
}
:root[data-sidebar="dark"] { --sidebar-bg: #081a30; --sidebar-text: #b0bfd4; --sidebar-caption: #8da0ba; }

/* A Plus Jakarta Sans tem o espaço entre palavras estreito: um pouco mais de ar no texto corrido, e menos aperto nos títulos grandes */
body, button, input, select, textarea { word-spacing: .07em; }
.num, td.num, .kpi-value, .stat-value, .abar-value, table { word-spacing: normal; }

/* ---------- Marca ---------- */
.brand { gap: 9px; font-size: 21px; }
.brand-mark { width: 28px; height: 28px; filter: none; }
.brand-name { font-weight: 800; letter-spacing: -.035em; color: var(--text); }
.sidebar .brand-name, .site-footer .brand-name { color: #fff; }
:root[data-sidebar="light"] .sidebar .brand-name { color: var(--text); }
.site-footer-inner .brand { font-size: 18px; }

/* ---------- Botões: cápsula turquesa com texto marinho ---------- */
.btn, :where(button[type="submit"]:not(.btn-link, .icon-btn, .toast-close)) {
  border-radius: 999px; padding: 8px 18px; font-weight: 700; color: var(--primary-ink); background: var(--primary-solid); border-color: var(--primary-solid);
}
.btn:hover, :where(button[type="submit"]:not(.btn-link, .icon-btn, .toast-close)):hover { color: var(--primary-ink); box-shadow: 0 6px 16px rgba(27, 220, 174, .32); }
.btn-small, button.btn-small { padding: 5px 13px; }
.btn-secondary, button.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover, button.btn-secondary:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--text); box-shadow: none; }
.btn-ghost, button.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover, button.btn-ghost:hover { box-shadow: none; color: var(--text); }
.btn-danger, button.btn-danger { color: var(--neg-text); background: var(--neg-soft); border-color: var(--neg-soft); }
.btn-danger:hover, button.btn-danger:hover { color: #fff; box-shadow: none; }
.btn-danger-solid, button.btn-danger-solid { color: #fff; background: var(--danger-solid); border-color: var(--danger-solid); }
.btn-danger-solid:hover, button.btn-danger-solid:hover { color: #fff; box-shadow: none; }
.icon-btn-primary, .topbar .icon-btn-primary { color: var(--primary-ink); }
.cal-day.today .d { color: var(--primary-ink); }
.customizer-head { background: var(--navy); color: #fff; }
.custom-swatch.brand { background: var(--navy); }
.nav-count { background: var(--mint); color: var(--primary-ink); }

/* ---------- Menu lateral: marinho, item ativo em turquesa ---------- */
.sidebar .nav-item { border-radius: 10px; margin: 1px 10px; }
.sidebar .nav-item.active { background: linear-gradient(90deg, rgba(27, 220, 174, .26), rgba(27, 220, 174, .1)); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 var(--sb-mark); }
.sidebar .nav-item.active .icon { color: var(--sb-mark); }
html.menu-collapsed .sidebar .nav-item { margin: 1px 6px; }
:root[data-sidebar="light"] .sidebar .nav-item.active { background: var(--primary-soft); color: var(--text); }
:root[data-sidebar="light"] .sidebar .nav-item.active .icon { color: var(--primary); }

/* ---------- Página pública: barra, início, cartões, rodapé ---------- */
.public-bar { background: color-mix(in srgb, var(--surface) 88%, transparent); border-bottom-color: transparent; box-shadow: 0 1px 0 rgba(11, 31, 58, .06); }

.hero { color: var(--text); padding: 64px 0 76px; }
.hero::before {
  inset: 0 auto 0 50%; width: 100vw; transform: translateX(-50%);          /* à largura da janela, para as faixas ficarem sempre no mesmo sítio */
  background:
    linear-gradient(112deg, transparent 0 60%, rgba(27, 220, 174, .14) 60% 69%, transparent 69%),
    linear-gradient(112deg, transparent 0 69%, #1bdcae 69% 80%, #0e9f94 80% 88%, #0b1f3a 88%),
    linear-gradient(180deg, #ffffff 0%, #eef7f8 100%);
}
.hero h1 { color: var(--text); font-size: 54px; letter-spacing: -.03em; word-spacing: .08em; line-height: 1.06; }
.hero h1 em { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--teal); display: block; }
.hero .lead { color: var(--text-2); font-size: 18px; max-width: 30em; }
.hero .muted { color: var(--muted); }
.hero .eyebrow { background: var(--primary-soft); color: var(--primary); }
.hero .btn:not(.btn-secondary) { background: var(--primary-solid); border-color: var(--primary-solid); color: var(--primary-ink); box-shadow: 0 10px 24px rgba(27, 220, 174, .35); }
.hero .btn:not(.btn-secondary):hover { background: var(--primary-solid-hover); border-color: var(--primary-solid-hover); color: var(--primary-ink); }
.hero .btn-secondary { background: #fff; border-color: var(--border-strong); color: var(--text); }
.hero .btn-secondary:hover { background: var(--surface-3); color: var(--text); }
.hero-actions .btn { padding: 13px 26px; font-size: 16px; }
.hero .mock { border: 0; border-radius: 18px; padding: 10px 10px 0; background: #fff; box-shadow: 0 30px 70px rgba(11, 31, 58, .28), 0 2px 6px rgba(11, 31, 58, .12); transform: perspective(1600px) rotateY(-9deg) rotateX(3deg); transform-origin: left center; }
.hero .mock img { border-radius: 10px 10px 0 0; }

.hero-points { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0 0 12px; padding: 26px 0 6px; list-style: none; }
.hero-points li { padding: 4px 28px; border-left: 1px solid var(--border); }
.hero-points li:first-child { border-left: 0; padding-left: 0; }
.hero-points .icon { width: 30px; height: 30px; color: var(--teal); margin-bottom: 10px; }
.hero-points strong { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.hero-points span { color: var(--text-2); }

.pillar-card, .feature { border-radius: var(--radius-lg); box-shadow: var(--shadow-card); border: 1px solid var(--border); }
.pillar-card:hover, .feature:hover { box-shadow: 0 12px 32px rgba(11, 31, 58, .1); }
.feature-icon { background: var(--primary-soft); color: var(--primary); border-radius: 14px; }
.public-content > .section-title::after { background: var(--mint); }
.tour-shot img, .tour-shot { border-radius: var(--radius-lg); }

.cta-panel { position: relative; overflow: hidden; border: 0; border-radius: 20px; text-align: left; padding: 40px 44px;
  background: linear-gradient(112deg, #0b1f3a 0 62%, #0e3a52 62% 74%, #0e7f86 74% 86%, #1bdcae 86%); color: #fff; }
.public-content .cta-panel h2 { color: #fff; margin: 0 0 6px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.cta-panel p { color: #c5d2e3; margin: 0 0 20px; font-size: 16px; }
.cta-panel .hero-actions { margin: 0 !important; justify-content: flex-start !important; }
.cta-panel .btn { background: var(--primary-solid); border-color: var(--primary-solid); color: var(--primary-ink); padding: 12px 24px; font-size: 15px; }
.cta-panel .btn:hover { background: #3fe3bd; border-color: #3fe3bd; }

/* entrar, registar, repor a palavra-passe: a faixa de topo em marinho com a diagonal turquesa */
.auth-wrap::before { background: linear-gradient(112deg, #0b1f3a 0 70%, #0e7f86 70% 84%, #1bdcae 84%); }
.auth-card { box-shadow: 0 20px 50px rgba(11, 31, 58, .16); }

.site-footer { background: var(--navy); color: #b9c6da; }
.site-footer .muted, .site-footer a { color: #b9c6da; }
.site-footer .brand-name span { color: inherit; }

/* ---------- Cartões, campos e pequenos componentes: cantos largos ---------- */
.panel, .card, .stat-card, .kpi { border-radius: var(--radius-lg); }
.kpi:hover { box-shadow: 0 10px 28px rgba(11, 31, 58, .1); }
.stat-icon { border-radius: 12px; }
input:not([type="checkbox"], [type="radio"], [type="range"]), select, textarea { border-radius: 10px; }
.pct-pill, .gain-pill, .badge, .chip { border-radius: 999px; }
.flash, .toast, .tx, .why-listed, .list-why, .yield-control { border-radius: 12px; }
.modal-box, .auth-card, .notif-panel, .apps-panel, .usermenu-panel, .topsearch-results, .chart-tooltip { border-radius: 14px; }
.auth-card .btn[type="submit"], .auth-card button[type="submit"] { border-radius: 999px; }
.usermenu-btn, .icon-btn, .page-btn, .cal-filters .cal-filter, .custom-option, .apps-grid a, .sidebar .abar-account, .sidebar .abar-menu { border-radius: 10px; }
.calendar, .heatmap { border-radius: 12px; }
.segmented { padding: 3px; gap: 2px; background: var(--surface-3); border: 0; border-radius: 999px; }
.segmented button, .segmented a { border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font-weight: 700; }
.segmented button:hover, .segmented a:hover { background: color-mix(in srgb, var(--mint) 22%, transparent); color: var(--text); }
.segmented button[aria-pressed="true"], .segmented a[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.segmented a:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

@media (max-width: 900px) {
  .hero h1 { font-size: 40px; }
  .hero::before { background: linear-gradient(112deg, transparent 0 82%, #1bdcae 82% 92%, #0b1f3a 92%), linear-gradient(180deg, #ffffff 0%, #e9f7f5 100%); }
  .hero .mock { transform: none; }
  .hero-points { grid-template-columns: repeat(2, 1fr); gap: 22px 0; }
  .hero-points li:nth-child(odd) { border-left: 0; padding-left: 0; }
  .cta-panel { background: linear-gradient(135deg, #0b1f3a 0 70%, #0e7f86 100%); padding: 30px 24px; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero::before { background: linear-gradient(112deg, transparent 0 69%, #1bdcae 69% 80%, #0e9f94 80% 88%, #0d2f52 88%), linear-gradient(180deg, #0a1d33 0%, #071526 100%); }
  :root:not([data-theme="light"]) .hero .btn-secondary { background: transparent; color: var(--text); }
  :root:not([data-theme="light"]) .hero .mock { background: var(--surface); }
}
:root[data-theme="dark"] .hero::before { background: linear-gradient(112deg, transparent 0 69%, #1bdcae 69% 80%, #0e9f94 80% 88%, #0d2f52 88%), linear-gradient(180deg, #0a1d33 0%, #071526 100%); }
:root[data-theme="dark"] .hero .btn-secondary { background: transparent; color: var(--text); }
:root[data-theme="dark"] .hero .mock { background: var(--surface); }

/* ---------- Aplicação: barra de topo, pesquisa e título da página (sem a faixa branca nem maiúsculas) ---------- */
.topbar { background: linear-gradient(112deg, var(--surface) 0 88%, rgba(27, 220, 174, .14) 88% 94%, rgba(14, 159, 148, .2) 94%); }
.topsearch input { height: 40px; border-radius: 999px; background: var(--surface-3); }
.titlebar { background: transparent; box-shadow: none; }
.titlebar-inner { padding-top: 20px; padding-bottom: 0; }
.titlebar h1 { font-size: 22px; font-weight: 800; text-transform: none; letter-spacing: -.02em; color: var(--text); }
.layout-app:has(.dash-hello) .titlebar h1, .layout-app:has(.inst-head) .titlebar h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.layout-app:has(.dash-hello) .titlebar-inner, .layout-app:has(.inst-head) .titlebar-inner { justify-content: flex-end; }

/* ---------- Painel: saudação, quatro cartões, gráfico ao lado da alocação, faixa das ideias ---------- */
.dash-hello { margin: -14px 0 20px; }
.dash-hello .hello { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; color: var(--text); }
.dash-hello .hello-sub { margin: 6px 0 0; font-size: 16px; color: var(--text-2); }
.dash-hello .hello-sub strong.positive, .dash-hello .hello-sub .icon { color: var(--pos-text); }
.dash-hello .hello-sub strong.negative { color: var(--neg-text); }
.dash-hello .subtitle { margin-top: 6px; font-size: 13px; }
.dash-hello ~ .kpi-grid, .div-head ~ .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.kpi { padding: 18px 20px; }
.kpi .stat-icon { width: 40px; height: 40px; border-radius: 12px; }
.kpi-label { font-weight: 700; color: var(--text-2); }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.dash-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; margin-bottom: 24px; align-items: stretch; }
.dash-top > .panel { margin-bottom: 0; min-width: 0; }
.dash-chart { display: flex; flex-direction: column; }
.dash-chart .chart-box { flex: 1; min-height: 300px; }
.dash-top .alloc-chart { height: 190px; }
.panel h2 { font-weight: 800; letter-spacing: -.01em; }
.dashboard-charts > .panel:has(.heatmap) { grid-column: 1 / -1; }
.promo-band { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; padding: 16px 22px; border-radius: var(--radius-lg); color: var(--text); text-decoration: none;
  background: linear-gradient(112deg, #e3f8f2 0 68%, #cdf3e8 68% 84%, #b2ecdc 84%); }
.promo-band:hover { text-decoration: none; box-shadow: 0 10px 28px rgba(11, 31, 58, .1); }
.promo-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #fff; color: var(--teal); }
.promo-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.promo-text strong { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.promo-text span { color: var(--text-2); font-size: 13.5px; }
.promo-go { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 999px; background: var(--navy); color: #fff; font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.promo-go .icon { width: 16px; height: 16px; }
@media (max-width: 1100px) { .dash-hello ~ .kpi-grid, .div-head ~ .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-top { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .dash-hello ~ .kpi-grid, .div-head ~ .kpi-grid { gap: 12px; } .dash-hello .hello { font-size: 24px; } .promo-band { flex-wrap: wrap; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .topbar { background: var(--surface); }
  :root:not([data-theme="light"]) .promo-band { background: linear-gradient(112deg, #0f2f3d 0 68%, #10424a 68% 84%, #0f5a59 84%); }
  :root:not([data-theme="light"]) .promo-icon { background: var(--surface); color: var(--mint); }
  :root:not([data-theme="light"]) .promo-go { background: var(--mint); color: var(--primary-ink); }
}
:root[data-theme="dark"] .topbar { background: var(--surface); }
:root[data-theme="dark"] .promo-band { background: linear-gradient(112deg, #0f2f3d 0 68%, #10424a 68% 84%, #0f5a59 84%); }
:root[data-theme="dark"] .promo-icon { background: var(--surface); color: var(--mint); }
:root[data-theme="dark"] .promo-go { background: var(--mint); color: var(--primary-ink); }

/* ---------- Página de um instrumento: cabeçalho com o preço em destaque e duas colunas (separadores | métricas e posição) ---------- */
.inst-head { align-items: center; gap: 20px 32px; margin: -6px 0 22px; }
.inst-id { display: flex; align-items: center; gap: 18px; min-width: 0; flex: 1 1 380px; }
.inst-logo { flex: none; display: grid; place-items: center; width: 84px; height: 84px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-card); border: 1px solid var(--border); }
.inst-logo .logo { width: 56px; height: 56px; border-radius: 12px; }
.inst-head h1.rich { display: block; margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; color: var(--text); }
.inst-symbol { font-weight: 600; color: var(--text-2); }
.inst-head .subtitle { margin: 4px 0 0; font-size: 15px; color: var(--text-2); }
.inst-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.inst-chips span { padding: 3px 11px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.inst-quote { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.inst-price { display: flex; flex-direction: column; gap: 2px; }
.inst-price strong { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; white-space: nowrap; }
.inst-price strong small { font-size: 17px; font-weight: 700; color: var(--text-2); letter-spacing: 0; }
.inst-change { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 700; }
.inst-change small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.inst-change.positive { color: var(--pos-text); }
.inst-change.negative { color: var(--neg-text); }
.inst-change.positive::before, .inst-change.negative::before { content: ""; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; }
.inst-change.positive::before { border-bottom: 7px solid currentColor; }
.inst-change.negative::before { border-top: 7px solid currentColor; }
.inst-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.inst-actions .btn { justify-content: center; padding: 10px 20px; }
.watch-btn[aria-pressed="true"] .icon { fill: var(--warn-fill, #f7b84b); color: var(--warn-fill, #f7b84b); }

.inst-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.inst-main { min-width: 0; }
.inst-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.inst-side .panel { margin: 0; }
.inst-side h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 16px; }
.inst-side h2 .icon { color: var(--teal); }
.kv { margin: 0; }
.kv > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--row-line); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--text-2); font-size: 13.5px; }
.kv dd { margin: 0; font-weight: 800; font-size: 14.5px; text-align: right; white-space: nowrap; word-spacing: normal; }
.kv dd small { font-weight: 600; font-size: 12px; }
.kv dd.positive { color: var(--pos-text); }
.kv dd.negative { color: var(--neg-text); }
.inst-metrics .stat-card { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; padding: 12px 0 0; border: 0; border-top: 1px solid var(--row-line); border-radius: 0; box-shadow: none; background: none; }
.inst-metrics .stat-card .stat-icon { display: none; }
.inst-metrics .stat-card .stat-value { font-size: 16px; font-weight: 800; }
.holding-band { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--radius-lg); background: linear-gradient(112deg, #e3f8f2 0 70%, #c7f2e6 70%); color: var(--text); }
.holding-band.is-down { background: linear-gradient(112deg, var(--neg-soft) 0 70%, color-mix(in srgb, var(--neg) 22%, var(--surface)) 70%); }
.holding-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #fff; color: var(--pos-text); }
.holding-band.is-down .holding-icon { color: var(--neg-text); }
.holding-band > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.holding-band strong { font-weight: 800; font-size: 15px; }
.holding-band span span { font-size: 13px; color: var(--text-2); }
@media (max-width: 1150px) { .inst-grid { grid-template-columns: minmax(0, 1fr); } .inst-side { order: -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
@media (max-width: 700px) { .inst-head h1.rich { font-size: 23px; } .inst-logo { width: 60px; height: 60px; border-radius: 16px; } .inst-logo .logo { width: 40px; height: 40px; } .inst-price strong { font-size: 28px; } .inst-actions { flex-direction: row; width: 100%; } .inst-actions .btn { flex: 1; } .inst-quote { width: 100%; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .holding-band { background: linear-gradient(112deg, #0f2f3d 0 70%, #10424a 70%); }
  :root:not([data-theme="light"]) .holding-band.is-down { background: var(--neg-soft); }
  :root:not([data-theme="light"]) .holding-icon { background: var(--surface); }
}
:root[data-theme="dark"] .holding-band { background: linear-gradient(112deg, #0f2f3d 0 70%, #10424a 70%); }
:root[data-theme="dark"] .holding-band.is-down { background: var(--neg-soft); }
:root[data-theme="dark"] .holding-icon { background: var(--surface); }

/* ---------- Dividendos: frase e botão no topo, quatro cartões, logótipos na tabela dos próximos dividendos ---------- */
.div-head { align-items: center; margin: -6px 0 20px; }
.page-lead { margin: 0; font-size: 16px; color: var(--text-2); }
.page-lead .icon { color: var(--teal); }
.div-head .subtitle { margin-top: 4px; font-size: 13px; }
.asset-cell { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.asset-cell .logo { flex: none; border-radius: 8px; }
@media (max-width: 700px) {
  .titlebar-inner { padding: 14px 16px 0; }
  .kpi { padding: 14px; gap: 10px; }
  .kpi .stat-icon { width: 34px; height: 34px; border-radius: 10px; }
  .kpi-value { font-size: 20px; }
  .kpi-label { font-size: 12.5px; }
}

/* ---------- Estrutura da aplicação como nos mockups: menu simples, cartão do utilizador ao fundo, barra de topo limpa, separadores do grupo ---------- */
.sidebar { display: flex; flex-direction: column; padding-bottom: 14px; }
.sidebar-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-top: 10px; gap: 4px; scrollbar-width: thin; }
.sidebar .nav-item { padding: 11px 14px; font-size: 14.5px; font-weight: 600; }
.sidebar .nav-item .icon { width: 19px; height: 19px; }
.sidebar-foot { flex: none; margin-top: 6px; padding-top: 8px; }
.sidebar-account { flex: none; margin: 10px 14px 0; }
.sidebar .abar-account.user-card { gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--sb-a); }
.sidebar .abar-account.user-card:hover { background: var(--sb-b); }
.user-card .avatar { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--mint); color: var(--primary-ink); font-weight: 800; font-size: 14px; }
.user-card .abar-account-text { display: flex; flex-direction: column; min-width: 0; text-align: left; line-height: 1.25; }
.user-card .abar-account-text strong { color: var(--sb-strong); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .abar-label { font-size: 11.5px; text-transform: none; letter-spacing: 0; color: var(--sidebar-caption); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .abar-caret { margin-left: auto; }
html.menu-collapsed .user-card .abar-account-text, html.menu-collapsed .user-card .abar-caret { display: none; }
html.menu-collapsed .sidebar-account { margin: 10px 8px 0; }
html.menu-collapsed .sidebar .abar-account.user-card { padding: 6px; justify-content: center; background: none; }

.topbar .abar-stats, .topbar .appsmenu, .topbar .theme-toggle { display: none; }
.topbar .topsearch { max-width: 520px; }
.topbar-right { margin-left: auto; }

.section-tabs { gap: 6px; margin: -4px 0 20px; border-bottom: 1px solid var(--border); }
.section-tabs .tab { padding: 10px 14px; font-size: 14.5px; font-weight: 700; color: var(--text-2); }
.section-tabs .tab:hover { color: var(--text); }
.section-tabs .tab.active { color: var(--text); border-bottom: 3px solid var(--mint); }
@media (max-width: 700px) { .sidebar { padding-bottom: 74px; } }   /* (o cartão do utilizador fica acima da barra de baixo do telemóvel) */
.inst-metrics .stat-card > * { width: 100%; }
.inst-metrics .stat-card .range-slim { display: block; box-sizing: border-box; }

/* ---------- Painel, segunda volta: período no topo, minigráficos de barras, cartões da fila de cima à mesma altura, ligação para a análise ---------- */
.dash-hello { align-items: flex-end; }
.dash-hello .page-actions { margin-bottom: 4px; }
.kpi-bars rect { fill: var(--mint); }
.kpi-bars rect.is-empty { fill: var(--surface-3); }
.dash-top .split-card { display: flex; flex-direction: column; }
.dash-top .split-card .alloc-list { margin-top: auto; }
.dash-more { margin: 0 0 24px; text-align: center; }
.dash-more .btn { padding: 10px 20px; }

/* ---------- Instrumento, segunda volta: tipo de gráfico, cartões por baixo do gráfico (dividendos | a tua posição), peso na carteira ---------- */
.chart-style button { padding: 5px 12px; font-size: 12.5px; }
.chart-bar .chart-style { margin-left: auto; }
.chart-tools-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.inst-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-bottom: 24px; align-items: start; }
.inst-cards > .panel { margin: 0; min-width: 0; }
.inst-cards h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 16px; }
.inst-cards h2 .icon { color: var(--teal); }
.div-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 14px; }
.div-facts > div { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.div-facts strong { font-size: 18px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.div-years { height: 170px; }
.inst-cards .small-heading, .inst-side .small-heading { margin: 14px 0 6px; font-size: 13px; font-weight: 800; color: var(--text-2); }
.order-mini { list-style: none; margin: 0; padding: 0; }
.order-mini li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--row-line); font-size: 13px; }
.order-mini li:last-child { border-bottom: 0; }
.order-mini span { color: var(--text-2); }
.order-mini strong { font-weight: 700; white-space: nowrap; word-spacing: normal; }
.order-mini strong.negative { color: var(--neg-text); }
.inst-side .split-card .alloc-chart { height: 170px; }
.promo-small { margin: 0; padding: 14px 16px; gap: 12px; }
.promo-small .promo-icon { width: 38px; height: 38px; }
.promo-small .promo-text strong { font-size: 15px; }

/* ---------- Dividendos, segunda volta: evolução por ano e tabela dos próximos dividendos mais curta ---------- */
.div-evolution .chart-box { height: 300px; }
.cell-sub { display: block; margin-top: 2px; font-weight: 500; }
#upcoming .asset-cell .logo { width: 32px; height: 32px; }
#upcoming td { padding-top: 11px; padding-bottom: 11px; }
.table-more { margin: 12px 0 0; text-align: right; font-weight: 700; }
.table-more a { color: var(--primary); text-decoration: none; }
.table-more a:hover { text-decoration: underline; }

/* ---------- Gráficos como nos mockups: etiqueta do valor, balões em marinho, paleta das fatias ---------- */
:root { --tag-bg: #0b1f3a; --tag-ink: #ffffff;
  --c1: #0ea596; --c2: #0b3f66; --c3: #2f9be0; --c4: #a9b6c8; --c5: #7fe3cf; --c6: #6c63d9; --c7: #ef8a3c; --c8: #f7b84b; --c9: #f06548; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --tag-bg: #1bdcae; --tag-ink: #06263d; --c1: #2fd9c0; --c2: #6fa8e0; --c3: #4fb3f0; --c4: #6f819b; --c5: #9eeedd; }
}
:root[data-theme="dark"] { --tag-bg: #1bdcae; --tag-ink: #06263d; --c1: #2fd9c0; --c2: #6fa8e0; --c3: #4fb3f0; --c4: #6f819b; --c5: #9eeedd; }
.chart-tooltip { min-width: 160px; padding: 0; border: 0; background: var(--navy); color: #fff; box-shadow: 0 12px 30px rgba(11, 31, 58, .3); overflow: hidden; }
.chart-tooltip .tt-title { margin: 0; padding: 8px 12px 4px; background: none; color: rgba(255, 255, 255, .72); font-weight: 700; font-size: 11.5px; }
.chart-tooltip .tt-row { padding: 3px 12px; }
.chart-tooltip .tt-row:last-child { padding-bottom: 9px; }
.chart-tooltip .tt-value { color: #fff; font-weight: 800; }
.chart-tooltip .tt-label { color: rgba(255, 255, 255, .7); }
.chart-tooltip .tt-key { width: 9px; height: 9px; border-radius: 50%; }
.price-chart .tt-box, .timeline-tip.tt-box { background: var(--navy); border: 0; color: #fff; border-radius: 12px; box-shadow: 0 12px 30px rgba(11, 31, 58, .3); }
.price-chart .tt-box .muted, .timeline-tip .muted { color: rgba(255, 255, 255, .7); }
:root[data-theme="dark"] .chart-tooltip, :root[data-theme="dark"] .price-chart .tt-box { background: #17324f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chart-tooltip, :root:not([data-theme="light"]) .price-chart .tt-box { background: #17324f; } }

/* ---------- Página inicial, segunda volta: slogan, «Learn more», portátil, bloco do companheiro, faixa final e rodapé com colunas ---------- */
.hero h1 { font-size: 60px; }
.hero-actions { align-items: center; gap: 18px; }
.hero-more { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; }
.hero-more:hover { text-decoration: none; color: var(--teal); }
.hero-more-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--teal); color: var(--teal); }
.hero-more-icon .icon { width: 18px; height: 18px; }
.laptop { position: relative; min-width: 0; transform: perspective(1700px) rotateY(-10deg) rotateX(4deg); transform-origin: left center; filter: drop-shadow(0 30px 50px rgba(11, 31, 58, .32)); }
.laptop-screen { padding: 12px 12px 14px; border-radius: 20px 20px 6px 6px; background: linear-gradient(180deg, #13294a, #0b1f3a); }
.laptop-screen img { display: block; width: 100%; height: auto; border-radius: 8px; }
.laptop-base { height: 16px; margin: 0 -5%; border-radius: 0 0 22px 22px; background: linear-gradient(180deg, #d9e1ea, #aebccc); }
.laptop-base::before { content: ""; display: block; width: 16%; height: 6px; margin: 0 auto; border-radius: 0 0 8px 8px; background: #95a5b8; }

.companion { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 40px; align-items: center; margin: 36px 0 56px; }
.companion-text h2 { margin: 0 0 12px; font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.companion-text p { margin: 0 0 22px; font-size: 16.5px; color: var(--text-2); max-width: 32em; }
.companion-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.companion-cards article { display: flex; flex-direction: column; gap: 6px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.companion-cards .feature-icon { width: 42px; height: 42px; margin-bottom: 6px; display: grid; place-items: center; }
.companion-cards strong { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.companion-cards article > span:last-child { color: var(--text-2); font-size: 14px; }

.site-footer { padding: 6px 0 0; }
.footer-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 28px; align-items: start; padding-top: 34px; padding-bottom: 26px; }
.footer-brand p { margin: 10px 0 0; color: #dbe5f1; font-weight: 600; }
.footer-brand p.muted { color: #93a4bd; font-weight: 500; }
.footer-cols nav { display: flex; flex-direction: column; gap: 9px; }
.footer-cols nav h2 { margin: 0 0 4px; font-size: 14px; font-weight: 800; color: #fff; letter-spacing: 0; }
.site-footer .footer-cols nav a { color: #b9c6da; text-decoration: none; font-size: 13.5px; }
.site-footer .footer-cols nav a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { justify-content: space-between; padding-top: 16px; padding-bottom: 20px; border-top: 1px solid rgba(255, 255, 255, .1); color: #93a4bd; font-size: 12.5px; }
@media (max-width: 900px) {
  .hero h1 { font-size: 42px; }
  .laptop { transform: none; }
  .companion { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) { .companion-cards { grid-template-columns: minmax(0, 1fr); } .footer-cols { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Páginas públicas com o título como na aplicação: sem faixa branca nem maiúsculas ---------- */
.public-titlebar { margin: -8px 0 18px; background: transparent; clip-path: none; }
.public-titlebar::before { display: none; }
.public-titlebar-inner { padding: 18px 0 0; align-items: flex-end; }
.public-titlebar h1 { font-size: 30px; font-weight: 800; text-transform: none; letter-spacing: -.03em; color: var(--text); line-height: 1.15; }
.public-titlebar-title { font-size: 13px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--muted); }
.public-titlebar .crumbs ol { padding-bottom: 6px; }
@media (max-width: 700px) { .public-titlebar h1 { font-size: 24px; } }
.public-titlebar-title { display: none; }                                   /* (a página do instrumento já tem o nome no cabeçalho dela: só ficam as migalhas) */
.public-titlebar-inner:not(:has(h1)) { justify-content: flex-end; padding-top: 8px; }
@media (max-width: 700px) { .public-titlebar .crumbs { display: none; } }   /* (no telemóvel as migalhas partiam-se em duas linhas por baixo do título) */
