/* PosturaIA Assistant Widget (n8n) */
:root{
  --assistant-z: 9999;
  --assistant-bg: rgba(10, 12, 16, 0.92);
  --assistant-panel: rgba(18, 22, 30, 0.98);
  --assistant-border: rgba(255, 255, 255, 0.10);
  --assistant-text: rgba(255, 255, 255, 0.92);
  --assistant-muted: rgba(255, 255, 255, 0.70);
  --assistant-shadow: 0 18px 60px rgba(0,0,0,0.45);
}

.assistant-fab{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: var(--assistant-z);
  border: 1px solid var(--assistant-border);
  background: var(--assistant-bg);
  color: var(--assistant-text);
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--assistant-shadow);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.assistant-fab:hover{ transform: translateY(-1px); }
.assistant-fab:active{ transform: translateY(0px); }
.assistant-fab svg{ width: 24px; height: 24px; opacity: 0.92; }

.assistant-backdrop{
  position: fixed;
  inset: 0;
  z-index: calc(var(--assistant-z) - 1);
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
}

.assistant-panel{
  position: fixed;
  right: 18px;
  bottom: 90px;
  z-index: var(--assistant-z);
  width: min(420px, calc(100vw - 36px));
  height: min(560px, calc(100vh - 140px));
  border-radius: 18px;
  border: 1px solid var(--assistant-border);
  background: var(--assistant-panel);
  box-shadow: var(--assistant-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.assistant-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 12px 14px;
  border-bottom: 1px solid var(--assistant-border);
}
.assistant-title{
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.assistant-title strong{
  font-size: 14px;
  letter-spacing: 0.2px;
}
.assistant-title span{
  font-size: 12px;
  color: var(--assistant-muted);
}

.assistant-close{
  background: transparent;
  border: 1px solid var(--assistant-border);
  color: var(--assistant-text);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
}
.assistant-close:hover{ opacity: 0.92; }

.assistant-messages{
  padding: 14px;
  overflow: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.assistant-msg{
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--assistant-border);
  line-height: 1.35;
  font-size: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.assistant-msg.user{
  align-self: flex-end;
  background: rgba(255,255,255,0.06);
}
.assistant-msg.bot{
  align-self: flex-start;
  background: rgba(0,0,0,0.18);
}
.assistant-msg small{
  display: block;
  margin-top: 6px;
  color: var(--assistant-muted);
  font-size: 11px;
}

.assistant-inputbar{
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--assistant-border);
  background: rgba(0,0,0,0.12);
}
.assistant-input{
  flex: 1;
  border: 1px solid var(--assistant-border);
  background: rgba(0,0,0,0.18);
  color: var(--assistant-text);
  border-radius: 14px;
  padding: 10px 12px;
  outline: none;
  font-size: 14px;
}
.assistant-send{
  border: 1px solid var(--assistant-border);
  background: rgba(255,255,255,0.06);
  color: var(--assistant-text);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  min-width: 46px;
}
.assistant-send:disabled{ opacity: 0.55; cursor: not-allowed; }

.assistant-hidden{ display:none !important; }

@media (max-width: 420px){
  .assistant-panel{
    right: 12px;
    bottom: 84px;
    width: calc(100vw - 24px);
    height: calc(100vh - 120px);
  }
  .assistant-fab{ right: 12px; bottom: 12px; }
}
