/* Painel do assistente pessoal. Uma camada só: cada regra aparece uma vez, na seção do que ela desenha.
   Ordem: cores, base, botões, estrutura (menu, cabeçalho, conversa), listas e cartões, telas (finanças, hoje,
   tarefas), sino e, por último, o celular. */

/* ===== Cores: toda cor do painel sai daqui =====
   Base neutra e quente, menu em petróleo e duas cores de destaque: framboesa para ações (botões, seleção, foco)
   e petróleo médio para gráficos e indicadores. */
:root {
  /* superfícies */
  --bg: #f6f4ee;
  --panel: #ffffff;
  --subtle: #ece9e0;
  --line: #dfdbcf;
  --line-strong: #c4bfb0;
  /* texto */
  --text: #17272a;
  --muted: #5c696a;
  --disabled: #9aa3a2;
  --on-dark: #ffffff;
  /* menu */
  --side: #12333a;
  --side-text: #c5d9da;
  --side-active: #1f4a52;
  /* destaque 1: ações */
  --accent: #a3324e;
  --accent-hover: #862840;
  --spark: #e08ea2;
  --focus: #a3324e;
  --mine: #a3324e;
  --hers: #ece9e0;
  /* destaque 2: gráficos e indicadores */
  --accent-2: #2e7d83;
  --accent-2-bg: #e3eef0;
  --accent-2-line: #c9dde0;
  /* significado */
  --success: #1a7f4b;
  --success-bg: #e5f3ea;
  --warn: #fbefd6;
  --danger: #b42318;
  --danger-bg: #fde7e4;
  --danger-line: #e3a29b;
  --info-bg: #e9eeee;
  /* gráficos: paleta categórica já validada para daltonismo; não muda com o tema */
  --chart-todo: #8a93a3;
  --chart-rest: #c5cad3;
  --chart-prev: #d9d5c8;
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }
button, input, textarea { font: inherit; }
[hidden] { display: none !important; }
a { color: var(--text); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.error { color: var(--danger); min-height: 1.4em; margin: 8px 0 0; }
.empty { color: var(--muted); }

/* ===== Botões =====
   Três tipos: principal (.primary, e .go na tela Hoje), secundário (todo o resto: fundo claro) e link (.link).
   Abas e itens do menu têm desenho próprio, mais abaixo. */
.primary { background: var(--accent); color: var(--on-dark); border: 0; border-radius: 8px; padding: 10px 16px; cursor: pointer; }
.primary:hover:not(:disabled), .need button.go:hover:not(:disabled) { background: var(--accent-hover); }
.primary:disabled { opacity: 0.6; cursor: default; color: var(--on-dark); }
button:disabled { color: var(--disabled); }
button:not(.primary, .go, .link, [role="tab"], nav button) { background: var(--subtle); border-color: var(--line); color: var(--text); }
button:not(.primary, .go, .link, [role="tab"], nav button):hover:not(:disabled) { background: var(--line); }
.link, .link:disabled { color: var(--text); }
.link { background: none; border: 0; cursor: pointer; padding: 6px 4px; text-decoration: underline; text-underline-offset: 2px; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); }
.tabs > button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 9px 14px; cursor: pointer; color: var(--muted); font-weight: 500; margin-bottom: -1px; }
.tabs > button:hover { color: var(--text); }
.tabs > button:not(.on):hover:not(:disabled) { border-bottom-color: var(--line-strong); }
.tabs > button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs small { margin-left: 6px; background: var(--hers); color: var(--muted); border-radius: 999px; padding: 1px 7px; font-size: 12px; }

/* ===== Entrada ===== */
#login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
#login form { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px; width: min(380px, 100%); }
#login h1 { font-size: 20px; margin: 0 0 6px; }
#login p { color: var(--muted); margin: 0 0 18px; }
#login input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; }

/* ===== Estrutura =====
   A página em si nunca rola: o menu fica parado e só a lista aberta (ou a conversa) rola por dentro. */
body:has(#app:not([hidden])) { overflow: hidden; }
#app { display: grid; grid-template-columns: 220px minmax(0, 1fr) 380px; grid-template-rows: minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
/* A conversa fica só na tela Hoje, à direita. Nas outras telas o módulo ocupa a largura toda. */
#app:not([data-view="today"]) { grid-template-columns: 220px minmax(0, 1fr); }
#app:not([data-view="today"]) #dock { display: none; }
main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; overflow: hidden; }
header { flex: none; padding: 16px 24px; border-bottom: 1px solid var(--line); background: var(--panel); }
header h1 { font-size: 18px; margin: 0; }
section { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* Menu */
nav { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; padding: 18px 10px; gap: 2px; min-height: 0; overflow-y: auto; }
nav h2 { color: var(--on-dark); font-size: 16px; margin: 0 10px 16px; }
nav button { background: none; border: 0; color: inherit; text-align: left; padding: 9px 12px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; }
nav button[data-view] { justify-content: flex-start; }
nav button[aria-current="page"] { background: var(--side-active); color: var(--on-dark); box-shadow: inset 3px 0 0 var(--spark); }
nav button:hover:not([aria-current]) { background: rgba(255, 255, 255, 0.06); }
nav button:disabled { opacity: 0.45; cursor: default; }
nav .spacer { flex: 1; }

/* Conversa (na tela Hoje) */
#dock { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; overflow: hidden; background: var(--panel); border-left: 1px solid var(--line); }
#dock > h3 { flex: none; margin: 0; padding: 16px 20px; font-size: 15px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#dock > h3 #new-chat { font-size: 13px; font-weight: 500; }
#thread { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 92%; font-size: 14px; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.user { align-self: flex-end; background: var(--mine); color: var(--on-dark); border-bottom-right-radius: 4px; }
.bubble.assistant { align-self: flex-start; background: var(--hers); border-bottom-left-radius: 4px; }
.bubble.lembrete { background: var(--warn); }
.bubble a.wa { display: inline-block; margin: 4px 0; padding: 6px 12px; border-radius: 999px; background: var(--mine); color: var(--on-dark); text-decoration: none; font-weight: 600; }
.bubble.sending { opacity: 0.6; }
.bubble.thinking { opacity: 0.7; font-style: italic; }
.bubble.thinking .dots { display: inline-block; animation: dots 1.2s steps(4, end) infinite; overflow: hidden; vertical-align: bottom; width: 0; }
@keyframes dots { to { width: 1.2em; } }
.bubble time { display: block; font-size: 11px; opacity: 0.7; margin-top: 3px; }
#composer { flex: none; display: flex; align-items: flex-end; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--panel); }
#composer textarea { flex: 1; resize: none; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; min-height: 44px; max-height: 40dvh; overflow-y: auto; }
#composer.tall { flex-wrap: wrap; }
#composer.tall textarea { flex: 1 1 100%; order: -1; }
#send { min-height: 44px; }
#composer.tall #send { margin-left: auto; }
#attach { border: 1px solid var(--line); border-radius: 10px; width: 44px; height: 44px; cursor: pointer; font-size: 18px; }
#attach:disabled { opacity: 0.5; cursor: default; }
#mic { border: 1px solid var(--line); border-radius: 10px; width: 44px; height: 44px; cursor: pointer; font-size: 17px; }
#mic.on { background: var(--danger-bg); border-color: var(--danger-line); }
#chat-error { padding: 0 24px 10px; background: var(--panel); margin: 0; }

/* ===== Listas e cartões (todas as telas) ===== */
.list { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px; display: grid; gap: 10px; align-content: start; }
.list > * { min-width: 0; }
.list h3 { font-size: 14px; margin: 10px 0 0; color: var(--muted); font-weight: 600; }
.list > div:not(.tabs) > button:not(.primary) { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.list > div > button.link:not(.primary) { border: 0; padding: 6px 4px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.card div { flex: 1; min-width: 0; }
.card strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.card span { color: var(--muted); font-size: 13px; }
.card a { color: var(--accent); white-space: nowrap; }
.card button { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; white-space: nowrap; }
.card select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); max-width: 190px; }
.card .gist { display: block; color: var(--text); margin-top: 2px; overflow-wrap: anywhere; }
.card .amount { flex: none; font-weight: 600; white-space: nowrap; min-width: 96px; text-align: right; }
.card .amount.in { color: var(--success); }
.card.done { opacity: 0.6; }
.card.real { border-left: 4px solid var(--success); }
.card.late { border-color: var(--danger-line); }
.card .tag { flex: none; font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--hers); color: var(--text); white-space: nowrap; }
.card .tag.cobranca, .card .tag.pagamento, .card .tag.cliente { background: var(--warn); }
.card .tag.suspeito { background: var(--danger-bg); color: var(--danger); }
.card .tag.pessoal { background: var(--info-bg); }
.card .tag.empresa { background: var(--success-bg); }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.found { margin: 0; color: var(--muted); font-size: 13px; }
.importer summary { cursor: pointer; color: var(--accent); }
.importer button { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.list .boxname { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.card .boxname { width: 130px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.boxname.wide { width: 280px; }

/* Ideias */
.idea { display: grid; gap: 0; }
.ideabody { background: var(--panel); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; padding: 4px 16px 14px; margin-top: -6px; }
.ideabody h4 { margin: 14px 0 2px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.ideabody p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Estudos (aba Memória): o texto inteiro, com títulos, listas e negrito */
.studytext { padding-top: 10px; max-width: 78ch; }
.studytext p { margin: 0 0 4px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.studytext p.bullet { padding-left: 18px; position: relative; }
.studytext p.bullet::before { content: "•"; position: absolute; left: 4px; color: var(--muted); }
.studytext h4 { margin: 14px 0 6px; font-size: 15px; color: var(--text); text-transform: none; letter-spacing: 0; }
.studytext .gap { height: 8px; }

/* ===== Finanças ===== */
#finance .tabs button:last-child { margin-left: auto; }
.monthnav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.monthnav strong { font-size: 18px; min-width: 190px; text-align: center; }
.monthnav button:not(.link) { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1; }
.monthnav button:disabled { opacity: 0.4; cursor: default; }
.summaries { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.summary { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 8px; border-top: 3px solid var(--accent-2); }
.summary.empresa { border-top-color: var(--success); }
.summary .figures { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 13px; }
.summary .figures b { color: var(--text); font-size: 16px; margin-left: 2px; }
.summary small { color: var(--muted); }
.bar { height: 8px; background: var(--hers); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent-2); border-radius: 999px; }
.summary.empresa .bar i { background: var(--success); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters input, .filters select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.filters input { flex: 1; min-width: 180px; }
.grouphead { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.list h3.grouphead { color: var(--text); font-size: 15px; margin-top: 14px; }
.grouphead b { font-weight: 500; font-size: 13px; color: var(--muted); }
.grouphead.late span { color: var(--danger); }
/* Gráfico de gastos */
.spendbody { display: grid; gap: 10px; }
.pie { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 24px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.piewrap { position: relative; }
.piewrap svg { width: 100%; height: auto; display: block; }
.slice { stroke: var(--panel); stroke-width: 2; stroke-linejoin: round; cursor: default; transition: opacity 0.12s; }
.slice.dim, .legendrow.dim { opacity: 0.35; }
.pietip { position: absolute; z-index: 2; pointer-events: none; background: var(--side); color: var(--on-dark); border-radius: 8px; padding: 8px 10px; font-size: 13px; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; max-width: 240px; box-shadow: 0 6px 18px rgba(23, 39, 42, 0.25); }
.pietip i { width: 10px; height: 10px; border-radius: 3px; }
.pietip span, .pietip small { grid-column: 2; }
.pietip small { opacity: 0.8; }
.pielegend { display: grid; gap: 6px; min-width: 0; }
.legendrow { display: grid; grid-template-columns: 14px 1fr auto 52px; gap: 10px; align-items: center; font-size: 14px; padding: 3px 6px; border-radius: 6px; transition: opacity 0.12s; }
.legendrow:hover { background: var(--bg); }
.legendrow i { width: 12px; height: 12px; border-radius: 3px; }
.legendrow b { font-weight: 600; white-space: nowrap; }
.legendrow small { color: var(--muted); text-align: right; }
.legendnote { color: var(--muted); font-size: 12px; padding-left: 30px; margin-top: -4px; }
.columns { display: flex; gap: 10px; align-items: flex-end; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; }
.col { flex: 1; min-width: 64px; display: grid; gap: 6px; justify-items: center; font-size: 12px; color: var(--muted); }
.col .stick { height: 120px; width: 60%; display: flex; align-items: flex-end; background: var(--hers); border-radius: 6px; overflow: hidden; }
.col .stick i { display: block; width: 100%; background: var(--chart-prev); }
.col.on .stick i { background: var(--accent-2); }
.col.on span { color: var(--text); font-weight: 600; }

/* ===== Hoje ===== */
#today { gap: 18px; }
#today h2 { margin: 0; font-size: 20px; letter-spacing: -0.3px; }
#today h3 { margin: 6px 0 0; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
#today h3 em { font-style: normal; background: var(--hers); color: var(--text); border-radius: 99px; padding: 0 9px; font-weight: 700; }
.tiles, .needs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.tile, .need { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.tile small, .need small { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; display: flex; align-items: center; gap: 6px; }
.tile strong { display: block; font-size: 19px; margin: 3px 0 2px; }
.tile span, .need span { color: var(--muted); font-size: 13px; display: block; }
.need { display: flex; flex-direction: column; gap: 4px; }
.need div { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.need button { border: 1px solid var(--line); border-radius: 9px; padding: 6px 12px; cursor: pointer; font-weight: 600; font-size: 13px; }
.need button.go { background: var(--accent); border-color: var(--accent); color: var(--on-dark); }
/* Agenda do dia */
.dayline { position: relative; padding-left: 78px; display: grid; gap: 8px; }
.dayline::before { content: ""; position: absolute; left: 61px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.dayline > div { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 9px 14px; display: flex; justify-content: space-between; gap: 12px; }
.dayline > div::before { content: ""; position: absolute; left: -23px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); border: 3px solid var(--bg); }
.dayline time { position: absolute; left: -78px; width: 50px; text-align: right; color: var(--muted); font-size: 12.5px; font-weight: 600; top: 10px; }
.dayline small { color: var(--muted); }
.dayline .past { opacity: 0.55; }
.dayline .upnext { border-color: var(--accent); }

/* ===== Tarefas ===== */
.kanban { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.kcol { background: var(--subtle); border-radius: 14px; padding: 12px; display: grid; gap: 10px; align-content: start; }
.kcol h3 { margin: 2px 4px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kcol h3 em { font-style: normal; background: var(--panel); border-radius: 99px; padding: 0 9px; color: var(--text); }
.kcol h3 small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.kcard.late { border-color: var(--danger-line); }
.kcard.isdone { opacity: 0.72; }
.kcard.isdone strong { text-decoration: line-through; }
.khead { display: flex; gap: 8px; align-items: flex-start; }
.khead strong { overflow-wrap: anywhere; }
.prio { flex: none; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 7px; text-transform: uppercase; letter-spacing: 0.4px; margin-top: 1px; }
.prio.alta { color: var(--danger); border: 1px solid var(--danger-line); }
.prio.normal, .prio.baixa { color: var(--muted); border: 1px solid var(--line); }
.kmeta { color: var(--muted); font-size: 12.5px; }
.kcard.late .kmeta { color: var(--danger); }
.kcard .bar { height: 6px; border-radius: 99px; }
.kcard .link { padding: 0; text-align: left; font-size: 13px; }
.steps { display: grid; gap: 4px; font-size: 14px; }
.steps .gone { text-decoration: line-through; color: var(--muted); }
.kact { display: flex; justify-content: flex-end; }
.kact button { border: 1px solid var(--line); border-radius: 8px; padding: 5px 12px; cursor: pointer; font-size: 13px; font-weight: 600; }
.reminders { background: var(--subtle); }
.remind { background: var(--panel); border-radius: 10px; padding: 8px 12px; display: flex; justify-content: space-between; gap: 12px; }
.remind span { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ===== Sino: notificações do painel. Fica no topo, em todas as telas ===== */
#bell { position: fixed; top: 12px; right: 404px; z-index: 31; width: 40px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 17px; background: var(--panel); }
#bell b { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; line-height: 18px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: var(--on-dark); font-size: 11px; font-weight: 600; }
#notes { position: fixed; top: 58px; right: 404px; z-index: 30; width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 76px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(18, 51, 58, 0.2); font-size: 13.5px; overflow: hidden; }
#app:not([data-view="today"]) #bell, #app:not([data-view="today"]) #notes { right: 24px; }
#notes .nhead { flex: none; display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
#notes [role="tab"] { white-space: nowrap; border: 0; background: none; padding: 6px 10px; border-radius: 6px; color: var(--muted); cursor: pointer; font: inherit; }
#notes [role="tab"][aria-selected="true"] { background: var(--subtle); color: var(--text); font-weight: 600; }
#notes .nhead .link { margin-left: auto; border: 0; background: none; cursor: pointer; font: inherit; font-size: 12.5px; }
#notes .nlist { flex: 1; min-height: 0; overflow-y: auto; }
#notes .note { display: flex; gap: 10px; align-items: center; padding: 10px 12px 10px 9px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
#notes .note.precisa { border-left-color: var(--accent); }
#notes .note > div { flex: 1; min-width: 0; cursor: pointer; }
#notes .ntags { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
#notes .ntags span { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--subtle); color: var(--muted); border: 1px solid var(--line); }
#notes .ntags span.mod { background: var(--accent-2-bg); color: var(--side); border-color: var(--accent-2-line); }
#notes .ntags time { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
#notes .note p { margin: 0; line-height: 1.35; overflow-wrap: anywhere; }
#notes .note button { flex: none; border: 1px solid var(--line); border-radius: 6px; padding: 4px 9px; font: inherit; font-size: 12px; cursor: pointer; }
#notes .nempty { padding: 22px 12px; color: var(--muted); text-align: center; }
#notes .nfoot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; color: var(--muted); font-size: 12.5px; background: var(--bg); border-top: 1px solid var(--line); }
#notes .nfoot button { border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; background: var(--panel); }

/* ===== Telas estreitas ===== */
@media (max-width: 900px) {
  .kanban { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  #app, #app:not([data-view="today"]) { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  /* No celular a conversa fica embaixo da tela Hoje. */
  #app[data-view="today"] { grid-template-rows: auto minmax(0, 1fr) minmax(0, 46dvh); }
  #dock { border-left: 0; border-top: 1px solid var(--line); }
  #dock > h3 { padding: 10px 16px; }
  nav { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 8px; }
  nav h2, nav .spacer { display: none; }
  nav button { white-space: nowrap; gap: 6px; }
  #bell, #app:not([data-view="today"]) #bell { top: 60px; right: 12px; }
  #notes, #app:not([data-view="today"]) #notes { top: 104px; right: 12px; max-height: calc(100dvh - 116px); }
  .monthnav strong { min-width: 0; flex: 1; font-size: 16px; }
  .filters input { flex-basis: 100%; }
  .filters select { flex: 1; min-width: 120px; }
  .card.entry { flex-wrap: wrap; gap: 8px; }
  .card.entry > div { flex-basis: 100%; }
  .card.entry .amount { margin-left: auto; min-width: 0; }
  .grouphead { flex-direction: column; gap: 2px; }
  .pie { grid-template-columns: 1fr; }
  .piewrap { max-width: 260px; margin: 0 auto; width: 100%; }
}
