:root{
  --bg:#F8F4EE; --surface:#ffffff; --soft:#f3ecef; --ink:#2a1636; --muted:#6f6377; --line:#ebe2e8;
  --accent:#4B1366; --violet:#813AC5; --blush:#f3e8f1; --warn:#8a5a00; --warn-soft:#fbf1dc;
  --serif:"Cormorant Garamond", Georgia, serif; --caps:"Cinzel", Georgia, serif;
  --body:"Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme:light;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{background:var(--bg);color:var(--ink);font-family:var(--body);font-size:16px;line-height:1.5;-webkit-tap-highlight-color:transparent}
[hidden]{display:none!important}
button{font:inherit;cursor:pointer}
a{color:var(--violet)}

.screen{min-height:100%;display:flex;flex-direction:column;max-width:560px;margin:0 auto;
  padding:env(safe-area-inset-top,0) 0 env(safe-area-inset-bottom,0)}
.page-body{flex:1;padding:22px 18px 28px;display:flex;flex-direction:column;gap:14px}
.page-body.narrow{justify-content:center;align-items:stretch;max-width:420px;width:100%;margin:0 auto}
.withnav .page-body{padding-bottom:96px}

/* Marca */
.wordmark{display:flex;flex-direction:column;line-height:1;color:var(--accent)}
.wordmark .w1{font-family:var(--caps);font-weight:600;font-size:2rem;letter-spacing:.06em}
.wordmark .w2{font-family:var(--caps);font-size:.62rem;letter-spacing:.55em;margin-top:4px;padding-left:.15em}
.wordmark.light{color:#fff;align-items:center}
.wordmark.light .w1{font-size:4rem;letter-spacing:.08em}
.wordmark.light .w2{font-size:1.3rem;letter-spacing:.6em;margin-top:10px}

/* Abertura */
.splash{background:var(--accent);color:#fff;min-height:100vh;justify-content:space-between;align-items:center;padding:48px 28px calc(36px + env(safe-area-inset-bottom,0))}
.splash-inner{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center}
.splash-logo{width:min(56vw,230px);height:auto;margin-bottom:10px}
.splash-tag{font-family:var(--serif);font-size:1.35rem;letter-spacing:.06em;margin:18px 0 0;opacity:.95}
.btn-white{width:100%;max-width:380px;border:0;border-radius:999px;background:#fff;color:var(--accent);font-weight:600;font-size:1.15rem;padding:16px 26px;display:flex;justify-content:center;gap:12px}

/* Textos */
.title{font-family:var(--serif);font-weight:700;font-size:2rem;text-align:center;margin:6px 0 0;color:var(--accent)}
.hero{font-family:var(--serif);font-weight:700;font-size:2.4rem;line-height:1.05;margin:4px 0 0;color:var(--accent)}
.hero.small{font-size:1.9rem}
.hero-sub{margin:-6px 0 4px;letter-spacing:.14em;font-size:1.05rem}
.sub{color:var(--muted);font-size:.92rem;margin:0}
.center{text-align:center}
.small{font-size:.82rem}
.label{font-size:.78rem;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;font-weight:600}
.note{background:var(--warn-soft);color:var(--warn);border-radius:12px;padding:9px 12px;font-size:.85rem;margin:0}
.foot{font-size:.72rem;color:var(--muted);text-align:center;margin:0;padding:0 16px 8px}

/* Formulários e botões */
.stack{display:flex;flex-direction:column;gap:9px}
label{font-size:.85rem;font-weight:600}
input{font:inherit;border:1px solid var(--line);border-radius:14px;padding:12px 14px;background:var(--surface);color:var(--ink)}
input:focus,textarea:focus,button:focus-visible{outline:2px solid var(--violet);outline-offset:1px}
.btn{display:flex;align-items:center;justify-content:center;gap:10px;border:0;border-radius:999px;background:var(--accent);color:#fff;font-weight:600;padding:13px 20px;text-decoration:none;text-align:center}
.btn.big{padding:16px 22px;font-size:1.08rem;margin-top:4px}
.btn.ghost{background:var(--surface);color:var(--accent);border:1px solid var(--line)}
.linkbtn,.textbtn{background:none;border:0;color:var(--accent);font-weight:600;padding:4px 0;align-self:center}
.textbtn{align-self:flex-start;font-size:.9rem}
.iconbtn{background:none;border:0;font-size:2rem;line-height:1;color:var(--ink);padding:0 8px 4px 0}
.hello-avatar{width:110px;height:110px;border-radius:50%;align-self:center;box-shadow:0 8px 28px rgba(75,19,102,.16)}

/* Início */
.home-top{display:flex;justify-content:space-between;align-items:center}
.brandline{display:flex;align-items:center;gap:10px}
.brand-mark{height:56px;width:auto}
.cards{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:4px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:16px 14px;display:flex;flex-direction:column;gap:12px;text-align:left;color:var(--accent);min-height:132px}
.card .circle{width:56px;height:56px;border-radius:50%;background:var(--blush);display:grid;place-items:center}
.card .circle svg{width:28px;height:28px;stroke:var(--accent);fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.card .row{display:flex;justify-content:space-between;align-items:center;gap:6px;font-weight:500;font-size:1rem;line-height:1.2}
.sectionhead{display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--line);padding-top:14px;margin-top:6px}
.sectionhead span{font-family:var(--serif);font-size:1.2rem;letter-spacing:.06em;color:var(--accent);font-weight:600}
.list{display:flex;flex-direction:column;gap:10px}
.item{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:12px 14px;text-align:left;color:var(--ink);width:100%}
.item img{width:44px;height:44px;border-radius:50%;flex:none}
.item .txt{flex:1;min-width:0}
.item .t{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.item small{color:var(--muted)}
.empty{color:var(--muted);font-size:.9rem;text-align:center;padding:14px}
.card-flat{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:14px;white-space:pre-wrap;overflow-wrap:anywhere}

/* Conversa */
.chat{height:100vh;height:100dvh;background:var(--surface)}
.chat-top{display:flex;align-items:center;gap:12px;padding:14px 16px;border-bottom:1px solid var(--line)}
.chat-avatar{width:48px;height:48px;border-radius:50%}
.chat-name{font-weight:600;font-size:1.15rem;color:var(--accent)}
.chat-role{color:var(--muted);font-size:.88rem}
#log{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:14px;min-height:0}
.me-wrap{align-self:flex-end;max-width:86%;display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.me{background:var(--violet);color:#fff;border-radius:18px;padding:12px 16px;white-space:pre-wrap;overflow-wrap:anywhere}
.time{font-size:.75rem;color:var(--muted)}
.bot-wrap{display:flex;gap:10px;align-items:flex-start;max-width:94%}
.bot-wrap > img{width:40px;height:40px;border-radius:50%;flex:none}
.bot-col{display:flex;flex-direction:column;gap:6px;min-width:0}
.bot{background:var(--soft);border-radius:18px;padding:12px 16px;white-space:pre-wrap;overflow-wrap:anywhere}
.bot.thinking{color:var(--muted);font-style:italic}
.actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.act{display:inline-flex;align-items:center;gap:6px;background:none;border:0;color:var(--accent);font-size:.88rem;padding:4px 2px}
.act.pill{border:1px solid var(--line);border-radius:999px;padding:6px 14px;background:var(--surface)}
.refs{background:var(--bg);border-radius:12px;padding:10px 12px;font-size:.84rem;color:var(--muted)}
.refs b{color:var(--accent);font-weight:600}
.tagk{display:inline-block;font-size:.72rem;font-weight:600;border-radius:999px;padding:2px 9px;background:var(--blush);color:var(--accent)}
.tagk.sem{background:var(--warn-soft);color:var(--warn)}
.intro{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;padding:8px 4px}
.intro .hello-title{font-family:var(--serif);font-weight:700;font-size:1.6rem;color:var(--accent);margin:4px 0 0}
.chips{display:flex;flex-direction:column;gap:8px;width:100%}
.chip{border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:14px;padding:10px 14px;text-align:left;font-size:.92rem}
.chip:hover{border-color:var(--violet);color:var(--violet)}
.composer{display:flex;gap:10px;align-items:flex-end;padding:10px 14px 8px}
textarea{flex:1;min-width:0;font:inherit;resize:none;border:0;border-radius:999px;padding:14px 18px;background:var(--soft);color:var(--ink);max-height:130px}
.sendbtn{width:52px;height:52px;border-radius:50%;border:0;background:var(--violet);color:#fff;display:grid;place-items:center;flex:none}
.sendbtn:disabled{opacity:.5}

/* Menu inferior */
.tabbar{position:fixed;left:0;right:0;bottom:0;margin:0 auto;max-width:560px;background:var(--surface);border-top:1px solid var(--line);
  display:grid;grid-template-columns:repeat(5,1fr);padding:8px 6px calc(8px + env(safe-area-inset-bottom,0));border-radius:22px 22px 0 0;box-shadow:0 -6px 24px rgba(75,19,102,.06)}
.tabbar button{background:none;border:0;display:flex;flex-direction:column;align-items:center;gap:3px;color:var(--muted);font-size:.72rem;padding:4px 0;min-width:0}
.tabbar svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round;stroke-linecap:round}
.tabbar button.on{color:var(--accent);font-weight:600}
.tabbar button.on svg{fill:var(--accent);stroke:var(--accent)}
@media (prefers-reduced-motion:no-preference){.me-wrap,.bot-wrap{animation:in .18s ease-out}@keyframes in{from{transform:translateY(4px);opacity:.6}to{transform:none;opacity:1}}}

/* Documentos */
select{font:inherit;border:1px solid var(--line);border-radius:14px;padding:12px 14px;background:var(--surface);color:var(--ink)}
.sectionhead.first{border-top:0;padding-top:0;margin-top:0}
.lock{display:flex;flex-direction:column;gap:10px;align-items:center;text-align:center;white-space:normal;padding:22px 18px}
.lock b{font-family:var(--serif);font-size:1.4rem;color:var(--accent)}
.gem{font-size:2.2rem;line-height:1}
.form-grid{white-space:normal}
.two{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.two input{min-width:0;width:100%}
details summary{cursor:pointer;color:var(--accent);font-weight:600;font-size:.92rem}
.filters{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}
.filters button{flex:none;border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:999px;padding:7px 14px;font-size:.85rem}
.filters button.on{background:var(--accent);color:#fff;border-color:var(--accent)}
.doc .num{width:44px;height:44px;border-radius:50%;background:var(--blush);display:grid;place-items:center;flex:none;color:var(--accent)}
.doc .num svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linejoin:round;stroke-linecap:round}
.doc small{display:block}
.msg{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:8px}
.msg-h{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
.msg-h b{color:var(--accent)}
.msg-h small{color:var(--muted);font-size:.78rem;text-align:right}
.msg-t{background:var(--soft);border-radius:14px;padding:10px 12px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:.92rem}
.msg-t mark{background:var(--warn-soft);color:var(--warn);border-radius:4px;padding:0 2px}
.btnrow{display:flex;gap:8px}
.btnrow .btn{flex:1;padding:11px 10px;font-size:.88rem;white-space:nowrap}

/* Clientes e sessões */
.headrow{display:flex;justify-content:space-between;align-items:center;gap:10px}
.headrow .textbtn{align-self:center;white-space:nowrap}
textarea.area{flex:none;border:1px solid var(--line);border-radius:14px;background:var(--surface);padding:12px 14px;max-height:none}
input[type=search]{width:100%}
.client-card{white-space:normal;display:flex;flex-direction:column;gap:4px}
.client-card .hero{margin:0}
.item .badge{flex:none;font-size:.75rem;font-weight:600;color:var(--accent);background:var(--blush);border-radius:999px;padding:3px 9px}
.next{background:var(--blush);color:var(--accent);border-radius:14px;padding:10px 14px;font-size:.9rem}
.visit{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:8px}
.visit-h{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
.visit-h b{color:var(--accent);font-size:1.02rem}
.visit-h small{color:var(--muted)}
.area-line{border-left:3px solid var(--violet);padding:2px 0 2px 10px}
.area-line b{display:block}
.area-line span{color:var(--muted);font-size:.88rem}
.visit p{margin:0;font-size:.9rem}
.areabox{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:8px}
.areabox .headrow b{color:var(--accent)}
.three{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.three input{min-width:0;width:100%}
.danger{color:#a3263b}
