/* Visual formal do Habblit (Inter no texto, IBM Plex Mono nos números): era o da página /economia; agora é usado por
   /valores (local/valores/) e /wiki (local/wiki.mjs). Mesma marca do site (azul Habblit, marinho, verde-limão), sem a
   fonte pixel. Vale dentro de body.eco-page: os tokens do design system são trocados só ali. */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/ds/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("/ds/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/ds/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700 800; font-display: swap; src: url("/ds/fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400 700; font-display: swap; src: url("/ds/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

/* ---------- Tokens da página (sobrepõem os do design system só aqui) ---------- */
body.eco-page {
    --eco-top: 64px; --eco-navh: 52px;
    --eco-bg: #f3f5fa; --eco-card: #ffffff; --eco-line: #e3e8f1; --eco-line-2: #eef1f6; --eco-ink: #0b1840; --eco-muted: #5d6578; --eco-faint: #8a93a6;
    --eco-head: #f7f9fc; --eco-shadow: 0 1px 2px #0b18400d, 0 6px 20px #0b18400a; --eco-r: 12px; --eco-r-sm: 8px;
    --ds-font: "Inter", "Segoe UI", system-ui, sans-serif;
    --ds-display: "Inter", "Segoe UI", system-ui, sans-serif;
    --ds-font-display: "Inter", "Segoe UI", system-ui, sans-serif;
    --ds-pixel: "Inter", "Segoe UI", system-ui, sans-serif;
    --ds-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
    --ds-radius: var(--eco-r); --ds-radius-sm: var(--eco-r-sm);
    --ds-raised: 0 0 0 0 transparent; --ds-sunken: 0 0 0 0 transparent;
    --ds-outline: 0 0 0 1px var(--eco-line); --ds-shadow: var(--eco-shadow); --ds-shadow-lg: var(--eco-shadow);
    --ds-surface-muted: #ffffff; --ds-border: #d5dbe7; --ds-border-soft: var(--eco-line-2);
    margin: 0; min-height: 100vh; background: var(--eco-bg); color: #1d2433;
    font: 400 14px/1.5 var(--ds-font); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
html:has(body.eco-page) { background: #f3f5fa; }
#eco-app { min-height: 100vh; display: flex; flex-direction: column; }
#eco-app > *, .eco-body > * { min-width: 0; }
.eco-page :is(b, strong) { font-weight: 600; }

/* ---------- Topo: marinho da marca, mascote do Habblit e a cotação ao vivo ---------- */
.eco-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1.25rem; height: var(--eco-top); padding: 0 1.25rem;
    background: var(--eco-ink); border-bottom: 3px solid var(--ds-brand); }
.eco-brand { display: flex; align-items: center; gap: .65rem; color: #fff; text-decoration: none; flex: none; }
.eco-brand img { display: block; height: 36px; width: auto; object-fit: contain; image-rendering: pixelated; }   /* logo 800x370: só a altura manda */
.eco-brand em { font: 600 .72rem var(--ds-font); font-style: normal; color: var(--eco-ink); background: var(--ds-lime); padding: .12rem .45rem; border-radius: 4px; letter-spacing: .08em; text-transform: uppercase; }
.eco-quote { display: flex; align-items: baseline; gap: .6rem; margin-left: auto; padding: .35rem .8rem; color: #fff; border-left: 1px solid #ffffff26; }
.eco-quote:empty { display: none; }
.eco-quote:empty + .eco-exits { margin-left: auto; }   /* sem cotação (sem sessão): botões continuam à direita */
.eco-quote .hb-eco-tick { align-self: center; }
.eco-quote b { font: 500 1.15rem var(--ds-mono); letter-spacing: -.01em; }
.eco-quote small { color: #ffffff99; font-size: .72rem; }
.eco-quote .hb-xc-pct { font: 500 .85rem var(--ds-mono); }
.eco-quote .hb-xc-pct.is-up { color: #4be37a; } .eco-quote .hb-xc-pct.is-down { color: #ff6b81; }
.eco-exits { display: flex; gap: .45rem; flex: none; }
.eco-top .eco-exits .ds-btn { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px #ffffff40; }
.eco-top .eco-exits .ds-btn:hover { background: #ffffff14; filter: none; }
.eco-top .eco-exits .ds-btn.is-primary { background: var(--ds-brand); box-shadow: none; }
.eco-top .eco-exits .ds-btn.is-primary:hover { background: #2a5fe6; }

/* ---------- Menu horizontal (fixo abaixo do topo) + seção ---------- */
.eco-navbar { position: sticky; top: var(--eco-top); z-index: 15; background: #ffffffeb; backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--eco-line); box-shadow: 0 6px 18px #0b18400a; }
.eco-nav { display: flex; align-items: stretch; gap: 2px; max-width: 1440px; height: var(--eco-navh); margin: 0 auto; padding: 0 1.25rem; box-sizing: border-box;
    overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.eco-nav::-webkit-scrollbar { display: none; }
.eco-nav a { position: relative; flex: none; display: flex; align-items: center; gap: .5rem; padding: 0 .85rem; color: #4a5468; text-decoration: none; font-weight: 500; font-size: .88rem;
    white-space: nowrap; transition: color .18s, background-color .18s; }
.eco-nav a .ds-icon { width: 17px; height: 17px; flex: none; color: var(--eco-faint); transition: color .18s, transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.eco-nav a:hover { color: var(--eco-ink); background: var(--eco-head); }
.eco-nav a:hover .ds-icon { transform: translateY(-2px); color: var(--ds-brand); }
.eco-nav a.is-active { color: var(--ds-brand-strong); font-weight: 600; }
.eco-nav a.is-active .ds-icon { color: var(--ds-brand); }
.eco-nav a::after { content: ""; position: absolute; left: .7rem; right: .7rem; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--ds-brand); transform: scaleX(0); transition: transform .28s cubic-bezier(.2, .9, .3, 1.2); }
.eco-nav a.is-active::after { transform: scaleX(1); }
.eco-nav a:focus-visible, .eco-card:focus-visible { outline: 2px solid var(--ds-brand); outline-offset: -4px; border-radius: 8px; }
.eco-body { flex: 1; display: block; width: 100%; max-width: 1440px; margin: 0 auto; padding: 1.5rem 1.25rem; box-sizing: border-box; }
.eco-main { min-width: 0; outline: none; }
/* Espaço igual entre todos os blocos da seção (nada colado) */
.eco-main > * + *, #ecop > * + * { margin-top: 1.25rem; }
.eco-main > .eco-title + * { margin-top: 0; }
.eco-title { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin: 0 0 1.25rem; font: 700 1.6rem/1.2 var(--ds-font); letter-spacing: -.02em; color: var(--eco-ink); }
.eco-title .ds-icon { width: 26px; height: 26px; color: var(--ds-brand); }
.eco-title small { flex-basis: 100%; font: 400 .92rem var(--ds-font); letter-spacing: 0; color: var(--eco-muted); }
.eco-foot { width: 100%; max-width: 1440px; margin: 0 auto; padding: 1rem 1.25rem 2rem; box-sizing: border-box; font-size: .78rem; color: var(--eco-faint); text-align: center; border-top: 1px solid var(--eco-line); }
.eco-loading { padding: 2rem; text-align: center; color: var(--eco-muted); }
.eco-login { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 2.5rem; background: var(--eco-card); border: 1px solid var(--eco-line); border-radius: var(--eco-r); box-shadow: var(--eco-shadow); }
.eco-page .hb-grid, .eco-page .hb-stack { gap: 1.25rem; }

/* ---------- Módulos: cartão branco com cabeçalho discreto (sem a barra de janela retrô) ---------- */
.eco-page .ds-module { padding: 0; overflow: hidden; background: var(--eco-card); border-radius: var(--eco-r); box-shadow: 0 0 0 1px var(--eco-line), var(--eco-shadow); animation: none; }
.eco-page .ds-module-header, .eco-page .ds-module.is-light .ds-module-header { min-height: 52px; background: var(--eco-card); border-radius: 0; border-bottom: 1px solid var(--eco-line-2); }
.eco-page .ds-module-header::after { display: none; }
.eco-page .ds-module-icon { width: 48px; flex-basis: 48px; color: var(--ds-brand); }
.eco-page .ds-module-icon .ds-icon { width: 18px; height: 18px; }
.eco-page .ds-module-title { font: 600 .95rem/1.25 var(--ds-font); color: var(--eco-ink); text-shadow: none; letter-spacing: -.005em; }
.eco-page .ds-module-subtitle { font-size: .78rem; color: var(--eco-muted); font-weight: 400; }
.eco-page .ds-module-body { background: var(--eco-card); padding: 1.1rem 1.15rem 1.15rem; }
.eco-page .ds-module-body.is-flush { padding: 0; }

/* Números: monoespaçada e alinhada, como em corretora */
.eco-page .ds-stats { gap: .75rem; }
.eco-page .ds-stat { background: var(--eco-head); border-radius: var(--eco-r-sm); box-shadow: inset 0 0 0 1px var(--eco-line-2); padding: .75rem .85rem; }
.eco-page .ds-stat b { font: 600 1.3rem/1.15 var(--ds-mono); color: var(--eco-ink); letter-spacing: -.02em; }
.eco-page .ds-stat span { color: var(--eco-muted); }
.eco-page .hb-xc-hbd-p b, .eco-page .hb-xc-asset-p b, .eco-page .hb-econ-head b, .eco-page .hb-eco-big { font-family: var(--ds-mono); font-weight: 500; letter-spacing: -.03em; color: var(--eco-ink); }
.eco-page .hb-eco-big.is-good { color: #12a03c; } .eco-page .hb-eco-big.is-warn { color: #b77d00; } .eco-page .hb-eco-big.is-bad { color: #d0303b; }
.eco-page .hb-xc-pct, .eco-page .hb-xc-price, .eco-page .ds-num { font-family: var(--ds-mono); font-weight: 500; font-style: normal; }
.eco-page .hb-eco-tick { font: 600 10px/1.2 var(--ds-mono); letter-spacing: .06em; padding: 3px 6px; border-radius: 4px; background: var(--ds-brand); color: #fff; }
.eco-page .hb-xc-hbd-stats small, .eco-page .hb-xc-today small { font-weight: 500; letter-spacing: .04em; color: var(--eco-faint); }

/* Botões, campos, abas e filtros: planos, com linha fina */
.eco-page .ds-btn { font: 500 .85rem/1 var(--ds-font); border-radius: var(--eco-r-sm); background: #fff; color: var(--eco-ink); box-shadow: inset 0 0 0 1px #d5dbe7; transform: none; }
.eco-page .ds-btn:hover { background: var(--eco-head); filter: none; }
.eco-page .ds-btn:active { box-shadow: inset 0 0 0 1px #b9c2d4; transform: none; }
.eco-page .ds-btn.is-primary, .eco-page .ds-btn-primary { background: var(--ds-brand); color: #fff; text-shadow: none; box-shadow: none; }
.eco-page .ds-btn.is-primary:hover, .eco-page .ds-btn-primary:hover { background: #2a5fe6; }
.eco-page .ds-input, .eco-page .ds-select { border-radius: var(--eco-r-sm); box-shadow: inset 0 0 0 1px #d5dbe7; padding: .55rem .7rem; font-family: var(--ds-font); }
.eco-page .ds-input:focus, .eco-page .ds-select:focus { box-shadow: inset 0 0 0 1px var(--ds-brand), 0 0 0 3px #1f4fd826; }
.eco-page .ds-label { font: 500 .78rem var(--ds-font); color: var(--eco-muted); }
.eco-page .ds-badge { font-family: var(--ds-font); border-radius: 999px; box-shadow: none; }
.eco-page .hb-xc-seg { border-radius: var(--eco-r-sm); background: var(--eco-head); box-shadow: inset 0 0 0 1px var(--eco-line); }
.eco-page .hb-xc-seg button { font: 500 12px var(--ds-font); border-radius: 6px; color: var(--eco-muted); box-shadow: none; }
.eco-page .hb-xc-seg button.is-on { background: var(--eco-ink); color: #fff; box-shadow: none; }
.eco-page .hb-xc-chip { font: 500 12px var(--ds-font); border-radius: 999px; background: #fff; color: #3a4357; box-shadow: inset 0 0 0 1px #d5dbe7; }
.eco-page .hb-xc-chip:hover { background: var(--eco-head); }
.eco-page .hb-xc-chip.is-on { background: var(--eco-ink); color: #fff; box-shadow: none; }
.eco-page .hb-xc-more-filters summary { font-weight: 500; color: #3a4357; }

/* Tabelas: cabeçalho em versalete, linhas finas */
.eco-page .ds-table-wrap { border-radius: var(--eco-r-sm); box-shadow: inset 0 0 0 1px var(--eco-line); }
.eco-page .ds-table th { font: 600 .7rem var(--ds-font); letter-spacing: .05em; text-transform: uppercase; color: var(--eco-faint); background: var(--eco-head); box-shadow: inset 0 -1px 0 var(--eco-line); padding: .6rem .8rem; }
.eco-page .ds-table td { border-top: 1px solid var(--eco-line-2); padding: .6rem .8rem; }
.eco-page .ds-table tbody tr:hover { background: #f5f8fe; }

