.ask-ai-widget {

  position: fixed;

  right: 0;

  top: calc(30% - 26px);

  z-index: 9999;

  display: flex;

  flex-direction: column;

  align-items: flex-end;

  font-family: inherit;

}



.ask-ai-widget__toggle {

  display: flex;

  align-items: center;

  box-sizing: border-box;

  width: 88px;

  padding: 12px 16px;

  border: none;

  border-radius: 12px 0 0 12px;

  background: rgba(4, 131, 199, 1);

  color: #fff;

  font-size: 15px;

  font-weight: 600;

  line-height: 1.2;

  cursor: pointer;

  box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.18);

  overflow: hidden;

  transition: width 0.3s ease;

}



.ask-ai-widget.is-expanded .ask-ai-widget__toggle {

  width: 256px;

}



.ask-ai-widget__arrow {

  display: block;

  flex-shrink: 0;

  width: 17px;

  height: 10px;

  max-width: 0;

  fill: currentColor;

  margin-right: 0;

  opacity: 0;

  transition: opacity 0.3s ease, max-width 0.3s ease, margin-right 0.3s ease;

}



.ask-ai-widget.is-expanded .ask-ai-widget__arrow {

  max-width: 17px;

  margin-right: 8px;

  opacity: 1;

}



.ask-ai-widget__toggle:focus-visible {

  outline: 2px solid #fff;

  outline-offset: 2px;

}



.ask-ai-widget__text-wrap {
font-size: var(--h6-size);
  position: relative;

  flex: 1;

  min-width: 0;

  min-height: 1.2em;

  overflow: hidden;

}



.ask-ai-widget__text-short,

.ask-ai-widget__text-full {

  position: absolute;

  left: 0;

  top: 50%;

  transform: translateY(-50%);

  white-space: nowrap;

}



.ask-ai-widget__text-full {

  visibility: hidden;

}



.ask-ai-widget.is-expanded .ask-ai-widget__text-short {

  visibility: hidden;

}



.ask-ai-widget.is-expanded .ask-ai-widget__text-full {

  visibility: visible;

}



.ask-ai-widget__icons {

  display: flex;

  flex-direction: column;

  align-items: center;

  gap: 10px;

  overflow: hidden;

  max-height: 0;

  padding: 0 10px;

  border-radius: 0px 0 12px 12px;

  background: rgba(4, 131, 199, 1);

  transform: translateX(100%);

  transform-origin: right center;

  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    max-height 0.3s ease,
    padding 0.3s ease;

}



.ask-ai-widget.is-expanded .ask-ai-widget__icons {

  transform: translateX(0);

  max-height: 300px;

  padding: 30px;

  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.05s,
    max-height 0.3s ease 0.05s,
    padding 0.3s ease 0.08s;

}



.ask-ai-widget__icon-btn {

  display: flex;

  align-items: center;

  justify-content: center;

  flex-shrink: 0;

  width: 44px;

  height: 44px;

  border-radius: 50%;

  background: #fff;

  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);

  transition: transform 0.2s ease;

}



.ask-ai-widget__icon-btn:hover,

.ask-ai-widget__icon-btn:focus-visible {

  transform: scale(1.06);

}



.ask-ai-widget__icon-btn:focus-visible {

  outline: 2px solid #fff;

  outline-offset: 2px;

}



.ask-ai-widget__icon-btn img {

  display: block;

  width: 24px;

  height: 24px;

}


@media (max-width: 749px) {
  .ask-ai-widget {
    top: 30%;
    right: 0;
    margin: 5px;
    overflow: hidden;
  }

  /* Collapsed: vertical tab — arrow on top, Ask AI rotated sideways */
  .ask-ai-widget:not(.is-expanded) .ask-ai-widget__toggle {
    position: relative;
    right: auto;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    width: 35px;
    min-height: 88px;
    padding: 10px 8px;
    transform: none;
    transform-origin: top right;
    border-radius: 8px 0 0 8px;
    transition:
      width 0.38s cubic-bezier(0.4, 0, 0.2, 1),
      min-height 0.38s ease,
      padding 0.38s ease,
      gap 0.38s ease,
      box-shadow 0.38s ease;
  }

  .ask-ai-widget:not(.is-expanded) .ask-ai-widget__arrow {
    order: -1;
    flex-shrink: 0;
    max-width: 17px;
    margin-right: 0;
    margin-bottom: 0;
    opacity: 1;
    transform: rotate(180deg);
    transition:
      transform 0.38s ease,
      margin 0.38s ease,
      opacity 0.38s ease;
  }

  .ask-ai-widget:not(.is-expanded) .ask-ai-widget__text-wrap {
    flex: 0 1 auto;
    width: fit-content;
    width: 23px;
        height: 48px;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    transition: flex 0.38s ease, width 0.38s ease;
  }

  .ask-ai-widget:not(.is-expanded) .ask-ai-widget__text-short {
    position: relative;
    left: auto;
    top: auto;
    display: block;
    white-space: nowrap;
    line-height: 1.1;
    transform: rotate(-90deg);
    transform-origin: center center;
    opacity: 1;
    visibility: visible;
    transition:
      opacity 0.22s ease,
      transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .ask-ai-widget:not(.is-expanded) .ask-ai-widget__text-full {
    display: block;
    position: absolute;
    left: 0;
    top: 50%;
    width: 0;
    height: 0;
    overflow: hidden;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-50%) translateX(110%) rotate(-90deg);
    pointer-events: none;
    transition:
      transform 0.38s cubic-bezier(0.4, 0, 0.2, 1) 0.06s,
      opacity 0.32s ease 0.06s,
      visibility 0s linear 0.38s;
  }

  /* Expanded: horizontal bar with slide-reveal full text */
  .ask-ai-widget.is-expanded .ask-ai-widget__toggle {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 0;
    width: min(calc(100vw - 10px), 280px);
    min-height: 0;
    padding: 12px 16px;
    border-radius: 8px 0 0 0;
    box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.18);
  }

  .ask-ai-widget.is-expanded .ask-ai-widget__arrow {
    order: 0;
    max-width: 17px;
    margin-right: 8px;
    margin-bottom: 0;
    opacity: 1;
    transform: rotate(0deg);
    transition:
      transform 0.38s ease,
      margin 0.38s ease,
      opacity 0.38s ease;
  }

  .ask-ai-widget.is-expanded .ask-ai-widget__text-wrap {
    flex: 1;
    width: auto;
    min-height: 1.2em;
    display: block;
    flex-direction: row;
    justify-content: flex-start;
    transition: flex 0.38s ease, width 0.38s ease;
  }

  .ask-ai-widget.is-expanded .ask-ai-widget__text-short {
    position: absolute;
    display: flex;
    flex-direction: row;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.85);
    pointer-events: none;
    transition:
      opacity 0.18s ease,
      transform 0.28s ease,
      visibility 0s linear 0.18s;
  }

  .ask-ai-widget.is-expanded .ask-ai-widget__text-full {
    display: block;
    position: absolute;
    left: 0;
    top: 50%;
    width: auto;
    height: auto;
    overflow: visible;
    white-space: nowrap;
    visibility: visible;
    opacity: 1;
    transform: translateY(-50%) translateX(0) ;
    pointer-events: auto;
    transition:
      transform 0.38s cubic-bezier(0.4, 0, 0.2, 1) 0.08s,
      opacity 0.32s ease 0.08s,
      visibility 0s linear 0s;
  }

  .ask-ai-widget__icons {
    flex-direction: row;
    justify-content: center;
    width: min(calc(100vw - 10px), 280px);
    border-radius: 0 0 0 8px;
    transform: translateX(100%);
    transform-origin: right center;
    transition:
      transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
      max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1),
      padding 0.32s ease;
  }

  .ask-ai-widget.is-expanded .ask-ai-widget__icons {
    width: min(calc(100vw - 10px), 280px);
    margin-top: 0;
    max-height: 88px;
    padding: 16px 20px;
    border-radius: 0 0 0 8px;
    transform: translateX(0);
    transition:
      transform 0.38s cubic-bezier(0.4, 0, 0.2, 1) 0.05s,
      max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1) 0.05s,
      padding 0.38s ease 0.08s;
  }
}