/* Assistente (voz e texto), edicao e entrada. Mesmas cores do painel. */
:root { --tp-bg: #fff; --tp-panel: #faf6ef; --tp-head: #f3ece0; --tp-line: #e7dccd; --tp-fg: #1f1a17; --tp-muted: #7b6e63; --tp-brown: #6b4a32; --tp-ok: #5f7f4f; --tp-warn: #c98a1b; --tp-bad: #b3392f; --tp-base: 0px; }
.tp, .tp * { box-sizing: border-box; font-family: var(--font-anthropic-sans); }
.tp button { font: inherit; cursor: pointer; }
.tp-fab { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(var(--tp-base) + 16px + env(safe-area-inset-bottom)); z-index: 60; display: flex; gap: 10px; align-items: center; }
.tp-fab button { border: 0; border-radius: 999px; box-shadow: 0 6px 18px rgba(60,40,20,.25); display: grid; place-items: center; }
.tp-mic { width: 64px; height: 64px; background: var(--tp-brown); color: #fff; }
.tp-mic svg { width: 28px; height: 28px; }
.tp-mic.gravando { background: var(--tp-bad); animation: tp-pulso 1.2s ease-in-out infinite; }
.tp-lapis { width: 48px; height: 48px; background: #fff; color: var(--tp-brown); border: 1px solid var(--tp-line) !important; }
.tp-lapis svg { width: 22px; height: 22px; }
@keyframes tp-pulso { 50% { box-shadow: 0 0 0 12px rgba(179,57,47,.18); } }

.tp-veu { position: fixed; inset: 0; background: rgba(31,26,23,.35); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .2s; }
.tp-veu.on { opacity: 1; pointer-events: auto; }
.tp-folha { position: fixed; left: 0; right: 0; bottom: 0; z-index: 71; max-width: 680px; margin: 0 auto; max-height: 92vh; display: flex; flex-direction: column;
  background: var(--tp-bg); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(60,40,20,.2); transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.9,.3,1); visibility: hidden; color: var(--tp-fg); }
.tp-folha.on { transform: none; visibility: visible; }
.tp-topo { display: flex; align-items: center; gap: 8px; padding: 10px 14px 8px; border-bottom: 1px solid var(--tp-line); }
.tp-topo .tp-puxa { position: absolute; left: 50%; top: 6px; width: 40px; height: 4px; margin-left: -20px; border-radius: 9px; background: var(--tp-line); }
.tp-abas { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; padding-top: 6px; }
.tp-abas button { border: 0; background: none; padding: 8px 10px; border-radius: 999px; color: var(--tp-muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.tp-abas button[aria-selected="true"] { background: var(--tp-head); color: var(--tp-fg); }
.tp-x { border: 0; background: none; width: 40px; height: 40px; border-radius: 50%; font-size: 22px; color: var(--tp-muted); }
.tp-corpo { overflow-y: auto; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }

.tp-escreve { display: flex; gap: 8px; align-items: flex-end; }
.tp-escreve textarea { flex: 1; min-height: 48px; max-height: 160px; resize: none; border: 1px solid var(--tp-line); border-radius: 14px; padding: 12px 14px; font: inherit; font-size: 16px; background: var(--tp-panel); color: var(--tp-fg); }
.tp-escreve textarea:focus { outline: 2px solid var(--tp-brown); outline-offset: 0; }
.tp-redondo { width: 48px; height: 48px; flex: none; border: 0; border-radius: 50%; background: var(--tp-brown); color: #fff; display: grid; place-items: center; }
.tp-redondo svg { width: 22px; height: 22px; }
.tp-redondo.gravando { background: var(--tp-bad); animation: tp-pulso 1.2s infinite; }
.tp-dica { color: var(--tp-muted); font-size: 13px; margin: 8px 2px 0; }
.tp-status { margin: 12px 0 0; font-size: 14px; color: var(--tp-muted); display: flex; align-items: center; gap: 8px; }
.tp-ponto { width: 10px; height: 10px; border-radius: 50%; background: var(--tp-warn); animation: tp-pisca 1s infinite; }
@keyframes tp-pisca { 50% { opacity: .3; } }
.tp-ouvi { margin-top: 14px; font-size: 14px; background: var(--tp-panel); border: 1px solid var(--tp-line); border-radius: 12px; padding: 10px 12px; }
.tp-ouvi b { display: block; font-size: 12px; color: var(--tp-muted); font-weight: 600; margin-bottom: 2px; }
.tp-entendi { margin: 14px 2px 8px; font-family: var(--font-anthropic-serif); font-size: 19px; line-height: 1.3; }
.tp-duvida { background: #fdf3df; border: 1px solid #ecd29a; color: #6d4c0f; border-radius: 12px; padding: 10px 12px; margin: 8px 0; font-size: 14px; }

.tp-card { border: 1px solid var(--tp-line); border-radius: 14px; padding: 12px; margin: 10px 0; background: var(--tp-panel); position: relative; }
.tp-card.credito { border-left: 4px solid var(--tp-ok); } .tp-card.gasto { border-left: 4px solid var(--tp-brown); } .tp-card.remover { border-left: 4px solid var(--tp-bad); }
.tp-card.receber, .tp-card.recebido { border-left: 4px solid #3d6b8a; } .tp-card.saldo, .tp-card.pago { border-left: 4px solid var(--tp-warn); }
.tp-card .tp-tipo { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--tp-muted); margin-bottom: 8px; padding-right: 36px; }
.tp-card .tp-tira { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border: 0; background: none; color: var(--tp-muted); font-size: 18px; border-radius: 50%; }
.tp-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tp-campos label { display: grid; gap: 3px; font-size: 12px; color: var(--tp-muted); font-weight: 600; min-width: 0; }
.tp-campos label.largo { grid-column: 1 / -1; }
.tp-campos input, .tp-campos select { width: 100%; min-width: 0; border: 1px solid var(--tp-line); border-radius: 10px; padding: 9px 10px; font: inherit; font-size: 16px; background: #fff; color: var(--tp-fg); }
.tp-frase { font-size: 15px; }
.tp-botoes { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.tp-bt { border: 1px solid var(--tp-line); background: #fff; color: var(--tp-fg); border-radius: 999px; padding: 11px 18px; font-weight: 600; font-size: 15px; }
.tp-bt.cheio { background: var(--tp-fg); border-color: var(--tp-fg); color: #fff; }
.tp-bt.vermelho { color: var(--tp-bad); border-color: #efc7c3; }
.tp-bt:disabled { opacity: .5; }

.tp-lista { display: grid; gap: 8px; }
.tp-linha { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; text-align: left; border: 1px solid var(--tp-line); background: #fff; border-radius: 12px; padding: 10px 12px; width: 100%; color: var(--tp-fg); }
.tp-linha .d { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-linha .m { font-size: 12px; color: var(--tp-muted); }
.tp-linha .v { grid-row: 1 / span 2; grid-column: 2; font-weight: 600; font-variant-numeric: tabular-nums; }
.tp-linha .v.ok { color: var(--tp-ok); }
.tp-grupo { font-size: 12px; font-weight: 700; color: var(--tp-muted); text-transform: uppercase; letter-spacing: .05em; margin: 16px 2px 4px; }
.tp-filtro { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tp-filtro button { border: 1px solid var(--tp-line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--tp-muted); }
.tp-filtro button[aria-pressed="true"] { background: var(--tp-fg); color: #fff; border-color: var(--tp-fg); }
.tp-hist { border-bottom: 1px solid var(--tp-line); padding: 10px 2px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 10px; align-items: center; }
.tp-hist .r { font-size: 14px; } .tp-hist .p { font-size: 12px; color: var(--tp-muted); grid-column: 1; }
.tp-hist.desfeito .r { text-decoration: line-through; color: var(--tp-muted); }

.tp-aviso { position: fixed; left: 50%; bottom: calc(var(--tp-base) + 96px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); opacity: 0; z-index: 90; background: var(--tp-fg); color: #fff; border-radius: 16px; padding: 10px 10px 10px 16px; display: flex; gap: 12px; align-items: center; font-size: 14px; line-height: 1.35; transition: .25s; pointer-events: none; width: max-content; max-width: min(92vw, 440px); }
.tp-aviso span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tp-aviso button { flex: none; }
.tp-aviso.on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.tp-aviso button { border: 0; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; padding: 6px 12px; font-weight: 600; }

#tela-entrar { position: fixed; inset: 0; z-index: 100; background: var(--tp-bg); display: grid; place-items: center; padding: 24px; }
#tela-entrar[hidden] { display: none; }
.tp-entrar { width: min(380px, 100%); text-align: center; color: var(--tp-fg); }
.tp-entrar h1 { font-family: var(--font-anthropic-serif); font-weight: 400; font-size: 44px; margin: 0 0 6px; letter-spacing: -.02em; }
.tp-entrar p { color: var(--tp-muted); margin: 0 0 22px; font-size: 15px; }
.tp-entrar input { width: 100%; border: 1px solid var(--tp-line); border-radius: 14px; padding: 14px 16px; font: inherit; font-size: 17px; margin-bottom: 10px; background: var(--tp-panel); }
.tp-entrar .tp-bt { width: 100%; padding: 14px; margin-top: 4px; }
.tp-entrar .tp-erro { color: var(--tp-bad); font-size: 14px; min-height: 20px; margin-top: 10px; }
.tp-entrar .tp-digital { display: grid; place-items: center; gap: 6px; margin: 0 auto 22px; width: 96px; height: 96px; border-radius: 50%; border: 1px solid var(--tp-line); background: var(--tp-panel); color: var(--tp-brown); }
.tp-entrar .tp-digital svg { width: 44px; height: 44px; }
.tp-ou { color: var(--tp-muted); font-size: 13px; margin: 4px 0 14px; }
