/* ============================================================
   chat.css — frontend próprio do jesuscristo.chat
   Identidade reaproveitada do protótipo (creme/dourado,
   header verificado, bolhas estilo WhatsApp). Mobile-first.
   ============================================================ */
:root{
  --pd-gold:#c79a3a; --pd-gold-deep:#a07c25; --pd-gold-soft:#f5edd8; --pd-gold-line:#e9dcb8;
  --pd-paper:#ffffff; --pd-paper-2:#faf6ec; --pd-ink:#2b2922; --pd-ink-soft:#5c564a; --pd-muted:#a39c8c;
  --pd-line:#ece6d6;
  --pd-feed-bg:#f3ecdd; --pd-bubble-me:#fbeecb;
  --pd-header-bg:#faf6ec; --pd-bubble-bot:#ffffff; --pd-bot-text:#2b2922; --pd-me-text:#2b2922; --pd-msg-size:14.5px;
}
/* modo incorporado/responsivo: o chat preenche o container (iframe/div) */
html.embed,html.embed body{height:100%}
html.embed body{min-height:0}
*{margin:0;padding:0;box-sizing:border-box}
html,body{height:100%}
body{font-family:'Plus Jakarta Sans',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;background:#fff;color:var(--pd-ink);-webkit-font-smoothing:antialiased;display:flex;flex-direction:column;min-height:100dvh}

/* ===== HEADER ===== */
.pd-header{position:sticky;top:0;z-index:50;background:var(--pd-header-bg);border-bottom:1px solid var(--pd-line)}
.pd-header__in{max-width:600px;margin:0 auto;padding:12px 16px;display:flex;align-items:center;gap:9px}
.pd-menu{flex-shrink:0;width:38px;height:38px;border:none;background:none;border-radius:10px;display:flex;align-items:center;justify-content:center;cursor:pointer;-webkit-tap-highlight-color:transparent}
.pd-menu:active{background:var(--pd-gold-soft)}
.pd-menu svg{width:22px;height:22px;stroke:var(--pd-ink-soft);fill:none;stroke-width:2;stroke-linecap:round}

/* ===== MENU LATERAL (histórico) ===== */
.pd-drawer-overlay{position:fixed;inset:0;z-index:90;background:rgba(43,41,34,.45);opacity:0;pointer-events:none;transition:opacity .25s}
.pd-drawer-overlay.show{opacity:1;pointer-events:auto}
.pd-drawer{position:fixed;top:0;left:0;bottom:0;z-index:100;width:280px;max-width:84vw;background:var(--pd-paper);border-right:1px solid var(--pd-line);transform:translateX(-100%);transition:transform .28s cubic-bezier(.2,.8,.2,1);display:flex;flex-direction:column}
.pd-drawer.show{transform:translateX(0)}
.pd-drawer__head{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid var(--pd-line);font-weight:800;font-size:15px}
.pd-drawer__close{border:none;background:none;font-size:26px;line-height:1;color:var(--pd-muted);cursor:pointer}
.pd-newchat{display:flex;align-items:center;gap:9px;margin:12px 14px;padding:11px 14px;border:1px solid var(--pd-gold-line);background:var(--pd-gold-soft);color:var(--pd-gold-deep);border-radius:12px;font-family:inherit;font-size:14px;font-weight:700;cursor:pointer}
.pd-newchat svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2.2;stroke-linecap:round}
.pd-history{flex:1;overflow-y:auto;padding:4px 10px 14px}
.pd-history__item{display:block;width:100%;text-align:left;padding:11px 12px;border:none;background:none;border-radius:10px;font-family:inherit;font-size:13.5px;color:var(--pd-ink);cursor:pointer;line-height:1.35}
.pd-history__item:hover{background:var(--pd-paper-2)}
.pd-history__item.active{background:var(--pd-gold-soft);color:var(--pd-gold-deep);font-weight:600}
.pd-history__item small{display:block;font-size:11px;color:var(--pd-muted);margin-top:2px}
.pd-history__empty{padding:18px 14px;font-size:13px;color:var(--pd-muted);text-align:center}
.pd-header__brand{display:flex;align-items:center;gap:11px}
.pd-header__avatar{width:42px;height:42px;flex-shrink:0;border-radius:50%;overflow:hidden;border:1px solid var(--pd-gold-line);background:var(--pd-gold-soft)}
.pd-header__avatar img{width:100%;height:100%;object-fit:cover;display:block}
.pd-header__id{display:flex;flex-direction:column;min-width:0}
.pd-header__name{font-size:16px;font-weight:800;color:var(--pd-ink);line-height:1.15;display:flex;align-items:center;gap:5px}
.pd-verified{display:inline-flex;align-items:center;flex-shrink:0}
.pd-verified svg{width:16px;height:16px}
.pd-header__handle{font-size:12px;color:var(--pd-muted);line-height:1.2;margin-top:1px;transition:color .2s}
.pd-header__handle b{font-weight:700;color:var(--pd-ink-soft)}
.pd-header__handle.typing{color:var(--pd-gold-deep);font-style:italic;font-weight:600}

/* ===== CHAT ===== */
.pd-chat{flex:1;max-width:600px;width:100%;margin:0 auto;display:flex;flex-direction:column;min-height:0}
.pd-feed{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:16px 14px;display:flex;flex-direction:column;gap:10px;
  background-color:var(--pd-feed-bg);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%23c79a3a' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' opacity='0.10'%3E%3Cpath d='M28 18v22M19 25h18'/%3E%3Cpath d='M104 30c8-7 20-7 28 0-8 7-20 7-28 0zm28 0l7-5m-7 5l7 5'/%3E%3Cpath d='M120 110c-6-2-10 2-14 2-3 0-5-3-9-2 2-5 7-8 12-7 1-3 4-5 7-4-1 3-3 4-3 6 3 0 6 2 7 5z'/%3E%3Cpath d='M40 112c-5-5-12-3-12 3 0 5 7 9 12 13 5-4 12-8 12-13 0-6-7-8-12-3z'/%3E%3Cpath d='M68 64c0 6 4 10 9 10s9-4 9-10zm9 10v10m-6 4h12'/%3E%3Cpath d='M132 78l2 5 5 1-4 4 1 5-4-3-4 3 1-5-4-4 5-1z'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat:repeat}

/* bolhas */
.pd-msg{display:flex;max-width:84%;animation:pdIn .35s ease}
.pd-msg--me{align-self:flex-end}
.pd-msg--jesus{align-self:flex-start}
.pd-bubble{padding:10px 13px;border-radius:16px;font-size:var(--pd-msg-size);line-height:1.5;position:relative;word-wrap:break-word;white-space:pre-wrap}
.pd-msg--jesus .pd-bubble{background:var(--pd-bubble-bot);color:var(--pd-bot-text);border-top-left-radius:5px;box-shadow:0 1px 1px rgba(0,0,0,.06)}
.pd-msg--me .pd-bubble{background:var(--pd-bubble-me);color:var(--pd-me-text);border-top-right-radius:5px}
@keyframes pdIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* link inline (texto-âncora) nas bolhas */
.pd-bubble .pd-link{color:var(--pd-gold-deep);font-weight:600;text-decoration:underline;text-underline-offset:2px}
.pd-bubble .pd-link:hover{color:var(--pd-gold)}

/* recomendações de artigos (botões) */
.pd-recs{align-self:flex-start;display:flex;flex-direction:column;gap:7px;max-width:84%;animation:pdIn .35s ease}
.pd-rec{display:flex;align-items:center;gap:10px;padding:11px 13px;background:#fff;border:1px solid var(--pd-gold-line);border-radius:14px;text-decoration:none;color:var(--pd-ink);box-shadow:0 1px 2px rgba(0,0,0,.05);transition:.15s}
.pd-rec:hover,.pd-rec:active{background:var(--pd-gold-soft);border-color:var(--pd-gold)}
.pd-rec__ic{flex-shrink:0;width:32px;height:32px;border-radius:9px;background:var(--pd-gold-soft);display:flex;align-items:center;justify-content:center}
.pd-rec__ic svg{width:17px;height:17px;stroke:var(--pd-gold-deep);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.pd-rec__t{flex:1;font-size:13.5px;font-weight:600;line-height:1.3}
.pd-rec__ar{flex-shrink:0;color:var(--pd-gold-deep);display:flex}
.pd-rec__ar svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}

/* digitando */
.pd-typing{align-self:flex-start;display:none;align-items:center;gap:4px;padding:12px 15px;background:#fff;border-radius:16px;border-top-left-radius:5px;box-shadow:0 1px 1px rgba(0,0,0,.06)}
.pd-typing.show{display:flex}
.pd-typing span{width:7px;height:7px;border-radius:50%;background:var(--pd-gold-line);animation:pdBlink 1.2s infinite}
.pd-typing span:nth-child(2){animation-delay:.2s}
.pd-typing span:nth-child(3){animation-delay:.4s}
@keyframes pdBlink{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}

/* chips quebra-gelo */
.pd-chips{display:flex;flex-wrap:nowrap;gap:7px;padding:10px 14px;background:var(--pd-paper-2);border-top:1px solid var(--pd-line);overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.pd-chips::-webkit-scrollbar{display:none}
.pd-chip{flex:0 0 auto;white-space:nowrap;padding:8px 14px;background:#fff;border:1px solid var(--pd-line);border-radius:18px;font-family:inherit;font-size:12.5px;font-weight:500;color:var(--pd-ink-soft);cursor:pointer;transition:.15s;-webkit-tap-highlight-color:transparent}
.pd-chip:active{background:var(--pd-gold-soft);border-color:var(--pd-gold-line);color:var(--pd-gold-deep)}

/* barra de input */
.pd-input{display:flex;align-items:center;gap:9px;padding:10px 12px;background:var(--pd-paper-2);border-top:1px solid var(--pd-line);padding-bottom:calc(10px + env(safe-area-inset-bottom))}
.pd-field{flex:1;border:1px solid var(--pd-line);background:#fff;border-radius:24px;padding:12px 18px;font-family:inherit;font-size:15px;color:var(--pd-ink);outline:none}
.pd-field:focus{border-color:var(--pd-gold-line)}
.pd-send{flex-shrink:0;width:46px;height:46px;border:none;border-radius:50%;background:var(--pd-gold);display:flex;align-items:center;justify-content:center;cursor:pointer;-webkit-tap-highlight-color:transparent}
.pd-send svg{width:20px;height:20px;stroke:#fff;fill:none;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.pd-send:disabled{opacity:.5}

/* microfone (voz) */
.pd-mic{flex-shrink:0;width:44px;height:44px;border:1px solid var(--pd-line);border-radius:50%;background:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;-webkit-tap-highlight-color:transparent}
.pd-mic svg{width:20px;height:20px;stroke:var(--pd-gold-deep);fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.pd-mic.rec{background:var(--pd-gold);border-color:var(--pd-gold);animation:pdPulseMic 1.2s infinite}
.pd-mic.rec svg{stroke:#fff}
@keyframes pdPulseMic{0%,100%{box-shadow:0 0 0 0 rgba(199,154,58,.5)}50%{box-shadow:0 0 0 8px rgba(199,154,58,0)}}

.pd-disclaimer{font-size:10px;line-height:1.4;color:var(--pd-muted);text-align:center;padding:7px 16px;background:var(--pd-paper-2)}

@media(max-width:380px){
  .pd-header__name{font-size:15px}
  .pd-bubble{font-size:14px}
}
@media(prefers-reduced-motion:reduce){
  *{animation-duration:.01ms!important;transition-duration:.01ms!important}
}
