html {
  scrollbar-width: auto;
  scrollbar-color: #00e5ef #05080c;
}

::-webkit-scrollbar {
  width: 14px;
}

::-webkit-scrollbar-thumb {
  background: #00e5ef;
  border-radius: 999px;
}

@media (max-width: 767px) {
  body {
    padding-left: 12px;
    padding-right: 0;
  }

  html {
    scrollbar-width: none;
  }

  html::-webkit-scrollbar {
    display: none;
  }

  .site-header {
    left: 12px;
    right: 0;
  }

  .back-top {
    right: 20px;
  }

  .assistant-panel {
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: none !important;
  }
}

@media (max-width: 1180px) {
  .site-header .desktop-nav {
    z-index: 1001;
    isolation: isolate;
    opacity: 1;
    background: #080f1f;
  }
}

@media (max-width: 600px) {
  .assistant-shell.open .assistant-panel {
    top: 12px !important;
    right: 8px !important;
    bottom: 12px !important;
    left: 8px !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    max-height: calc(100dvh - 24px) !important;
    margin: 0;
    transform: none !important;
  }

  .assistant-shell.open .assistant-head,
  .assistant-shell.open .ai-console-head,
  .assistant-shell.open .ai-core-mark,
  .assistant-shell.open .ai-head-actions {
    min-width: 0;
  }

  .assistant-shell.open .assistant-head {
    gap: 8px;
  }

  .assistant-shell.open .ai-core-mark {
    flex: 1 1 auto;
  }

  .assistant-shell.open .ai-core-mark > div {
    min-width: 0;
  }

  .assistant-shell.open .ai-core-mark strong,
  .assistant-shell.open .ai-core-mark small,
  .assistant-shell.open .assistant-msg,
  .assistant-shell.open .ai-stream-text,
  .assistant-shell.open .ai-memory-summary {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .assistant-shell.open .ai-head-actions {
    flex: 0 0 auto;
    gap: 8px;
  }

  .assistant-shell.open .ai-confidence {
    white-space: nowrap;
  }

  .assistant-shell.open .assistant-messages,
  .assistant-shell.open .assistant-prompts,
  .assistant-shell.open .assistant-form {
    min-width: 0;
    max-width: 100%;
  }
}

.assistant-shell.open {
  position: fixed;
  inset: 0 !important;
  width: auto !important;
  height: 100dvh;
  z-index: 9000;
  overflow: hidden;
  overscroll-behavior: none;
  pointer-events: auto;
}

.assistant-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(2, 6, 15, .72);
  backdrop-filter: blur(0);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease, backdrop-filter .35s ease;
}

.assistant-shell.open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(2, 6, 15, .72);
  backdrop-filter: blur(4px);
  opacity: 1;
  pointer-events: auto;
  transition: opacity .35s ease, backdrop-filter .35s ease;
}

.assistant-shell.open .assistant-trigger {
  display: none;
}

.assistant-shell.open .assistant-panel {
  position: fixed;
  z-index: 1;
  top: 32px;
  left: 50%;
  right: auto;
  bottom: auto;
  width: min(760px, calc(100vw - 64px));
  height: min(780px, calc(100dvh - 64px));
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%);
  transform-origin: center center;
  transition: transform .42s cubic-bezier(.22, .8, .24, 1), opacity .22s ease;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Closed/closing states must never leave the full-screen assistant shell as a
   touch interceptor. The JavaScript close fallback also removes the state if
   a mobile browser skips transitionend. */
.assistant-shell:not(.open) {
  width: auto !important;
  height: auto !important;
  overflow: visible;
  pointer-events: auto;
}

.assistant-shell:not(.open) .assistant-panel {
  pointer-events: none !important;
  visibility: hidden !important;
}

.assistant-shell.is-closing,
.assistant-shell.is-closing::before,
.assistant-shell.is-closing .assistant-panel {
  pointer-events: none !important;
}

.assistant-shell.open.is-originating .assistant-panel,
.assistant-shell.open.is-closing .assistant-panel {
  transform: translate(calc(-50% + var(--assistant-origin-x, 0px)), var(--assistant-origin-y, 0px)) scale(var(--assistant-origin-scale-x, 1), var(--assistant-origin-scale-y, 1));
}

.assistant-shell.open.is-originating .assistant-panel {
  transition: none;
}

.assistant-shell.open.is-originating .assistant-scroll-area,
.assistant-shell.open.is-originating .assistant-form {
  opacity: 0;
  transform: translateY(8px);
}

.assistant-shell.open .assistant-scroll-area,
.assistant-shell.open .assistant-form {
  transition: opacity .2s ease .18s, transform .2s ease .18s;
}

.assistant-shell.open.is-closing::before {
  opacity: 0;
  transition: opacity .28s ease;
}

.assistant-shell.open.is-closing .assistant-panel {
  opacity: 0;
  transition: transform .38s cubic-bezier(.65, 0, .78, .2), opacity .25s ease;
}

.assistant-shell.open .assistant-scroll-area {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 48px;
  overscroll-behavior-y: contain;
  overscroll-behavior-x: none;
  -webkit-overflow-scrolling: touch;
  touch-action: auto;
  scroll-behavior: auto;
}

.assistant-shell.open .assistant-head,
.assistant-shell.open .ai-status-strip,
.assistant-shell.open .ai-knowledge,
.assistant-shell.open .assistant-prompts,
.assistant-shell.open .assistant-form {
  flex: 0 0 auto;
}

.assistant-shell.open .assistant-messages {
  flex: 0 0 auto;
  min-height: 86px;
  max-height: none;
  overflow: visible;
}

.assistant-shell.open .assistant-prompts {
  max-height: none;
  overflow: visible;
}

.assistant-shell.open .ai-code-block {
  overflow-x: auto;
  overflow-y: hidden;
}

.assistant-shell.open .assistant-form {
  position: relative;
  bottom: auto;
  width: 100%;
  margin-top: 12px;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 2;
}

@media (max-width: 767px) {
  .assistant-shell.open .assistant-panel {
    top: max(12px, var(--assistant-viewport-offset-top, 0px));
    width: calc(100% - 24px);
    height: calc(var(--assistant-viewport-height, 100dvh) - 24px);
    max-height: none;
  }

}

@media (prefers-reduced-motion: reduce) {
  .assistant-shell.open .assistant-panel,
  .assistant-shell.open .assistant-scroll-area,
  .assistant-shell.open .assistant-form {
    transition-duration: .01ms !important;
  }
}
