/* Layout: celular = 1 coluna + barra de abas embaixo; tablet = 2 colunas;
   PC (≥1024px) = menu lateral fixo + grade de 12 colunas com cards lado a lado.
   Identidade: a cédula do real. Papel de segurança com guilhoché ao fundo, tinta verde, as cores de
   cada nota nas categorias e valores em letra larga, como o número de uma nota (seção "Visual cédula"). */
:root {
  color-scheme: light;
  --bg: #e6ece4;            /* papel de segurança, verde-acinzentado */
  --surface: #f5f8f2;
  --surface-2: #e4eae1;
  --border: #d3dccf;
  --text: #12302a;          /* tinta verde-escura, nunca preto */
  --text-2: #4b6159;
  --text-3: #6c7f77;
  --accent: #0e6b4e;
  --accent-hover: #0a573f;
  --accent-ink: #ffffff;
  --accent-soft: #d4e8dc;
  --note: #0f3b30;          /* fundo dos cartões de destaque (cédula) */
  --note-ink: #eef6f0;
  --note-line: rgb(255 255 255 / 0.08);
  --series-1: #2c6ba6;      /* azul da nota de 100 */
  --series-2: #b9762b;      /* ocre da nota de 50 */
  --good: #11753f;
  --warning: #995800;
  --critical: #c0302f;
  --good-bg: #e2f2e7;
  --warning-bg: #f9eed8;
  --critical-bg: #f9e3e2;
  --info-bg: #e7eef3;
  --focus: #2a78d6;

  /* Uma família só (Archivo), usando a largura variável como personalidade:
     estreita no texto, bem larga nos valores e na saudação. */
  --font-display: "Archivo", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --font-body: "Archivo", "Helvetica Neue", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-num: "Archivo", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --sidebar: 248px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f2622; --surface: #15302a; --surface-2: #1c3a33; --border: #24443c;
    --text: #e8f1ea; --text-2: #a9beb4; --text-3: #81978d;
    --accent: #6fcf9f; --accent-hover: #88dbb2; --accent-ink: #082019; --accent-soft: #1d4438;
    --note: #0b2e25; --note-ink: #e8f3ec; --note-line: rgb(255 255 255 / 0.06);
    --series-1: #6aa5dc; --series-2: #e0a458;
    --good: #4cc27a; --warning: #e3a33b; --critical: #f07170;
    --good-bg: #143021; --warning-bg: #33270e; --critical-bg: #3a1919; --info-bg: #17232c;
    --focus: #6da7ec;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f2622; --surface: #15302a; --surface-2: #1c3a33; --border: #24443c;
  --text: #e8f1ea; --text-2: #a9beb4; --text-3: #81978d;
  --accent: #6fcf9f; --accent-hover: #88dbb2; --accent-ink: #082019; --accent-soft: #1d4438;
  --note: #0b2e25; --note-ink: #e8f3ec; --note-line: rgb(255 255 255 / 0.06);
  --series-1: #6aa5dc; --series-2: #e0a458;
  --good: #4cc27a; --warning: #e3a33b; --critical: #f07170;
  --good-bg: #143021; --warning-bg: #33270e; --critical-bg: #3a1919; --info-bg: #17232c;
  --focus: #6da7ec;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
/* O cabeçalho fixo não pode cobrir o campo em foco. */
html { scroll-padding-top: 88px; -webkit-tap-highlight-color: transparent; }
button, a, input, select, textarea, summary { touch-action: manipulation; }
.sr-only, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link:focus {
  position: fixed; z-index: 30; top: calc(8px + env(safe-area-inset-top, 0px)); left: max(16px, env(safe-area-inset-left, 0px));
  background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: var(--radius-sm); font-weight: 600;
}
main:focus { outline: none; }
.form-status { margin: 0; font-size: 0.88rem; color: var(--good); min-height: 1.3em; }
.form-status.error { color: var(--critical); }
.form-status:empty { min-height: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--text-2); margin: 0 0 0.75rem; font-size: 0.9rem; }
kbd {
  font-family: var(--font-num); font-size: 0.75rem; padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}

/* ---------- Topo ---------- */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface);
}
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 6;
  display: flex; align-items: center; gap: 12px;
  padding-block: 10px; padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand, .side-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.page-title { margin: 0; font-size: 1.5rem; font-weight: 800; }
/* No celular o título fica só para leitores de tela (a aba ativa já aparece embaixo). */
@media (max-width: 1023px) {
  .page-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.month-picker { margin-left: auto; display: flex; align-items: center; gap: 4px; font-weight: 600; font-size: 0.95rem; }
.month-picker span { min-width: 9.5em; text-align: center; }
.month-picker button {
  border: 1px solid var(--border); background: var(--surface); width: 34px; height: 34px; border-radius: 50%;
  cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.month-picker button:hover { background: var(--surface-2); }

/* ---------- Grade ---------- */
main {
  max-width: 1280px; margin: 0 auto;
  padding-block: 16px 24px; padding-left: var(--gutter-l); padding-right: var(--gutter-r);
}
.tab { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.tab[hidden] { display: none; }
.tab > * { min-width: 0; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; min-width: 0;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 0.75rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.link { color: var(--accent); font-size: 0.9rem; font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* Cartão de destaque: fundo de cédula com guilhoché. */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: 6px; justify-content: center;
  background: var(--note); color: var(--note-ink); border: 0; min-height: 132px;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    repeating-radial-gradient(circle at 110% -10%, transparent 0 13px, var(--note-line) 13px 14px),
    repeating-radial-gradient(circle at -10% 120%, transparent 0 17px, var(--note-line) 17px 18px);
}
.hero .stat-label { color: inherit; opacity: 0.85; font-size: 0.85rem; font-weight: 600; }
.hero .muted { color: inherit; opacity: 0.85; margin: 0; }
.hero-value { font-family: var(--font-num); font-size: clamp(1.9rem, 6vw, 2.6rem); font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

/* ---------- Botões ---------- */
.primary, .secondary, .danger {
  border: 0; border-radius: var(--radius-sm); padding: 10px 16px; font-weight: 600; cursor: pointer;
  transition: background-color 0.15s ease;
}
.primary { background: var(--accent); color: var(--accent-ink); }
.primary:hover { background: var(--accent-hover); }
.secondary { background: var(--surface-2); }
.secondary:hover { background: var(--border); }
.danger { background: var(--critical-bg); color: var(--critical); }
button:disabled { opacity: 0.6; cursor: progress; }
.icon-btn {
  border: 0; background: var(--surface-2); border-radius: 8px; width: 32px; height: 32px; flex: none;
  cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { background: var(--critical-bg); color: var(--critical); }

/* ---------- Início: conversa ---------- */
.chat-tab { display: block; }
.chat {
  max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px;
  padding-top: clamp(8px, 6vh, 64px);
}
.chat-greeting h2 {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(1.8rem, 6vw, 2.6rem);
  letter-spacing: -0.03em; line-height: 1.1; margin: 0;
}
.chat-greeting p { margin: 6px 0 4px; color: var(--text-2); font-size: 1.05rem; }
.chat-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.chat-log:empty { display: none; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 18px; font-size: 0.95rem; overflow-wrap: anywhere; }
.bubble.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; }
.bubble.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.bubble.bot strong { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.bubble.bot ul { margin: 4px 0 0; padding: 0; list-style: none; font-size: 0.92rem; color: var(--text); }
.bubble.bot ul li + li { margin-top: 2px; }
.bubble.bot p { margin: 6px 0 0; font-size: 0.88rem; color: var(--text-2); }
.bubble.bot.error { background: var(--critical-bg); border-color: transparent; }
.bubble.bot.error ul { font-family: var(--font-body); }
.bubble.bot.undone { opacity: 0.7; }
.undo {
  margin-top: 8px; border: 1px solid var(--border); background: transparent; border-radius: 999px;
  padding: 3px 12px; font-size: 0.8rem; color: var(--text-2); cursor: pointer;
}
.undo:hover { border-color: var(--critical); color: var(--critical); }

.composer {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 18px;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 999px;
  box-shadow: 0 6px 24px -12px rgb(12 58 44 / 0.25);
}
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.composer input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 0; font-size: 1.1rem; }
.composer input:focus { outline: none; }
.send {
  flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
  transition: background-color 0.15s ease;
}
.send:hover { background: var(--accent-hover); }
.send svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mic {
  flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: transparent; color: var(--text-2); display: grid; place-items: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.mic:hover { color: var(--text); background: var(--accent-soft); }
.mic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mic[aria-pressed="true"] { background: var(--critical); color: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .mic[aria-pressed="true"] { animation: mic-pulse 1.2s ease-in-out infinite; }
}
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 7px rgb(200 60 50 / 0.18); } }
.preview { min-height: 1.6em; padding-inline: 12px; font-size: 0.88rem; color: var(--text-2); }
.preview:empty { min-height: 0; }
.preview .pill { display: inline-block; background: var(--accent-soft); color: var(--text); border-radius: 999px; padding: 3px 12px; margin: 2px 4px 2px 0; }
.preview .err { color: var(--critical); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding-inline: 4px; }
.chip {
  border: 1px solid var(--border); background: transparent; border-radius: 999px; padding: 5px 12px;
  font-size: 0.82rem; color: var(--text-2); cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chat-log:not(:empty) ~ .chips { display: none; }

.mini { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.mini-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.mini-head h2 { margin: 0; font-size: 0.95rem; color: var(--text-2); font-weight: 600; }
.mini-total { font-family: var(--font-num); font-weight: 600; font-variant-numeric: tabular-nums; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { border-top: 1px solid var(--border); }
.mini-list li:first-child { border-top: 0; }
.link-btn { border: 0; background: none; color: var(--accent); font-weight: 600; padding: 8px 0; cursor: pointer; font-size: 0.9rem; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Números do mês ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat {
  display: flex; flex-direction: column; gap: 2px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.stat-label { font-size: 0.78rem; color: var(--text-2); font-weight: 500; }
.stat-value { font-family: var(--font-num); font-size: clamp(0.82rem, 3.4vw, 1.35rem); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -0.02em; }
.neg { color: var(--critical); }
.pos { color: var(--good); }

/* ---------- Dicas e alertas ---------- */
.insights { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.insights:empty { display: none; }
.insights li {
  padding: 10px 12px; border-radius: var(--radius-sm); background: var(--info-bg); font-size: 0.92rem;
  display: flex; gap: 10px; align-items: baseline;
}
.insights li::before { content: "i"; flex: none; width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 0.72rem; font-weight: 700; background: var(--text-3); color: var(--surface); transform: translateY(2px); }
.insights li.good { background: var(--good-bg); }
.insights li.good::before { content: "✓"; background: var(--good); }
.insights li.warning { background: var(--warning-bg); }
.insights li.warning::before { content: "!"; background: var(--warning); }
.insights li.critical { background: var(--critical-bg); }
.insights li.critical::before { content: "!"; background: var(--critical); }

/* ---------- Listas de lançamentos ---------- */
.tx-list { list-style: none; margin: 0; padding: 0; }
.tx-list li { border-top: 1px solid var(--border); }
.tx-list li:first-child { border-top: 0; }
.tx-item { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 4px; background: none; border: 0; text-align: left; cursor: pointer; border-radius: 8px; }
button.tx-item:hover { background: var(--surface-2); }
.tx-main { flex: 1; min-width: 0; }
.tx-desc { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-meta { display: block; font-size: 0.8rem; color: var(--text-2); }
.tx-amount { font-family: var(--font-num); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 0.95rem; }
.tx-amount.income { color: var(--good); }
.empty { color: var(--text-3); padding: 12px 0; text-align: center; list-style: none; }

/* ---------- Gráficos ---------- */
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 28%) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 0.9rem; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 14px; background: var(--surface-2); border-radius: 4px; position: relative; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar-budget { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); }
.hbar-value { font-family: var(--font-num); font-variant-numeric: tabular-nums; text-align: right; font-size: 0.85rem; }
.hbar-value small { display: block; color: var(--text-3); font-size: 0.72rem; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis-label { fill: var(--text-3); font-size: 11px; font-family: var(--font-body); }
.chart .bar-1 { fill: var(--series-1); }
.chart .bar-2 { fill: var(--series-2); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hover-band.on { fill: var(--surface-2); }
.legend { display: flex; gap: 16px; font-size: 0.85rem; color: var(--text-2); margin-bottom: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw.s1 { background: var(--series-1); }
.sw.s2 { background: var(--series-2); }
.tooltip {
  position: fixed; z-index: 20; pointer-events: none; background: var(--text); color: var(--surface);
  padding: 6px 10px; border-radius: 8px; font-size: 0.8rem; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px));
}
.table-view { margin-top: 12px; font-size: 0.9rem; }
details > summary { cursor: pointer; color: var(--accent); font-weight: 600; }
table { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 0.8rem; color: var(--text-3); font-weight: 600; }
td.num, th.num { text-align: right; }
.places { margin: 0; padding-left: 1.5rem; display: grid; gap: 8px; }
.places li { padding-left: 4px; }
.places li span { float: right; font-family: var(--font-num); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.places small { color: var(--text-3); }

.rule { display: grid; gap: 16px; }
.rule-row header { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 6px; gap: 8px; flex-wrap: wrap; }
.meter { height: 10px; background: var(--surface-2); border-radius: 4px; position: relative; overflow: hidden; }
.meter-fill { height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }
.meter-fill.over { background: var(--critical); }
.meter-target { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); }
.rule-row small { color: var(--text-2); display: block; margin-top: 4px; }

/* ---------- Investir ---------- */
.market { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.market div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; }
.market b { display: block; font-family: var(--font-num); font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.market span { font-size: 0.78rem; color: var(--text-2); }
.market-note { grid-column: 1 / -1; background: none !important; padding: 0 !important; font-size: 0.8rem; color: var(--text-3); margin: 0; }
.allocation { display: grid; gap: 10px; }
.alloc { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.alloc header { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.alloc header span:first-child { min-width: 0; }
.alloc header span:last-child { font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.alloc p { margin: 0; font-size: 0.85rem; color: var(--text-2); }
.alloc ul { margin: 2px 0 0; padding-left: 1.1rem; font-size: 0.88rem; }
.alloc li span { color: var(--text-2); }
.projection { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.projection div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; }
.projection b { display: block; font-family: var(--font-num); font-size: clamp(0.95rem, 1.3vw, 1.15rem); overflow-wrap: anywhere; font-weight: 600; font-variant-numeric: tabular-nums; }
.projection small { color: var(--text-2); display: block; }
.research-section h3 { font-size: 0.95rem; margin: 16px 0 6px; }
.table-scroll { overflow-x: auto; }
.research-section table { font-size: 0.86rem; }
.research-section td small { color: var(--text-2); display: block; }
.sources { font-size: 0.8rem; padding-left: 1.1rem; }
.sources a { color: var(--accent); overflow-wrap: anywhere; }
.import { margin-top: 14px; }
.import textarea { width: 100%; margin: 8px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; background: var(--bg); font-family: var(--font-num); font-size: 0.8rem; }
.disclaimer { font-size: 0.78rem; color: var(--text-3); text-align: center; margin: 4px auto 0; max-width: 62ch; }
.progress-bar { height: 10px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.progress-bar div { height: 100%; background: var(--good); border-radius: 0 4px 4px 0; }

/* ---------- Carteira ---------- */
.positions { display: grid; gap: 10px; }
.position { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.position-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.position-head b { font-family: var(--font-num); font-size: 1rem; letter-spacing: 0.02em; }
.position-head .val { font-family: var(--font-num); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.position-meta { display: flex; justify-content: space-between; align-items: center; gap: 4px 10px; font-size: 0.84rem; color: var(--text-2); flex-wrap: wrap; }
.position-meta .num { font-variant-numeric: tabular-nums; }
.position select { padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; background-color: var(--bg); color: var(--text); font-size: 0.8rem; }
.watch-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; align-items: end; margin-bottom: 12px; }
.watch-form label { display: grid; gap: 4px; font-size: 0.85rem; font-weight: 600; }
.watch-form input { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); width: 100%; }
.watchlist { list-style: none; margin: 0; padding: 0; }
.watchlist li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.watchlist li:first-child { border-top: 0; }
.watchlist .w-main { flex: 1; min-width: 0; }
.watchlist .w-main b { font-family: var(--font-num); }
.watchlist small { display: block; color: var(--text-2); }
.watchlist .w-price { font-family: var(--font-num); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Formulários ---------- */
.form { display: grid; gap: 14px; align-content: start; }
.form h2 { margin: 0; }
.form label { display: grid; gap: 5px; font-size: 0.9rem; font-weight: 600; }
.form small { font-weight: 400; color: var(--text-3); }
.form input, .form select {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background-color: var(--bg); color: var(--text); font-weight: 400; width: 100%;
}
.form > .primary { justify-self: start; }
.budgets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }

dialog {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 22px;
  width: min(460px, calc(100vw - 32px)); background: var(--surface); color: var(--text);
  overscroll-behavior: contain;
}
dialog::backdrop { background: rgb(5 15 11 / 0.5); }
.dialog-actions { display: flex; gap: 8px; align-items: center; }
.spacer { flex: 1; }

/* ---------- Navegação: barra embaixo (celular/tablet) ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 6;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
.side-brand, .side-note { display: none; }
.tabbar button {
  border: 0; background: none; padding: 8px 2px 10px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 0.72rem; font-weight: 500; color: var(--text-2); cursor: pointer;
}
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button.active { color: var(--accent); font-weight: 700; }

/* ---------- Tablet: 2 colunas ---------- */
@media (min-width: 700px) {
  .tab { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w-12 { grid-column: 1 / -1; }
  .card { padding: 20px; }
}

/* ---------- PC: menu lateral + grade de 12 colunas ---------- */
@media (min-width: 1024px) {
  body { padding-bottom: 0; padding-left: var(--sidebar); }
  .brand { display: none; }
  .topbar { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); padding-block: 16px; }
  main { padding-block: 24px 40px; padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); }
  .tab { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
  .w-12 { grid-column: span 12; }
  .w-7 { grid-column: span 7; }
  .w-6 { grid-column: span 6; }
  .w-5 { grid-column: span 5; }

  .tabbar {
    top: 0; right: auto; width: var(--sidebar);
    display: flex; flex-direction: column; gap: 4px;
    padding: 20px 14px; padding-left: max(14px, env(safe-area-inset-left, 0px));
    border-top: 0; border-right: 1px solid var(--border);
  }
  .side-brand { display: flex; padding: 4px 10px 22px; font-size: 1.3rem; }
  .tabbar button {
    flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 12px; border-radius: var(--radius-sm);
    font-size: 0.95rem;
  }
  .tabbar button:hover { background: var(--surface-2); color: var(--text); }
  .tabbar button.active { background: var(--accent-soft); color: var(--accent); }
  /* "Ajustes" fica no rodapé do menu. */
  .side-note { display: block; order: 98; margin: auto 10px 10px; font-size: 0.8rem; color: var(--text-3); }
  #nav-settings { order: 99; }

  .stat { padding: 16px 18px; }
  .tx-list { max-height: 640px; overflow-y: auto; }
  #research { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; align-items: start; }
  #research > p { grid-column: 1 / -1; }
}

@media (min-width: 1440px) {
  :root { --sidebar: 268px; }
}

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

/* ---------- Instalar como app ---------- */
.install-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  border: 0; border-radius: 999px; padding: 7px 12px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 0.85rem;
}
.install-btn:hover { background: var(--accent-hover); }
.install-btn[hidden] { display: none; }
.install-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#month-label .short { display: none; }
@media (max-width: 480px) {
  #month-label .long { display: none; }
  #month-label .short { display: inline; }
  .month-picker span#month-label { min-width: 4.6em; }
  .install-btn span { display: none; }
  .install-btn { padding: 8px; }
  .install-btn::after { content: "Instalar"; }
}
.steps { margin: 0; padding-left: 1.3rem; display: grid; gap: 10px; }
.inline-icon { width: 20px; height: 20px; vertical-align: -4px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Aberto como app instalado: a barra de status do iPhone fica por cima do conteúdo. */
@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top, 0px); }
}

/* =====================================================================
   Visual cédula
   Fundo: papel de segurança com guilhoché (linhas finas onduladas, como numa nota de real).
   Superfícies: chapadas, sem vidro; o desenho do fundo aparece nas margens, não atrás do texto.
   PC: barra de ícones à esquerda; celular: barra de abas flutuando embaixo.
   ===================================================================== */
:root {
  --guilloche: rgb(18 48 42 / 0.075);
  --tint: radial-gradient(90% 60% at 100% 0%, rgb(14 107 78 / 0.10), transparent 70%),
          radial-gradient(70% 50% at 0% 100%, rgb(185 118 43 / 0.08), transparent 70%);
  --glass: var(--surface);
  --glass-strong: var(--surface);
  --glass-inner: rgb(18 48 42 / 0.045);
  --glass-border: rgb(18 48 42 / 0.10);
  --glass-shadow: 0 1px 2px rgb(18 48 42 / 0.06);
  --surface-2: rgb(18 48 42 / 0.06);
  --border: rgb(18 48 42 / 0.10);
  --bar-muted: rgb(18 48 42 / 0.16);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --guilloche: rgb(190 240 215 / 0.055);
    --tint: radial-gradient(90% 60% at 100% 0%, rgb(111 207 159 / 0.10), transparent 70%),
            radial-gradient(70% 50% at 0% 100%, rgb(224 164 88 / 0.07), transparent 70%);
    --glass-inner: rgb(232 241 234 / 0.05);
    --glass-border: rgb(232 241 234 / 0.09);
    --glass-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
    --surface-2: rgb(232 241 234 / 0.07);
    --border: rgb(232 241 234 / 0.09);
    --bar-muted: rgb(232 241 234 / 0.2);
  }
}
:root[data-theme="dark"] {
  --guilloche: rgb(190 240 215 / 0.055);
  --tint: radial-gradient(90% 60% at 100% 0%, rgb(111 207 159 / 0.10), transparent 70%),
          radial-gradient(70% 50% at 0% 100%, rgb(224 164 88 / 0.07), transparent 70%);
  --glass-inner: rgb(232 241 234 / 0.05);
  --glass-border: rgb(232 241 234 / 0.09);
  --glass-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
  --surface-2: rgb(232 241 234 / 0.07);
  --border: rgb(232 241 234 / 0.09);
  --bar-muted: rgb(232 241 234 / 0.2);
}

/* Fundo fixo numa camada própria (background-attachment: fixed não funciona no iPhone). */
body { background: var(--bg); }
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--guilloche);
  -webkit-mask: url("guilloche.svg") 0 0 / 280px 280px repeat;
  mask: url("guilloche.svg") 0 0 / 280px 280px repeat;
}
body::before { inset: 0; height: auto; z-index: -2; background: var(--tint); }

/* Superfícies chapadas */
.card, .stat, .composer, .bubble.bot, dialog, .topbar, .tabbar {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
dialog { box-shadow: 0 24px 60px -20px rgb(0 0 0 / 0.45); }
dialog::backdrop { background: rgb(8 24 20 / 0.5); }
.card { border-radius: 18px; }

.alloc, .position, .market div, .projection div, .chip, .month-picker button, kbd, .icon-btn, .secondary, .undo {
  background: var(--glass-inner);
  border-color: var(--glass-border);
}
.alloc, .position { border-radius: 12px; }
.secondary:hover, .month-picker button:hover, .icon-btn:hover { background: var(--surface-2); }
.form input, .form select, .watch-form input, .import textarea { background-color: var(--glass-inner); }
.form select option { background: var(--surface); }

/* Números do mês: uma faixa só, dividida por fios, em vez de três cartões soltos. */
.stats { gap: 0; background: var(--surface); border: 1px solid var(--glass-border); border-radius: 18px; overflow: hidden; box-shadow: var(--glass-shadow); }
.stats .stat { background: none; border: 0; border-left: 1px solid var(--glass-border); border-radius: 0; box-shadow: none; padding: 16px; }
.stats .stat:first-child { border-left: 0; }
.stat { position: relative; overflow: hidden; gap: 4px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.stat-icon { display: none; }
.spark { width: 100%; height: 30px; display: block; margin-top: 6px; overflow: visible; }
.spark .line { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.spark .end { stroke: var(--surface); stroke-width: 2; }
.stat .trend { font-size: 0.72rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; width: fit-content; background: var(--glass-inner); }

/* Cartão de destaque: a própria cédula, com moldura dupla e guilhoché. */
.hero {
  background: var(--note); color: var(--note-ink); border: 0;
  box-shadow: inset 0 0 0 6px var(--note), inset 0 0 0 7px rgb(255 255 255 / 0.22);
}

/* Valores: Archivo bem larga e com algarismos de mesma largura, como o número de uma nota. */
.stat-value, .tx-amount, .hbar-value, .mini-total, .places li span, .market b, .alloc header span:last-child,
.projection b, .position-head .val, .watchlist .w-price, .cal-val, .hero-value, .position-head b, .watchlist .w-main b {
  font-stretch: 118%; font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
.stat-value { font-weight: 700; font-size: clamp(0.95rem, 3.8vw, 1.5rem); }
.hero-value { font-weight: 800; font-stretch: 125%; }
.chat-greeting h2 { font-stretch: 125%; font-weight: 800; letter-spacing: -0.035em; }
.page-title, .brand, .side-brand { font-stretch: 112%; }
h2 { font-weight: 650; }

/* Gráfico por dia */
.chart .bar-muted { fill: var(--bar-muted); }
.chart .bar-hi { fill: var(--series-1); }

/* Topo e barra de abas */
.topbar { margin: 10px 12px 0; border-radius: 16px; top: calc(10px + env(safe-area-inset-top, 0px)); }
.tabbar {
  left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px; padding: 4px; box-shadow: 0 10px 30px -12px rgb(8 24 20 / 0.35);
}
.tabbar button { border-radius: 18px; padding: 7px 2px 8px; }
.tabbar button.active { background: var(--accent-soft); }
body { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

/* PC: barra de ícones à esquerda, com o nome ao passar o mouse */
@media (min-width: 1024px) {
  :root { --sidebar: 104px; }
  body { padding-bottom: 24px; }
  .brand { display: flex; }
  .topbar { width: min(1216px, 100% - 64px); margin: 16px auto 0; top: 16px; }
  .tabbar {
    top: 50%; bottom: auto; left: 20px; right: auto; width: auto; transform: translateY(-50%);
    padding: 10px 8px; gap: 6px; border-radius: 999px; border-right: 1px solid var(--glass-border);
  }
  .side-brand, .side-note { display: none; }
  #nav-settings { order: 0; }
  .tabbar button { position: relative; width: 48px; height: 48px; padding: 0; justify-content: center; border-radius: 50%; }
  .tabbar button span {
    position: absolute; left: calc(100% + 12px); top: 50%; transform: translate(-6px, -50%);
    white-space: nowrap; pointer-events: none; opacity: 0;
    padding: 6px 12px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; color: var(--text);
    background: var(--surface); border: 1px solid var(--glass-border);
    transition: opacity 0.15s ease, transform 0.15s ease;
  }
  .tabbar button:hover span, .tabbar button:focus-visible span { opacity: 1; transform: translate(0, -50%); }
  .tabbar button.active { background: var(--accent); color: var(--accent-ink); }
  .tabbar button:hover:not(.active) { background: var(--surface-2); }
}

/* Saudação digitada letra por letra, com cursor piscando */
.caret {
  display: inline-block; width: 0.08em; height: 0.95em; margin-left: 0.06em; vertical-align: -0.08em;
  background: var(--accent); border-radius: 2px; animation: caret-blink 1s steps(1) infinite;
  transition: opacity 0.4s ease;
}
.caret.done { opacity: 0; animation: none; }
@keyframes caret-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { display: none; } }
#name-dialog input { font-size: 1.1rem; padding: 12px 14px; }

/* Celular estreito: só o ícone da marca, para caber Instalar e o mês no topo. */
@media (max-width: 480px) {
  .brand-name { display: none; }
  .topbar { gap: 8px; }
  .month-picker { gap: 2px; }
  .month-picker button { width: 32px; height: 32px; }
}

button.link { border: 0; background: none; padding: 4px; cursor: pointer; }
.tx-edit { flex: none; color: var(--text-2); opacity: 0.55; }
button.tx-item:hover .tx-edit, button.tx-item:focus-visible .tx-edit { opacity: 1; color: var(--accent); }
.mini-hint { margin: 0 0 4px; font-size: 0.8rem; color: var(--text-2); }
.bubble-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.bubble-actions .undo { margin: 0; }
.undo.fix:hover { border-color: var(--accent); color: var(--accent); }
.stat-sub { font-size: 0.78rem; color: var(--text-2); margin-top: 2px; }
.tag-credit { color: var(--accent); font-weight: 600; }
.card-help { margin: 0; }
.card-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.card-list li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--glass-inner); border: 1px solid var(--glass-border); }
.card-list li.empty { background: none; border: 0; padding: 0; color: var(--text-2); }
#edit-form label[hidden] { display: none; }
@media (max-width: 420px) {
  .tabbar button { font-size: 0.64rem; letter-spacing: -0.01em; }
  .tabbar svg { width: 20px; height: 20px; }
}

/* Ajustes em abas */
.subtabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--glass-inner); border: 1px solid var(--glass-border); overflow-x: auto; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button { flex: 1 0 auto; border: 0; background: none; padding: 9px 16px; border-radius: 999px; font: inherit; font-weight: 600; font-size: 0.9rem; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.subtabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
#tab-settings .pane[hidden], .month-picker[hidden] { display: none; }

/* Calendário */
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.cal-head { text-align: center; font-size: 0.75rem; font-weight: 600; color: var(--text-2); padding-bottom: 2px; }
.cal-day { aspect-ratio: 1 / 1; min-height: 40px; border: 1px solid var(--glass-border); border-radius: 12px; background: var(--glass-inner);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 6px; cursor: pointer; font: inherit; color: var(--text); text-align: left; }
.cal-num { font-size: 0.8rem; font-weight: 600; }
.cal-val { font-family: var(--font-num); font-size: 0.72rem; font-weight: 600; }
.cal-day.l1 { background: color-mix(in srgb, var(--series-2) 18%, transparent); }
.cal-day.l2 { background: color-mix(in srgb, var(--series-2) 36%, transparent); }
.cal-day.l3 { background: color-mix(in srgb, var(--series-2) 58%, transparent); }
.cal-day.l4 { background: color-mix(in srgb, var(--series-2) 82%, transparent); color: #fff; }
.cal-day.today { border-color: var(--accent); border-width: 2px; }
.cal-day.selected { outline: 2px solid var(--text); outline-offset: 1px; }
.cal-legend { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; }
.cal-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cal-legend .l1 { background: color-mix(in srgb, var(--series-2) 18%, transparent); }
.cal-legend .l2 { background: color-mix(in srgb, var(--series-2) 36%, transparent); }
.cal-legend .l3 { background: color-mix(in srgb, var(--series-2) 58%, transparent); }
.cal-legend .l4 { background: color-mix(in srgb, var(--series-2) 82%, transparent); }
.calendar-day { margin-top: 14px; }
.calendar-day h3 { margin: 0; font-size: 1rem; }
@media (max-width: 480px) {
  .calendar { gap: 4px; }
  .cal-day { padding: 4px; border-radius: 9px; }
  .cal-val { font-size: 0.62rem; }
}

/* Pergunta de categoria no chat */
.ask { margin: 8px 0 4px; font-weight: 600; font-size: 0.88rem; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-chips .chip { font-size: 0.8rem; padding: 5px 10px; }
@media (min-width: 720px) {
  .cal-day { aspect-ratio: auto; height: 64px; }
}
@media (max-width: 480px) {
  .subtabs button { flex: 1 1 auto; padding: 8px 10px; font-size: 0.84rem; }
}
@media (min-width: 720px) {
  .subtabs { max-width: 560px; }
}

/* Lista de lançamentos: valor e data alinhados à direita, ponto com a cor da categoria. */
.tx-right { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; flex: none; }
.tx-date { font-size: 0.75rem; color: var(--text-3); }
.cat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 1px; }
.tag-credit { color: var(--accent); font-weight: 600; margin-left: 4px; }

/* Dicas: faixa com fio colorido à esquerda em vez de ícone redondo. */
.insights li { border-left: 3px solid var(--text-3); border-radius: 4px 10px 10px 4px; background: var(--glass-inner); display: block; }
.insights li::before { content: none; }
.insights li.good { border-left-color: var(--good); background: var(--good-bg); }
.insights li.warning { border-left-color: var(--warning); background: var(--warning-bg); }
.insights li.critical { border-left-color: var(--critical); background: var(--critical-bg); }

/* Cripto agora */
.crypto-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); column-gap: 24px; }
.crypto-list li { display: grid; grid-template-columns: minmax(64px, auto) minmax(40px, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.crypto-list li.empty { display: block; }
.c-name { display: grid; line-height: 1.2; }
.c-name b { font-stretch: 112%; }
.c-name small { color: var(--text-2); font-size: 0.78rem; }
.crypto-spark { width: 100%; height: 30px; }
.c-price { display: grid; text-align: right; font-weight: 700; font-stretch: 112%; font-variant-numeric: tabular-nums; line-height: 1.25; }
.c-price small { font-size: 0.75rem; font-weight: 600; font-stretch: 100%; }
.c-watch { padding: 7px 10px; font-size: 0.8rem; }
@media (max-width: 480px) {
  .crypto-list li { gap: 8px; grid-template-columns: minmax(48px, auto) minmax(24px, 1fr) auto auto; }
  .c-watch { padding: 6px 8px; font-size: 0.75rem; }
  .c-price { font-size: 0.9rem; }
}
.notify-box { margin-bottom: 12px; }
.notify-box .muted { margin: 6px 0 0; }

/* Confirmação no chat */
.confirm-actions { margin-top: 10px; }
.primary.small { padding: 7px 14px; font-size: 0.85rem; border-radius: 999px; }

/* Resposta do assistente */
.bubble.bot.answer p { margin: 0; color: var(--text); font-size: 0.95rem; }
.bubble.bot.answer p + p { margin-top: 6px; }
.bubble.bot.thinking p { color: var(--text-2); }
@media (prefers-reduced-motion: no-preference) {
  .bubble.bot.thinking p { animation: pulse 1.2s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: 0.45; } }
}
.chip[hidden] { display: none; }

/* Plano em passos (aba Investir) */
.plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.plan li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; opacity: 0.7; }
.plan li.current, .plan li.done { opacity: 1; }
.plan-mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 0.85rem;
  border: 1.5px solid var(--glass-border); background: var(--glass-inner); }
.plan li.done .plan-mark { background: var(--good-bg); color: var(--good); border-color: transparent; }
.plan li.current .plan-mark { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.plan b { font-weight: 650; }
.plan small { margin-left: 6px; font-size: 0.75rem; font-weight: 600; color: var(--accent); }
.plan li.done small { color: var(--good); }
.plan p { margin: 2px 0 0; color: var(--text-2); font-size: 0.92rem; }
@media (min-width: 900px) { .plan { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.picks-note { font-size: 0.82rem; }
.picks { display: grid; gap: 8px; }
.picks li { display: grid; gap: 1px; }
.picks .why { color: var(--text-2); font-size: 0.8rem; }
.picks .risk { color: var(--warning); font-size: 0.8rem; }

/* Sugestão de limites */
.budget-suggest { margin: 18px 0 14px; padding-top: 16px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.budget-suggest:empty { display: none; }
.budget-suggest h3 { margin: 0; font-size: 1rem; }
.budget-suggest .muted { margin: 0; }
.bs-groups li { font-size: 0.88rem; }
.sw.tick { width: 2px; height: 12px; border-radius: 1px; background: var(--text); vertical-align: -2px; }
.hbar-value .cut { color: var(--warning); font-weight: 600; }
.hbar-value .cut::before { content: "! "; }
#use-suggest { justify-self: start; }
.bs-chart .hbar { grid-template-columns: minmax(80px, 24%) minmax(0, 1fr) 8.5em; }
@media (max-width: 480px) {
  .bs-chart .hbar { grid-template-columns: 6em minmax(0, 1fr) 8.4em; gap: 8px; font-size: 0.82rem; }
  .bs-chart .hbar-value { font-size: 0.8rem; }
  .bs-chart .hbar-value small { font-size: 0.68rem; }
}
.bs-chart .hbar-value small { white-space: nowrap; }
.bubble.bot p.habit-note { color: var(--text); background: var(--warning-bg); border-left: 3px solid var(--warning); padding: 6px 10px; border-radius: 4px 8px 8px 4px; }

/* Importar extrato */
.card-actions { display: flex; align-items: center; gap: 12px; }
.small-btn { padding: 6px 12px; font-size: 0.85rem; }
#import-dialog { width: min(640px, calc(100% - 24px)); }
#import-form label[hidden], #import-step1[hidden], #import-step2[hidden] { display: none; }
.import-summary { margin: 0 0 8px; font-size: 0.92rem; }
.import-list { list-style: none; margin: 0; padding: 0; max-height: min(52vh, 460px); overflow-y: auto; border-top: 1px solid var(--border); }
.import-list li { border-bottom: 1px solid var(--border); }
.import-list label { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 2px; font-weight: 400; cursor: pointer; }
.import-list input { width: 18px; height: 18px; accent-color: var(--accent); }
.imp-main { display: grid; min-width: 0; }
.imp-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.imp-main small { color: var(--text-2); font-size: 0.78rem; }
.import-list .badge { display: inline-block; margin: 2px 0 0 4px; padding: 0 6px; border-radius: 6px; background: var(--glass-inner); border: 1px solid var(--glass-border); font-size: 0.72rem; }
.import-list .badge.new { color: var(--accent); border-color: var(--accent); }
.import-list li.dup, .import-list li.skip { opacity: 0.75; }
.import-list .badge.maybe { color: var(--warning); border-color: var(--warning); }
.import-list .badge.warn { color: var(--critical); border-color: var(--critical); }
.imp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 2px; }
.import-missing { margin-top: 12px; }
.import-missing summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.import-missing p { font-size: 0.82rem; margin: 6px 0; }
.link.danger { color: var(--critical); background: none; border: 0; cursor: pointer; padding: 4px; font: inherit; font-size: 0.85rem; }

.import-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.import-cta h2 { margin-bottom: 2px; }
.import-cta p { margin: 0; }

.inline-form { display: grid; gap: 8px; margin: 10px 0 16px; }
.inline-form button { justify-self: start; }
.stat-sub b { color: var(--text); font-weight: 600; }
