/* =====================================================
   COGNIFY DOCUMENTATION
   =====================================================
   Layered on premium.css and built only from its tokens, so the docs follow
   the same light / dark theming as the rest of the site with nothing to
   redefine per theme here.
   ===================================================== */

:root {
  --docs-nav-offset: 84px;      /* clears the fixed navbar */
  --docs-sidebar-w: 274px;
  --docs-toc-w: 232px;
  --docs-measure: 760px;        /* comfortable reading width */
}

/* =====================================================
   SHELL
   ===================================================== */

.docs-shell {
  display: grid;
  grid-template-columns: var(--docs-sidebar-w) minmax(0, 1fr);
  gap: 3rem;
  max-width: 1440px;
  margin: 0 auto;
  padding: calc(var(--docs-nav-offset) + 1.5rem) 2rem 6rem;
}

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

/* =====================================================
   SIDEBAR
   ===================================================== */

.docs-sidebar-inner {
  position: sticky;
  top: calc(var(--docs-nav-offset) + 1.5rem);
  max-height: calc(100vh - var(--docs-nav-offset) - 3rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.5rem;
}

/* Slim scrollbar so the rail does not shout */
.docs-sidebar-inner::-webkit-scrollbar { width: 6px; }
.docs-sidebar-inner::-webkit-scrollbar-thumb {
  background: var(--glass-border-hover);
  border-radius: var(--radius-full);
}

.docs-product {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  text-decoration: none;
  transition: var(--transition-fast);
}

.docs-product:hover {
  border-color: var(--glass-border-hover);
  background: var(--glass-bg-hover);
}

.docs-product span {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.docs-product strong {
  color: var(--ct-white);
  font-size: 0.95rem;
  font-weight: 700;
}

.docs-product small {
  color: var(--ct-gray-500);
  font-size: 0.75rem;
}

/* ---------- Search ---------- */

.docs-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.75rem;
  height: 42px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  transition: var(--transition-fast);
}

.docs-search:focus-within {
  border-color: var(--ct-primary);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.docs-search > .bi {
  color: var(--ct-gray-500);
  font-size: 0.9rem;
  flex: 0 0 auto;
}

.docs-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--ct-white);
  font-size: 0.9rem;
  font-family: inherit;
}

.docs-search-input:focus { outline: none; }
.docs-search-input::placeholder { color: var(--ct-gray-500); }
.docs-search-input::-webkit-search-cancel-button { display: none; }

.docs-search-hint {
  flex: 0 0 auto;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--ct-gray-500);
  font-size: 0.7rem;
  font-family: var(--font-mono);
}

.docs-search-results {
  margin-top: 0.5rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--ct-bg-elevated);
  box-shadow: var(--shadow-lg);
  max-height: 340px;
  overflow-y: auto;
  padding: 0.375rem;
}

.docs-result {
  display: block;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition-fast);
}

.docs-result:hover,
.docs-result.active {
  background: var(--accent-tint);
}

.docs-result-title {
  display: block;
  color: var(--ct-white);
  font-size: 0.875rem;
  font-weight: 600;
}

.docs-result-meta {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--ct-gray-500);
  font-size: 0.75rem;
  margin-top: 0.125rem;
}

.docs-result mark {
  background: var(--accent-tint-strong);
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}

.docs-search-empty {
  padding: 0.875rem 0.625rem;
  color: var(--ct-gray-500);
  font-size: 0.85rem;
}

/* ---------- Nav ---------- */

/* Only used below lg, where the rail sits above the article */
.docs-nav-toggle {
  display: none;
  width: 100%;
  align-items: center;
  gap: 0.625rem;
  margin-top: 1rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--ct-white);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
}

.docs-nav-toggle:hover { border-color: var(--glass-border-hover); }

.docs-nav-toggle > span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-nav-toggle .bi { color: var(--ct-primary); flex: 0 0 auto; }

.docs-nav-toggle-caret {
  font-size: 0.75rem;
  transition: transform var(--transition-fast);
}

.docs-nav-toggle[aria-expanded="true"] .docs-nav-toggle-caret {
  transform: rotate(180deg);
}

.docs-nav {
  margin-top: 1.5rem;
}

.docs-nav-group + .docs-nav-group {
  margin-top: 1.5rem;
}

.docs-nav-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  padding-left: 0.25rem;
  color: var(--ct-gray-500);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.docs-nav-title .bi {
  color: var(--ct-primary);
  font-size: 0.8rem;
}

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

.docs-nav-link {
  display: block;
  padding: 0.4rem 0.625rem;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  color: var(--ct-gray-400);
  font-size: 0.875rem;
  line-height: 1.45;
  text-decoration: none;
  transition: var(--transition-fast);
}

.docs-nav-link:hover {
  background: var(--surface-2);
  color: var(--ct-white);
}

.docs-nav-link.active {
  background: var(--accent-tint);
  border-left-color: var(--ct-primary);
  color: var(--ct-primary);
  font-weight: 600;
}

/* =====================================================
   LANDING PAGE
   ===================================================== */

.docs-hero {
  max-width: var(--docs-measure);
  margin-bottom: 3.5rem;
}

.docs-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  color: var(--ct-primary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.docs-hero-title {
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.docs-hero-lead {
  color: var(--ct-gray-400);
  font-size: 1.075rem;
  line-height: 1.75;
}

.docs-hero-lead strong { color: var(--ct-gray-300); }

.docs-chain {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.docs-chain .bi {
  color: var(--ct-gray-600);
  font-size: 0.7rem;
}

.docs-chain-item {
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  color: var(--ct-gray-300);
  font-size: 0.85rem;
  font-weight: 600;
}

.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;   /* let each card size to its own list */
  gap: 1.5rem;
}

.docs-card {
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  background: var(--glass-bg);
  transition: var(--transition-base);
}

.docs-card:hover {
  border-color: var(--glass-border-soft);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.docs-card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.docs-card-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--accent-tint);
  color: var(--ct-primary);
  font-size: 1.05rem;
}

.docs-card-head h2 {
  font-size: 1.075rem;
  font-weight: 700;
  margin: 0;
}

.docs-card-blurb {
  color: var(--ct-gray-400);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.docs-card-links {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--glass-border);
}

.docs-card-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--glass-border);
  color: var(--ct-gray-300);
  font-size: 0.9rem;
  text-decoration: none;
  transition: var(--transition-fast);
}

.docs-card-links li:last-child a { border-bottom: 0; }

.docs-card-links a .bi {
  color: var(--ct-gray-600);
  font-size: 0.8rem;
  transition: var(--transition-fast);
}

.docs-card-links a:hover { color: var(--ct-primary); }
.docs-card-links a:hover .bi { color: var(--ct-primary); transform: translateX(3px); }

.docs-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 3rem;
  padding: 2rem 2.25rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  background: var(--glass-bg);
}

.docs-help h2 {
  font-size: 1.2rem;
  margin-bottom: 0.375rem;
}

.docs-help p {
  color: var(--ct-gray-400);
  font-size: 0.9rem;
  margin: 0;
  max-width: 46ch;
}

/* =====================================================
   ARTICLE
   ===================================================== */

.docs-article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--docs-toc-w);
  gap: 3rem;
  align-items: start;
}

.docs-article {
  min-width: 0;
  max-width: var(--docs-measure);
}

.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  color: var(--ct-gray-500);
  font-size: 0.8rem;
}

.docs-breadcrumb a {
  color: var(--ct-gray-400);
  text-decoration: none;
}

.docs-breadcrumb a:hover { color: var(--ct-primary); }
.docs-breadcrumb .bi { font-size: 0.6rem; color: var(--ct-gray-600); }
.docs-breadcrumb .current { color: var(--ct-gray-300); }

.docs-article-head {
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--glass-border);
}

.docs-step {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.625rem;
  color: var(--ct-primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.docs-title {
  font-size: clamp(1.85rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

/* ---------- Article body ---------- */

.docs-lead {
  margin-top: 0.875rem;
  color: var(--ct-gray-400);
  font-size: 1.075rem;
  line-height: 1.7;
}

.docs-body {
  color: var(--ct-gray-300);
  font-size: 1rem;
  line-height: 1.75;
}

.docs-body > p { margin-bottom: 1.25rem; }

.docs-body a {
  color: var(--ct-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: var(--transition-fast);
}

.docs-body a:hover { border-bottom-color: var(--ct-primary); }
.docs-body strong { color: var(--ct-white); font-weight: 650; }
.docs-body em { color: var(--ct-gray-400); }

.docs-body h2 {
  scroll-margin-top: calc(var(--docs-nav-offset) + 1rem);
  margin: 3rem 0 1.25rem;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
  font-size: 1.5rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.docs-body h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.docs-body h3 {
  scroll-margin-top: calc(var(--docs-nav-offset) + 1rem);
  margin: 2.25rem 0 0.875rem;
  font-size: 1.175rem;
  font-weight: 700;
}

.docs-body h4 {
  scroll-margin-top: calc(var(--docs-nav-offset) + 1rem);
  margin: 1.75rem 0 0.625rem;
  font-size: 1rem;
  font-weight: 650;
}

.docs-body ul,
.docs-body ol {
  margin: 0 0 1.25rem;
  padding-left: 1.35rem;
}

.docs-body li { margin-bottom: 0.5rem; padding-left: 0.2rem; }
.docs-body li::marker { color: var(--ct-primary); }
.docs-body li > ul, .docs-body li > ol { margin: 0.5rem 0 0; }

/* Numbered walkthrough */
.doc-steps {
  counter-reset: doc-step;
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
}

.doc-steps > li {
  counter-increment: doc-step;
  position: relative;
  margin-bottom: 1rem;
  padding: 0 0 0 3rem;
  min-height: 2rem;
}

.doc-steps > li::before {
  content: counter(doc-step);
  position: absolute;
  left: 0;
  top: -0.1rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--accent-tint);
  border: 1px solid var(--accent-tint-strong);
  color: var(--ct-primary);
  font-size: 0.85rem;
  font-weight: 700;
}

/* "How do I…" answer card */
.doc-task {
  scroll-margin-top: calc(var(--docs-nav-offset) + 1rem);
  margin-bottom: 0.875rem;
  padding: 0.875rem 1.125rem;
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--ct-primary);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  font-size: 0.95rem;
  line-height: 1.7;
}

.doc-task strong { color: var(--ct-white); }

/* Callouts */
.doc-callout {
  display: flex;
  gap: 0.875rem;
  margin: 1.75rem 0;
  padding: 1.125rem 1.25rem;
  border: 1px solid var(--accent-tint-strong);
  border-radius: var(--radius-md);
  background: var(--accent-tint);
  font-size: 0.925rem;
  line-height: 1.65;
}

.doc-callout > .bi { flex: 0 0 auto; margin-top: 0.15rem; color: var(--ct-primary); }
.doc-callout p:last-child { margin-bottom: 0; }

.doc-callout.warn {
  border-color: var(--flux-tint-border);
  background: var(--flux-tint);
}

.doc-callout.warn > .bi { color: var(--flux-primary); }

.doc-callout.tip {
  border-color: var(--cognify-tint-border);
  background: var(--cognify-tint);
}

.doc-callout.tip > .bi { color: var(--cognify-primary); }

/* Tables */
.doc-table-wrap {
  margin: 1.75rem 0;
  overflow-x: auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.doc-table th {
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--glass-border);
  color: var(--ct-white);
  font-weight: 650;
  text-align: left;
  white-space: nowrap;
}

.doc-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--glass-border);
  vertical-align: top;
  line-height: 1.6;
}

.doc-table tbody tr:last-child td { border-bottom: 0; }
.doc-table tbody tr:hover { background: var(--surface-1); }
.doc-table td:first-child { color: var(--ct-gray-300); }
.doc-table code { white-space: nowrap; }

/* Inline code and keys */
.docs-body code {
  padding: 0.15em 0.4em;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--ct-primary);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.docs-body pre {
  margin: 1.5rem 0;
  padding: 1.125rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  font-size: 0.85rem;
  line-height: 1.6;
}

.docs-body pre code {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ct-gray-300);
}

.docs-body kbd {
  display: inline-block;
  padding: 0.1em 0.45em;
  border: 1px solid var(--glass-border-hover);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--ct-white);
  font-family: var(--font-mono);
  font-size: 0.8em;
  line-height: 1.5;
  white-space: nowrap;
}

/* ---------- Figures / screenshot slots ---------- */

.doc-figure {
  margin: 1.75rem 0;
}

.doc-figure-img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.doc-figure-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 210px;
  padding: 2rem 1.5rem;
  text-align: center;
  border: 1px dashed var(--glass-border-hover);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
}

.doc-figure-slot > .bi {
  font-size: 1.5rem;
  color: var(--ct-gray-600);
}

.doc-figure-hint {
  margin: 0;
  max-width: 46ch;
  color: var(--ct-gray-400);
  font-size: 0.875rem;
  line-height: 1.55;
}

.doc-figure-tag {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--surface-3);
  color: var(--ct-gray-500);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.doc-figure-caption {
  margin-top: 0.625rem;
  color: var(--ct-gray-500);
  font-size: 0.825rem;
  line-height: 1.5;
  text-align: center;
}

/* Let a figure breathe past the reading column on wide screens */
@media (min-width: 1201px) {
  .doc-figure-wide {
    width: calc(100% + 6rem);
    margin-left: -3rem;
    margin-right: -3rem;
  }
}

/* ---------- Small building blocks ---------- */

/* Two-up feature grid */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.doc-grid-item {
  padding: 1.125rem 1.25rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
}

.doc-grid-item h4 {
  margin: 0 0 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.doc-grid-item h4 .bi { color: var(--ct-primary); }

.doc-grid-item p {
  margin: 0;
  color: var(--ct-gray-400);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Inline chips, e.g. a list of statuses */
.doc-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0;
  padding: 0;
  list-style: none;
}

.doc-pills li {
  margin: 0;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  color: var(--ct-gray-300);
  font-size: 0.825rem;
  font-weight: 600;
}

/* Where a feature lives in the UI */
.doc-path {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--ct-gray-300);
  font-size: 0.85em;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Pager ---------- */

.docs-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
}

.docs-pager-link {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  text-decoration: none;
  transition: var(--transition-base);
}

.docs-pager-link.next {
  justify-content: flex-end;
  text-align: right;
}

.docs-pager-link:hover {
  border-color: var(--ct-primary);
  transform: translateY(-2px);
}

.docs-pager-link span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.docs-pager-link small {
  color: var(--ct-gray-500);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.docs-pager-link strong {
  color: var(--ct-white);
  font-size: 0.925rem;
  font-weight: 600;
}

.docs-pager-link .bi {
  flex: 0 0 auto;
  color: var(--ct-primary);
}

/* =====================================================
   ON THIS PAGE
   ===================================================== */

.docs-toc-inner {
  position: sticky;
  top: calc(var(--docs-nav-offset) + 1.5rem);
  max-height: calc(100vh - var(--docs-nav-offset) - 3rem);
  overflow-y: auto;
  padding-left: 1.125rem;
  border-left: 1px solid var(--glass-border);
}

.docs-toc-title {
  margin-bottom: 0.75rem;
  color: var(--ct-gray-500);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.docs-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-toc ul ul {
  margin: 0.25rem 0 0.5rem 0.625rem;
  padding-left: 0.625rem;
  border-left: 1px solid var(--glass-border);
}

.docs-toc-link {
  display: block;
  padding: 0.25rem 0;
  color: var(--ct-gray-400);
  font-size: 0.85rem;
  line-height: 1.45;
  text-decoration: none;
  transition: var(--transition-fast);
}

.docs-toc-link.sub {
  font-size: 0.8rem;
  color: var(--ct-gray-500);
}

.docs-toc-link:hover { color: var(--ct-primary); }

.docs-toc-link.active {
  color: var(--ct-primary);
  font-weight: 600;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

/* Drop the contents rail before the sidebar — it is the least essential */
@media (max-width: 1200px) {
  .docs-article-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .docs-toc { display: none; }
  .docs-article { max-width: none; }
}

@media (max-width: 991.98px) {
  .docs-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    padding: calc(var(--docs-nav-offset) + 1rem) 1.25rem 4rem;
  }

  /* The nav becomes a collapsible block above the article */
  .docs-sidebar-inner {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 1.25rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    background: var(--glass-bg);
  }

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

  /* Collapsed by default so the article is not pushed off the screen */
  .docs-nav {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
  }

  .docs-sidebar-inner.is-open .docs-nav { display: grid; }

  .docs-nav-group + .docs-nav-group { margin-top: 0; }

  .docs-pager { grid-template-columns: 1fr; }
  .docs-pager-link.next { justify-content: flex-start; text-align: left; }
}

@media (max-width: 576px) {
  .docs-shell { padding-left: 1rem; padding-right: 1rem; }
  .docs-help { padding: 1.5rem; }
  .doc-task { padding: 0.75rem 0.875rem; }
}

/* =====================================================
   PRODUCT SWITCHER
   ===================================================== */

.docs-switcher {
  margin-bottom: 1.25rem;
}

.docs-switcher .docs-product {
  margin-bottom: 0.5rem;
}

.docs-switcher-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}

.docs-switcher-tab {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--ct-gray-500);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-fast);
}

.docs-switcher-tab img {
  opacity: 0.55;
  transition: var(--transition-fast);
}

.docs-switcher-tab:hover {
  color: var(--ct-white);
}

.docs-switcher-tab:hover img { opacity: 0.85; }

.docs-switcher-tab.active {
  background: var(--glass-bg-hover);
  border: 1px solid var(--glass-border);
  color: var(--ct-white);
}

.docs-switcher-tab.active img { opacity: 1; }

/* =====================================================
   DOCS HOME (product picker)
   ===================================================== */

.docs-home {
  max-width: 1000px;
  margin: 0 auto;
  padding: calc(var(--docs-nav-offset) + 3rem) 2rem 6rem;
}

.docs-home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.docs-home-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 2rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  background: var(--glass-bg);
  text-decoration: none;
  transition: var(--transition-base);
}

.docs-home-card:hover {
  border-color: var(--ct-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.docs-home-card h2 {
  margin: 1rem 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 750;
}

.docs-home-card p {
  flex: 1 1 auto;
  margin-bottom: 1.25rem;
  color: var(--ct-gray-400);
  font-size: 0.925rem;
  line-height: 1.6;
}

.docs-home-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ct-primary);
  font-size: 0.9rem;
  font-weight: 600;
}

@media (max-width: 576px) {
  .docs-home { padding-left: 1rem; padding-right: 1rem; }
}
