/* site-bar — виджет-гид «Тропы». Палитра наследуется от сайта (var(--olive) и т.д.). */
:root{
  --sb-olive:#7C7F6A; --sb-ink:#1A1A18; --sb-tm:#6E7163;
  --sb-bd:#EAE7E0; --sb-bg:#FFFFFF; --sb-gl:#F4F2EE; --sb-sand:#DBD4C7;
}

/* Плавающая кнопка */
.sb-fab{
  position:fixed; right:22px; bottom:22px; z-index:9998;
  display:flex; align-items:center; gap:9px;
  padding:11px 16px 11px 13px; border:none; border-radius:999px;
  background:var(--sb-olive); color:#fff; cursor:pointer;
  font:600 0.9rem/1 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  box-shadow:0 6px 22px rgba(40,42,34,0.26); transition:transform .15s, box-shadow .15s, opacity .2s;
}
.sb-fab:hover{ transform:translateY(-2px); box-shadow:0 9px 28px rgba(40,42,34,0.32); }
.sb-fab svg{ width:19px; height:19px; flex:none; }
.sb-fab.sb-hidden{ opacity:0; pointer-events:none; transform:scale(.85); }

/* Панель чата */
.sb-panel{
  position:fixed; right:22px; bottom:22px; z-index:9999;
  width:380px; max-width:calc(100vw - 32px); height:560px; max-height:calc(100vh - 44px);
  display:flex; flex-direction:column; overflow:hidden;
  background:var(--sb-bg); border:1px solid var(--sb-bd); border-radius:16px;
  box-shadow:0 18px 50px rgba(30,32,26,0.28);
  opacity:0; transform:translateY(14px) scale(.98); pointer-events:none;
  transition:opacity .2s, transform .2s;
}
.sb-panel.sb-open{ opacity:1; transform:none; pointer-events:auto; }

.sb-head{
  display:flex; align-items:center; gap:10px;
  padding:13px 14px; background:var(--sb-olive); color:#fff;
}
.sb-head-ic{ width:30px; height:30px; flex:none; display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.16); border-radius:8px; }
.sb-head-ic svg{ width:17px; height:17px; }
.sb-head-t{ font-family:"Cormorant Garamond",Georgia,serif; font-weight:700; font-size:1.18rem; line-height:1.05; }
.sb-head-s{ font-size:0.72rem; opacity:.82; letter-spacing:.02em; }
.sb-head-x{ margin-left:auto; background:none; border:none; color:#fff; opacity:.85; cursor:pointer;
  padding:4px; display:flex; border-radius:6px; }
.sb-head-x:hover{ opacity:1; background:rgba(255,255,255,.14); }
.sb-head-x svg{ width:18px; height:18px; }

/* Лента сообщений */
.sb-log{ flex:1; overflow-y:auto; padding:14px; display:flex; flex-direction:column; gap:11px;
  background:var(--sb-gl); scrollbar-width:thin; }
.sb-msg{ max-width:86%; padding:9px 12px; border-radius:13px; font-size:0.9rem; line-height:1.55;
  word-wrap:break-word; }
.sb-msg.sb-bot{ align-self:flex-start; background:#fff; border:1px solid var(--sb-bd); color:var(--sb-ink);
  border-bottom-left-radius:4px; }
.sb-msg.sb-user{ align-self:flex-end; background:var(--sb-olive); color:#fff; border-bottom-right-radius:4px; }
.sb-msg p{ margin:0 0 .5em; } .sb-msg p:last-child{ margin:0; }
.sb-msg strong{ font-weight:700; }
.sb-msg ul,.sb-msg ol{ margin:.3em 0; padding-left:1.2em; }
.sb-msg a{ color:var(--sb-olive); text-decoration:underline; }
.sb-msg.sb-user a{ color:#fff; }

/* Приветствие + чипы-подсказки */
.sb-hint{ font-size:0.78rem; color:var(--sb-tm); padding:2px 2px 0; }
.sb-chips{ display:flex; flex-wrap:wrap; gap:7px; padding:2px; }
.sb-chip{ font-size:0.78rem; padding:6px 11px; border:1px solid var(--sb-sand); border-radius:999px;
  background:#fff; color:var(--sb-tm); cursor:pointer; transition:background .12s,color .12s,border-color .12s; }
.sb-chip:hover{ background:var(--sb-olive); color:#fff; border-color:var(--sb-olive); }

/* Индикатор «печатает» */
.sb-typing{ display:flex; gap:4px; padding:11px 13px; }
.sb-typing span{ width:6px; height:6px; border-radius:50%; background:var(--sb-tm); opacity:.5;
  animation:sb-bounce 1.1s infinite; }
.sb-typing span:nth-child(2){ animation-delay:.18s; } .sb-typing span:nth-child(3){ animation-delay:.36s; }
@keyframes sb-bounce{ 0%,60%,100%{ transform:translateY(0); opacity:.4; } 30%{ transform:translateY(-5px); opacity:.9; } }

/* Поле ввода */
.sb-form{ display:flex; gap:8px; align-items:flex-end; padding:11px; border-top:1px solid var(--sb-bd); background:#fff; }
.sb-input{ flex:1; resize:none; max-height:110px; min-height:38px; padding:9px 12px;
  border:1px solid var(--sb-bd); border-radius:11px; font:0.9rem/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  color:var(--sb-ink); outline:none; transition:border-color .15s; }
.sb-input:focus{ border-color:var(--sb-olive); }
.sb-send{ flex:none; width:38px; height:38px; border:none; border-radius:11px; background:var(--sb-olive);
  color:#fff; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:opacity .15s; }
.sb-send:disabled{ opacity:.4; cursor:default; }
.sb-send svg{ width:18px; height:18px; }
.sb-foot{ text-align:center; font-size:0.66rem; color:var(--sb-tm); padding:0 0 8px; background:#fff; opacity:.7; }

@media(max-width:480px){
  .sb-panel{ right:8px; bottom:8px; width:calc(100vw - 16px); height:calc(100vh - 80px); }
  .sb-fab{ right:14px; bottom:14px; }
}
