/* Olhari — design system
   Regras fixas (aprendidas nos apps anteriores):
   - Sem calendário nativo: datas são campo com máscara + atalhos em chips.
   - Sem setas: nada de spinner em número, nada de seta de <select>, variação sem ▲▼.
   - Ícones somente Material Symbols Rounded (sem emoji).
   - Inputs com 16px para o iPhone não dar zoom. Alvos de toque >= 44px. */

:root {
  --bg: #0b0f1e;
  --bg-2: #0e1328;
  --surface: #131934;
  --surface-2: #1a2145;
  --surface-3: #232b57;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eef1ff;
  --text-2: #b9bfdc;
  --muted: #8189ad;
  --primary: #8b7cff;
  --primary-ink: #0b0f1e;
  --accent: #5ce1e6;
  --grad: linear-gradient(120deg, #8b7cff 0%, #5ce1e6 100%);
  --up: #34d399;
  --up-bg: rgba(52, 211, 153, 0.13);
  --down: #ff6b81;
  --down-bg: rgba(255, 107, 129, 0.13);
  --warn: #fbbf24;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --c-br: #8b7cff; --c-us: #5ce1e6; --c-crypto: #fbbf24; --c-td: #34d399; --c-rf: #f472b6; --c-fx: #60a5fa; --c-idx: #a3a3c2;
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: #f4f5fb;
  --bg-2: #eceefa;
  --surface: #ffffff;
  --surface-2: #f0f1fa;
  --surface-3: #e4e6f5;
  --border: rgba(16, 20, 50, 0.08);
  --border-strong: rgba(16, 20, 50, 0.16);
  --text: #12162e;
  --text-2: #3c4266;
  --muted: #6d7396;
  --primary: #6c5cf2;
  --primary-ink: #ffffff;
  --accent: #0fb5bd;
  --grad: linear-gradient(120deg, #6c5cf2 0%, #0fb5bd 100%);
  --up: #059669;
  --up-bg: rgba(5, 150, 105, 0.1);
  --down: #e11d48;
  --down-bg: rgba(225, 29, 72, 0.09);
  --shadow: 0 10px 30px rgba(20, 24, 60, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
.num, .tnum { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

.ms {
  font-family: 'Material Symbols Rounded';
  font-weight: 400;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none;
  flex: none;
  /* se a fonte de ícones demorar, o nome do ícone não vaza na tela */
  width: 1em;
  overflow: hidden;
  text-align: center;
}
.ms.fill { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }

/* ---------- layout ---------- */
#app { min-height: 100%; }
.page {
  max-width: 760px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 14px) 16px calc(var(--nav-h) + var(--safe-b) + 28px);
  animation: fade 0.18s ease-out;
}
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.topbar { display: flex; align-items: center; gap: 10px; min-height: 48px; margin-bottom: 10px; }
.topbar .title { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; flex: 1; min-width: 0; }
.topbar .title small { display: block; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.brand { display: flex; align-items: center; gap: 9px; flex: 1; }
.brand img { width: 30px; height: 30px; }
.brand span { font-weight: 800; font-size: 22px; letter-spacing: -0.8px; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); transition: background 0.15s;
}
.icon-btn:active { background: var(--surface-2); }
.icon-btn.ghost { background: transparent; border-color: transparent; }
.icon-btn.on { color: var(--warn); }

.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 10px; }
.section-title h2 { font-size: 16px; font-weight: 800; margin: 0; letter-spacing: -0.2px; }
.section-title .link { color: var(--primary); font-weight: 700; font-size: 14px; padding: 6px 0; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
}
.card + .card { margin-top: 12px; }
.card.hero { background: radial-gradient(120% 140% at 0% 0%, rgba(139,124,255,.28) 0%, transparent 55%), radial-gradient(120% 140% at 100% 100%, rgba(92,225,230,.16) 0%, transparent 55%), var(--surface); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.bold { font-weight: 800; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stack > * + * { margin-top: 12px; }
.hidden { display: none !important; }

/* ---------- search trigger ---------- */
.search-trigger {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 52px; padding: 0 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; color: var(--muted); font-size: 16px; text-align: left;
}
.search-trigger .ms { color: var(--text-2); }

/* ---------- indicators strip ---------- */
.strip { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; margin: 14px -16px 0; padding: 2px 16px 4px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.ind {
  scroll-snap-align: start; flex: none; min-width: 132px; padding: 12px 14px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
}
.ind .lbl { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.ind .val { font-size: 18px; font-weight: 800; margin-top: 2px; letter-spacing: -0.3px; }
.ind .sub { font-size: 12px; margin-top: 2px; }

/* ---------- pills / variation (sem setas) ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.pill.up { color: var(--up); background: var(--up-bg); }
.pill.down { color: var(--down); background: var(--down-bg); }
.pill.flat { color: var(--muted); background: var(--surface-2); }
.up-t { color: var(--up); }
.down-t { color: var(--down); }

/* ---------- list items ---------- */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px; width: 100%; text-align: left; }
.item + .item { border-top: 1px solid var(--border); }
.item:active { background: var(--surface-2); }
.item .t1 { font-weight: 800; font-size: 15px; }
.item .t2 { font-size: 13px; color: var(--muted); }
.item .right { text-align: right; flex: none; }
.item .right .t1 { font-size: 15px; }
.avatar {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; overflow: hidden;
  background: var(--surface-2); color: var(--text-2); font-weight: 800; font-size: 12px; letter-spacing: -0.3px;
}
.avatar img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.avatar.c-br { background: color-mix(in srgb, var(--c-br) 20%, transparent); color: var(--c-br); }
.avatar.c-us { background: color-mix(in srgb, var(--c-us) 20%, transparent); color: var(--c-us); }
.avatar.c-crypto { background: color-mix(in srgb, var(--c-crypto) 20%, transparent); color: var(--c-crypto); }
.avatar.c-td { background: color-mix(in srgb, var(--c-td) 20%, transparent); color: var(--c-td); }
.avatar.c-rf { background: color-mix(in srgb, var(--c-rf) 20%, transparent); color: var(--c-rf); }
.avatar.c-fx, .avatar.c-idx { background: color-mix(in srgb, var(--c-fx) 20%, transparent); color: var(--c-fx); }
.spark { width: 72px; height: 32px; flex: none; }

/* ---------- chips / segmented ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: none; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong);
  font-size: 14px; font-weight: 700; color: var(--text-2); background: transparent; display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip.sm { height: 32px; padding: 0 11px; font-size: 13px; }
.seg { display: flex; padding: 4px; gap: 4px; background: var(--surface-2); border-radius: 14px; }
.seg button { flex: 1; height: 40px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.18); }

/* ---------- buttons ---------- */
.btn {
  height: 52px; padding: 0 20px; border-radius: 16px; font-weight: 800; font-size: 15px; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px; width: 100%; transition: transform 0.08s, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--grad); color: #0b0f1e; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--down-bg); color: var(--down); }
.btn.sm { height: 42px; border-radius: 12px; font-size: 14px; width: auto; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn-row { display: flex; gap: 10px; }

.fab {
  position: fixed; right: max(18px, calc(50% - 362px)); bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: 30;
  width: 58px; height: 58px; border-radius: 20px; background: var(--grad); color: #0b0f1e; display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(92, 225, 230, 0.25);
}
.fab .ms { font-size: 28px; }

/* ---------- forms (sem setas, sem calendário nativo) ---------- */
.field { display: block; }
.field + .field { margin-top: 14px; }
.field > .lbl { display: block; font-size: 13px; font-weight: 700; color: var(--text-2); margin: 0 2px 6px; }
.field .hint { font-size: 12px; color: var(--muted); margin: 6px 2px 0; }
.input-wrap { position: relative; display: flex; align-items: center; background: var(--surface-2); border: 1.5px solid transparent; border-radius: 14px; transition: border 0.15s; }
.input-wrap:focus-within { border-color: var(--primary); background: var(--surface); }
.input-wrap .pre, .input-wrap .suf { padding: 0 0 0 14px; color: var(--muted); font-weight: 700; font-size: 15px; }
.input-wrap .suf { padding: 0 14px 0 0; }
.input-wrap .ms { padding-left: 14px; width: calc(1em + 14px); color: var(--muted); }
.input, .input-wrap input, .input-wrap textarea {
  width: 100%; height: 52px; padding: 0 14px; border: 0; outline: 0; background: transparent; font-size: 16px; font-weight: 600;
  -webkit-appearance: none; appearance: none; border-radius: 14px;
}
.input-wrap textarea { height: 84px; padding: 14px; resize: none; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type='number'] { -moz-appearance: textfield; }
input[type='search']::-webkit-search-cancel-button, input[type='search']::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.input-wrap .clear { width: 44px; height: 44px; display: grid; place-items: center; color: var(--muted); }
.field.error .input-wrap { border-color: var(--down); }
.field .err { color: var(--down); font-size: 12px; margin: 6px 2px 0; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 .field + .field { margin-top: 0; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* range slider estilizado (cenários) */
.slider { margin-top: 6px; }
.slider input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; background: transparent; }
.slider input[type='range']::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: var(--track, var(--surface-3)); }
.slider input[type='range']::-moz-range-track { height: 6px; border-radius: 6px; background: var(--surface-3); }
.slider input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; margin-top: -10px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); border: 4px solid var(--primary); }
.slider input[type='range']::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--primary); }
.slider-head { display: flex; justify-content: space-between; align-items: center; }
.slider-head .v { font-weight: 800; min-width: 74px; text-align: right; padding: 4px 8px; border-radius: 10px; background: var(--surface-2); }

/* ---------- search page ---------- */
.search-head { position: sticky; top: 0; z-index: 10; background: var(--bg); padding: calc(var(--safe-t) + 10px) 16px 10px; margin: calc(-1 * (var(--safe-t) + 14px)) -16px 0; }
.search-head .input-wrap { background: var(--surface); border-color: var(--border); }
.group-title { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: 0.6px; text-transform: uppercase; margin: 18px 4px 8px; display: flex; align-items: center; gap: 6px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ms { font-size: 44px; color: var(--surface-3); display: block; margin: 0 auto 10px; }

/* ---------- skeleton ---------- */
.sk { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: sk 1.2s infinite linear; border-radius: 8px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- asset page ---------- */
.price-big { font-size: 34px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; }
.chart-box { position: relative; height: 220px; margin: 14px -6px 6px; touch-action: pan-y; }
.chart-box svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart-tip { position: absolute; top: -4px; transform: translateX(-50%); background: var(--surface-3); padding: 4px 8px; border-radius: 8px; font-size: 12px; font-weight: 700; pointer-events: none; white-space: nowrap; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.stat { padding: 12px 4px; border-bottom: 1px solid var(--border); }
.stat:nth-last-child(-n + 2) { border-bottom: 0; }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .v { font-weight: 800; margin-top: 2px; }

/* ---------- donut / bars ---------- */
.alloc { display: flex; align-items: center; gap: 18px; }
.alloc svg { width: 128px; height: 128px; flex: none; }
.legend { flex: 1; min-width: 0; }
.legend .li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; }
.legend .dot { width: 10px; height: 10px; border-radius: 4px; flex: none; }
.bars .bar { margin-top: 12px; }
.bars .track { height: 10px; background: var(--surface-2); border-radius: 6px; position: relative; overflow: hidden; margin-top: 6px; }
.bars .fillb { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }

/* ---------- bottom nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border); display: flex; justify-content: center;
}
.nav .in { display: flex; width: 100%; max-width: 560px; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11.5px; font-weight: 700; }
.nav a .ms { font-size: 24px; padding: 3px 16px; width: calc(1em + 32px); border-radius: 999px; transition: background 0.15s; }
.nav a.on { color: var(--text); }
.nav a.on .ms { background: color-mix(in srgb, var(--primary) 22%, transparent); color: var(--primary); font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }

/* ---------- bottom sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(5, 7, 18, 0.6); z-index: 60; opacity: 0; transition: opacity 0.2s; }
.scrim.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--bg-2); border-radius: 26px 26px 0 0; border-top: 1px solid var(--border-strong);
  transform: translateY(100%); transition: transform 0.26s cubic-bezier(.2,.8,.2,1); max-width: 640px; margin: 0 auto;
}
.sheet.show { transform: none; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 10px auto 2px; flex: none; }
.sheet .sh-head { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 20px; flex: none; }
.sheet .sh-head h3 { margin: 0; font-size: 18px; font-weight: 800; flex: 1; }
.sheet .sh-body { overflow-y: auto; padding: 8px 20px 20px; -webkit-overflow-scrolling: touch; }
.sheet .sh-foot { padding: 12px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--border); flex: none; background: var(--bg-2); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 12px); transform: translate(-50%, -20px); z-index: 90;
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 14px;
  opacity: 0; transition: all 0.2s; max-width: calc(100% - 32px); box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login .box { width: 100%; max-width: 360px; text-align: center; }
.login img { width: 72px; height: 72px; }
.login h1 { font-size: 30px; font-weight: 800; letter-spacing: -1px; margin: 12px 0 4px; }

.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--text); font-size: 13px; margin-top: 12px; }
.banner .ms { color: var(--warn); font-size: 20px; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); letter-spacing: 0.2px; }

@media (min-width: 900px) {
  .page { padding-top: 28px; }
}

/* ---------- notícias ---------- */
.news { display: block; padding: 14px 16px; }
.news + .news { border-top: 1px solid var(--border); }
.news .meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.news .meta .src { color: var(--text-2); font-weight: 800; max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news .meta .imp { margin-left: auto; display: inline-flex; gap: 2px; }
.news .meta .imp i { width: 4px; height: 10px; border-radius: 2px; background: var(--surface-3); }
.news .meta .imp i.on { background: var(--primary); }
.news h4 { margin: 6px 0 0; font-size: 15.5px; line-height: 1.35; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.news .tags .tk { font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 8px; background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary); }
.news .tags .tag.mine { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.news .more { font-size: 12px; font-weight: 700; color: var(--muted); padding: 3px 0; display: inline-flex; align-items: center; gap: 2px; }
.news .others { margin-top: 8px; border-left: 2px solid var(--border-strong); padding-left: 10px; }
.news .others a { display: block; font-size: 13px; padding: 5px 0; color: var(--text-2); }
.news.lead h4 { font-size: 19px; -webkit-line-clamp: 4; letter-spacing: -0.2px; }
.news .tags .ms { font-size: 14px; vertical-align: -2px; }
.news .tags button.tag { cursor: pointer; }

/* ---------- acesso (login, cadastro, 2FA) ---------- */
.link { color: var(--primary); font-weight: 700; }
button.link { background: none; }
.center { text-align: center; }
.ms.big { font-size: 30px; width: 1.2em; color: var(--primary); }
.ms.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth { min-height: 100vh; min-height: 100dvh; display: flex; justify-content: center; padding: calc(var(--safe-t) + 28px) 20px calc(var(--safe-b) + 28px);
  background: radial-gradient(80% 50% at 0% 0%, rgba(139,124,255,.22), transparent 60%), radial-gradient(70% 40% at 100% 100%, rgba(92,225,230,.12), transparent 60%), var(--bg); }
.auth-box { width: 100%; max-width: 400px; position: relative; animation: fade .2s ease-out; }
.auth-back { position: absolute; left: -8px; top: -6px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 8px 0 26px; }
.auth-brand img { width: 40px; height: 40px; }
.auth-brand span { font-size: 28px; font-weight: 800; letter-spacing: -1px; }
.auth h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.6px; margin: 0 0 4px; }
.auth h1 + p { margin: 0 0 20px; }
.auth .btn + .btn, .auth-social .btn + .btn { margin-top: 10px; }
.auth-social { margin-top: 12px; }
.auth-social .btn img { width: 20px; height: 20px; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 600; margin: 20px 0 14px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--border-strong); }
.err-box { background: var(--down-bg); color: var(--down); font-weight: 700; font-size: 14px; padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; }
.pw-meter { display: flex; gap: 6px; margin-top: 8px; }
.pw-meter i { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-3); }
.pw-meter i.on.s1 { background: var(--down); } .pw-meter i.on.s2 { background: var(--warn); } .pw-meter i.on.s3, .pw-meter i.on.s4 { background: var(--up); }
.code-input { text-align: center; letter-spacing: 10px; font-size: 24px !important; font-weight: 800 !important; }
.setup-opt { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-top: 12px; }
.setup-opt.disabled { opacity: .7; }
.qr { background: #fff; border-radius: 16px; padding: 10px; width: 210px; height: 210px; margin: 16px auto 10px; }
.qr svg { width: 100%; height: 100%; display: block; }
.secret { display: block; margin: 10px auto 14px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); font-weight: 800; letter-spacing: 1px; font-size: 14px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px; font-weight: 800; font-size: 16px; text-align: center; letter-spacing: 1px; }
.codes span { padding: 6px; background: var(--surface-2); border-radius: 8px; }
.auth .btn-row .btn + .btn { margin-top: 0; }

/* ---------- versão web (telas largas): barra lateral e conteúdo em colunas ---------- */
.desk { display: none !important; }
.cols { display: block; }
.cols > .col { min-width: 0; }
@media (min-width: 1024px) {
  .desk { display: flex !important; }
  .mob { display: none !important; }
  body.with-nav { padding-left: 248px; }
  .nav {
    top: 0; bottom: 0; left: 0; right: auto; width: 248px; height: 100vh; padding: 22px 14px 18px; flex-direction: column;
    justify-content: flex-start; border-top: 0; border-right: 1px solid var(--border); background: var(--bg-2); backdrop-filter: none;
  }
  .nav .in { flex-direction: column; gap: 4px; flex: 1; max-width: none; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: 12px; font-size: 15px; color: var(--text-2); }
  .nav a .ms { padding: 0; width: 1em; font-size: 22px; }
  .nav a.on { background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--text); }
  .nav a.on .ms { background: none; }
  .nav a:hover { background: var(--surface); }
  .nav .nav-brand { gap: 10px; padding: 4px 10px 22px; font-size: 22px; font-weight: 800; letter-spacing: -0.8px; color: var(--text); }
  .nav .nav-brand:hover { background: none; }
  .nav .nav-brand img { width: 30px; height: 30px; }
  .nav-user { align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--border); }
  .nav-user .avatar { width: 36px; height: 36px; font-size: 12px; }
  .nav-user .who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px; margin: -6px; border-radius: 12px; color: inherit; }
  .nav-user .who:hover { background: var(--surface); }
  .nav-collapse { position: absolute; top: 50%; margin-top: -14px; right: -14px; width: 28px; height: 28px; padding: 0; display: grid !important; place-items: center; border-radius: 50%;
    border: 1px solid var(--border-strong, var(--border)); background: var(--bg-2); color: var(--muted); cursor: pointer; z-index: 5;
    box-shadow: 0 4px 14px rgba(0,0,0,.35); transition: color .15s, background .15s; }
  .nav-collapse:hover { background: var(--surface-2); color: var(--text); }
  .nav-collapse .ms { font-size: 18px; transition: transform .2s; }
  /* menu recolhido: só ícones */
  body.with-nav.nav-mini { padding-left: 84px; }
  body.nav-mini .nav { width: 84px; padding-left: 12px; padding-right: 12px; }
  body.nav-mini .nav .lb, body.nav-mini .nav-user .who .grow, body.nav-mini .nav-user [data-logout] { display: none; }
  body.nav-mini .nav a { justify-content: center; padding: 11px 0; }
  body.nav-mini .nav .nav-brand { justify-content: center; padding: 4px 0 22px; }
  body.nav-mini .nav-user { justify-content: center; padding: 12px 0 0; }
  body.nav-mini .nav-user .who { flex: none; }
  body.nav-mini .nav-collapse .ms { transform: rotate(180deg); }
  .nav { transition: width .2s; }
  body.with-nav { transition: padding-left .2s; }
  body.with-nav.nav-mini .toast { left: calc(50% + 42px); }
  body.with-nav.nav-mini .sheet { margin-left: 42px; }
  .page { max-width: 1200px; padding: 30px 36px 48px; }
  .cols { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; align-items: start; }
  .cols.even { grid-template-columns: 1fr 1fr; }
  .cols > .col > :first-child { margin-top: 0; }
  .cols > .col > .section-title:first-child { margin-top: 0; }
  .fab { right: 36px; bottom: 32px; }
  body.with-nav .toast { left: calc(50% + 124px); }
  .chart-box { height: 320px; }
  .strip { margin: 16px 0 0; padding: 2px 0 4px; flex-wrap: wrap; overflow: visible; }
  .strip .ind { min-width: 150px; flex: 1; }
  /* sheets viram janelas centralizadas */
  .sheet { top: 50%; bottom: auto; left: 50%; right: auto; width: 560px; max-height: 86vh; border-radius: 22px; border: 1px solid var(--border-strong);
    transform: translate(-50%, -46%); opacity: 0; transition: transform .2s, opacity .2s; margin: 0; }
  body.with-nav .sheet { margin-left: 124px; }
  .sheet.show { transform: translate(-50%, -50%); opacity: 1; }
  .sheet .grab { display: none; }
  .sheet .sh-foot { padding-bottom: 16px; border-radius: 0 0 22px 22px; }
  .search-head { margin: -30px -36px 0; padding: 24px 36px 12px; }
}
.cols > .col + .col { margin-top: 18px; }
@media (min-width: 1024px) { .cols > .col + .col { margin-top: 0; } }
@media (min-width: 1024px) { .topbar .title.desk { display: block !important; } }
.avatar.c-fundo { background: color-mix(in srgb, #22d3ee 20%, transparent); color: #22d3ee; }
.avatar.c-caixa { background: color-mix(in srgb, #94a3b8 20%, transparent); color: #94a3b8; }

/* ---------- família (somente leitura) e assinatura ---------- */
.family-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; justify-content: center; padding: 8px 14px; font-size: 13px; background: color-mix(in srgb, var(--primary) 18%, var(--bg)); border-bottom: 1px solid var(--line); }
.family-bar .ms { font-size: 18px; color: var(--primary); }
body.readonly .fab, body.readonly [data-add], body.readonly [data-import], body.readonly [data-new], body.readonly [data-manage], body.readonly [data-conexoes], body.readonly [data-rules] { display: none !important; }
.plan-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan-card { text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 18px; padding: 16px; color: inherit; cursor: pointer; font: inherit; position: relative; }
.plan-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.plan-card .pp { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }
.plan-card .badge { position: absolute; top: -10px; right: 12px; background: var(--grad, linear-gradient(120deg,#8B7CFF,#5CE1E6)); color: #0B0F1E; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.kpi .k { font-size: 12px; color: var(--muted); font-weight: 700; }
.kpi .v { font-size: 22px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }
@media (max-width: 700px) { .kpis { grid-template-columns: 1fr 1fr; } }

.plan-list .plan-opt { text-align: left; }
.plan-list .plan-opt.on { box-shadow: inset 0 0 0 1.5px var(--primary); }
.plan-list .pp { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.plan-list .pp small { font-size: 12px; font-weight: 600; color: var(--muted); }
.pay-methods { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; font-size: 13px; font-weight: 700; }
.pay-methods .ms { font-size: 18px; }
.pay-methods .pm { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; }

.icon-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.icon-grid button { aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2, var(--muted)); display: grid; place-items: center; cursor: pointer; }
.icon-grid button.on { border-color: currentColor; background: var(--surface-2); }
.color-row { display: flex; flex-wrap: wrap; gap: 10px; }
.color-row button { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.color-row button.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg) inset; }
@media (max-width: 420px) { .icon-grid { grid-template-columns: repeat(6, 1fr); } }

.chip.prev { border-style: dashed; }
.chip.prev .xs { opacity: .7; margin-left: 4px; }
.proj-chart { width: 100%; height: auto; margin-top: 6px; display: block; }
i.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }

.cmp-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 8px 10px; margin-top: 10px; font-size: 13px; align-items: start; }
.cmp-grid .h { font-size: 11px; font-weight: 700; color: var(--muted); text-align: right; }
.cmp-grid .num { text-align: right; font-weight: 600; }
.cmp-grid .l { font-weight: 600; }
.cmp-grid .tot { border-top: 1px solid var(--border); padding-top: 6px; font-weight: 800; }
.cmp-grid .l.tot ~ .num { }

@media (max-width: 600px) {
  .cmp-grid { grid-template-columns: repeat(3, 1fr); gap: 4px 8px; font-size: 12.5px; }
  .cmp-grid .h:first-child { display: none; }
  .cmp-grid .l { grid-column: 1 / -1; margin-top: 8px; }
  .cmp-grid .l.tot { padding-top: 8px; }
}

/* previsto × realizado */
.seg.sm { padding: 3px; border-radius: 12px; }
.seg.sm button { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 9px; flex: 0 0 auto; }
.pm-detail { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.pm-detail .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
.pm-detail .stat { border-bottom: 0; padding: 6px 0 2px; }
.pm-detail .stat .v { font-size: 14px; }

.pm-grid { display: grid; gap: 6px 10px; margin-top: 8px; align-items: start; font-size: 13px; }
.pm-grid.c2 { grid-template-columns: 1fr auto; }
.pm-grid.c4 { grid-template-columns: auto 1fr 1fr 1fr; }
.pm-grid .h { font-size: 11px; color: var(--muted); font-weight: 600; }
.pm-grid .num { text-align: right; font-weight: 700; }
.pm-grid .l { font-weight: 700; }
.pm-grid .h:not(:first-child) { text-align: right; }
.pm-grid.c4 { grid-template-columns: auto repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .pm-grid { font-size: 12px; gap: 6px 6px; } .pm-grid .num .xs, .pm-grid .num span { font-size: 11px; } }
/* relatórios */
.rep-wrap { padding: 0; overflow-x: auto; }
.rep { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; white-space: nowrap; }
.rep th, .rep td { padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--border); }
.rep thead th { font-size: 11px; color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--surface); }
.rep .c { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; font-weight: 700; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.rep .c .ms { vertical-align: -3px; margin-right: 6px; }
.rep td button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; font-variant-numeric: tabular-nums; }
.rep td button:hover { color: var(--primary); text-decoration: underline; }
.rep td { font-variant-numeric: tabular-nums; }
.rep .b, .rep tfoot td, .rep tfoot th { font-weight: 800; }
.rep tfoot th, .rep tfoot td { border-bottom: 0; background: var(--surface-2); }
.rep tfoot .c { background: var(--surface-2); }
.chip[disabled] { opacity: .35; pointer-events: none; }
/* renda passiva: simulador e exemplo diversificado */
.sim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.sim-grid .field { margin-top: 8px; }
.sim-grid .field .hint { font-size: 11px; }
.sim-res { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--up) 12%, transparent); }
.sim-res .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.sim-res .v { font-size: 22px; font-weight: 800; margin-top: 2px; }
.ap-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.ap-grid > div { padding: 8px 10px; border-radius: 12px; background: var(--surface-2); font-size: 13px; }
.mixbar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 2px; }
.mixbar i { display: block; height: 100%; }
.banner.warn-b { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.banner.warn-b .ms { color: var(--warn); }
@media (max-width: 640px) { .ap-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .sim-grid { grid-template-columns: 1fr; } }
.ap-grid > div.ok { background: color-mix(in srgb, var(--up) 12%, transparent); }
.ap-grid .num.bold { font-size: 14px; margin-top: 2px; }
.input-wrap .suf { white-space: nowrap; }
.sim-h { font-size: 13px; font-weight: 700; margin-top: 12px; }
.yr-list { margin-top: 6px; border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.yr { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.yr:last-child { border-bottom: 0; }
.yr.ok { background: color-mix(in srgb, var(--up) 10%, transparent); }
.yr-y { font-size: 13px; font-weight: 700; }
.yr-y small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.yr-v { min-width: 0; }
.yr-v .num { font-size: 15px; }
.yr-v small { font-size: 11px; color: var(--muted); font-weight: 500; }
.yr-v .track { height: 5px; margin: 5px 0 3px; }
.yr-v .fillb { background: var(--up); }
.yr-v.right-v { text-align: right; }
.sim-note { display: flex; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.sim-note b { color: var(--text); }
.mixleg { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.mixleg span { display: inline-flex; align-items: center; gap: 5px; }
.mixleg i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.mixleg b { color: var(--text); margin-left: 2px; }
.practices { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; }
.practices li { display: flex; gap: 8px; align-items: flex-start; }
.practices li > .ms { color: var(--up); font-size: 18px; margin-top: 1px; }
.practices b { display: block; font-size: 13px; }
.practices span { display: block; font-size: 12px; color: var(--muted); line-height: 1.45; }
/* alertas */
.switch { position: relative; width: 44px; height: 26px; border-radius: 99px; background: var(--surface-3, var(--border)); border: 0; flex: none; cursor: pointer; transition: background .2s; padding: 0; }
.switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch.on { background: var(--up); }
.switch.on i { transform: translateX(18px); }
.al-row { display: flex; align-items: center; gap: 10px; }
.al-row .al-main { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: center; background: none; border: 0; color: inherit; text-align: left; padding: 0; cursor: pointer; font: inherit; }
.al-row.off .al-main { opacity: .55; }
.al-mail { width: 100%; margin-top: 14px; padding-top: 12px; border: 0; border-top: 1px solid var(--border); background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; align-items: center; }
.empty-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 24px; text-align: center; }
.empty-card .ms { font-size: 30px; color: var(--muted); }
.dot-new { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); vertical-align: middle; }
.nbadge { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--down); color: #fff; font-size: 10px; font-weight: 800; line-height: 17px; text-align: center; }
.nbadge[hidden] { display: none; }
.nav a { position: relative; }
.icon-btn.bell { position: relative; }
.icon-btn.on .ms { color: var(--primary); }
/* carteira cripto: ocultar moedas */
.wa-row { display: flex; align-items: center; gap: 6px; }
.wa-row .wa-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.wa-row.off .wa-main { opacity: .55; }
.icon-btn.sm { width: 34px; height: 34px; flex: none; }
.icon-btn.sm .ms { font-size: 19px; }
.wa-more { margin-top: 10px; }
.wa-more summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); padding: 8px 4px; }
.wa-more summary::-webkit-details-marker { display: none; }
.wa-more summary .ms { font-size: 18px; }
