src/styles/global.css
@layer scalar-base, base, scalar-theme, starlight, theme, components, utilities, scalar-client;

@import "@astrojs/starlight-tailwind";
@import "tailwindcss/theme.css" layer(theme);
@import "tailwindcss/preflight.css" layer(base);
@import "tailwindcss/utilities.css" layer(utilities);

@custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *));

/* Required due to Algolia DocSearch bug: https://github.com/algolia/docsearch/issues/2243 */
@media (max-width: 768px) {
  .DocSearch-Container {
    position: fixed !important;
  }
}

/* Chat Widget Styles */
:root {
  --chat-header-height: 3.5rem;
  --chat-footer-height: 4.5rem;
  --chat-dialog-width: min(85vw, 1200px);
  --chat-dialog-height: 85vh;
  --chat-sidebar-width: 15rem;
}

.chat-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: var(--chat-dialog-width);
  height: var(--chat-dialog-height);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--sl-color-gray-6);
  border-radius: var(--global-radius);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.chat-dialog-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--sl-color-black) 70%, transparent);
  backdrop-filter: blur(6px);
}

/* Chat Dialog Container */
.chat-dialog-container {
  position: fixed;
  inset: 0;
  isolation: isolate;
  z-index: 100;
}

.chat-dialog-overlay[data-state="open"] {
  animation: fade-in 0.2s ease-out;
}

.chat-dialog-overlay[data-state="closed"] {
  animation: fade-out 0.2s ease-in;
}

/* Share Modal Styles */
.chat-share-modal {
  position: fixed;
  z-index: 102;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  max-width: 32rem;
  background-color: var(--sl-color-black);
  border: 1px solid var(--sl-color-gray-5);
}

.chat-share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--sl-color-gray-6);
}

.chat-share-title {
  font-size: var(--sl-text-lg);
  font-weight: 500;
  color: var(--sl-color-white);
}

.chat-share-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chat-share-description {
  color: var(--sl-color-gray-2);
  font-size: var(--sl-text-sm);
  line-height: 1.5;
}

.chat-share-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-share-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-share-label {
  font-size: var(--sl-text-sm);
  font-weight: 500;
  color: var(--sl-color-white);
}

.chat-share-input {
  width: 100%;
  height: 2.5rem;
  padding: 0 0.75rem;
  background-color: var(--sl-color-gray-6);
  border: 1px solid var(--sl-color-gray-5);
  border-radius: 0.5rem;
  color: var(--sl-color-white);
  font-size: var(--sl-text-sm);
  line-height: 2.5rem;
}

.chat-share-select {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--sl-color-gray-6);
  border: 1px solid var(--sl-color-gray-5);
  border-radius: 0.5rem;
  color: var(--sl-color-white);
  font-size: var(--sl-text-sm);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.chat-share-url {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.chat-share-url .chat-share-input {
  flex: 1;
}

.chat-button-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: none;
  color: inherit;
  transition: all 0.2s;
  width: 1.25rem;
  height: 1.25rem;
}

.chat-share-note {
  padding: 1rem;
  background-color: var(--sl-color-gray-6);
  border-radius: 0.5rem;
  font-size: var(--sl-text-sm);
  color: var(--sl-color-gray-2);
  line-height: 1.5;
}

.chat-share-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}

.chat-button-secondary {
  padding: 0.75rem 1rem;
  background-color: var(--sl-color-gray-6);
  border: 1px solid var(--sl-color-gray-5);
  border-radius: 0.5rem;
  color: var(--sl-color-white);
  font-size: var(--sl-text-sm);
  font-weight: 500;
  transition: all 0.2s;
}

.chat-button-secondary:hover {
  background-color: var(--sl-color-gray-5);
}

.chat-button-primary {
  padding: 0.75rem 1rem;
  background-color: var(--sl-color-accent);
  border: none;
  border-radius: 0.5rem;
  color: var(--sl-color-white);
  font-size: var(--sl-text-sm);
  font-weight: 500;
  transition: all 0.2s;
}

.chat-button-primary:hover {
  background-color: color-mix(in srgb, var(--sl-color-accent) 85%, var(--sl-color-white));
}

.chat-button-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Chat Dialog Content */
.chat-dialog-content {
  position: fixed;
  z-index: 101;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: 100dvh;
  width: 100%;
  background-color: var(--sl-color-black);
  border: 1px solid var(--sl-color-gray-5);
}

.chat-dialog-content[data-state="open"] {
  animation: zoom-in 0.2s ease-out;
}

.chat-dialog-content[data-state="closed"] {
  animation: zoom-out 0.2s ease-in;
}

@media (min-width: 768px) {
  .chat-dialog-content {
    height: 85vh;
    width: 85vw;
    max-width: 1200px;
  }
}

/* Animations */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes zoom-in {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes zoom-out {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.96);
  }
}

.chat-dialog-header {
  height: var(--chat-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  border-bottom: 1px solid var(--sl-color-gray-6);
  background-color: var(--sl-color-black);
}

.chat-dialog-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-dialog-title h2 {
  font-size: var(--sl-text-lg);
  font-weight: 500;
  color: var(--sl-color-white);
}

.chat-dialog-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: var(--global-radius);
  color: var(--sl-color-gray-3);
  transition: all 0.2s;
}

.chat-button:hover {
  background-color: var(--sl-color-gray-5);
  color: var(--sl-color-white);
}

.chat-button-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: inherit;
}

.chat-new-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: 0.5rem;
  background-color: var(--sl-color-white);
  color: var(--sl-color-black);
  font-size: var(--sl-text-sm);
  font-weight: 500;
  transition: all 0.2s;
}

@media (min-width: 768px) {
  .chat-new-button {
    padding: 0.375rem 1rem;
  }
}

.chat-new-button.hidden {
  opacity: 0;
  transform: translateX(-1rem);
  pointer-events: none;
}

/* Chat Dialog Body */
.chat-dialog-body {
  display: flex;
  min-height: 0;
  flex: 1;
}

/* Chat Sidebar */
.chat-sidebar-container {
  display: none;
}

@media (min-width: 768px) {
  .chat-sidebar-container {
    display: block;
  }
}

/* Chat Main Content */
.chat-scroll-root {
  height: 100%;
}

.chat-scroll-viewport {
  height: 100%;
  width: 100%;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-0.25rem);
  }
}

.chat-scrollbar {
  width: 0.5rem;
  padding: 0.125rem;
  background-color: transparent;
  touch-action: none;
  user-select: none;
}

.chat-scrollbar-thumb {
  background-color: var(--sl-color-gray-4);
  border-radius: var(--global-radius);
}

.chat-input-area {
  height: var(--chat-footer-height);
  padding: 0 1rem;
  background-color: var(--sl-color-gray-6);
}

.chat-trigger {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--sl-color-white);
  color: var(--sl-color-black);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.2s;
}

.chat-trigger:hover {
  background-color: var(--sl-color-accent-high);
}

/* Chat Input Styles */
.chat-input-form {
  display: flex;
  height: 100%;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background-color: var(--sl-color-black);
  border-radius: 0.75rem;
  width: 100%;
}

.chat-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.chat-input {
  width: 100%;
  min-height: 2.5rem;
  max-height: 7.5rem;
  resize: none;
  padding: 0.5rem 1rem;
  background-color: var(--sl-color-gray-6);
  color: var(--sl-color-white);
  border-radius: 0.75rem;
  font-size: var(--sl-text-sm);
  line-height: 1.5;
  border: none;
  transition: all 0.2s;
}

.chat-input::placeholder {
  color: var(--sl-color-gray-3);
}

.chat-input:focus {
  outline: none;
  box-shadow: none;
}

.chat-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--sl-color-gray-5);
}

.chat-input-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  border-radius: 0.75rem;
  color: var(--sl-color-gray-3);
  background-color: transparent;
  transition: all 0.2s;
  padding: 0.5rem;
}

.chat-input-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-input-button-active {
  color: var(--sl-color-white);
}

.chat-input-button-active:hover {
  background-color: var(--sl-color-gray-5);
}

.chat-input-button-stop {
  color: var(--sl-color-white);
  background-color: var(--sl-color-gray-5);
}

.chat-input-button-stop:hover {
  background-color: var(--sl-color-gray-4);
}

.chat-message-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
}

.chat-message-action {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border-radius: var(--global-radius);
  color: var(--sl-color-gray-5);
  transition: all 0.2s;
  border: none;
  background: none;
  cursor: pointer;
}

.chat-message-action:hover {
  color: var(--sl-color-white);
}

.chat-message-action-active {
  color: var(--sl-color-white);
}

.chat-message-action-positive.chat-message-action-active {
  color: var(--sl-color-green);
}

.chat-message-action-positive:hover {
  color: var(--sl-color-green);
}

.chat-message-action-negative.chat-message-action-active {
  color: var(--sl-color-red);
}

.chat-message-action-negative:hover {
  color: var(--sl-color-red);
}

.chat-error {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 0.5rem 1rem;
  border-radius: var(--global-radius);
  background-color: var(--sl-color-red);
  color: var(--sl-color-white);
  font-size: var(--sl-text-sm);
  z-index: 100;
}

/* Chat Sidebar */
.chat-sidebar {
  width: var(--chat-sidebar-width);
  border-right: 1px solid var(--sl-color-hairline);
  background-color: var(--sl-color-bg-sidebar);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-sidebar.collapsed {
  width: 0;
  border-right: none;
  overflow: hidden;
}

.chat-sidebar-scroll {
  flex: 1;
  min-height: 0;
}

.chat-sidebar-viewport {
  height: 100%;
}

.chat-sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-sidebar-group {
  padding: 0.75rem 1rem;
}

.chat-sidebar-group-title {
  font-size: var(--sl-text-sm);
  font-weight: 500;
  color: var(--sl-color-text);
  opacity: 0.8;
  text-transform: uppercase;
}

.chat-sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--sl-color-text);
}

.chat-sidebar-item:hover {
  background: var(--sl-color-gray-6);
}

.chat-sidebar-actions {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 1;
}

.chat-sidebar-action {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  color: var(--sl-color-gray-3);
  transition: color 0.2s ease;
  background: transparent !important;
  border: none;
  outline: none;
  cursor: pointer;
}

.chat-sidebar-action:hover {
  color: var(--sl-color-gray-1);
}

.chat-sidebar-action-icon {
  width: 1rem;
  height: 1rem;
}

.chat-sidebar-item:hover .chat-sidebar-actions {
  opacity: 0.5;
}

.chat-sidebar-actions button {
  padding: 0.25rem;
  border-radius: var(--global-radius);
  color: var(--sl-color-text);
  transition: all 0.2s ease;
}

.chat-sidebar-actions button:hover {
  background: var(--sl-color-gray-5);
  color: var(--sl-color-white);
}

.chat-sidebar-item.active {
  background-color: var(--sl-color-gray-6);
}

.chat-sidebar-item.active .chat-sidebar-button {
  color: var(--sl-color-white);
  font-weight: 500;
}

.chat-sidebar-item.active .chat-sidebar-icon {
  color: var(--sl-color-white);
  opacity: 1;
}

.chat-sidebar-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--sl-color-text);
  opacity: 0.8;
  position: relative;
}

.chat-sidebar-input {
  flex: 1;
  background: transparent;
  font-size: var(--sl-text-sm);
  color: var(--sl-color-text);
  border: none;
}

.chat-sidebar-input:focus {
  outline: none;
}

.chat-sidebar-button {
  width: calc(var(--chat-sidebar-width) - 5rem);
  text-align: left;
  font-size: var(--sl-text-sm);
  color: var(--sl-color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

.chat-sidebar-item:hover .chat-sidebar-button {
  color: var(--sl-color-white);
}

.chat-sidebar-item.active .chat-sidebar-button {
  color: var(--sl-color-white);
  font-weight: 500;
}

.chat-sidebar-footer {
  padding: 1rem;
}

/* Custom checkbox styles */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 1px solid #2e2e2e;
  border-radius: 4px;
  background-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

input[type="checkbox"]:checked {
  background-color: #2563eb;
  border-color: #2563eb;
}

input[type="checkbox"]:checked::after {
  content: "";
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  position: absolute;
}

input[type="checkbox"]:hover:not(:checked) {
  border-color: #4b5563;
}

/* Chat Message Styles */
.chat-message {
  display: flex;
  width: 100%;
  padding: 0.25rem 1.5rem;
  font-family: var(--font-sans);
  line-height: 1.5;
  color: var(--sl-color-white);
}

/* Chat Message Headers */
.chat-message-h1,
.chat-message-h2,
.chat-message-h3,
.chat-message-h4,
.chat-message-h5,
.chat-message-h6 {
  color: var(--sl-color-white);
  font-weight: 600;
  margin: 1.5em 0 0.5em 0;
}

.chat-message-h1 {
  font-size: 2em;
}
.chat-message-h2 {
  font-size: 1.5em;
}
.chat-message-h3 {
  font-size: 1.25em;
}
.chat-message-h4 {
  font-size: 1em;
}
.chat-message-h5 {
  font-size: 0.875em;
}
.chat-message-h6 {
  font-size: 0.85em;
}

.chat-message-content {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Bold text in chat messages */
.chat-message-strong {
  font-weight: 600;
  font-size: inherit;
  color: inherit;
  display: inline;
  margin: 0;
}

/* First strong element (usually the title) should not have top margin */
.chat-message-content > p:first-child strong {
  margin-top: 0;
}

/* Main paragraphs */
.chat-message p {
  margin: 0.75em 0;
  line-height: 1.6;
}

/* Lists */
.chat-message ul,
.chat-message ol {
  margin: 0.5em 0 0.75em 0;
  padding-left: 1.25em;
}

/* List items */
.chat-message li {
  margin: 0.4em 0;
  line-height: 1.5;
}

/* Nested lists */
.chat-message li ul,
.chat-message li ol {
  margin: 0.25em 0 0.25em 1em;
}

/* Links */
.chat-message a {
  color: var(--sl-color-accent);
  text-decoration: none;
  transition: all 0.2s ease;
}

/* Inline code */
.chat-message p code,
.chat-message li code,
.chat-message-inline-code {
  display: inline-block;
  background: var(--sl-color-gray-6);
  color: var(--sl-color-text);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0.2em;
  vertical-align: middle;
}

.code-block-wrapper {
  position: relative;
  margin: 1.5em 0;
  width: 100%;
}

.code-block-wrapper pre {
  margin: 0 !important;
  overflow-x: auto;
  width: 100%;
}

.code-copy-button {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.375rem;
  background: transparent;
  border: none;
  color: var(--sl-color-gray-3);
  opacity: 0;
  transition: all 0.15s ease;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.code-block-wrapper:hover .code-copy-button {
  opacity: 1;
}

.code-copy-icon {
  width: 1.125rem;
  height: 1.125rem;
}

.code-copy-icon.copied {
  color: var(--sl-color-green);
}

/* Blockquotes (if any) */
.chat-message blockquote {
  margin: 1em 0;
  padding-left: 1em;
  border-left: 3px solid var(--sl-color-accent);
  color: var(--sl-color-gray-3);
}

/* Bottom links section */
.chat-message p:last-child {
  margin-top: 1.5em;
  padding-top: 1em;
  font-style: italic;
  color: var(--sl-color-gray-3);
}

/* Horizontal rules */
.chat-message hr {
  border: none;
  border-top: 1px solid var(--sl-color-gray-5);
  margin: 1.5em 0;
  opacity: 0.4;
}

/* Tables */
.chat-message table {
  width: 100%;
  margin: 1em 0;
  border-collapse: collapse;
  font-size: var(--sl-text-sm);
}

.chat-message th {
  background: var(--sl-color-gray-6);
  font-weight: 600;
  text-align: left;
}

.chat-message th,
.chat-message td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--sl-color-gray-5);
}

.chat-message tr:nth-child(even) {
  background: color-mix(in srgb, var(--sl-color-gray-6) 15%, transparent);
}

/* Fast Mode Box */
.chat-fast-mode {
  background-color: var(--sl-color-bg-hover);
  padding: 1rem;
  border-radius: var(--global-radius);
  border: 1px solid var(--sl-color-hairline);
}

.chat-fast-mode-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--sl-color-text);
}

.chat-fast-mode-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: var(--global-radius);
  border: 1px solid var(--sl-color-hairline);
  background-color: var(--sl-color-bg);
}

.chat-fast-mode-checkbox:checked {
  background-color: var(--sl-color-accent);
  border-color: var(--sl-color-accent);
}

.chat-fast-mode-checkbox:hover:not(:checked) {
  border-color: var(--sl-color-accent);
}

.chat-fast-mode-text {
  font-size: var(--sl-text-base);
  color: var(--sl-color-text);
}

.chat-fast-mode-description {
  margin-top: 0.25rem;
  font-size: var(--sl-text-xs);
  color: var(--sl-color-text);
  opacity: 0.8;
}

/* Dialog Title */
.chat-dialog-title-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--sl-text-lg);
  font-weight: 500;
  color: var(--sl-color-white);
}

.chat-dialog-logo {
  width: 1.25rem;
  height: 1.25rem;
  filter: invert(1);
}

/* Button Content */
.chat-button-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-icon {
  width: 1rem;
  height: 1rem;
}

.chat-button-text {
  display: none;
}

@media (min-width: 768px) {
  .chat-button-text {
    display: inline;
  }
}

/* Load More Button */
.chat-load-more {
  margin: 0 auto;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background-color: var(--sl-color-gray-6);
  color: var(--sl-color-white);
  font-size: var(--sl-text-sm);
}

.chat-load-more:hover {
  background-color: var(--sl-color-gray-5);
}

/* Empty State */
.chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 0;
  text-align: center;
}

.chat-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background-color: var(--sl-color-gray-6);
  padding: 1rem;
}

.chat-empty-logo {
  width: 2rem;
  height: 2rem;
  filter: invert(1);
}

.chat-empty-content {
  max-width: 24rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-empty-title {
  font-size: var(--sl-text-lg);
  font-weight: 500;
  color: var(--sl-color-white);
}

.chat-empty-text {
  font-size: var(--sl-text-sm);
  color: var(--sl-color-white);
}

.chat-empty-tip {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background-color: var(--sl-color-gray-6);
}

.chat-tip-text {
  font-size: var(--sl-text-sm);
  color: var(--sl-color-white);
  opacity: 0.7;
}

/* Thinking State */
.chat-thinking {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background-color: color-mix(in srgb, var(--sl-color-accent) 10%, var(--sl-color-black));
  border: 1px solid color-mix(in srgb, var(--sl-color-accent) 30%, transparent);
  border-radius: 0.5rem;
  color: var(--sl-color-white);
  font-size: var(--sl-text-sm);
}

.chat-thinking-logo {
  width: 1.25rem;
  height: 1.25rem;
  filter: invert(1);
  animation: pulse 2s infinite;
}

.chat-thinking span {
  opacity: 0.9;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-25%);
  }
}

/* Disclaimer */
.chat-disclaimer {
  text-align: center;
  font-size: 0.7rem;
  color: var(--sl-color-gray-3);
  opacity: 0.5;
  width: 100%;
  margin-bottom: 0.5rem;
}

.chat-disclaimer-link {
  color: var(--sl-color-accent-high);
  text-decoration: none;
  transition: opacity 0.2s;
}

.chat-disclaimer-link:hover {
  opacity: 0.8;
}

/* Error Message */
.chat-input-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chat-error-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: color-mix(in srgb, var(--sl-color-red) 15%, var(--sl-color-black));
  border: 1px solid color-mix(in srgb, var(--sl-color-red) 50%, transparent);
  color: var(--sl-color-white);
  border-radius: 0.5rem;
  font-size: var(--sl-text-sm);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  animation:
    slide-up 0.2s ease-out,
    fade-in 0.2s ease-out;
  width: max-content;
  max-width: 90%;
}

.chat-error-message span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-error-message span::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--sl-color-red);
  border-radius: 9999px;
  animation: pulse 2s infinite;
}

.chat-error-dismiss {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem;
  color: var(--sl-color-gray-3);
  transition: all 0.2s;
  background: none;
}

.chat-error-dismiss:hover {
  color: var(--sl-color-white);
}

@keyframes pulse {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slide-up {
  from {
    transform: translateY(0.5rem);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.chat-error-message.fade-out {
  animation: fade-out 0.2s ease-in forwards;
}

@keyframes fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Chat Footer */
.chat-footer {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Chat Main Layout */
.chat-main {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  background-color: var(--sl-color-black);
}

.chat-messages {
  flex: 1;
  overflow: hidden;
}

.chat-messages-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
}

/* Chat Bottom Section */
.chat-bottom {
  background: none;
}

.chat-input-container {
  /* margin-bottom: 0.5rem; */
  background: none;
}

/* Rest of the existing styles */
.sl-markdown-content {
  font-size: var(--sl-text-base);
}

:root[data-theme="light"],
[data-theme="light"] ::backdrop {
  --sl-color-bg-nav: var(--sl-color-bg);
}

@media (min-width: 1536px) {
  :root {
    --sl-content-width: 56rem;
  }
}

:root {
  --sl-color-bg-nav: var(--sl-color-bg);
  --sl-color-bg-sidebar: transparent;

  --global-radius: 2px;

  --color-link-breadcrumbs: var(--sl-color-text-accent);

  --docsearch-searchbox-shadow: inset 0 0 0 1px var(--docsearch-primary-color);

  --text-scale: 1;

  --sl-text-xs: clamp(0.88rem, -0.18vi + 0.92rem, 0.78rem);
  --sl-text-sm: clamp(0.94rem, 0vi + 0.94rem, 0.94rem);
  --sl-text-base: clamp(1rem, 0.23vi + 0.94rem, 1.13rem);
  --sl-text-lg: clamp(1.07rem, 0.51vi + 0.94rem, 1.35rem);
  --sl-text-xl: clamp(1.14rem, 0.88vi + 0.92rem, 1.62rem);
  --sl-text-2xl: clamp(1.21rem, 1.33vi + 0.88rem, 1.94rem);
  --sl-text-3xl: clamp(1.3rem, 1.88vi + 0.82rem, 2.33rem);
  --sl-text-4xl: clamp(1.38rem, 2.58vi + 0.74rem, 2.8rem);
  --sl-text-5xl: clamp(1.48rem, 3.42vi + 0.62rem, 3.36rem);
}

/* Dark mode colors. */
:root {
  --sl-color-accent-low: #062833;
  --sl-color-accent: #007592;
  --sl-color-accent-high: hsl(180, 72%, 82%);
  --sl-color-white: #ffffff;
  --sl-color-gray-1: #eceef2;
  --sl-color-gray-2: #c6c8ce;
  --sl-color-gray-3: #a0a4ae;
  --sl-color-gray-4: #545861;
  --sl-color-gray-5: #353841;
  --sl-color-gray-6: #24272f;
  --sl-color-black: #0b1418;

  --sl-color-orange-low: hsl(var(--sl-hue-orange), 39%, 15%);
  --sl-color-green-low: hsl(var(--sl-hue-green), 39%, 15%);
  --sl-color-blue-low: hsl(var(--sl-hue-blue), 54%, 18%);
  --sl-color-purple-low: hsl(var(--sl-hue-purple), 39%, 15%);
  --sl-color-red-low: hsl(var(--sl-hue-red), 39%, 15%);
}
/* Light mode colors. */
:root[data-theme="light"] {
  --sl-color-accent-low: #caf1f7;
  --sl-color-accent: #00b6c2;
  --sl-color-accent-high: #00525e;
  --sl-color-white: #17181c;
  --sl-color-gray-1: #24272f;
  --sl-color-gray-2: #353841;
  --sl-color-gray-3: #545861;
  --sl-color-gray-4: #888b96;
  --sl-color-gray-5: #c0c2c7;
  --sl-color-gray-6: #eceef2;
  --sl-color-gray-7: #f5f6f8;
  --sl-color-black: #ffffff;

  --sl-color-orange-low: hsl(var(--sl-hue-orange), 90%, 90%);
  --sl-color-green-low: hsl(var(--sl-hue-green), 85%, 92%);
  --sl-color-blue-low: hsl(var(--sl-hue-blue), 88%, 94%);
  --sl-color-purple-low: hsl(var(--sl-hue-purple), 80%, 94%);
  --sl-color-red-low: hsl(var(--sl-hue-red), 80%, 94%);
}

@theme {
  --font-sans: var(--font-atkinson-hyperlegible-next);
}

html {
  scroll-behavior: smooth;
}

.sidebar-pane {
  border-right: 1px solid var(--sl-color-hairline);
  .sidebar-content {
    padding: 0;
  }
}

.sidebar-content ul ul li {
  border-inline-start: 1px solid var(--sl-color-hairline);
}

.sidebar-content ul li a {
  display: flex;
}

.sidebar-content ul li a[aria-current="page"] {
  background-color: var(--sl-color-text-invert);
  color: var(--sl-color-text-accent);
}

.sidebar-content ul li a:not([aria-current="page"]):hover {
  background-color: color-mix(in srgb, var(--sl-color-text-invert) 35%, transparent);
}

.sidebar-content .large:hover {
  color: var(--sl-color-gray-1);
}

header {
  border-bottom: 1px solid var(--sl-color-hairline) !important;
}

.sidebar-content .sl-badge {
  align-items: center;
  display: flex;
  font-size: xx-small !important;
  align-self: flex-start;
  text-wrap: nowrap;
}

.sidebar-content details ul li a {
  display: flex;
  justify-content: space-between;
  border-radius: var(--global-radius);
}

.pagination-links > a {
  border-radius: var(--global-radius);
}

header site-search button {
  border-radius: var(--global-radius) !important;
}

@media (min-width: 50rem) {
  .DocSearch-Button {
    border-radius: var(--global-radius) !important;
  }
}

.DocSearch-Modal,
.DocSearch-Form,
.DocSearch-Hit a,
.DocSearch-Commands-Key {
  border-radius: var(--global-radius);
}

.DocSearch-Footer {
  border-radius: 0 0 var(--global-radius) var(--global-radius);
}

.sl-link-card {
  border-radius: var(--global-radius) !important;
  background: color-mix(in srgb, var(--sl-color-white) 1%, transparent);
  box-shadow: none;
  .description {
    font-size: var(--sl-text-sm);
  }
  &:hover {
    border-color: var(--sl-color-accent-high);
    background: var(--sl-color-gray-9);
  }
}

.group-label {
  text-transform: capitalize;
}

.sl-link-button {
  font-weight: 500;
}
.sl-link-button.primary {
  border-radius: var(--global-radius);
  border: none;
}

.sl-markdown-content a:not(:where(.not-content *)) {
  font-weight: 500;
  text-underline-offset: 4px;
  text-decoration-line: underline;
  text-decoration-thickness: 0.5px;
  color: var(--sl-color-gray-1);
  text-decoration-color: var(--sl-color-text-accent);
  &:hover {
    text-decoration-thickness: 2px;
  }
}

.sl-markdown-content :is(.sl-heading-wrapper.level-h2):not(:first-child) {
  margin-top: 1.75em;
}

.sl-link-card a {
  text-decoration: none;
}

.content-panel {
  padding: 2.5rem var(--sl-content-pad-x);
}

.tab {
  text-wrap: nowrap;
}

.sl-markdown-content :not(ul, ol) + :is(ul, ol):not(:where(.not-content *, .sl-steps)) {
  margin-block: 0.75rem;
  margin-inline: 0;
  padding-inline-start: 1.5rem;
}

.sl-markdown-content :not(ul) + :is(ul):not(:where(.not-content *, .sl-steps)) {
  list-style-type: disc;
}

.sl-markdown-content :not(ol) + :is(ol):not(:where(.not-content *, .sl-steps)) {
  list-style-type: decimal;
}

code {
  border-radius: var(--global-radius);
}

.starlight-aside {
  border-radius: var(--global-radius);
}

.card .title code {
  font-size: inherit;
}

.site-title {
  color: var(--sl-color-white);
  gap: 0.75rem;
  font-size: var(--sl-text-xl);
}

.social-icons {
  a {
    color: var(--sl-color-gray-1);
  }
}

.toggle {
  border-radius: var(--global-radius);
}

astro-island[component-export="Faucet"] {
  display: block;
}

astro-island[component-export="GraphQLEditor"] {
  display: block;
  min-height: 500px;
}

@media (width < 80rem) {
  astro-island[component-export="GraphQLEditor"] {
    min-height: 720px;
  }
}

.sl-markdown-content code:not(:where(.not-content *)) {
  border: 1px solid color-mix(in srgb, var(--sl-color-gray-5), transparent 25%);
  background: var(--sl-color-gray-6);
  padding: 0.15rem 0.4rem;
}

/* API Reference Overrides */
.content-panel {
  .panel {
    background-color: transparent;
  }
  details {
    padding: 0;
    border: 0;
  }
  .key {
    .name {
      min-width: 50%;
    }
  }
}

.expressive-code {
  .frame {
    --header-border-radius: var(--global-radius) !important;
    .header {
      border-top-left-radius: var(--header-border-radius);
      border-top-right-radius: var(--header-border-radius);
    }
    pre {
      border-bottom-left-radius: var(--global-radius) !important;
      border-bottom-right-radius: var(--global-radius) !important;
    }
    .copy button {
      border-radius: var(--global-radius);
    }
  }
  .ec-section:is(.collapsible-start, .collapsible-end) {
    details {
      &[open] + .content-lines {
        background-color: var(--code-background) !important;
      }
      summary {
        background-color: transparent;
        .ec-line {
          opacity: 0.35;
          &:hover {
            opacity: 0.5;
          }
          .text {
            font-size: small;
          }
        }
      }
    }
  }
  .ec-section:is(.collapsible-start) {
    details {
      summary {
        border-bottom: 1px solid color-mix(in srgb, var(--sl-color-gray-4) 25%, transparent);
      }
    }
  }
  .ec-section:is(.collapsible-end) {
    details {
      summary {
        border-top: 1px solid color-mix(in srgb, var(--sl-color-gray-4) 25%, transparent);
      }
    }
  }
}

header.header {
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  > div {
    width: 100%;
  }
}

.DocSearch-Button {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  transform: translateX(0.5rem);
}

.DocSearch-Search-Icon {
  width: auto;
  height: auto;
}

@media (min-width: 50rem) {
  .DocSearch-Button:hover {
    border-color: var(--docsearch-primary-color);
  }
}

.DocSearch-Form {
  box-shadow: none;
}

.DocSearch-Form:focus-within {
  box-shadow: var(--docsearch-searchbox-shadow);
}

.hero {
  h1,
  .tagline {
    text-wrap: balance;
  }
}
@media (width < 40rem) {
  .hero {
    > img,
    > .hero-html {
      width: min(40%, 20rem);
    }
    .actions {
      flex-direction: column;
      align-items: center;
    }
  }
}

.mobile-preferences {
  padding: 1rem var(--sl-sidebar-pad-x);
}

[data-has-hero] .sl-container {
  max-width: 100%;
}

[data-has-hero] .sl-markdown-content,
.hero {
  max-width: 72rem;
  margin-inline: auto;
}

.starlight-aside {
  border: 1px solid var(--sl-color-asides-border);
}
