/* Fatyx — tokens e componentes (by WJSOMA) */
:root {
  --bg: #0E1318;
  --bg-elev: #11171D;
  --surface: #151C23;
  --surface-sunken: #0F151B;
  --surface-hover: #1C2630;
  --border: #222C36;
  --border-soft: #1B242D;
  --border-strong: #2F3B47;
  --grid: #1A232C;

  --text: #E6EDF3;
  --text-strong: #F2F6FA;
  --text-2: #C9D4DE;
  --text-3: #B6C2CE;
  --text-muted: #8E9BA8;

  --brand: #2E8F77;
  --brand-strong: #1F6F5C;
  --brand-ink: #F4FFFB;

  --up: #3CC99A;
  --up-text: #7FE0B8;
  --up-bg: #13261F;
  --down: #F0874A;
  --down-text: #F7A877;
  --down-bg: #2A1A12;
  --warn-text: #E8D9A0;
  --warn-bg: #1A1A12;
  --warn-border: #3A3519;
  --link: #7CC4FF;
  --link-hover: #B3DCFF;
  --focus: #7CC4FF;

  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 50; padding: 10px 14px; background: var(--brand); color: var(--brand-ink); border-radius: var(--r-sm); text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }
.wrap { max-width: 1360px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
@media (max-width: 640px) { .wrap { padding-left: 16px; padding-right: 16px; } }

/* Header */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg-elev) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand b { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-strong); }
.brand small { font-size: 12px; color: var(--text-muted); }
.nav { display: flex; gap: 4px; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
.nav a { padding: 10px 14px; border-radius: var(--r-sm); color: var(--text-3); text-decoration: none; white-space: nowrap; }
.nav a:hover { background: var(--surface-hover); color: var(--text-strong); }
.nav a[aria-current="true"] { background: var(--surface-hover); color: var(--text-strong); font-weight: 600; }
.userbox { display: flex; align-items: center; gap: 12px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill--ok { background: var(--up-bg); color: var(--up-text); }
.pill--ok::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--up); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-strong); color: #EAFBF4; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.userbox a { color: var(--text-3); font-size: 14px; }
@media (max-width: 720px) {
  .topbar .wrap { gap: 8px 12px; }
  .nav { order: 3; flex-basis: 100%; }
  .userbox { margin-left: auto; }
  .pill--ok span { display: none; }
}

.disclaimer { background: var(--warn-bg); border-bottom: 1px solid var(--warn-border); }
.disclaimer p { margin: 0; padding-top: 10px; padding-bottom: 10px; font-size: 13px; color: var(--warn-text); }

/* Layout */
main { padding-top: 28px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 28px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.page-head p { margin: 4px 0 0; color: var(--text-muted); font-size: 14px; }
.sample-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px dashed var(--border-strong); color: var(--warn-text); font-size: 12px; font-weight: 600; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; min-width: 0; }
.card h2 { margin: 0; font-size: 17px; font-weight: 600; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-head p { margin: 2px 0 0; font-size: 13px; color: var(--text-muted); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.section-head span { font-size: 13px; color: var(--text-muted); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1080px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* Tickers */
.tickers { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.ticker { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
.ticker-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ticker h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-2); }
.ticker h3 span { color: var(--text-muted); font-weight: 400; }
.chg { font-family: var(--mono); font-size: 13px; padding: 2px 8px; border-radius: 6px; }
.chg--up { color: var(--up-text); background: var(--up-bg); }
.chg--down { color: var(--down-text); background: var(--down-bg); }
.price { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 30px; font-weight: 600; letter-spacing: -0.02em; color: var(--text-strong); }
.range { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-muted); }
.range-bar { position: relative; height: 4px; border-radius: 2px; background: var(--border); }
.range-bar i { position: absolute; top: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--text-strong); border: 2px solid var(--surface); transform: translateY(-50%); }
.range-labels { display: flex; justify-content: space-between; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.range-labels b { color: var(--text-2); font-weight: 500; }
.prov { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.prov .st { color: var(--warn-text); }

/* Segmented control */
.seg { display: flex; gap: 4px; background: var(--surface-sunken); padding: 4px; border-radius: var(--r-md); }
.seg button { min-width: 52px; min-height: 36px; border: 0; border-radius: var(--r-sm); background: transparent; color: #9AA7B4; font: 500 13px var(--sans); cursor: pointer; }
.seg button[aria-pressed="true"] { background: #25313C; color: var(--text-strong); }
.seg button[aria-disabled="true"] { color: #5B6773; cursor: not-allowed; }

/* Chart */
.readout { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; padding: 10px 12px; margin-bottom: 10px; border-radius: var(--r-md); background: var(--surface-sunken); font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-muted); min-height: 41px; }
.readout .t { color: var(--text-strong); font-weight: 600; }
.readout strong { font-weight: 500; }
.readout .is-up { color: var(--up-text); }
.readout .is-down { color: var(--down-text); }
.chart-box { position: relative; width: 100%; height: 400px; touch-action: pan-y; }
.chart-box svg { display: block; width: 100%; height: 100%; cursor: crosshair; }
.chart-box svg:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; font-size: 13px; color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
@media (max-width: 640px) { .chart-box { height: 320px; } }

/* Perfis */
.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.tabs button { min-height: 44px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-sunken); color: var(--text-3); font: 600 14px var(--sans); cursor: pointer; }
.tabs button:hover { border-color: var(--border-strong); color: var(--text-strong); }
.tabs button[aria-selected="true"] { background: var(--brand-strong); border-color: var(--brand); color: #EAFBF4; }
.tabpanel { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.tabpanel p { margin: 0; color: var(--text-2); }
.facts { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; font-size: 14px; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; }
.note { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-sunken); font-size: 13px; color: var(--text-muted) !important; }
.risk { display: flex; gap: 4px; }
.risk i { flex: 1; height: 6px; border-radius: 3px; background: var(--border); }
.risk i.on { background: var(--brand); }

/* Alertas */
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px 20px; border: 1px dashed var(--border-strong); border-radius: var(--r-lg); color: var(--text-3); font-size: 14px; }
.empty b { color: var(--text-strong); font-size: 15px; }
details.example { margin-top: 12px; }
details.example > summary { cursor: pointer; color: var(--link); font-size: 14px; padding: 6px 0; }
.alert { margin-top: 10px; display: flex; flex-direction: column; gap: 14px; border-style: dashed; border-color: #36424E; }
.alert-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sev { padding: 4px 10px; border-radius: 999px; background: #2A2113; color: #F4C77B; font-size: 12px; font-weight: 600; }
.alert h3 { margin: 0; font-size: 18px; font-weight: 600; }
.alert p { margin: 0; color: var(--text-3); font-size: 14px; }
.scenarios { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.scenarios div { background: var(--surface-sunken); border-radius: var(--r-md); padding: 14px; }
.scenarios h4 { margin: 0 0 6px; font-size: 14px; }
.scenarios p { font-size: 13px; }
.alert .foot { font-family: var(--mono); font-size: 12px; color: var(--text-muted); }

/* Tabela */
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid var(--border-soft); }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.badge { padding: 3px 10px; border-radius: 999px; background: var(--surface-hover); color: var(--text-3); font-size: 12px; white-space: nowrap; }

footer.site { border-top: 1px solid var(--border); padding: 20px 24px; text-align: center; font-size: 12px; color: var(--text-muted); }

/* Login */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth main { width: 100%; max-width: 420px; padding: 0; gap: 28px; }
.auth .logo { display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; }
.auth .logo b { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; color: var(--text-strong); }
.auth .logo span { font-size: 13px; color: var(--text-muted); }
.auth form { display: flex; flex-direction: column; gap: 18px; padding: 28px; }
.auth h1 { margin: 0; font-size: 22px; font-weight: 700; }
.auth p { margin: 0; font-size: 14px; color: var(--text-3); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input { min-height: 48px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface-sunken); color: var(--text-strong); font: 400 16px var(--sans); }
.field input:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.field input[aria-invalid="true"] { border-color: var(--down); }
.field .err { font-size: 13px; color: var(--down-text); min-height: 1em; }
.btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--r-md); background: var(--brand); color: var(--brand-ink); font: 600 15px var(--sans); cursor: pointer; text-decoration: none; }
.btn:hover { background: #33A085; }
.btn[disabled] { opacity: .6; cursor: progress; }
.success { padding: 14px; border-radius: var(--r-md); background: var(--up-bg); color: var(--up-text); font-size: 14px; }
.small { font-size: 12px !important; color: var(--text-muted) !important; text-align: center; }

/* ===== Fase 2: dados reais ===== */
.ticker { text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s; }
.ticker:hover { border-color: var(--border-strong); }
.ticker[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.ticker.is-stale { opacity: .6; }
.ticker .px2 { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--text-3); }
.prov b { color: var(--text-2); font-weight: 500; font-family: var(--mono); }
.age-ok { color: var(--up-text); }
.age-warn { color: var(--warn-text); }
.age-bad { color: var(--down-text); }
.pill--warn { background: #2A2113; color: #F4C77B; }
.pill--warn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #F4C77B; }
.pill--bad { background: var(--down-bg); color: var(--down-text); }
.pill--bad::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--down); }
.seg { flex-wrap: wrap; }
.seg button { min-width: 44px; padding: 0 10px; }
.seg .sep { width: 1px; background: var(--border-strong); margin: 6px 2px; }
.chart-sym { display: flex; gap: 6px; flex-wrap: wrap; }
.loading { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); font-size: 14px; }

/* Análise */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface-sunken); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat span { font-size: 12px; color: var(--text-muted); }
.stat b { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 600; color: var(--text-strong); }
.stat small { font-size: 12px; color: var(--text-muted); font-family: var(--mono); }
.compare { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; margin-top: 18px; align-items: start; }
@media (max-width: 900px) { .compare { grid-template-columns: minmax(0, 1fr); } }
.compare-chart { height: 220px; }
.compare-chart svg { display: block; width: 100%; height: 100%; }
.series-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); margin-bottom: 8px; }
.series-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
table.mini { min-width: 0; font-size: 13px; }
table.mini th, table.mini td { padding: 8px 6px; }
.fine { font-size: 12px; color: var(--text-muted); margin: 12px 0 0; }

/* Alertas reais */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-sunken); color: var(--text-3); font: 500 13px var(--sans); cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--surface-hover); color: var(--text-strong); border-color: var(--border-strong); }
.alert-list { display: flex; flex-direction: column; gap: 12px; }
.alert-list .alert { margin-top: 0; border-style: solid; border-color: var(--border); }
.sev--forte { background: var(--down-bg); color: var(--down-text); }
.sev--estudo { background: #1E1A2E; color: #C6B5FF; }
.sev--aviso { background: var(--surface-hover); color: var(--text-2); }
.dir-alta { color: var(--up-text); }
.dir-queda { color: var(--down-text); }
.checks { display: flex; gap: 8px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; }
.checks span { padding: 3px 8px; border-radius: 6px; background: var(--surface-sunken); }

/* Conta */
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-row .field { flex: 1 1 200px; }
.field select { min-height: 48px; padding: 0 12px; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface-sunken); color: var(--text-strong); font: 400 15px var(--sans); }
.btn--ghost { background: transparent; border: 1px solid var(--border-strong); color: var(--text-strong); padding: 0 16px; }
.btn--ghost:hover { background: var(--surface-hover); }
.btn--sm { min-height: 40px; font-size: 14px; padding: 0 14px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; padding: 12px 16px; border-radius: var(--r-md); background: #25313C; color: var(--text-strong); font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); max-width: calc(100% - 32px); }
.gate { min-height: 60vh; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--text-3); }

[hidden] { display: none !important; }

/* ===== Áreas: Mundo, Radar, Notícias, APIs ===== */
.view { display: flex; flex-direction: column; gap: 28px; }
.clock { font-size: 15px; color: var(--text-2); padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; }
.notice { padding: 14px 16px; border-radius: var(--r-md); background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text); font-size: 14px; }
.notice b { color: #F5E7B5; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.map-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .map-wrap { grid-template-columns: minmax(0, 1fr); } }
.map-box svg { display: block; width: 100%; height: auto; background: #0F151B; border-radius: var(--r-md); }
.map-box path:hover { stroke: #8E9BA8; stroke-width: 1; }
.map-box g[role="button"]:focus-visible circle { stroke: var(--focus); stroke-width: 2; }
.map-side { background: var(--surface-sunken); border-radius: var(--r-md); padding: 14px; font-size: 14px; display: flex; flex-direction: column; gap: 10px; max-height: 470px; overflow: auto; }
.map-side h3 { margin: 0; font-size: 16px; }
.map-side h4 { margin: 6px 0 0; font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.side-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.side-ex { padding: 10px; border-radius: var(--r-sm); background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.side-ex.is-hl { box-shadow: inset 0 0 0 1px var(--brand); }
.side-news { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.side-news li { display: flex; flex-direction: column; gap: 2px; }
.side-news a { color: var(--text-strong); text-decoration: none; }
.side-news a:hover { color: var(--link); text-decoration: underline; }
.side-news span { font-size: 12px; }
.rank { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.rank li { display: flex; justify-content: space-between; align-items: center; }
.rank button, .link { background: none; border: 0; padding: 4px 0; color: var(--link); font: inherit; cursor: pointer; text-align: left; }
.rank button:hover, .link:hover { color: var(--link-hover); text-decoration: underline; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.st-aberta { background: var(--up-bg) !important; color: var(--up-text) !important; }
.st-pausa { background: #2A2113 !important; color: #F4C77B !important; }
.st-fechada { background: var(--surface-hover) !important; color: var(--text-muted) !important; }
.st-erro { background: var(--down-bg) !important; color: var(--down-text) !important; }
.qlist { display: flex; flex-direction: column; }
.qlist h4 { margin: 14px 0 4px; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.qlist h4:first-child { margin-top: 0; }
.qrow { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.qrow > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.qrow small { font-size: 11px; }
.qrow .mono { text-align: right; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chk { font-size: 11px; color: var(--up-text); font-family: var(--mono); }
.search, .select-sm { min-height: 40px; padding: 0 12px; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface-sunken); color: var(--text-strong); font: 400 14px var(--sans); min-width: 0; }
.search { width: 240px; max-width: 100%; }
.radar td, .radar th { white-space: nowrap; }
.radar tr.rrow { cursor: pointer; }
.radar tr.rrow:hover td { background: #18212A; }
.radar tr.is-open td { background: #18212A; }
.rdetail td { background: var(--surface-sunken); white-space: normal; }
.rgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; padding: 6px 0; }
.rgrid h4 { margin: 0 0 8px; font-size: 13px; color: var(--text-muted); }
.reasons { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.score { display: inline-block; width: 70px; height: 6px; background: var(--border); border-radius: 3px; margin-right: 8px; vertical-align: middle; overflow: hidden; }
.score i { display: block; height: 100%; border-radius: 3px; }
.nowrap { white-space: nowrap; }
.risk-baixo { background: var(--up-bg) !important; color: var(--up-text) !important; }
.risk-médio { background: #2A2113 !important; color: #F4C77B !important; }
.risk-alto { background: var(--down-bg) !important; color: var(--down-text) !important; }
.news-list { display: flex; flex-direction: column; }
.news { padding: 14px 0; border-bottom: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 6px; }
.news h3 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.35; }
.news h3 a { color: var(--text-strong); text-decoration: none; }
.news h3 a:hover { color: var(--link); text-decoration: underline; }
.news p { margin: 0; color: var(--text-3); font-size: 14px; }
.news-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--text-muted); }
.ctag { border: 1px solid var(--border-strong); background: transparent; color: var(--text-3); border-radius: 999px; padding: 2px 8px; font: 500 11px var(--sans); cursor: pointer; }
.ctag:hover { color: var(--text-strong); border-color: var(--text-muted); }
h3.grp { margin: 20px 0 8px; font-size: 14px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
table.apis { min-width: 860px; font-size: 13px; }
table.apis td { vertical-align: top; }
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--brand); }
@media (max-width: 640px) { .search { width: 100%; } .card-head .form-row { width: 100%; } .select-sm { flex: 1; } }

/* ---------- Fase 4: fluxos, laboratório, carteira, admin ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-strong); }
.fx-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.fx-chart { background: var(--surface-sunken); border: 1px solid var(--border-soft); border-radius: var(--r-md); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fx-chart span { font-size: 12px; color: var(--text-muted); }
.fx-chart b { font: 600 16px var(--mono); color: var(--text-strong); }
.whale-bars { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 14px; }
.wb { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: center; }
.wb small { display: block; margin-top: 3px; font-size: 12px; }
.wb-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--grid); }
.wb-bar i { display: block; height: 100%; }
.doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; max-height: 520px; overflow-y: auto; }
.doc-list li { padding: 10px 0; border-bottom: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 3px; font-size: 14px; min-width: 0; }
.doc-list li .muted { font-size: 12px; }
.doc-list li a { color: var(--link); text-decoration: none; overflow-wrap: anywhere; }
.doc-list li a:hover { color: var(--link-hover); text-decoration: underline; }
.agenda { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.agenda li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.ag-time { min-width: 48px; color: var(--text-strong); font-weight: 600; }
.clocks { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; font-size: 13px; color: var(--text-3); }
.clocks span { display: inline-flex; gap: 6px; align-items: baseline; }
.clocks small { color: var(--text-muted); font: 500 11px var(--sans); text-transform: uppercase; letter-spacing: .04em; }
.clk-main { font-size: 18px; color: var(--text-strong); font-weight: 600; }
.adm-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.adm-tabs button { background: transparent; border: 1px solid var(--border-strong); color: var(--text-3); border-radius: 999px; padding: 6px 14px; font: 500 13px var(--sans); cursor: pointer; }
.adm-tabs button:hover { color: var(--text-strong); border-color: var(--text-muted); }
.adm-tabs button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.adm-tabs button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.adm { display: flex; flex-direction: column; gap: 12px; }
.adm[hidden] { display: none; }
.out { background: var(--surface-sunken); border: 1px solid var(--border-soft); border-radius: var(--r-md); padding: 12px; font: 12px/1.5 var(--mono); color: var(--text-2); max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.settings { display: flex; flex-direction: column; }
.srow { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.srow small { font-size: 12px; }
.srow input { width: 100%; }
@media (max-width: 720px) { .srow { grid-template-columns: minmax(0, 1fr); } }
.archive { font-size: 14px; }
.adm table input[type="number"], .adm table select, .adm table input:not([type]) { background: var(--surface-sunken); border: 1px solid var(--border-strong); color: var(--text); border-radius: var(--r-sm); padding: 5px 8px; font: 13px var(--sans); max-width: 130px; }
.adm table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.srow input, .settings input { background: var(--surface-sunken); border: 1px solid var(--border-strong); color: var(--text); border-radius: var(--r-sm); padding: 7px 10px; font: 13px var(--mono); }
tr.rrow { cursor: pointer; }
tr.rrow:hover { background: var(--surface-hover); }
tr.rrow.is-open { background: var(--surface-hover); box-shadow: inset 3px 0 0 var(--brand); }
#eq-chart { height: 260px; }
@media (max-width: 640px) { #eq-chart { height: 200px; } .wb { grid-template-columns: 72px minmax(0, 1fr); } .adm-tabs { overflow-x: auto; flex-wrap: nowrap; } .adm-tabs button { flex: 0 0 auto; } }

/* =====================================================================
   Camada premium — profundidade, gradientes, movimento e acabamento
   ===================================================================== */
:root {
  --bg: #090D12;
  --bg-elev: #0D1218;
  --surface: #121921;
  --surface-sunken: #0B1016;
  --surface-hover: #18222C;
  --border: #1D2731;
  --border-soft: #161F28;
  --border-strong: #2A3642;
  --brand: #2FB38F;
  --brand-strong: #1E7A62;
  --brand-2: #4FA3F7;
  --accent-grad: linear-gradient(135deg, #2FB38F 0%, #4FA3F7 100%);
  --gold: #E8C76A;
  --shadow-1: 0 1px 0 rgba(255,255,255,.03) inset, 0 1px 2px rgba(0,0,0,.35), 0 8px 24px -12px rgba(0,0,0,.55);
  --shadow-2: 0 1px 0 rgba(255,255,255,.05) inset, 0 12px 40px -16px rgba(0,0,0,.7), 0 0 0 1px rgba(79,163,247,.06);
  --glow: 0 0 0 1px rgba(47,179,143,.35), 0 8px 30px -10px rgba(47,179,143,.45);
  --ease: cubic-bezier(.2,.7,.2,1);
  --r-lg: 16px;
}
body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(79,163,247,.07), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(47,179,143,.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  font-feature-settings: "cv11", "ss01", "ss03";
  letter-spacing: -0.003em;
}
::selection { background: rgba(79,163,247,.35); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: #2A3642 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #243039; border-radius: 10px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: #334250; }

/* Barra superior translúcida */
.topbar { background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid rgba(255,255,255,.06); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--accent-grad); opacity: .35; }
.brand b { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; letter-spacing: -0.035em; }
.nav a { position: relative; font-weight: 500; transition: color .15s var(--ease), background .15s var(--ease); }
.nav a[aria-current="page"], .nav a[aria-current="true"] { color: var(--text-strong); font-weight: 600; background: rgba(255,255,255,.04); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--accent-grad); }
.avatar { background: var(--accent-grad); color: #04130E; font-weight: 700; box-shadow: 0 0 0 2px rgba(255,255,255,.06); }
.disclaimer { background: linear-gradient(90deg, rgba(232,199,106,.07), rgba(232,199,106,.02)); border-bottom-color: rgba(232,199,106,.12); }

/* Títulos */
.page-head h1 { font-size: 30px; font-weight: 750; letter-spacing: -0.025em; color: var(--text-strong); }
.section-head h2, .card h2 { letter-spacing: -0.012em; }

/* Cards com profundidade */
.card { background: linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,0) 40%), var(--surface); border-color: var(--border); box-shadow: var(--shadow-1); transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease); }
.card:hover { border-color: var(--border-strong); }
.ticker { position: relative; overflow: hidden; }
.ticker:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.ticker[aria-pressed="true"] { border-color: transparent; box-shadow: var(--glow); }
.ticker::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--accent-grad); opacity: 0; transition: opacity .2s; }
.ticker[aria-pressed="true"]::before, .ticker:hover::before { opacity: 1; }
.price { font-size: 32px; letter-spacing: -0.03em; }

/* KPIs */
.stat { position: relative; background: linear-gradient(180deg, rgba(255,255,255,.025), transparent), var(--surface-sunken); border: 1px solid var(--border-soft); padding: 14px 16px 12px; transition: border-color .2s; }
.stat::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; background: var(--accent-grad); opacity: .7; }
.stat:hover { border-color: var(--border-strong); }
.stat b { font-size: 20px; letter-spacing: -0.02em; }

/* Controles */
.seg { background: rgba(0,0,0,.25); border: 1px solid var(--border-soft); }
.seg button { transition: background .15s var(--ease), color .15s var(--ease); }
.seg button:hover:not([aria-pressed="true"]) { color: var(--text-strong); background: rgba(255,255,255,.03); }
.seg button[aria-pressed="true"] { background: linear-gradient(180deg, #24313D, #1C2732); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 2px 6px rgba(0,0,0,.35); }
.btn { background: var(--accent-grad); color: #04130E; font-weight: 700; box-shadow: 0 6px 20px -8px rgba(47,179,143,.6); transition: transform .15s var(--ease), box-shadow .15s var(--ease), filter .15s; }
.btn:hover { background: var(--accent-grad); filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 10px 26px -10px rgba(79,163,247,.6); }
.btn--ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border-strong); box-shadow: none; }
.btn--ghost:hover { background: rgba(255,255,255,.04); color: #fff; border-color: var(--text-muted); filter: none; box-shadow: none; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.field input, .search, select, input[type="text"], input[type="number"], input[type="date"], input:not([type]) { transition: border-color .15s, box-shadow .15s; }
.field input:focus, .search:focus, select:focus, input:focus { border-color: var(--brand-2) !important; box-shadow: 0 0 0 3px rgba(79,163,247,.18); outline: none; }

/* Badges e status */
.badge { border: 1px solid rgba(255,255,255,.05); font-weight: 500; }
.st-aberta { background: var(--up-bg); color: var(--up-text); }
.st-aberta::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 rgba(60,201,154,.6); animation: fx-pulse 2s infinite; vertical-align: middle; }
.pill--ok::before { animation: fx-pulse 2s infinite; }
@keyframes fx-pulse { 0% { box-shadow: 0 0 0 0 rgba(60,201,154,.55); } 70% { box-shadow: 0 0 0 7px rgba(60,201,154,0); } 100% { box-shadow: 0 0 0 0 rgba(60,201,154,0); } }

/* Tabelas */
.table-scroll { border-radius: var(--r-md); }
.table-scroll table thead th { position: sticky; top: 0; z-index: 1; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(6px); }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(255,255,255,.025); }
td.num, .num { font-feature-settings: "tnum", "zero"; }
.dir-alta { color: var(--up-text); }
.dir-queda { color: var(--down-text); }

/* Carregamento */
.loading { gap: 10px; }
.loading::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--brand-2); animation: fx-spin .8s linear infinite; }
@keyframes fx-spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #121921 0%, #1A242E 50%, #121921 100%); background-size: 200% 100%; animation: fx-shimmer 1.4s infinite; border-radius: 6px; min-height: 14px; }
@keyframes fx-shimmer { to { background-position: -200% 0; } }

/* Variação de preço ao vivo */
.flash-up { animation: fx-flash-up .9s var(--ease); }
.flash-down { animation: fx-flash-down .9s var(--ease); }
@keyframes fx-flash-up { 0% { background: rgba(60,201,154,.28); } 100% { background: transparent; } }
@keyframes fx-flash-down { 0% { background: rgba(240,135,74,.28); } 100% { background: transparent; } }

/* Entrada das telas */
.view:not([hidden]) > * { animation: fx-in .35s var(--ease) both; }
.view:not([hidden]) > *:nth-child(2) { animation-delay: .04s; }
.view:not([hidden]) > *:nth-child(3) { animation-delay: .08s; }
.view:not([hidden]) > *:nth-child(4) { animation-delay: .12s; }
@keyframes fx-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Abas do admin com o acabamento novo */
.adm-tabs button[aria-pressed="true"] { background: var(--accent-grad); border-color: transparent; color: #04130E; font-weight: 700; }
.fx-chart, .doc-list li, .wb-bar { transition: border-color .2s; }
.fx-chart:hover { border-color: var(--border-strong); }

/* Paleta de comandos (Ctrl+K) */
.kbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 10px 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: rgba(255,255,255,.03); color: var(--text-3); font: 500 13px var(--sans); cursor: pointer; transition: border-color .15s, color .15s; }
.kbtn:hover { color: #fff; border-color: var(--text-muted); }
kbd { font: 600 11px var(--mono); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--surface-sunken); color: var(--text-2); }
.cmdk { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; background: rgba(4,7,10,.6); backdrop-filter: blur(6px); animation: fx-fade .15s; }
.cmdk[hidden] { display: none; }
@keyframes fx-fade { from { opacity: 0; } }
.cmdk-box { width: 100%; max-width: 620px; background: linear-gradient(180deg, #151D26, #10161D); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(79,163,247,.08); overflow: hidden; animation: fx-pop .18s var(--ease); }
@keyframes fx-pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.cmdk-box input { width: 100%; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: #fff; font: 500 17px var(--sans); padding: 18px 20px; outline: none; box-shadow: none !important; }
.cmdk-list { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow-y: auto; }
.cmdk-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--text-2); font-size: 14px; }
.cmdk-list li small { margin-left: auto; color: var(--text-muted); font-size: 12px; }
.cmdk-list li .ic { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.04); color: var(--brand-2); font: 700 12px var(--mono); flex: 0 0 auto; }
.cmdk-list li[aria-selected="true"] { background: rgba(79,163,247,.12); color: #fff; }
.cmdk-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.copy-tbl { display: flex; width: auto; margin: 0 0 8px auto; align-self: flex-end; }
.copy-tbl + .table-scroll { clear: both; }
@media (max-width: 720px) { .kbtn span { display: none; } }

/* Toast */
.toast, #toast { border-radius: 12px !important; box-shadow: 0 16px 40px -12px rgba(0,0,0,.7) !important; border: 1px solid var(--border-strong) !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Barra superior numa linha só no desktop */
@media (min-width: 721px) {
  .topbar .wrap { flex-wrap: nowrap; gap: 12px 20px; }
  .nav { flex: 1 1 0; min-width: 0; }
  .nav a { padding: 9px 12px; }
  .userbox { flex: 0 0 auto; }
}
@media (min-width: 721px) and (max-width: 1500px) { .kbtn span, #coleta-txt { display: none; } .pill--ok { padding: 6px 8px; } }

.doc-list li > * { align-self: flex-start; max-width: 100%; }
@media (max-width: 720px) {
  .kbtn span { display: inline; }
  .kbtn kbd { display: none; }
  .kbtn { padding: 0 12px; }
  .topbar .wrap { flex-wrap: wrap; }
  .userbox { gap: 8px; }
  .fx-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .fx-chart { padding: 8px 10px; }
  .fx-chart svg { height: 44px; }
}
@media (max-width: 420px) { .brand small { display: none; } }

/* Conhecimento (admin) */
.kn-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); background: rgba(255,255,255,.015); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.kn-drop b { color: var(--text-strong); font-size: 15px; }
.kn-drop span { color: var(--text-muted); font-size: 13px; }
.kn-drop:hover, .kn-drop.is-over { border-color: var(--brand-2); background: rgba(79,163,247,.06); }
.kn-paste { margin: 4px 0; }
.kn-paste > summary { cursor: pointer; color: var(--link); font-size: 14px; padding: 6px 0; }
.kn-form { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.kn-form textarea, .kn-view textarea { width: 100%; background: var(--surface-sunken); border: 1px solid var(--border-strong); color: var(--text); border-radius: var(--r-md); padding: 10px 12px; font: 13px/1.5 var(--mono); resize: vertical; }
.kn-filters { align-items: center; gap: 10px; flex-wrap: wrap; }
.kn-view { margin-top: 12px; padding: 18px; border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--surface-sunken); }
.kn-md { font-size: 14px; line-height: 1.6; color: var(--text-2); max-height: 520px; overflow: auto; }
.kn-md h2, .kn-md h3, .kn-md h4 { color: var(--text-strong); margin: 14px 0 6px; }
.kn-md code { font-family: var(--mono); font-size: 12.5px; background: rgba(255,255,255,.05); padding: 1px 5px; border-radius: 4px; }
.kn-code { max-height: 520px; overflow: auto; margin: 0; padding: 14px; border-radius: var(--r-md); background: #070A0E; border: 1px solid var(--border); font: 12.5px/1.55 var(--mono); color: #C9D4DE; white-space: pre; }
.kn-k-codigo { color: #9CC8FF; } .kn-k-analise { color: var(--up-text); } .kn-k-fonte { color: var(--gold); } .kn-k-dados { color: #D6B4FF; }
button.link { background: none; border: 0; padding: 0; color: var(--link); font: inherit; cursor: pointer; text-align: left; }
button.link:hover { color: var(--link-hover); text-decoration: underline; }
.kn-md pre code { background: none; padding: 0; }

/* Proteção do investidor */
.protect-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.protect-grid > div { background: var(--surface-sunken); border: 1px solid var(--border-soft); border-radius: var(--r-md); padding: 14px 16px; }
.protect-grid b { color: var(--text-strong); font-size: 14px; }
.protect-grid p { margin: 6px 0 0; font-size: 13px; color: var(--text-3); line-height: 1.5; }

/* Barras horizontais (Ibovespa) */
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hb { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr) 56px; gap: 10px; align-items: center; font-size: 13px; }
.hb-name { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-track { height: 10px; border-radius: 5px; background: var(--grid); overflow: hidden; }
.hb-track i { display: block; height: 100%; border-radius: 5px; background: #4A6578; }
.hb b { text-align: right; color: var(--text-strong); font-weight: 600; }
/* Padrões de candle */
.pat-ctl { gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.pat-card { background: linear-gradient(180deg, rgba(255,255,255,.025), transparent), var(--surface-sunken); border: 1px solid var(--border-soft); border-radius: var(--r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.pat-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pat-top b { color: var(--text-strong); font-size: 15px; }
.pat-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pat-kpis span { display: block; font-size: 11.5px; color: var(--text-muted); }
.pat-kpis b { font-size: 17px; color: var(--text-strong); }
.pat-kpis small { display: block; font-size: 11.5px; color: var(--text-muted); font-family: var(--mono); }
.pat-verdict { margin: 0; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 8px; }
.v-bad { background: var(--down-bg); color: var(--down-text); }
.v-mid { background: #2A2113; color: #F4C77B; }
.v-good { background: var(--up-bg); color: var(--up-text); }
.pat-card > small { font-size: 12px; line-height: 1.45; }
.pat-method { margin-top: 10px; }
.pat-method > summary { cursor: pointer; color: var(--link); font-size: 14px; }
@media (max-width: 640px) { .hb { grid-template-columns: 96px minmax(0, 1fr) 48px; } }

/* Gatilhos e banca */
.trig-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.trig { background: var(--surface-sunken); border: 1px solid var(--border-soft); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.trig-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.trig-top b { color: var(--text-strong); font-size: 13.5px; }
.sev-forte { background: var(--down-bg) !important; color: var(--down-text) !important; }
.ev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ev { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
.ev-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--text-muted); }
.ev b { font-size: 15px; }
.bank-rules { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chip { display: inline-flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: rgba(255,255,255,.02); font-size: 13px; color: var(--text-strong); }
.chip small { font-size: 11px; color: var(--text-muted); }

/* Cenários de carteira */
.scen-chart { height: 270px; }
.scen-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 10px 0 14px; font-size: 13px; color: var(--text-3); }
.scen-legend span { display: inline-flex; align-items: center; gap: 6px; }
.scen-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
td.best { color: var(--up-text); font-weight: 700; }

/* ===== Navegação inferior no celular e toasts com variantes (aprendido com Seengo, Nexus e Ticklo, 31/10/2026) ===== */
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.kicker { display: block; font: 500 11px/1 "JetBrains Mono", monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted, #8E9BA8); }
.bottomnav, .nav-sheet { display: none; }
#toasts { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; width: min(92vw, 400px); pointer-events: none; }
.toast2 { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 12px 12px 14px; border-radius: 12px; background: #1B242D; color: var(--text-strong, #F2F6FA); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 16px 40px -12px rgba(0,0,0,.7); font-size: 14px; line-height: 1.4; animation: fx-pop .18s ease-out; }
.toast2 .ic { flex: none; margin-top: 1px; }
.toast2 p { margin: 0; flex: 1; }
.toast2 button { flex: none; background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; min-width: 24px; min-height: 24px; }
.toast2--ok { border-color: rgba(60,201,154,.45); } .toast2--ok .ic { color: #3CC99A; }
.toast2--warn { border-color: rgba(244,199,123,.45); } .toast2--warn .ic { color: #F4C77B; }
.toast2--err { border-color: rgba(240,135,74,.5); } .toast2--err .ic { color: #F0874A; }
.toast2--info .ic { color: #6FB7E8; }
@keyframes fx-pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .topbar .nav { display: none; }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg-elev, #11181F) 90%, transparent);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid rgba(255,255,255,.08); }
  .bottomnav a, .bottomnav button { min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    font-size: 11px; color: var(--text-3, #A9B6C2); text-decoration: none; background: none; border: 0; font-family: inherit; cursor: pointer; }
  .bottomnav a[aria-current="page"] { color: var(--text-strong, #F2F6FA); }
  .bottomnav a[aria-current="page"] .ic { stroke: #3CC99A; }
  .nav-sheet:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(5,8,11,.55); }
  .nav-sheet-panel { position: absolute; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom)); max-height: 70vh; overflow-y: auto;
    background: var(--bg-elev, #11181F); border-top: 1px solid rgba(255,255,255,.1); border-radius: 18px 18px 0 0; padding: 18px 16px 12px; display: flex; flex-direction: column; gap: 2px; }
  .nav-sheet-panel .kicker { margin: 12px 4px 6px; }
  .nav-sheet-panel a { min-height: 46px; display: flex; align-items: center; padding: 0 12px; border-radius: 10px; color: var(--text-strong, #F2F6FA); text-decoration: none; font-size: 16px; }
  .nav-sheet-panel a[aria-current="page"] { background: rgba(60,201,154,.12); box-shadow: inset 3px 0 0 #3CC99A; }
  main#painel { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  #toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
  input, select, textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .toast2 { animation: none; } }
