/* ==========================================================================
   ScanSuite documentation
   --------------------------------------------------------------------------
   Loaded after scansuite-redesign.css, whose :root tokens it reuses.

   Two rules from the design system govern this file:
     - separation is tonal, not a drawn line (sidebar and rail sit on
       --surface-container against the --surface page);
     - where an edge is genuinely needed, it is a ghost border at low opacity.
   ========================================================================== */

.docs-body {
  --docs-sidebar-width: 288px;
  --docs-rail-width: 232px;
  --docs-nav-height: 64px;
}

/* --------------------------------------------------------------- shell --- */

.docs-shell {
  display: grid;
  grid-template-columns: var(--docs-sidebar-width) minmax(0, 1fr) var(--docs-rail-width);
  align-items: start;
  width: min(100%, 1440px);
  margin: 0 auto;
  padding-top: var(--docs-nav-height);
}

/* ------------------------------------------------------------- sidebar --- */

.docs-drawer-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  border: 0;
  background: var(--surface-container);
  color: var(--on-surface);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.docs-sidebar {
  position: sticky;
  top: var(--docs-nav-height);
  height: calc(100vh - var(--docs-nav-height));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface-container);
}

.docs-sidebar-inner {
  padding: 32px 20px 48px;
}

.docs-sidebar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.docs-sidebar-title {
  color: var(--on-surface);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.docs-sidebar-title:hover {
  color: var(--primary);
}

.docs-version {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.12);
  color: var(--primary);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* -------------------------------------------------------------- search --- */

.docs-search {
  position: relative;
  margin-bottom: 28px;
}

.docs-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 4px;
  background: var(--surface-low);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
  transition: box-shadow 160ms ease;
}

.docs-search-field:focus-within {
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.4), 0 0 0 4px rgba(249, 115, 22, 0.08);
}

.docs-search-field .material-symbols-outlined {
  color: var(--on-surface-muted);
  font-size: 18px;
}

.docs-search-field input {
  width: 100%;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--on-surface);
  font-family: "Inter", Arial, sans-serif;
  font-size: 13px;
  outline: none;
}

.docs-search-field input::placeholder {
  color: var(--on-surface-muted);
}

.docs-search-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 6px;
  background: var(--surface-high);
  box-shadow: 0 24px 60px rgba(6, 14, 32, 0.55);
}

.docs-search-hit {
  display: block;
  padding: 9px 10px;
  border-radius: 4px;
  color: var(--on-surface);
  text-decoration: none;
}

.docs-search-hit:hover,
.docs-search-hit:focus-visible,
.docs-search-hit.is-active {
  background: var(--surface-bright);
  outline: none;
}

.docs-search-hit-title {
  font-family: "Manrope", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.docs-search-hit-trail {
  margin-top: 2px;
  color: var(--on-surface-muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.docs-search-empty {
  padding: 12px 10px;
  color: var(--on-surface-muted);
  font-size: 12px;
}

/* ----------------------------------------------------------------- nav --- */

.docs-nav-section + .docs-nav-section {
  margin-top: 26px;
}

.docs-nav-heading {
  margin-bottom: 10px;
  color: var(--on-surface-muted);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.docs-nav-list,
.docs-nav-children {
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-nav-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.docs-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border-radius: 4px;
  color: var(--on-surface-muted);
  font-size: 13.5px;
  line-height: 1.4;
  text-decoration: none;
  transition: color 140ms ease, background 140ms ease;
}

.docs-nav-link:hover {
  background: rgba(148, 163, 184, 0.08);
  color: var(--on-surface);
}

.docs-nav-link.is-active {
  background: rgba(249, 115, 22, 0.12);
  color: var(--primary);
  font-weight: 600;
}

.docs-nav-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.docs-badge {
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 999px;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.docs-badge-new {
  background: rgba(147, 204, 255, 0.16);
  color: var(--intelligence);
}

.docs-badge-updated {
  background: rgba(249, 115, 22, 0.16);
  color: var(--primary);
}

.docs-nav-toggle {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--on-surface-muted);
  cursor: pointer;
}

.docs-nav-toggle:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--on-surface);
}

.docs-nav-toggle .material-symbols-outlined {
  font-size: 18px;
  transition: transform 160ms ease;
}

.docs-nav-item.is-open > .docs-nav-row .docs-nav-toggle .material-symbols-outlined {
  transform: rotate(180deg);
}

.docs-nav-children {
  display: none;
  margin: 2px 0 6px 12px;
  padding-left: 10px;
  box-shadow: inset 1px 0 0 rgba(148, 163, 184, 0.14);
}

.docs-nav-item.is-open > .docs-nav-children {
  display: block;
}

.docs-nav-children .docs-nav-link {
  font-size: 13px;
}

/* ------------------------------------------------------------- content --- */

.docs-main {
  min-width: 0;
  padding: 30px 48px 80px;
}

.docs-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  color: var(--on-surface-muted);
  font-size: 12px;
}

.docs-breadcrumbs li + li::before {
  content: "/";
  margin-right: 6px;
  color: #475569;
}

.docs-breadcrumbs a {
  color: var(--on-surface-muted);
  text-decoration: none;
}

.docs-breadcrumbs a:hover {
  color: var(--primary);
}

.docs-eyebrow {
  margin-bottom: 10px;
  color: var(--primary);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.docs-header h1 {
  margin: 0 0 14px;
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.docs-lede {
  margin: 0 0 40px;
  max-width: 68ch;
  color: var(--on-surface-muted);
  font-size: 17px;
  line-height: 1.65;
}

.docs-reviewed {
  margin-top: 56px;
  color: #64748b;
  font-size: 12px;
}

/* --------------------------------------------------------------- prose --- */

.docs-prose {
  max-width: 76ch;
  color: var(--on-surface);
  font-size: 16px;
  line-height: 1.75;
}

.docs-prose > *:first-child {
  margin-top: 0;
}

.docs-prose h2,
.docs-prose h3,
.docs-prose h4 {
  position: relative;
  margin: 48px 0 14px;
  font-family: "Manrope", Arial, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  scroll-margin-top: calc(var(--docs-nav-height) + 24px);
}

.docs-prose h2 {
  font-size: 27px;
}

.docs-prose h3 {
  margin-top: 36px;
  font-size: 20px;
}

.docs-prose h4 {
  margin-top: 28px;
  font-size: 16px;
}

.docs-heading-anchor {
  position: absolute;
  left: -22px;
  opacity: 0;
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
  transition: opacity 140ms ease;
}

.docs-prose h2:hover .docs-heading-anchor,
.docs-prose h3:hover .docs-heading-anchor,
.docs-heading-anchor:focus-visible {
  opacity: 1;
}

.docs-prose p {
  margin: 0 0 18px;
}

.docs-prose ul,
.docs-prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.docs-prose li {
  margin-bottom: 8px;
}

.docs-prose a {
  color: var(--primary);
  text-decoration: none;
  box-shadow: inset 0 -1px 0 rgba(249, 115, 22, 0.35);
}

.docs-prose a:hover {
  box-shadow: inset 0 -1px 0 var(--primary);
}

.docs-prose strong {
  color: #fff;
  font-weight: 600;
}

.docs-prose code {
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875em;
}

.docs-prose hr {
  height: 0;
  margin: 40px 0;
  border: 0;
  box-shadow: 0 1px 0 rgba(148, 163, 184, 0.14);
}

/* ---------------------------------------------------------- code blocks --- */

.docs-code {
  margin: 0 0 24px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-low);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
}

.docs-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: rgba(148, 163, 184, 0.06);
}

.docs-code-label {
  color: var(--on-surface-muted);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-copy {
  padding: 4px 10px;
  border: 0;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--on-surface-muted);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.docs-copy:hover {
  background: rgba(249, 115, 22, 0.18);
  color: var(--primary);
}

.docs-code pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
}

.docs-code code {
  padding: 0;
  background: none;
  color: #cbd5e1;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre;
}

/* ------------------------------------------------------------ callouts --- */

.docs-callout {
  display: flex;
  gap: 14px;
  margin: 0 0 24px;
  padding: 16px 18px;
  border-radius: 6px;
  background: var(--surface-container);
  box-shadow: inset 3px 0 0 var(--docs-callout-accent, var(--on-surface-muted));
}

.docs-callout-icon {
  flex-shrink: 0;
  color: var(--docs-callout-accent, var(--on-surface-muted));
  font-size: 20px;
}

.docs-callout-body p:last-child {
  margin-bottom: 0;
}

.docs-callout-title {
  margin-bottom: 4px;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.docs-callout-note {
  --docs-callout-accent: var(--intelligence);
}

.docs-callout-tip {
  --docs-callout-accent: #4ade80;
}

.docs-callout-warning {
  --docs-callout-accent: var(--primary);
}

.docs-callout-danger {
  --docs-callout-accent: #f87171;
}

/* --------------------------------------------------------------- steps --- */

.docs-steps {
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.docs-step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.docs-step-index {
  display: grid;
  place-items: center;
  width: 40px;
  height: 28px;
  border-radius: 4px;
  background: rgba(249, 115, 22, 0.12);
  color: var(--primary);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.docs-step-title {
  margin-bottom: 6px;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 15.5px;
  font-weight: 700;
}

.docs-step-detail {
  margin: 0 0 12px;
  color: var(--on-surface-muted);
}

.docs-step .docs-code {
  margin-bottom: 0;
}

/* -------------------------------------------------------------- tables --- */

.docs-table-wrap {
  margin: 0 0 26px;
  overflow-x: auto;
  border-radius: 6px;
  background: var(--surface-container);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.docs-table th {
  padding: 12px 16px;
  background: rgba(148, 163, 184, 0.07);
  color: var(--on-surface-muted);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.docs-table td {
  padding: 12px 16px;
  vertical-align: top;
  line-height: 1.6;
}

.docs-table tbody tr:nth-child(even) {
  background: rgba(148, 163, 184, 0.04);
}

/* ------------------------------------------------------------- figures --- */

.docs-figure {
  margin: 0 0 28px;
}

.docs-figure img {
  display: block;
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 22px 60px rgba(6, 14, 32, 0.5), inset 0 0 0 1px rgba(148, 163, 184, 0.12);
}

.docs-figure figcaption {
  margin-top: 10px;
  color: var(--on-surface-muted);
  font-size: 13px;
}

/* --------------------------------------------------------------- cards --- */

.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 0 0 28px;
}

.docs-card {
  position: relative;
  display: block;
  padding: 20px 22px;
  border-radius: 6px;
  background: var(--surface-container);
  box-shadow: none;
  color: var(--on-surface);
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease;
}

.docs-card:hover {
  background: var(--surface-high);
  transform: translateY(-2px);
}

.docs-card h3 {
  margin: 0 0 6px;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 15.5px;
  font-weight: 700;
}

.docs-card p {
  margin: 0;
  color: var(--on-surface-muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.docs-card-arrow {
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--on-surface-muted);
  font-size: 18px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.docs-card:hover .docs-card-arrow {
  color: var(--primary);
  opacity: 1;
}

/* --------------------------------------------------------------- pager --- */

.docs-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 56px;
}

.docs-pager-link {
  display: block;
  padding: 16px 20px;
  border-radius: 6px;
  background: var(--surface-container);
  color: var(--on-surface);
  text-decoration: none;
  transition: background 160ms ease;
}

.docs-pager-link:hover {
  background: var(--surface-high);
}

.docs-pager-link.is-next {
  text-align: right;
}

.docs-pager-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  color: var(--on-surface-muted);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-pager-link.is-next .docs-pager-label {
  justify-content: flex-end;
}

.docs-pager-label .material-symbols-outlined {
  font-size: 16px;
}

.docs-pager-title {
  font-family: "Manrope", Arial, sans-serif;
  font-size: 14.5px;
  font-weight: 700;
}

/* ---------------------------------------------------------------- rail --- */

.docs-rail {
  position: sticky;
  top: var(--docs-nav-height);
  max-height: calc(100vh - var(--docs-nav-height));
  overflow-y: auto;
}

.docs-rail-inner {
  padding: 34px 24px 48px 8px;
}

.docs-rail-title {
  margin-bottom: 12px;
  color: var(--on-surface-muted);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.docs-rail-nav a {
  display: block;
  padding: 5px 0 5px 12px;
  box-shadow: inset 1px 0 0 rgba(148, 163, 184, 0.16);
  color: var(--on-surface-muted);
  font-size: 12.5px;
  line-height: 1.5;
  text-decoration: none;
  transition: color 140ms ease, box-shadow 140ms ease;
}

.docs-rail-nav a.is-sub {
  padding-left: 24px;
}

.docs-rail-nav a:hover {
  color: var(--on-surface);
}

.docs-rail-nav a.is-active {
  box-shadow: inset 2px 0 0 var(--primary);
  color: var(--primary);
}

/* ---------------------------------------------------------- responsive --- */

@media (max-width: 1180px) {
  .docs-shell {
    grid-template-columns: var(--docs-sidebar-width) minmax(0, 1fr);
  }

  .docs-rail {
    display: none;
  }

  .docs-main {
    padding-inline: 36px;
  }
}

@media (max-width: 980px) {
  .docs-shell {
    display: block;
  }

  .docs-drawer-toggle {
    display: flex;
  }

  .docs-sidebar {
    display: none;
    position: static;
    height: auto;
    max-height: 70vh;
  }

  .docs-sidebar.is-open {
    display: block;
  }

  .docs-main {
    padding: 28px 28px 72px;
  }
}

@media (max-width: 640px) {
  .docs-body {
    --docs-nav-height: 58px;
  }

  .docs-main {
    padding: 24px 20px 64px;
  }

  .docs-prose {
    font-size: 15.5px;
  }

  .docs-pager {
    grid-template-columns: 1fr;
  }

  .docs-pager-link.is-next {
    text-align: left;
  }

  .docs-pager-link.is-next .docs-pager-label {
    justify-content: flex-start;
  }

  .docs-heading-anchor {
    display: none;
  }
}

/* --------------------------------------------------------------- print --- */

@media print {
  .site-nav,
  .site-footer,
  .docs-sidebar,
  .docs-rail,
  .docs-drawer-toggle,
  .docs-pager,
  .docs-copy,
  .skip-link {
    display: none !important;
  }

  .docs-shell {
    display: block;
    width: auto;
    padding-top: 0;
  }

  .docs-main {
    padding: 0;
  }

  body.docs-body {
    background: #fff;
    color: #000;
  }

  .docs-prose,
  .docs-header h1,
  .docs-lede {
    max-width: none;
    color: #000;
  }

  .docs-prose a {
    box-shadow: none;
    color: #000;
    text-decoration: underline;
  }

  .docs-prose a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 11px;
  }

  .docs-code,
  .docs-callout,
  .docs-table-wrap {
    background: #f5f5f5;
    box-shadow: none;
  }

  .docs-code code,
  .docs-callout,
  .docs-table {
    color: #000;
  }
}
