/* /local/css/ai-widget.css */

:root{
  --aiw-accent:#00a6c9;
  --aiw-bg:#ffffff;
  --aiw-panel:#f5f7f9;
  --aiw-border:#e0e4ea;
  --aiw-text:#0b1220;
  --aiw-muted:#5b667a;
  --aiw-shadow:0 10px 30px rgba(0,0,0,.18);
  --aiw-radius:14px;
  --aiw-font:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

.aiw-btn{
  position:fixed;
  right:20px;
  bottom:20px;
  z-index:999999;
  width:56px;
  height:56px;
  border:0;
  border-radius:999px;
  background:var(--aiw-accent);
  color:#fff;
  cursor:pointer;
  box-shadow:0 6px 18px rgba(0,0,0,.22);
  display:flex;
  align-items:center;
  justify-content:center;
  font-family:var(--aiw-font);
  font-weight:700;
  letter-spacing:.5px;
}

.aiw-btn:hover{ filter:brightness(.95); }
.aiw-btn:active{ transform:translateY(1px); }

.aiw-btn-badge{
  position:absolute;
  top:-4px;
  right:-4px;
  width:18px;
  height:18px;
  border-radius:99px;
  background:#ff3b30;
  border:2px solid #fff;
  display:none;
}

.aiw-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.35);
  z-index:999998;
  display:none;
}

.aiw-overlay.open{ display:block; }

.aiw-window{
  position:fixed;
  right:20px;
  bottom:90px;
  width:360px;
  max-width:calc(100vw - 40px);
  max-height:560px;
  height:560px;
  background:var(--aiw-bg);
  border-radius:var(--aiw-radius);
  box-shadow:var(--aiw-shadow);
  z-index:999999;
  overflow:hidden;
  display:none;
  flex-direction:column;
  font-family:var(--aiw-font);
  color:var(--aiw-text);
}

.aiw-window.open{ display:flex; }

.aiw-header{
  padding:12px 14px;
  background:var(--aiw-accent);
  color:#fff;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.aiw-header-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.aiw-title{
  font-size:14px;
  font-weight:700;
  line-height:1.2;
}

.aiw-subtitle{
  font-size:12px;
  opacity:.92;
  line-height:1.2;
}

.aiw-close{
  width:32px;
  height:32px;
  border:0;
  border-radius:10px;
  background:rgba(255,255,255,.18);
  color:#fff;
  cursor:pointer;
  font-size:18px;
  line-height:32px;
  text-align:center;
  flex:0 0 auto;
}

.aiw-close:hover{ background:rgba(255,255,255,.26); }

.aiw-messages{
  flex:1 1 auto;
  padding:12px 12px 10px;
  background:var(--aiw-panel);
  overflow:auto;
}

.aiw-msg{
  max-width:92%;
  padding:9px 10px;
  border-radius:12px;
  line-height:1.35;
  font-size:13px;
  white-space:pre-wrap;
  word-break:break-word;
  margin:0 0 10px 0;
}

.aiw-msg-user{
  margin-left:auto;
  background:var(--aiw-accent);
  color:#fff;
  border-bottom-right-radius:4px;
}

.aiw-msg-bot{
  margin-right:auto;
  background:#fff;
  color:var(--aiw-text);
  border:1px solid var(--aiw-border);
  border-bottom-left-radius:4px;
}

.aiw-meta{
  font-size:11px;
  color:var(--aiw-muted);
  margin-top:4px;
}

.aiw-typing{
  display:none;
  padding:6px 12px 10px;
  font-size:12px;
  color:var(--aiw-muted);
  background:var(--aiw-panel);
}

.aiw-typing.show{ display:block; }

.aiw-footer{
  border-top:1px solid var(--aiw-border);
  background:#fff;
  padding:10px;
  display:flex;
  align-items:flex-end;
  gap:8px;
}

.aiw-input{
  flex:1 1 auto;
  min-height:38px;
  max-height:96px;
  resize:none;
  border:1px solid #cfd4dd;
  border-radius:12px;
  padding:9px 10px;
  font-size:13px;
  font-family:var(--aiw-font);
  outline:none;
}

.aiw-input:focus{
  border-color:var(--aiw-accent);
  box-shadow:0 0 0 3px rgba(0,166,201,.12);
}

.aiw-send{
  flex:0 0 auto;
  height:38px;
  padding:0 12px;
  border:0;
  border-radius:12px;
  background:var(--aiw-accent);
  color:#fff;
  cursor:pointer;
  font-size:13px;
  font-weight:700;
}

.aiw-send:disabled{
  opacity:.65;
  cursor:default;
}

@media (max-height:720px){
  .aiw-window{ height:520px; max-height:520px; }
}
