:root {
  --docs-bg: #eef2f7;
  --docs-surface: #ffffff;
  --docs-ink: #0f172a;
  --docs-muted: #475569;
  --docs-faint: #94a3b8;
  --docs-line: #e2e8f0;
  --docs-line-strong: #cbd5e1;
  --docs-accent: #2563eb;
  --docs-accent-soft: #eff6ff;
  --docs-accent-mid: #dbeafe;
  --docs-sidebar: #0b1220;
  --docs-sidebar-text: #e2e8f0;
  --docs-sidebar-muted: #94a3b8;
  --docs-sidebar-hover: rgba(255, 255, 255, 0.06);
  --docs-sidebar-active: rgba(59, 130, 246, 0.22);
  --docs-radius: 16px;
  --docs-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --docs-font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--docs-bg);
  color: var(--docs-ink);
  font-family: var(--docs-font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.material-symbols-rounded {
  font-family: "Material Symbols Rounded", sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
  user-select: none;
  flex-shrink: 0;
}

a { color: var(--docs-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.docs-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}

/* —— Sidebar —— */
.docs-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--docs-sidebar);
  color: var(--docs-sidebar-text);
  padding: 1.15rem 0.95rem 2rem;
  border-right: 0;
}

.docs-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.4rem 1.1rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.docs-brand:hover { text-decoration: none; color: #fff; }

.docs-brand__mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 55%, #1d4ed8 100%);
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.45);
}

.docs-brand__mark img {
  width: 58%;
  height: 72%;
  object-fit: contain;
  display: block;
}

.docs-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.docs-brand__text strong {
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.docs-brand__text small {
  color: var(--docs-sidebar-muted);
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.12rem;
}

.docs-search {
  position: relative;
  margin-bottom: 1rem;
}

.docs-search .material-symbols-rounded {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--docs-sidebar-muted);
  font-size: 1.15rem;
  pointer-events: none;
}

.docs-search input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.7rem 0.8rem 0.7rem 2.25rem;
  font: inherit;
  color: #fff;
}

.docs-search input::placeholder { color: #64748b; }

.docs-search input:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.docs-nav-label {
  margin: 0.45rem 0.5rem 0.55rem;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.docs-nav { display: grid; gap: 0.35rem; min-width: 0; max-width: 100%; }

.docs-nav__section {
  margin-top: 0.65rem;
  padding: 0.35rem 0.55rem;
  color: var(--docs-sidebar-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.docs-nav__group,
.docs-nav__subgroup {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
  max-width: 100%;
}

.docs-nav__row {
  display: flex;
  align-items: flex-start;
  gap: 0.15rem;
  min-width: 0;
}

.docs-nav__row--nested {
  margin-top: 0.1rem;
}

.docs-nav__caret {
  width: 28px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.docs-nav__caret:hover {
  background: var(--docs-sidebar-hover);
  color: #e2e8f0;
}

.docs-nav__caret .material-symbols-rounded {
  font-size: 1.2rem;
  color: inherit;
  transition: transform .18s ease;
}

.docs-nav__group.is-open > .docs-nav__row > .docs-nav__caret .material-symbols-rounded,
.docs-nav__subgroup.is-open > .docs-nav__row > .docs-nav__caret .material-symbols-rounded {
  transform: rotate(180deg);
}

.docs-nav__caret--empty {
  width: 28px;
  height: 34px;
  flex-shrink: 0;
  pointer-events: none;
}

.docs-nav__link,
.docs-nav__parent {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  flex: 1 1 auto;
  width: auto;
  max-width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 0.5rem 0.55rem;
  color: var(--docs-sidebar-text);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;
}

.docs-nav__parent {
  font-weight: 650;
  color: #fff;
}

.docs-nav__link .material-symbols-rounded,
.docs-nav__parent .material-symbols-rounded {
  font-size: 1.15rem;
  color: #64748b;
  margin-top: 0.1rem;
}

.docs-nav__label-text,
.docs-nav__link > span:last-child {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  line-height: 1.35;
}

.docs-nav__link:hover,
.docs-nav__parent:hover {
  background: var(--docs-sidebar-hover);
  text-decoration: none;
  color: #fff;
}

.docs-nav__link.is-active,
.docs-nav__parent.is-active {
  background: var(--docs-sidebar-active);
  color: #93c5fd;
  font-weight: 650;
}

.docs-nav__link.is-active .material-symbols-rounded,
.docs-nav__parent.is-active .material-symbols-rounded,
.docs-nav__parent:hover .material-symbols-rounded {
  color: #93c5fd;
}

.docs-nav__children {
  display: none;
  margin: 0.05rem 0 0.35rem 0.9rem;
  padding-left: 0.55rem;
  border-left: 1px solid rgba(148, 163, 184, 0.22);
  gap: 0.05rem;
  min-width: 0;
  max-width: 100%;
}

.docs-nav__group.is-open > .docs-nav__children,
.docs-nav__subgroup.is-open > .docs-nav__children {
  display: grid;
}

.docs-nav__children--nested {
  margin-left: 0.55rem;
}

.docs-nav__link--folder {
  font-weight: 600;
  color: #cbd5e1;
}

.docs-nav__link--nested {
  padding-left: 0.5rem;
  font-size: 0.88rem;
  color: #cbd5e1;
}

/* —— Main —— */
.docs-main {
  padding: 1.75rem 2rem 3.5rem;
  width: 100%;
  max-width: 1080px;
}

.docs-main > .docs-card,
.docs-main > .docs-welcome,
.docs-main > .docs-home-head,
.docs-main > .docs-blocks,
.docs-main > .docs-hero {
  width: 100%;
}

/* —— Home welcome —— */
.docs-welcome {
  background: var(--docs-surface);
  border: 1px solid var(--docs-line);
  border-radius: var(--docs-radius);
  box-shadow: var(--docs-shadow);
  padding: 1.85rem 2rem 1.7rem;
  margin-bottom: 1.75rem;
  position: relative;
  overflow: hidden;
}

.docs-welcome::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #60a5fa, #2563eb 45%, #1d4ed8);
}

.docs-welcome h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.7rem, 2.6vw, 2.15rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--docs-ink);
}

.docs-welcome > p {
  margin: 0;
  max-width: 40rem;
  color: var(--docs-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* —— Home sections —— */
.docs-home-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
}

.docs-home-head h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.docs-home-head p {
  margin: 0.2rem 0 0;
  color: var(--docs-muted);
  font-size: 0.92rem;
}

.docs-blocks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.docs-block {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.15rem;
  align-items: start;
  padding: 1.25rem 1.35rem 1.2rem;
  border-radius: var(--docs-radius);
  border: 1px solid var(--docs-line);
  background: var(--docs-surface);
  box-shadow: var(--docs-shadow);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.docs-block:hover {
  text-decoration: none;
  border-color: #93c5fd;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.docs-block__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--docs-accent-soft);
  border: 1px solid var(--docs-accent-mid);
  color: var(--docs-accent);
}

.docs-block__icon .material-symbols-rounded { font-size: 1.45rem; color: var(--docs-accent); }

.docs-block__body { min-width: 0; }

.docs-block__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.docs-block__title {
  display: block;
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  color: var(--docs-ink);
}

.docs-block__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--docs-muted);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.docs-block__desc {
  display: block;
  color: var(--docs-muted);
  font-size: 0.9rem;
  margin: 0.15rem 0 0.75rem;
}

.docs-block__articles {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-block__articles a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--docs-line);
  color: var(--docs-ink);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.docs-block__articles a:hover {
  background: var(--docs-accent-soft);
  border-color: #bfdbfe;
  color: #1d4ed8;
  text-decoration: none;
}

.docs-block__articles .material-symbols-rounded {
  font-size: 1.05rem;
  color: var(--docs-faint);
}

.docs-block__articles a:hover .material-symbols-rounded {
  color: var(--docs-accent);
}

.docs-block__more {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.75rem;
  color: var(--docs-accent);
  font-size: 0.88rem;
  font-weight: 650;
}

.docs-block__more .material-symbols-rounded {
  font-size: 1.05rem;
}

/* —— Shared content —— */
.docs-hero {
  background: var(--docs-surface);
  border: 1px solid var(--docs-line);
  border-radius: var(--docs-radius);
  box-shadow: var(--docs-shadow);
  padding: 1.5rem 1.6rem;
  margin-bottom: 1.25rem;
}

.docs-hero h1 {
  margin: 0 0 0.4rem;
  font-size: 1.7rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.docs-hero p {
  margin: 0;
  color: var(--docs-muted);
}

.docs-card {
  background: var(--docs-surface);
  border: 1px solid var(--docs-line);
  border-radius: var(--docs-radius);
  box-shadow: var(--docs-shadow);
  padding: 1.35rem 1.5rem;
}

.docs-card + .docs-card { margin-top: 0.9rem; }

.docs-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.docs-card p {
  margin: 0;
  color: var(--docs-muted);
}

.docs-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.docs-list a {
  display: block;
  border: 1px solid var(--docs-line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  color: inherit;
  background: #fff;
}

.docs-list a:hover {
  border-color: #93c5fd;
  text-decoration: none;
  background: var(--docs-accent-soft);
}

.docs-list__title { font-weight: 650; color: var(--docs-ink); }
.docs-list__meta { color: var(--docs-muted); font-size: 0.85rem; margin-top: 0.2rem; }

.docs-article__title {
  margin: 0 0 0.5rem;
  font-size: 1.85rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.docs-article__meta {
  color: var(--docs-muted);
  font-size: 0.88rem;
  margin-bottom: 1.2rem;
}

.docs-article__body {
  font-size: 1.02rem;
  line-height: 1.7;
  color: #1e293b;
}

.docs-article__body :is(p, ul, ol) { margin: 0 0 0.95rem; }
.docs-article__body h2, .docs-article__body h3 { margin: 1.5rem 0 0.55rem; color: var(--docs-ink); }
.docs-article__body img { max-width: 100%; border-radius: 10px; }
.docs-article__body mark { background: #fef08a; padding: 0 0.15rem; }
.docs-article__body a { font-weight: 550; }

.docs-article__body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0 0 1rem;
  border: 1px solid var(--docs-line);
  border-radius: 12px;
  overflow: hidden;
}

.docs-article__body th,
.docs-article__body td {
  padding: 0.65rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--docs-line);
  vertical-align: top;
}

.docs-article__body th {
  background: #f8fafc;
  color: var(--docs-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.docs-article__body tr:last-child td { border-bottom: 0; }

.docs-article__body pre {
  margin: 0 0 1.15rem;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  border: 1px solid #1e293b;
  background: #0f172a;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
}

.docs-article__body pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.docs-article__body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86em;
  background: #f1f5f9;
  border: 1px solid var(--docs-line);
  border-radius: 6px;
  padding: 0.08rem 0.35rem;
  color: #0f172a;
}

.docs-empty {
  text-align: center;
  padding: 2.75rem 1.25rem;
  color: var(--docs-muted);
}

.docs-loader {
  padding: 2rem;
  color: var(--docs-muted);
}

/* —— Client API docs —— */
.docs-api h2 {
  margin: 1.6rem 0 0.55rem;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.docs-api h2:first-child { margin-top: 0; }

.docs-api > p,
.docs-api > ul {
  color: var(--docs-muted);
  margin: 0 0 0.85rem;
}

.docs-api > ul { padding-left: 1.15rem; }

.docs-api code,
.docs-api__code-inline {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86em;
  background: #f1f5f9;
  border: 1px solid var(--docs-line);
  border-radius: 6px;
  padding: 0.08rem 0.35rem;
  color: #0f172a;
}

.docs-hero .docs-api__code-inline {
  white-space: nowrap;
}

.docs-api__endpoint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.85rem !important;
}

.docs-api__endpoint span {
  color: var(--docs-faint);
  font-size: 0.85rem;
}

.docs-api__code {
  position: relative;
  margin: 0 0 1.15rem;
  border-radius: 12px;
  border: 1px solid #1e293b;
  background: #0f172a;
  overflow: auto;
}

.docs-api__code pre {
  margin: 0;
  padding: 0.95rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
}

.docs-api__code code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.docs-api__table-wrap {
  overflow: auto;
  margin: 0 0 1rem;
  border: 1px solid var(--docs-line);
  border-radius: 12px;
}

.docs-api__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.docs-api__table th,
.docs-api__table td {
  padding: 0.65rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--docs-line);
  vertical-align: top;
}

.docs-api__table th {
  background: #f8fafc;
  color: var(--docs-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.docs-api__table tr:last-child td { border-bottom: 0; }

.docs-api__table td:nth-child(2) {
  white-space: nowrap;
  color: var(--docs-muted);
  width: 4.5rem;
}

.docs-api__status {
  margin-bottom: 0 !important;
}

.docs-mobile-bar {
  display: none;
}

.docs-scrim { display: none; }

@media (max-width: 960px) {
  .docs-shell {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(88vw, 310px);
    z-index: 40;
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 16px 0 40px rgba(15, 23, 42, 0.28);
  }

  .docs-shell.is-nav-open .docs-sidebar {
    transform: none;
  }

  .docs-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .docs-mobile-bar button {
    border: 1px solid var(--docs-line-strong);
    background: #fff;
    border-radius: 11px;
    padding: 0.5rem 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font: inherit;
    color: var(--docs-ink);
    box-shadow: var(--docs-shadow);
  }

  .docs-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 30;
  }

  .docs-shell.is-nav-open .docs-scrim {
    display: block;
  }

  .docs-main { padding: 1rem 1rem 2.5rem; }

  .docs-welcome { padding: 1.35rem 1.25rem 1.25rem; }

  .docs-block {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
}

@media (min-width: 1100px) {
  .docs-blocks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* —— AI consultant —— */
.docs-ai-dock {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  pointer-events: none;
}

.docs-ai-dock > * {
  pointer-events: auto;
}

.docs-ai-badge {
  max-width: min(240px, calc(100vw - 6.5rem));
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 14px;
  padding: 0.65rem 0.85rem;
  text-align: left;
  cursor: pointer;
  color: #0f172a;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  position: relative;
  animation: docs-ai-badge-in .45s ease both;
  transition: opacity .18s ease, transform .18s ease;
}

.docs-ai-badge::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  width: 12px;
  height: 12px;
  background: #fff;
  border-right: 1px solid rgba(37, 99, 235, 0.18);
  border-bottom: 1px solid rgba(37, 99, 235, 0.18);
  transform: translateY(-50%) rotate(-45deg);
}

.docs-ai-badge strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  color: #1d4ed8;
}

.docs-ai-badge span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  line-height: 1.3;
  color: #64748b;
}

.docs-ai-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
}

.docs-ai-badge.is-hidden,
.docs-ai-dock.is-open .docs-ai-badge {
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  visibility: hidden;
}

@keyframes docs-ai-badge-in {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.docs-ai-fab {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 16px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 55%, #1d4ed8 100%);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.35);
  transition: transform .15s ease, box-shadow .15s ease;
  flex-shrink: 0;
}

.docs-ai-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.42);
}

.docs-ai-fab .material-symbols-rounded { font-size: 1.55rem; color: #fff; }

.docs-ai-fab.is-open {
  background: #0f172a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
}

.docs-ai-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.5rem;
  z-index: 61;
  width: min(400px, calc(100vw - 1.5rem));
  height: min(560px, calc(100vh - 7rem));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--docs-line);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.docs-ai-panel[hidden] { display: none !important; }

.docs-ai-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: #0b1220;
  color: #fff;
}

.docs-ai-panel__title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.docs-ai-panel__avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  overflow: hidden;
  flex-shrink: 0;
}

.docs-ai-panel__avatar img {
  width: 58%;
  height: 70%;
  object-fit: contain;
}

.docs-ai-panel__title strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.2;
}

.docs-ai-panel__title small {
  display: block;
  color: #94a3b8;
  font-size: 0.75rem;
  margin-top: 0.1rem;
}

.docs-ai-panel__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.docs-ai-panel__close,
.docs-ai-panel__new {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.docs-ai-panel__new:hover,
.docs-ai-panel__close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.docs-ai-panel__new .material-symbols-rounded,
.docs-ai-panel__close .material-symbols-rounded {
  font-size: 1.15rem;
  color: #fff;
}

.docs-ai-panel__messages {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #f8fafc;
}

.docs-ai-msg {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 92%;
}

.docs-ai-msg--user { align-self: flex-end; }
.docs-ai-msg--assistant { align-self: flex-start; }

.docs-ai-msg__bubble {
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
}

.docs-ai-msg--user .docs-ai-msg__bubble {
  background: var(--docs-accent);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.docs-ai-msg--assistant .docs-ai-msg__bubble {
  background: #fff;
  border: 1px solid var(--docs-line);
  color: var(--docs-ink);
  border-bottom-left-radius: 6px;
}

.docs-ai-msg--pending .docs-ai-msg__bubble {
  color: var(--docs-muted);
  font-style: italic;
}

.docs-ai-msg__bubble a {
  color: inherit;
  text-decoration: underline;
  word-break: break-all;
}

.docs-ai-msg--assistant .docs-ai-msg__bubble a {
  color: var(--docs-accent);
}

.docs-ai-msg__sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.docs-ai-msg__sources a {
  display: inline-flex;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--docs-accent-soft);
  border: 1px solid var(--docs-accent-mid);
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-ai-panel__footer {
  border-top: 1px solid var(--docs-line);
  background: #fff;
}

.docs-ai-contact-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--docs-line);
  background: #f8fafc;
  color: #1d4ed8;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  text-align: center;
}

.docs-ai-contact-toggle .material-symbols-rounded {
  font-size: 1.05rem;
  color: inherit;
}

.docs-ai-contact-toggle:hover,
.docs-ai-contact-toggle.is-open {
  background: var(--docs-accent-soft);
}

.docs-ai-contact-toggle[hidden] { display: none !important; }

.docs-ai-contact {
  border-top: 1px solid var(--docs-line);
  background: #fff;
  padding: 0.85rem 0.85rem 0.65rem;
}

.docs-ai-contact[hidden] { display: none !important; }

.docs-ai-contact__hint {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: var(--docs-muted);
  line-height: 1.35;
}

.docs-ai-contact__field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--docs-muted);
}

.docs-ai-contact__field input {
  border: 1px solid var(--docs-line);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--docs-ink);
  background: #f8fafc;
}

.docs-ai-contact__field input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.docs-ai-contact__actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.docs-ai-contact__cancel,
.docs-ai-contact__submit {
  flex: 1;
  border: 0;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.docs-ai-contact__cancel {
  background: #f1f5f9;
  color: var(--docs-ink);
}

.docs-ai-contact__submit {
  background: var(--docs-accent);
  color: #fff;
}

.docs-ai-contact__submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

.docs-ai-panel__form {
  display: flex;
  gap: 0.45rem;
  padding: 0.75rem;
  background: #fff;
}

.docs-ai-panel__form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--docs-line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  background: #f8fafc;
  color: inherit;
}

.docs-ai-panel__form input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.docs-ai-panel__form button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--docs-accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.docs-ai-panel__form button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.docs-ai-panel__form button .material-symbols-rounded {
  color: #fff;
  font-size: 1.2rem;
}

@media (max-width: 600px) {
  .docs-ai-dock {
    right: 1rem;
    bottom: 1rem;
  }

  .docs-ai-badge {
    max-width: min(190px, calc(100vw - 5.75rem));
    padding: 0.55rem 0.7rem;
  }

  .docs-ai-badge strong { font-size: 0.76rem; }
  .docs-ai-badge span { font-size: 0.7rem; }

  .docs-ai-panel {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    bottom: 5rem;
    height: min(70vh, 520px);
  }
}
