/* =====================================================
   ARIDES VEOKORRALDAJA — compact character + comic bubble
   ===================================================== */

.arides-assistant-launcher{
  position:fixed;
  right:10px;
  bottom:calc(8px + var(--arides-assistant-footer-lift, 0px));
  z-index:9998;

  width:92px;
  height:138px;

  padding:0;
  border:0;
  margin:0;

  background:transparent !important;
  box-shadow:none !important;

  cursor:pointer;
  overflow:visible;

  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

/* сам персонаж */
.arides-assistant-character{
  position:absolute;
  right:0;
  bottom:0;

  display:block;

  width:82px;
  height:122px;

  object-fit:contain;
  object-position:center bottom;

  background:transparent !important;
  box-shadow:none !important;
  border:0 !important;

  filter:drop-shadow(0 6px 8px rgba(0,0,0,.16));

  transition:
    width .28s ease,
    height .28s ease,
    transform .28s ease,
    filter .28s ease;
}

/* маленькая плашка — компактная и ближе к правому краю */
.arides-assistant-launcher-label{
  position:absolute;
  right:40px;
  bottom:96px;

  width:154px;

  padding:8px 10px;

  border:1px solid #d8e4dd;
  border-radius:14px;

  background:rgba(255,255,255,.97);
  color:#173629;

  box-shadow:0 8px 22px rgba(12,45,31,.14);

  font-size:12px;
  font-weight:750;
  line-height:1.2;
  text-align:left;

  transition:
    opacity .2s ease,
    transform .2s ease;

  animation:arides-dispatcher-hello .45s ease both;
}

.arides-assistant-launcher-label::after{
  content:"";
  position:absolute;
  right:16px;
  bottom:-6px;

  width:11px;
  height:11px;

  background:#fff;
  border-right:1px solid #d8e4dd;
  border-bottom:1px solid #d8e4dd;

  transform:rotate(45deg);
}

/* при открытии персонаж немного увеличивается, но не слишком */
.arides-assistant-launcher.is-open{
  width:150px;
  height:215px;
}

.arides-assistant-launcher.is-open .arides-assistant-character{
  width:142px;
  height:205px;
  transform:translateY(4px);
  filter:drop-shadow(0 10px 13px rgba(0,0,0,.22));
}

.arides-assistant-launcher.is-open .arides-assistant-launcher-label{
  opacity:0;
  transform:translateY(8px);
  pointer-events:none;
}

/* =====================================================
   bubble
   ===================================================== */

.arides-assistant{
  position:fixed;
  right:132px;
  bottom:calc(46px + var(--arides-assistant-footer-lift, 0px));
  z-index:9999;

  width:min(360px,calc(100vw - 165px));

  display:none;

  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:#173629;
}

.arides-assistant.is-open{
  display:block;
  animation:arides-assistant-pop .24s ease both;
}

.arides-assistant-bubble{
  position:relative;
  overflow:visible;

  border:1px solid #d4e2db;
  border-radius:23px;

  background:linear-gradient(180deg,#fff 0%,#fbfdfc 100%);

  box-shadow:
    0 22px 58px rgba(15,39,29,.19),
    0 5px 16px rgba(15,39,29,.08),
    inset 0 1px 0 rgba(255,255,255,.9);
}

.arides-assistant-bubble::before{
  content:"";
  position:absolute;

  right:-16px;
  bottom:40px;

  width:28px;
  height:28px;

  background:#fff;
  clip-path:polygon(0 0,100% 50%,0 100%);
  filter:drop-shadow(2px 1px 1px rgba(15,55,36,.10));
}

.arides-assistant-bubble-top{
  display:flex;
  align-items:flex-start;
  gap:10px;

  padding:16px 17px 9px;
  border-bottom:1px solid rgba(221,233,226,.7);
}

.arides-assistant-title{
  min-width:0;
  flex:1;
}

.arides-assistant-title strong{
  display:block;
  font-size:15.5px;
  font-weight:850;
  line-height:1.2;
  color:#086f40;
}

.arides-assistant-title span{
  display:block;
  margin-top:3px;
  color:#718177;
  font-size:11px;
  line-height:1.2;
}

.arides-assistant-title span::before{
  content:"";
  display:inline-block;
  width:7px;
  height:7px;
  margin-right:5px;
  border-radius:50%;
  background:#19a463;
  vertical-align:1px;
}

.arides-assistant-new-conversation{
  min-width:0;
  height:34px;
  flex:0 0 auto;

  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;

  padding:0 13px 0 11px;

  border:1px solid rgba(7,117,66,.32);
  border-radius:999px;

  background:linear-gradient(145deg,#22c968,#079146);
  color:#fff;
  box-shadow:
    0 8px 18px rgba(7,145,70,.20),
    inset 0 1px 0 rgba(255,255,255,.35);

  font-size:12px;
  font-weight:850;
  line-height:1;
  white-space:nowrap;

  cursor:pointer;
}

.arides-assistant-new-conversation::before{
  content:"↻";
  display:block;
  transform:translateY(-.5px);
  font-size:15px;
  font-weight:800;
  line-height:1;
}

.arides-assistant-new-conversation:hover{
  border-color:rgba(5,96,54,.40);
  background:linear-gradient(145deg,#20bd61,#077f3f);
  box-shadow:
    0 10px 22px rgba(7,145,70,.24),
    inset 0 1px 0 rgba(255,255,255,.35);
  transform:translateY(-1px);
}

.arides-assistant-new-conversation:focus-visible{
  outline:3px solid rgba(34,197,94,.25);
  outline-offset:3px;
}

.arides-assistant-close{
  width:30px;
  height:30px;
  flex:0 0 30px;

  border:0;
  border-radius:50%;

  background:#f1f5f3;
  color:#587066;

  font-size:20px;
  line-height:1;

  cursor:pointer;
}

.arides-assistant-close:hover{
  background:#e6eeea;
}

.arides-assistant-log{
  max-height:min(360px,50vh);
  overflow:auto;
  padding:10px 17px 13px;
  scroll-behavior:smooth;
}

.arides-assistant-msg{
  max-width:94%;
  margin:0 0 11px;
  padding:11px 14px;
  border-radius:16px;
  font-size:15px;
  font-weight:520;
  line-height:1.55;
  white-space:pre-line;
  overflow-wrap:anywhere;
}

.arides-assistant-msg.bot{
  padding:3px 2px 7px;
  border:0;
  background:transparent;
  color:#243b31;
}

.arides-assistant-msg.user{
  margin-left:auto;
  border:1px solid #087341;
  border-bottom-right-radius:6px;
  background:linear-gradient(145deg,#0b8050,#07683e);
  color:#fff;
  box-shadow:0 5px 12px rgba(6,92,54,.12);
}

.arides-assistant-actions{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin:2px 0 14px;
  min-width:0;
}

.arides-assistant-chip{
  border:1px solid #acd0bd;
  border-radius:999px;
  max-width:100%;
  padding:8px 11px;
  background:#f9fcfa;
  color:#086f40;
  font:700 12px/1.25 system-ui,-apple-system,sans-serif;
  text-align:left;
  white-space:normal;
  overflow-wrap:anywhere;
  cursor:pointer;
  transition:background .15s ease,border-color .15s ease,transform .15s ease;
}

.arides-assistant-chip:hover{
  background:#edf8f2;
  border-color:#77b996;
  transform:translateY(-1px);
}

.arides-assistant-chip.is-install{
  border-color:#14563b;
  background:linear-gradient(145deg,#176642,#104d35);
  color:#fff;
  box-shadow:0 5px 13px rgba(17,79,53,.16);
}

.arides-assistant-chip.is-install:hover{
  border-color:#0c432d;
  background:linear-gradient(145deg,#0f5b3a,#0b432d);
}

.arides-assistant-chip.is-history{
  border-color:#d2e2d9;
  background:#f5faf7;
  color:#315b47;
}

.arides-assistant-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:8px;
  min-width:0;
  box-sizing:border-box;

  margin:0 12px 12px;
  padding:9px;

  border:1px solid #d8e5de;
  border-radius:16px;

  background:linear-gradient(180deg,#f8fbf9,#f1f7f3);
  box-shadow:inset 0 1px 2px rgba(25,57,40,.035);
}

.arides-assistant-input{
  width:100%;
  min-width:0;
  box-sizing:border-box;
  border:0;
  outline:none;
  padding:8px 7px;
  background:transparent;
  color:#19382b;
  font:14px system-ui,-apple-system,sans-serif;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.arides-assistant-input::placeholder{
  color:#89998f;
}

.arides-assistant-send{
  min-width:42px;
  border:0;
  border-radius:13px;
  background:#087a45;
  color:#fff;
  padding:0 13px;
  font-size:18px;
  font-weight:900;
  cursor:pointer;
}

.arides-assistant-photo{
  display:grid;
  place-items:center;
  width:42px;
  min-width:42px;
  border:0;
  border-radius:13px;
  background:#eef6f1;
  color:#087a45;
  padding:0;
  cursor:pointer;
}

.arides-assistant-photo:hover{
  background:#e1f0e7;
}

.arides-assistant-photo-icon{
  width:32px;
  height:32px;
  display:block;
}

.arides-assistant-photo-camera{
  fill:currentColor;
}

.arides-assistant-photo-lens-outer{
  fill:#eef6f1;
}

.arides-assistant-photo-lens-inner{
  fill:currentColor;
}

.arides-assistant-photo-box{
  fill:#fff;
  stroke:currentColor;
  stroke-width:2;
}

.arides-assistant-photo-box-line{
  fill:none;
  stroke:currentColor;
  stroke-width:1.35;
  stroke-linecap:round;
  opacity:.65;
}

.arides-assistant-photo-input{
  position:absolute;
  width:1px;
  height:1px;
  opacity:0;
  pointer-events:none;
}

.arides-assistant-note{
  grid-column:1/-1;
  padding-top:1px;
  color:#8a9890;
  font-size:9px;
  line-height:1.2;
  text-align:center;
}

.arides-assistant-launcher:focus-visible,
.arides-assistant button:focus-visible{
  outline:3px solid #f2b84b;
  outline-offset:3px;
}

/* =====================================================
   mobile
   ===================================================== */

@media(max-width:700px){

  .arides-assistant-launcher{
    right:6px;
    bottom:calc(6px + var(--arides-assistant-footer-lift, 0px));
    width:78px;
    height:112px;
  }

  .arides-assistant-character{
    width:68px;
    height:102px;
  }

  .arides-assistant-launcher-label{
    right:28px;
    bottom:78px;
    width:120px;
    padding:7px 9px;
    border-radius:12px;
    font-size:10px;
  }

  .arides-assistant-launcher.is-open{
    width:115px;
    height:150px;
  }

  .arides-assistant-launcher.is-open .arides-assistant-character{
    width:108px;
    height:144px;
  }

  .arides-assistant{
    right:8px;
    bottom:calc(124px + var(--arides-assistant-footer-lift, 0px));
    width:calc(100vw - 16px);
  }

  .arides-assistant-bubble{
    border-radius:22px;
  }

  .arides-assistant-bubble::before{
    right:26px;
    bottom:-16px;
    width:26px;
    height:26px;
    transform:rotate(90deg);
  }

  .arides-assistant-log{
    max-height:40vh;
    padding-left:14px;
    padding-right:14px;
  }

  .arides-assistant-msg{
    max-width:96%;
    font-size:14.5px;
    line-height:1.52;
  }

  .arides-assistant-bubble-top{
    padding:14px 14px 7px;
  }

  .arides-assistant-form{
    grid-template-columns:minmax(0,1fr) 38px 38px;
    gap:5px;
    margin:0 8px 8px;
    padding:7px;
  }

  .arides-assistant-input{
    padding:8px 2px;
    font-size:13px;
  }

  .arides-assistant-send,
  .arides-assistant-photo{
    width:38px;
    min-width:38px;
    padding:0;
  }

  .arides-assistant-photo-icon{
    width:29px;
    height:29px;
  }

  .arides-assistant-actions{
    gap:6px;
  }

  .arides-assistant-chip{
    max-width:100%;
  }
}

@media(max-width:380px){
  .arides-assistant-launcher-label{
    width:108px;
    font-size:10px;
  }

  .arides-assistant{
    right:5px;
    width:calc(100vw - 10px);
  }

  .arides-assistant-form{
    grid-template-columns:minmax(0,1fr) 36px 36px;
    gap:4px;
    margin:0 6px 8px;
    padding:6px;
  }

  .arides-assistant-send,
  .arides-assistant-photo{
    width:36px;
    min-width:36px;
  }

  .arides-assistant-input{
    font-size:13px;
  }
}

@keyframes arides-assistant-pop{
  from{
    opacity:0;
    transform:translate(10px,10px) scale(.96);
  }
  to{
    opacity:1;
    transform:translate(0,0) scale(1);
  }
}

@keyframes arides-dispatcher-hello{
  from{
    opacity:0;
    transform:translateY(6px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

@media(prefers-reduced-motion:reduce){
  .arides-assistant,
  .arides-assistant-character,
  .arides-assistant-launcher-label{
    animation:none !important;
    transition:none !important;
  }

  .arides-assistant-log{
    scroll-behavior:auto;
  }
}

/* Hide launcher hint while dispatcher chat is open */
.arides-assistant-launcher.is-open .arides-assistant-launcher-label {
  display: none !important;
}

/* =====================================================
   ARIDES_MOBILE_CHAT_MAP_V1
   ===================================================== */

.arides-assistant-map-preview{
  display:none;
}

@media(max-width:700px){

  .arides-assistant-map-preview{
    display:block;
    margin:2px 0 12px;
    overflow:hidden;
    border:1px solid #d7e7de;
    border-radius:17px;
    background:#f8fbf9;
    box-shadow:0 7px 22px rgba(22,58,42,.11);
  }

  .arides-assistant-map-preview-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:10px;
    padding:9px 11px 7px;
  }

  .arides-assistant-map-preview-head strong{
    color:#193c2d;
    font-size:12px;
  }

  .arides-assistant-map-preview-head span{
    max-width:67%;
    color:#667a70;
    font-size:10px;
    line-height:1.25;
    text-align:right;
  }

  .arides-assistant-map-mini{
    width:100%;
    height:135px;
    background:#eef4f0;
  }

  .arides-assistant-map-preview-route
  .arides-assistant-map-mini{
    height:155px;
  }

  .arides-assistant-map-addresses{
    display:grid;
    gap:5px;
    padding:0 11px 8px;
  }

  .arides-assistant-map-addresses > div{
    display:grid;
    grid-template-columns:22px minmax(0,1fr);
    align-items:center;
    gap:6px;
  }

  .arides-assistant-map-addresses b{
    display:grid;
    place-items:center;
    width:21px;
    height:21px;
    border-radius:50%;
    background:#087a45;
    color:#fff;
    font-size:10px;
  }

  .arides-assistant-map-addresses span{
    overflow:hidden;
    color:#40574c;
    font-size:10px;
    white-space:nowrap;
    text-overflow:ellipsis;
  }

  .arides-assistant-map-preview
  .leaflet-control-attribution{
    font-size:7px;
    line-height:1;
  }
}


/* ARIDES_ASSISTANT_FOOTER_GUARD_V1 */
.arides-assistant-launcher,
.arides-assistant {
  transition: bottom .18s ease-out;
}
/* /ARIDES_ASSISTANT_FOOTER_GUARD_V1 */
