/* Chatbot Lirandzo — advanced compact assistant */
html[data-theme="light"] {
  --chatbot-bg: #F7F0E8;
  --chatbot-card: #FFF9F3;
  --chatbot-soft: #EFE4D8;
  --chatbot-border: rgba(126, 91, 63, .22);
  --chatbot-text: #2E241E;
  --chatbot-muted: #746255;
  --chatbot-link: #8f623f;
  --chatbot-shadow: rgba(54, 35, 22, .18);
}
html[data-theme="dark"], html:not([data-theme]) {
  --chatbot-bg: #15110F;
  --chatbot-card: #201A16;
  --chatbot-soft: #2A211C;
  --chatbot-border: rgba(220, 190, 160, .18);
  --chatbot-text: #F6EDE4;
  --chatbot-muted: #B9A89A;
  --chatbot-link: #E1B98B;
  --chatbot-shadow: rgba(0, 0, 0, .42);
}
.chatbot-container{position:fixed;bottom:22px;left:20px;z-index:999;font-family:'Inter',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;transition:bottom .25s ease,left .25s ease}.chatbot-toggle{width:54px;height:54px;border-radius:50%;background:linear-gradient(135deg,#B08968,#8f623f);color:#fff;border:1px solid rgba(255,255,255,.25);cursor:pointer;box-shadow:0 14px 34px rgba(176,137,104,.28);display:flex;align-items:center;justify-content:center;position:relative;transition:transform .25s ease,box-shadow .25s ease,filter .25s ease}.chatbot-toggle:hover{transform:translateY(-2px) scale(1.03);box-shadow:0 18px 44px rgba(176,137,104,.38);filter:saturate(1.05)}.chatbot-toggle-dot{position:absolute;right:8px;top:8px;width:10px;height:10px;background:#35d07f;border:2px solid #fff;border-radius:999px}.chatbot-window{position:absolute;bottom:68px;left:0;width:370px;height:min(610px,calc(100vh - 120px));background:var(--chatbot-card);border:1px solid var(--chatbot-border);border-radius:22px;overflow:hidden;display:none;flex-direction:column;box-shadow:0 24px 70px var(--chatbot-shadow);color:var(--chatbot-text);isolation:isolate}.chatbot-window.active{display:flex;animation:chatIn .22s ease both}@keyframes chatIn{from{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.chatbot-header{padding:14px 14px 12px;background:linear-gradient(135deg,var(--chatbot-soft),var(--chatbot-card));border-bottom:1px solid var(--chatbot-border);display:flex;justify-content:space-between;align-items:center}.chatbot-header-info{display:flex;align-items:center;gap:10px}.chatbot-avatar{width:38px;height:38px;border-radius:14px;background:linear-gradient(135deg,#B08968,#E1B98B);color:#20120d;font-weight:700;display:flex;align-items:center;justify-content:center;box-shadow:inset 0 0 0 1px rgba(255,255,255,.35)}.chatbot-header h4{margin:0;color:var(--chatbot-text);font-size:.95rem;font-weight:650;letter-spacing:-.02em}.chatbot-status{font-size:.68rem;color:var(--chatbot-muted);display:block;margin-top:2px}.chatbot-close{width:32px;height:32px;border-radius:50%;background:transparent;border:1px solid transparent;color:var(--chatbot-muted);font-size:1.35rem;line-height:1;cursor:pointer;transition:all .2s ease}.chatbot-close:hover{color:var(--chatbot-text);border-color:var(--chatbot-border);background:rgba(176,137,104,.08)}.chatbot-intelligence-bar{padding:8px 14px;font-size:.69rem;letter-spacing:.08em;text-transform:uppercase;color:var(--chatbot-muted);border-bottom:1px solid var(--chatbot-border);background:rgba(176,137,104,.06);display:flex;align-items:center;gap:8px}.chatbot-intelligence-bar span{width:7px;height:7px;border-radius:50%;background:#35d07f;box-shadow:0 0 0 4px rgba(53,208,127,.12)}.chatbot-messages{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px;background:var(--chatbot-bg);scroll-behavior:smooth}.message{display:flex;gap:8px;max-width:94%;align-items:flex-end}.message.bot{align-self:flex-start}.message.user{align-self:flex-end;flex-direction:row-reverse}.message-avatar{width:24px;height:24px;border-radius:9px;background:var(--chatbot-soft);color:var(--chatbot-muted);display:flex;align-items:center;justify-content:center;font-size:.72rem;font-weight:700;flex-shrink:0;border:1px solid var(--chatbot-border)}.message.user .message-avatar{display:none}.message-content{padding:10px 12px;border-radius:16px;line-height:1.48;font-size:.86rem;word-wrap:break-word;white-space:normal;box-shadow:0 8px 24px rgba(0,0,0,.04)}.message.bot .message-content{background:var(--chatbot-soft);color:var(--chatbot-text);border:1px solid var(--chatbot-border);border-bottom-left-radius:5px}.message.user .message-content{background:#B08968;color:#fff;border-bottom-right-radius:5px}.message-content strong{font-weight:650}.message-content a{color:var(--chatbot-link);text-decoration:underline;text-underline-offset:3px}.message.user .message-content a{color:#fff}.chatbot-actions,.chatbot-tools{display:flex;gap:7px;flex-wrap:wrap;margin-left:32px}.chatbot-actions button,.chatbot-tools button{border:1px solid var(--chatbot-border);background:var(--chatbot-card);color:var(--chatbot-text);padding:7px 10px;border-radius:999px;font-size:.74rem;cursor:pointer;transition:all .2s ease}.chatbot-tools button{background:rgba(176,137,104,.1);color:var(--chatbot-link)}.chatbot-actions button:hover,.chatbot-tools button:hover{transform:translateY(-1px);border-color:#B08968;box-shadow:0 8px 18px rgba(176,137,104,.12)}.chatbot-typing{padding:8px 12px;display:flex;gap:4px;align-items:center;background:var(--chatbot-soft);border:1px solid var(--chatbot-border);border-radius:16px;margin:0 14px 10px 46px;width:fit-content}.chatbot-typing span{width:6px;height:6px;background:#B08968;border-radius:50%;display:inline-block;opacity:.55;animation:typing 1.2s infinite}.chatbot-typing span:nth-child(2){animation-delay:.16s}.chatbot-typing span:nth-child(3){animation-delay:.32s}@keyframes typing{0%,60%,100%{transform:translateY(0);opacity:.45}30%{transform:translateY(-3px);opacity:1}}.chatbot-input-area{display:flex;padding:11px;gap:8px;background:var(--chatbot-soft);border-top:1px solid var(--chatbot-border)}.chatbot-input-area input{flex:1;min-width:0;padding:11px 13px;border:1px solid var(--chatbot-border);border-radius:999px;background:var(--chatbot-bg);color:var(--chatbot-text);font-size:.86rem;transition:all .2s ease}.chatbot-input-area input:focus{outline:none;border-color:#B08968;box-shadow:0 0 0 3px rgba(176,137,104,.16)}.chatbot-input-area input::placeholder{color:var(--chatbot-muted);opacity:.8}.chatbot-input-area button{width:41px;height:41px;border-radius:50%;background:#B08968;color:#fff;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0}.chatbot-input-area button:hover{background:#9A6F50;transform:translateY(-1px)}.chatbot-input-area button:disabled,.chatbot-input-area input:disabled{opacity:.65;cursor:not-allowed}.chatbot-messages::-webkit-scrollbar{width:5px}.chatbot-messages::-webkit-scrollbar-track{background:transparent}.chatbot-messages::-webkit-scrollbar-thumb{background:rgba(176,137,104,.45);border-radius:99px}@media(max-width:768px){.chatbot-container{left:10px;bottom:18px}.chatbot-toggle{width:50px;height:50px}.chatbot-window{width:min(335px,calc(100vw - 20px));height:min(540px,calc(100vh - 112px));bottom:62px;border-radius:20px}.chatbot-header{padding:12px}.chatbot-messages{padding:12px}.message-content{font-size:.82rem;padding:9px 11px}.chatbot-actions,.chatbot-tools{margin-left:0}.chatbot-input-area{padding:9px}.chatbot-input-area input{font-size:.82rem;padding:10px 12px}}@media(max-width:380px){.chatbot-window{width:calc(100vw - 20px);height:min(500px,calc(100vh - 105px))}.chatbot-intelligence-bar{font-size:.62rem}.chatbot-actions button,.chatbot-tools button{font-size:.7rem;padding:6px 8px}}

/* ==========================================================
   LIRANDZO CHATBOT — COMPACT RESPONSIVE LAUNCH FIX
   Mantém o chat abaixo do header, menor em ecrãs pequenos e sem tapar a navegação.
   ========================================================== */
.chatbot-container {
  z-index: 850 !important;
  left: 18px !important;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
}
.chatbot-toggle {
  width: 50px !important;
  height: 50px !important;
  box-shadow: 0 12px 28px rgba(176,137,104,.26) !important;
}
.chatbot-window {
  width: min(340px, calc(100vw - 36px)) !important;
  height: min(456px, calc(100dvh - 190px)) !important;
  max-height: calc(100dvh - 190px) !important;
  bottom: 62px !important;
  border-radius: 18px !important;
}
.chatbot-header { padding: 10px 12px !important; }
.chatbot-avatar { width: 32px !important; height: 32px !important; border-radius: 11px !important; }
.chatbot-header h4 { font-size: .86rem !important; }
.chatbot-status { font-size: .62rem !important; }
.chatbot-close { width: 28px !important; height: 28px !important; }
.chatbot-intelligence-bar { padding: 6px 12px !important; font-size: .61rem !important; }
.chatbot-messages { padding: 11px !important; gap: 8px !important; }
.message-content { padding: 8px 10px !important; font-size: .8rem !important; line-height: 1.42 !important; }
.message-avatar { width: 22px !important; height: 22px !important; font-size: .66rem !important; }
.chatbot-actions, .chatbot-tools { gap: 6px !important; margin-left: 28px !important; }
.chatbot-actions button, .chatbot-tools button { padding: 6px 8px !important; font-size: .68rem !important; }
.chatbot-input-area { padding: 8px !important; gap: 7px !important; }
.chatbot-input-area input { padding: 9px 11px !important; font-size: .78rem !important; }
.chatbot-input-area button { width: 36px !important; height: 36px !important; }
.chatbot-typing { margin: 0 11px 8px 38px !important; padding: 7px 10px !important; }

@media (min-width: 769px) and (max-height: 760px) {
  .chatbot-window {
    height: min(380px, calc(100dvh - 178px)) !important;
    max-height: calc(100dvh - 178px) !important;
  }
}
@media (max-width: 768px) {
  .chatbot-container {
    left: 12px !important;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .chatbot-toggle { width: 46px !important; height: 46px !important; }
  .chatbot-toggle svg { width: 21px !important; height: 21px !important; }
  .chatbot-toggle-dot { width: 9px !important; height: 9px !important; right: 7px !important; top: 7px !important; }
  .chatbot-window {
    width: min(300px, calc(100vw - 24px)) !important;
    height: min(350px, calc(100dvh - 166px)) !important;
    max-height: min(52dvh, calc(100dvh - 166px)) !important;
    bottom: 54px !important;
    border-radius: 16px !important;
  }
  .chatbot-header { padding: 8px 10px !important; }
  .chatbot-avatar { width: 28px !important; height: 28px !important; border-radius: 9px !important; }
  .chatbot-header h4 { font-size: .8rem !important; }
  .chatbot-status { display: none !important; }
  .chatbot-close { width: 26px !important; height: 26px !important; font-size: 1.1rem !important; }
  .chatbot-intelligence-bar { display: none !important; }
  .chatbot-messages { padding: 9px !important; gap: 7px !important; }
  .message { max-width: 98% !important; gap: 6px !important; }
  .message-content { font-size: .76rem !important; line-height: 1.38 !important; padding: 7px 9px !important; border-radius: 13px !important; }
  .message-avatar { width: 20px !important; height: 20px !important; border-radius: 8px !important; }
  .chatbot-actions, .chatbot-tools { margin-left: 0 !important; gap: 5px !important; }
  .chatbot-actions button, .chatbot-tools button { padding: 5px 7px !important; font-size: .64rem !important; }
  .chatbot-input-area { padding: 7px !important; }
  .chatbot-input-area input { padding: 8px 10px !important; font-size: .75rem !important; }
  .chatbot-input-area button { width: 33px !important; height: 33px !important; }
}
@media (max-width: 380px) {
  .chatbot-container { left: 10px !important; bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important; }
  .chatbot-window {
    width: min(286px, calc(100vw - 20px)) !important;
    height: min(318px, calc(100dvh - 154px)) !important;
    max-height: min(49dvh, calc(100dvh - 154px)) !important;
    bottom: 52px !important;
  }
  .chatbot-header-info { gap: 7px !important; }
  .chatbot-header h4 { font-size: .76rem !important; }
  .message-content { font-size: .72rem !important; }
  .chatbot-actions button:nth-child(n+4) { display: none !important; }
}
@media (max-height: 620px) {
  .chatbot-window {
    height: min(292px, calc(100dvh - 142px)) !important;
    max-height: calc(100dvh - 142px) !important;
  }
  .chatbot-actions button:nth-child(n+4) { display: none !important; }
}

/* AUDIT FIX — prioridade do chatbot sobre o dock e tamanho seguro */
.chatbot-container{z-index:1650!important;}
body.chatbot-open .chatbot-container{z-index:2100!important;}
.chatbot-window{max-height:calc(100dvh - var(--lz-header-live,80px) - 116px)!important;}
body.chatbot-open .lz-smart-dock,body.chatbot-open .lz-resume-pill,body.chatbot-open #backToTopBtn{opacity:0!important;visibility:hidden!important;pointer-events:none!important;}
@media(max-width:900px){
  .chatbot-container{left:12px!important;bottom:calc(var(--lz-dock-height,66px) + 18px + env(safe-area-inset-bottom,0px))!important;}
  .chatbot-window{bottom:54px!important;max-height:calc(100dvh - var(--lz-header-live,70px) - var(--lz-dock-height,66px) - 78px)!important;}
}
@media(max-width:768px){
  .chatbot-window.lz-chat-mini{height:auto!important;max-height:min(292px,calc(100dvh - 164px))!important;}
}
