/* Lastro — design do canvas: verde #183630, creme #E3DAC9, ouro #E5C690. */
:root {
  --verde: #183630; --verde2: #20463D; --verde3: #2E5A4F; --verde4: #5E8C7A; --verde5: #9DB8A6; --verde6: #B9CCBF;
  --creme: #E3DAC9; --papel: #F4EFE6; --ouro: #E5C690; --ouro2: #C9A766; --areia: #C9BFAE;
  --texto2: #4A5E57; --texto3: #2E4A43; --alerta: #8A4B20;
  --sans: 'Plus Jakarta Sans', system-ui, sans-serif;
  --serif: 'Fraunces', Georgia, serif;
  --mao: 'Caveat', cursive;
  --topo: max(env(safe-area-inset-top), 14px);
  --base: env(safe-area-inset-bottom);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--verde); }
body { font-family: var(--sans); color: var(--verde); overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ouro2); outline-offset: 2px; }
.app { position: fixed; inset: 0; max-width: 560px; margin: 0 auto; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Telas */
.tela { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--creme); color: var(--verde); }
.tela.escura { background: radial-gradient(circle at 50% -10%, rgba(229,198,144,.16), rgba(229,198,144,0) 50%), var(--verde); color: var(--creme); }
.rolo { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(var(--topo) + 10px) 20px calc(110px + var(--base)); display: flex; flex-direction: column; gap: 14px; }
.rolo.sem-nav { padding-bottom: calc(28px + var(--base)); }
.cab { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.cab h1 { margin: 0; flex: 1; font-size: 20px; font-weight: 800; }
.circ { width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--papel); color: var(--verde); display: flex; align-items: center; justify-content: center; position: relative; text-decoration: none; }
.escura .circ { background: rgba(227,218,201,.1); color: var(--creme); }
.ponto { position: absolute; top: 10px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: #C9952E; }
.rot { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--texto2); text-transform: uppercase; }
.escura .rot, .cartao-verde .rot { color: rgba(227,218,201,.8); }
.folha .rot { color: var(--texto2); }
.sub { font-size: 12px; color: var(--texto2); }
.escura .sub, .cartao-verde .sub { color: rgba(227,218,201,.8); }
.folha .sub, .folha .cartao .sub { color: var(--texto2); }
.folha .sub.claro { color: rgba(227,218,201,.8); }
.h2 { margin: 0; font-size: 16px; font-weight: 700; }
.linha { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vazio { padding: 18px; border-radius: 18px; background: var(--papel); text-align: center; font-size: 13px; color: var(--texto2); }

/* Cartões */
.cartao { border-radius: 22px; background: var(--papel); padding: 16px 18px; }
.cartao-verde { border-radius: 26px; padding: 20px; color: var(--creme); background: radial-gradient(circle at 100% 0%, rgba(229,198,144,.22), rgba(229,198,144,0) 55%), linear-gradient(160deg, var(--verde2), var(--verde)); box-shadow: 0 14px 30px rgba(24,54,48,.25); }
.valor-grande { display: flex; align-items: baseline; gap: 2px; font-weight: 800; letter-spacing: -.02em; }
.valor-grande .rs { font-size: 20px; margin-right: 4px; }
.valor-grande .int { font-size: 40px; }
.valor-grande .cent { font-size: 22px; opacity: .7; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.ouro { background: var(--ouro); color: var(--verde); }
.pill.verde { background: var(--verde); color: var(--ouro); }
.pill.suave { background: rgba(46,90,79,.12); color: #1F4A3F; }
.pill.vidro { background: rgba(227,218,201,.12); color: var(--creme); }
.pill.alerta { background: rgba(138,75,32,.12); color: var(--alerta); }

/* Botões */
.btn { height: 50px; padding: 0 18px; border: 0; border-radius: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 700; text-decoration: none; }
.btn.grande { height: 58px; border-radius: 18px; font-size: 17px; }
.btn.verde { background: var(--verde); color: var(--ouro); }
.btn.ouro { background: var(--ouro); color: var(--verde); }
.btn.creme { background: var(--creme); color: var(--verde); }
.btn.contorno { background: transparent; border: 1.5px solid currentColor; }
.btn.vidro { background: transparent; border: 1px solid rgba(227,218,201,.35); color: var(--creme); }
.btn.mini { height: 34px; padding: 0 12px; border-radius: 10px; font-size: 12px; }
.link { border: 0; background: none; padding: 10px 4px; font-weight: 700; font-size: 13px; text-decoration: none; color: inherit; min-height: 44px; display: inline-flex; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }

/* Ações rápidas */
.acao { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border: 0; background: none; padding: 0; color: var(--verde); }
.acao span { width: 56px; height: 56px; border-radius: 18px; background: var(--papel); border: 1px solid rgba(24,54,48,.08); display: flex; align-items: center; justify-content: center; }
.acao.on span { background: var(--ouro); border-color: var(--ouro); }

/* Abas */
.abas { display: grid; gap: 4px; padding: 4px; border-radius: 999px; background: var(--papel); }
.aba { height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--texto3); font-weight: 600; font-size: 13px; }
.aba.on { background: var(--verde); color: var(--creme); }
.escura .abas { background: rgba(227,218,201,.1); }
.escura .aba { color: var(--creme); }
.escura .aba.on { background: var(--creme); color: var(--verde); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin-right: -20px; padding-right: 20px; scrollbar-width: none; }
.chip { flex-shrink: 0; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(24,54,48,.18); background: var(--papel); font-weight: 600; font-size: 13px; }
.chip.on { background: var(--verde); color: var(--creme); border-color: var(--verde); }
.escura .chip { border-color: rgba(227,218,201,.28); background: rgba(227,218,201,.06); color: var(--creme); }

/* Itens de lista */
.item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: var(--papel); border: 0; width: 100%; text-align: left; color: var(--verde); text-decoration: none; }
.item .ic { width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; background: var(--verde3); color: var(--creme); }
.item .meio { flex: 1; min-width: 0; }
.item .t { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { font-size: 12px; color: var(--texto2); }
.item .v { font-size: 15px; font-weight: 700; white-space: nowrap; }
.item.tracejado { background: transparent; border: 1px dashed rgba(24,54,48,.3); }
.item.atencao { box-shadow: inset 0 0 0 1.5px var(--ouro2); }

/* Claude */
.claude { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 22px; background: var(--verde); color: var(--creme); border: 0; text-align: left; width: 100%; }
.claude .ic { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; background: var(--ouro); color: var(--verde); display: flex; align-items: center; justify-content: center; }
.serif { font-family: var(--serif); font-style: italic; }
.dica { display: flex; gap: 8px; padding: 10px 12px; border-radius: 14px; background: rgba(229,198,144,.5); font-size: 12px; line-height: 1.4; }
.mao { font-family: var(--mao); font-size: 22px; line-height: 1; color: var(--texto3); }

/* Barras e gráficos */
.barras { display: grid; gap: 12px; align-items: end; }

.barras > span { border-radius: 8px; background: var(--verde6); position: relative; min-height: 4px; }
.barras > span.on { background: var(--ouro); box-shadow: inset 0 0 0 1.5px var(--ouro2); }
.barras > span.escuro { background: var(--verde); }
.balao { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); padding: 3px 8px; border-radius: 8px; background: var(--ouro); color: var(--verde); font-size: 11px; font-weight: 800; white-space: nowrap; }
.progresso { height: 8px; border-radius: 999px; background: rgba(24,54,48,.12); overflow: hidden; }
.progresso i { display: block; height: 100%; border-radius: 999px; background: var(--verde); }
.legenda { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--texto3); }
.legenda i { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.legenda b { margin-left: auto; color: var(--verde); }

/* Formulários */
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label { font-size: 13px; font-weight: 700; }
.campo input, .campo select { height: 52px; padding: 0 16px; border: 1px solid rgba(24,54,48,.2); border-radius: 14px; background: var(--papel); color: var(--verde); font-size: 16px; }
.escura .campo input { background: rgba(227,218,201,.1); border-color: rgba(227,218,201,.25); color: var(--creme); }
.interruptor { flex-shrink: 0; width: 52px; height: 32px; border: 0; border-radius: 999px; padding: 3px; display: flex; background: #8F8676; justify-content: flex-start; }
.interruptor span { width: 26px; height: 26px; border-radius: 50%; background: var(--papel); }
.interruptor.on { background: var(--verde); justify-content: flex-end; }
.interruptor.on span { background: var(--ouro); }

/* Navegação inferior */
.nav { position: absolute; left: 0; right: 0; bottom: 0; height: calc(78px + var(--base)); padding: 0 8px var(--base); background: var(--papel); border-top: 1px solid rgba(24,54,48,.08); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; z-index: 5; }
.nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 44px; border: 0; background: none; font-size: 11px; font-weight: 600; color: #5A6B64; }
.nav button.on { color: var(--verde); }
.nav .fab { width: 60px; height: 60px; margin: -30px auto 0; border-radius: 50%; background: var(--verde); color: var(--ouro); border: 5px solid var(--papel); box-shadow: 0 10px 24px rgba(24,54,48,.3); }

/* Conversa */
.bolha { max-width: 85%; padding: 12px 16px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.bolha.claude { align-self: flex-start; border-radius: 6px 20px 20px 20px; background: rgba(227,218,201,.09); border: 1px solid rgba(227,218,201,.12); }
.bolha.eu { align-self: flex-end; border-radius: 20px 6px 20px 20px; background: var(--ouro); color: var(--verde); font-weight: 600; }
.entrada { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 22px; background: var(--creme); color: var(--verde); }
.entrada input { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; font-size: 16px; }
.entrada input:focus { outline: none; }

/* Calendário */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.dia { height: 34px; border: 0; border-radius: 9px; font-weight: 700; font-size: 12px; color: var(--verde); padding: 0; }
.dia.l0 { background: rgba(24,54,48,.07); color: var(--texto2); font-weight: 500; }
.dia.l1 { background: rgba(24,54,48,.18); }
.dia.l2 { background: rgba(24,54,48,.36); }
.dia.l3 { background: #4E7266; color: var(--papel); }
.dia.l4 { background: var(--verde); color: var(--ouro); }
.dia.vz { background: transparent; }
.dia.sel { box-shadow: 0 0 0 2px var(--ouro), 0 0 0 4px var(--verde); }
.dia.hoje { outline: 2px dashed var(--verde); outline-offset: -3px; }

/* Avisos e carregamento */
.toast { position: absolute; left: 16px; right: 16px; bottom: calc(96px + var(--base)); z-index: 20; padding: 14px 16px; border-radius: 16px; background: var(--verde); color: var(--creme); font-size: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.3); }
.toast.erro { background: var(--alerta); }
.esqueleto { height: 56px; border-radius: 16px; background: linear-gradient(90deg, #EDE6D8 0%, #F7F2E9 50%, #EDE6D8 100%); background-size: 200% 100%; animation: brilho 1.4s linear infinite; }
@keyframes brilho { from { background-position: 200% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .esqueleto { animation: none; } }
.folha { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 32px 32px 0 0; background: var(--creme); color: var(--verde); }
.tecla { height: 52px; border: 0; border-radius: 16px; background: transparent; font-size: 24px; font-weight: 600; color: var(--verde); }
.tecla:active { background: var(--papel); }
