/* =====================================================================
   CloudSource CMS — shared site styles

   Loaded by the marketing homepage, the success page and every /docs/
   page, after the compiled Tailwind utilities. Everything that appears on
   more than one page lives here as a component class, so pages stay
   visually identical without each one re-inventing the same markup.

   Contents
     1. Design tokens
     2. Base + accessibility
     3. Top navigation
     4. Docs shell (sidebar, drawer, mobile bar, content column, TOC)
     5. Docs content components
     6. Footer
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Design tokens
   --------------------------------------------------------------------- */
:root {
    --primary-50:  #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;
    --primary-950: #1e1b4b;

    --accent-400: #22d3ee;
    --accent-500: #06b6d4;
    --accent-600: #0891b2;

    --gray-50:  #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --gray-950: #030712;

    --ink:        #111827;
    --ink-muted:  #4b5563;
    --ink-subtle: #6b7280;

    --nav-height: 4rem;
    --bar-height: 3.25rem;
    --sidebar-width: 17rem;
    --toc-width: 13rem;

    --radius-sm: 0.5rem;
    --radius:    0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow:    0 4px 12px -2px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 18px 40px -12px rgba(30, 27, 75, 0.18);

    --focus: 0 0 0 3px rgba(99, 102, 241, 0.45);
}

/* ---------------------------------------------------------------------
   2. Base + accessibility
   --------------------------------------------------------------------- */
[x-cloak] { display: none !important; }

html {
    scroll-behavior: smooth;
    /* Stop the fixed header covering anchor targets. */
    scroll-padding-top: calc(var(--nav-height) + 1.5rem);
    -webkit-text-size-adjust: 100%;
}

body { overflow-x: hidden; }
body.has-drawer-open { overflow: hidden; }

/* Never let a stray wide element create a horizontal scrollbar. */
img, svg, video, canvas { max-width: 100%; }

:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 2px solid transparent;
    box-shadow: var(--focus);
    border-radius: 0.375rem;
}

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.skip-link {
    position: absolute;
    top: 0.5rem;
    left: 50%;
    transform: translate(-50%, -150%);
    z-index: 100;
    padding: 0.625rem 1.25rem;
    background: var(--primary-600);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: transform 0.15s ease;
}
.skip-link:focus { transform: translate(-50%, 0); }

.gradient-text {
    background: linear-gradient(135deg, var(--primary-400), var(--accent-400));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------------------------------------------------------------------
   3. Top navigation
   --------------------------------------------------------------------- */
.site-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid var(--gray-100);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.site-nav.is-scrolled {
    border-bottom-color: var(--gray-200);
    box-shadow: 0 1px 16px -6px rgba(16, 24, 40, 0.18);
}

.site-nav__inner {
    max-width: 90rem;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
@media (min-width: 640px)  { .site-nav__inner { padding: 0 2rem; } }
@media (min-width: 1024px) { .site-nav__inner { padding: 0 2.5rem; } }

.site-nav__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--primary-950);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.site-nav__brand-accent { color: var(--accent-500); }

.site-nav__links { display: none; }
@media (min-width: 768px) {
    .site-nav__links {
        display: inline-flex;
        align-items: center;
        gap: 1.75rem;
    }
}

.site-nav__link {
    position: relative;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-600);
    text-decoration: none;
    transition: color 0.15s ease;
}
.site-nav__link:hover { color: var(--primary-600); }
.site-nav__link--active { color: var(--primary-700); font-weight: 600; }

.site-nav__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.125rem;
    background: var(--primary-600);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.25);
    transition: background 0.15s ease, transform 0.15s ease;
}
.site-nav__cta:hover { background: var(--primary-700); transform: translateY(-1px); }
.site-nav__cta svg { width: 1rem; height: 1rem; }

.site-nav__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-right: -0.625rem;
    color: var(--gray-700);
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.site-nav__toggle:hover { background: var(--gray-100); }
.site-nav__toggle svg { width: 1.5rem; height: 1.5rem; }
@media (min-width: 768px) { .site-nav__toggle { display: none; } }

.site-nav__mobile {
    display: none;
    border-top: 1px solid var(--gray-100);
    background: #fff;
    padding: 0.75rem 1.25rem 1.25rem;
    flex-direction: column;
    gap: 0.25rem;
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
}
.site-nav__mobile.is-open { display: flex; }
@media (min-width: 768px) {
    .site-nav__mobile, .site-nav__mobile.is-open { display: none; }
}
.site-nav__mobile .site-nav__link {
    display: block;
    padding: 0.75rem 0.25rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--gray-100);
}
.site-nav__mobile .site-nav__cta {
    margin-top: 0.875rem;
    justify-content: center;
    padding: 0.875rem 1.25rem;
}

/* ---------------------------------------------------------------------
   4. Docs shell
   --------------------------------------------------------------------- */
.doc-shell {
    padding-top: var(--nav-height);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
@media (min-width: 1024px) {
    .doc-shell { flex-direction: row; align-items: flex-start; }
}

/* --- Sidebar: drawer on small screens, sticky rail on desktop --- */
.doc-sidebar {
    position: fixed;
    top: var(--nav-height);
    bottom: 0;
    left: 0;
    width: min(var(--sidebar-width), 85vw);
    background: #fff;
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 40;
}
.doc-sidebar.is-open { transform: translateX(0); }

@media (min-width: 1024px) {
    .doc-sidebar {
        position: sticky;
        top: var(--nav-height);
        bottom: auto;
        height: calc(100vh - var(--nav-height));
        width: var(--sidebar-width);
        flex-shrink: 0;
        transform: none;
        z-index: 10;
    }
}

.doc-sidebar::-webkit-scrollbar { width: 6px; }
.doc-sidebar::-webkit-scrollbar-track { background: transparent; }
.doc-sidebar::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 999px; }
.doc-sidebar::-webkit-scrollbar-thumb:hover { background: var(--gray-300); }

.doc-sidebar__inner {
    padding: 1.25rem 1rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-height: 100%;
}

/* Search */
.doc-sidebar__search { position: relative; }
.doc-sidebar__search input {
    width: 100%;
    padding: 0.5625rem 2.25rem 0.5625rem 2.25rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--ink);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    appearance: none;
}
.doc-sidebar__search input::placeholder { color: var(--gray-400); }
.doc-sidebar__search input:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary-300);
    box-shadow: var(--focus);
}
.doc-sidebar__search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.doc-sidebar__search-icon {
    position: absolute;
    left: 0.6875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--gray-400);
    pointer-events: none;
}
.doc-sidebar__kbd {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.0625rem 0.375rem;
    font-size: 0.6875rem;
    font-family: inherit;
    color: var(--gray-400);
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 0.25rem;
    pointer-events: none;
}
@media (max-width: 1023px) { .doc-sidebar__kbd { display: none; } }

.doc-sidebar__group + .doc-sidebar__group { margin-top: 1.25rem; }
.doc-sidebar__group[hidden] { display: none; }

.doc-sidebar__heading {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-400);
    font-weight: 700;
    padding: 0 0.625rem;
    margin: 0 0 0.375rem;
}

.doc-sidebar__list { list-style: none; margin: 0; padding: 0; }
.doc-sidebar__list li[hidden] { display: none; }

.doc-sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
    line-height: 1.35;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background-color 0.15s ease, color 0.15s ease;
}
.doc-sidebar__link svg { width: 1rem; height: 1rem; flex-shrink: 0; color: var(--gray-400); }
.doc-sidebar__link:hover { color: var(--primary-700); background: var(--gray-50); }
.doc-sidebar__link:hover svg { color: var(--primary-500); }
.doc-sidebar__link--active,
.doc-sidebar__link--active:hover {
    background: var(--primary-50);
    color: var(--primary-700);
    font-weight: 600;
}
.doc-sidebar__link--active svg { color: var(--primary-600); }

.doc-sidebar__empty {
    padding: 0.75rem 0.625rem;
    font-size: 0.8125rem;
    color: var(--gray-400);
    margin: 0;
}

.doc-sidebar__cta {
    margin-top: auto;
    display: block;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, var(--primary-50), rgba(34, 211, 238, 0.12));
    border: 1px solid var(--primary-100);
    border-radius: var(--radius);
    text-decoration: none;
}
.doc-sidebar__cta span {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 0.125rem;
}
.doc-sidebar__cta strong {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--primary-700);
}
.doc-sidebar__cta svg { width: 0.875rem; height: 0.875rem; transition: transform 0.15s ease; }
.doc-sidebar__cta:hover svg { transform: translateX(2px); }

/* Overlay behind the mobile drawer */
.doc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.5);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}
.doc-overlay.is-open { opacity: 1; pointer-events: auto; }
@media (min-width: 1024px) { .doc-overlay, .doc-overlay.is-open { display: none; } }

/* Mobile docs bar — replaces the old floating action button */
.doc-bar {
    position: sticky;
    top: var(--nav-height);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: var(--bar-height);
    padding: 0 1rem;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--gray-200);
}
@media (min-width: 1024px) { .doc-bar { display: none; } }

.doc-bar__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    padding: 0.4375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--primary-700);
    background: var(--primary-50);
    border: 1px solid var(--primary-100);
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
}
.doc-bar__toggle svg { width: 1rem; height: 1rem; }
.doc-bar__current {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Content column */
.doc-main { flex: 1 1 0%; min-width: 0; width: 100%; }

.doc-content {
    display: flex;
    align-items: flex-start;
    gap: 2.5rem;
    max-width: 88rem;
    margin: 0 auto;
    padding: 2rem 1.25rem 3.5rem;
}
@media (min-width: 640px)  { .doc-content { padding: 2.5rem 2rem 4rem; } }
@media (min-width: 1024px) { .doc-content { padding: 3.25rem 2.5rem 5rem; } }

.doc-article {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 48rem;
    /* Email addresses, endpoints and URLs must never widen the page. */
    overflow-wrap: break-word;
}

/* On-this-page rail */
.doc-toc { display: none; }
@media (min-width: 1280px) {
    .doc-toc {
        display: block;
        position: sticky;
        top: calc(var(--nav-height) + 3.25rem);
        width: var(--toc-width);
        flex-shrink: 0;
        max-height: calc(100vh - var(--nav-height) - 6rem);
        overflow-y: auto;
        border-left: 1px solid var(--gray-200);
        padding-left: 1.25rem;
    }
}
.doc-toc__heading {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--gray-400);
    margin: 0 0 0.625rem;
}
.doc-toc__list { list-style: none; margin: 0; padding: 0; }
.doc-toc__link {
    display: block;
    padding: 0.3125rem 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--gray-500);
    text-decoration: none;
    border-left: 2px solid transparent;
    margin-left: -1.3125rem;
    padding-left: 1.25rem;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.doc-toc__link:hover { color: var(--primary-600); }
.doc-toc__link.is-active {
    color: var(--primary-700);
    border-left-color: var(--primary-500);
    font-weight: 600;
}
.doc-toc__link--h3 { padding-left: 2rem; font-size: 0.78125rem; }

/* ---------------------------------------------------------------------
   5. Docs content components
   --------------------------------------------------------------------- */

/* Breadcrumb */
.doc-breadcrumb { margin-bottom: 1.5rem; }
.doc-breadcrumb__list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.8125rem;
}
.doc-breadcrumb__list a { color: var(--gray-500); text-decoration: none; }
.doc-breadcrumb__list a:hover { color: var(--primary-600); }
.doc-breadcrumb__list span { color: var(--gray-700); font-weight: 600; }
.doc-breadcrumb__list svg { width: 0.875rem; height: 0.875rem; color: var(--gray-300); display: block; }

/* Page header — identical on every docs page */
.doc-header { margin-bottom: 2.5rem; }
.doc-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.75rem;
    background: var(--primary-50);
    color: var(--primary-700);
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--primary-100);
    border-radius: 999px;
    margin-bottom: 1rem;
}
.doc-eyebrow svg { width: 0.875rem; height: 0.875rem; }

.doc-title {
    font-size: 2rem;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--primary-950);
    margin: 0;
}
@media (min-width: 640px) { .doc-title { font-size: 2.5rem; } }

.doc-lede {
    margin: 1rem 0 0;
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ink-subtle);
}
@media (min-width: 640px) { .doc-lede { font-size: 1.125rem; } }

/* Sections and typography inside an article */
.doc-section { margin-bottom: 3rem; }
.doc-section:last-of-type { margin-bottom: 2rem; }

.doc-h2 {
    font-size: 1.5rem;
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--primary-950);
    margin: 0 0 1rem;
    scroll-margin-top: calc(var(--nav-height) + 1.5rem);
}
.doc-h3 {
    font-size: 1.125rem;
    line-height: 1.4;
    font-weight: 700;
    color: var(--primary-950);
    margin: 2rem 0 0.75rem;
    scroll-margin-top: calc(var(--nav-height) + 1.5rem);
}
.doc-p {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--ink-muted);
    margin: 0 0 1rem;
}
.doc-p:last-child { margin-bottom: 0; }
.doc-p a, .doc-link {
    color: var(--primary-600);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    font-weight: 500;
}
.doc-p a:hover, .doc-link:hover { color: var(--primary-800); }

.doc-list {
    margin: 0 0 1rem;
    padding-left: 1.125rem;
    color: var(--ink-muted);
    font-size: 1rem;
    line-height: 1.75;
}
.doc-list li { margin-bottom: 0.375rem; }
.doc-list li::marker { color: var(--primary-400); }

/* Inline code — must be able to break, or long endpoints and keys
   push the whole page sideways on a 320px screen. */
.doc-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.875em;
    padding: 0.125rem 0.375rem;
    background: var(--primary-50);
    color: var(--primary-700);
    border-radius: 0.3125rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Callouts */
.callout {
    display: flex;
    gap: 0.875rem;
    padding: 1rem 1.125rem;
    border-radius: var(--radius);
    border: 1px solid;
    margin: 0 0 1.25rem;
}
.callout:last-child { margin-bottom: 0; }
.callout__icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; margin-top: 0.125rem; }
.callout__body { font-size: 0.9375rem; line-height: 1.65; min-width: 0; }
.callout__body p { margin: 0 0 0.5rem; }
.callout__body p:last-child { margin-bottom: 0; }
.callout__body strong { font-weight: 700; }
.callout__body a { text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }

.callout--info   { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary-900); }
.callout--info .callout__icon { color: var(--primary-500); }
.callout--tip    { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.callout--tip .callout__icon { color: #10b981; }
.callout--warn   { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.callout--warn .callout__icon { color: #f59e0b; }
.callout--note   { background: var(--gray-50); border-color: var(--gray-200); color: var(--gray-700); }
.callout--note .callout__icon { color: var(--gray-400); }

/* Numbered step lists */
.steps {
    list-style: none;
    counter-reset: step;
    margin: 0;
    padding: 1.5rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
}
.steps > li {
    counter-increment: step;
    position: relative;
    padding-left: 2.875rem;
    min-height: 2rem;
}
.steps > li + li { margin-top: 1.25rem; }
.steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: -0.0625rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-600);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: 999px;
}
.steps__title {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0.25rem 0 0;
}
.steps__desc {
    display: block;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--ink-subtle);
    margin: 0.25rem 0 0;
}
.steps__desc + .steps__desc { margin-top: 0.5rem; }

/* Card grids */
.card-grid { display: grid; gap: 1rem; }
.card-grid--2 { grid-template-columns: 1fr; }
.card-grid--3 { grid-template-columns: 1fr; }
.card-grid--4 { grid-template-columns: 1fr; }
@media (min-width: 560px) {
    .card-grid--2, .card-grid--3, .card-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
    .card-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .card-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}
.card__icon {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--primary-50);
    color: var(--primary-600);
    margin-bottom: 0.75rem;
}
.card__icon svg { width: 1.125rem; height: 1.125rem; }
.card__title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--primary-950);
    margin: 0 0 0.375rem;
}
.card__text {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--ink-subtle);
    margin: 0;
}

/* Linked cards (index pages) */
.card--link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.card--link:hover {
    border-color: var(--primary-300);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.card--link .card__arrow {
    width: 1.125rem;
    height: 1.125rem;
    color: var(--gray-300);
    flex-shrink: 0;
    margin-left: auto;
    transition: color 0.15s ease, transform 0.15s ease;
}
.card--link:hover .card__arrow { color: var(--primary-500); transform: translateX(2px); }

/* Field / spec rows — the "type + label" pattern used across the docs */
.spec-grid { display: grid; gap: 0.625rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.spec {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 0.875rem;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}
.spec__type {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.6875rem;
    padding: 0.1875rem 0.4375rem;
    background: var(--primary-50);
    color: var(--primary-700);
    border-radius: 0.3125rem;
    flex-shrink: 0;
    margin-top: 0.0625rem;
    white-space: nowrap;
}
.spec__name { font-size: 0.875rem; font-weight: 500; color: var(--gray-900); margin: 0; }
.spec__desc { font-size: 0.75rem; line-height: 1.5; color: var(--ink-subtle); margin: 0.125rem 0 0; }
.spec__req { color: #dc2626; font-size: 0.6875rem; font-weight: 600; }

/* Panels — a titled box wrapping a table or grid */
.panel {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.25rem;
}
.panel__head {
    padding: 0.875rem 1.25rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}
.panel__title { font-size: 0.9375rem; font-weight: 700; color: var(--primary-950); margin: 0; }
.panel__sub { font-size: 0.8125rem; color: var(--ink-subtle); margin: 0.1875rem 0 0; }
.panel__body { padding: 1.25rem; }

/* Tables — always horizontally scrollable rather than squashing */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
.table {
    width: 100%;
    min-width: 30rem;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.panel .table { min-width: 26rem; }
.table th {
    text-align: left;
    padding: 0.75rem 1.25rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    white-space: nowrap;
}
.table td {
    padding: 0.8125rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--ink-muted);
    vertical-align: top;
    line-height: 1.6;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table td code, .table th code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    color: var(--gray-800);
    white-space: nowrap;
}
.table__mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; }
.table__yes { color: #059669; font-weight: 600; }
.table__no  { color: var(--gray-400); }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1875rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.badge--get  { background: #ecfdf5; color: #047857; }
.badge--err  { background: #fef2f2; color: #b91c1c; }
.badge--info { background: var(--primary-50); color: var(--primary-700); }

/* Code blocks */
.code-block {
    position: relative;
    background: var(--gray-950);
    border-radius: var(--radius-lg);
    margin: 0 0 1.25rem;
    overflow: hidden;
}
.code-block__label {
    display: block;
    padding: 0.75rem 1.25rem 0;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
}
.code-block pre {
    margin: 0;
    padding: 1.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: #6ee7b7;
    tab-size: 2;
}
@media (min-width: 640px) { .code-block pre { font-size: 0.875rem; } }
.code-block--sm pre { padding: 0.75rem 1.25rem; }

.code-copy {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    padding: 0.3125rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--gray-300);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 0.375rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
}
.code-block:hover .code-copy,
.code-copy:focus-visible { opacity: 1; }
.code-copy:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.code-copy.is-copied { color: #6ee7b7; }
@media (hover: none) { .code-copy { opacity: 1; } }

/* Language tabs (API examples) */
.tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: var(--gray-100);
    border-radius: var(--radius);
    margin-bottom: 0.875rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tabs__btn {
    padding: 0.4375rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--gray-500);
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}
.tabs__btn:hover { color: var(--gray-700); }
.tabs__btn.is-active {
    background: #fff;
    color: var(--gray-900);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* Comparison / metric tiles */
.metric-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.metric {
    padding: 1.25rem;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    text-align: center;
}
.metric__value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--primary-600);
    margin: 0 0 0.25rem;
}
.metric__label { font-size: 0.8125rem; line-height: 1.45; color: var(--ink-subtle); margin: 0; }

/* FAQ disclosure */
.faq { border-top: 1px solid var(--gray-200); }
.faq__item { border-bottom: 1px solid var(--gray-200); }
.faq__q {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 1.125rem 0;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    text-align: left;
    color: var(--primary-950);
    background: none;
    border: 0;
    cursor: pointer;
    list-style: none;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q:hover { color: var(--primary-700); }
.faq__icon {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    margin-top: 0.1875rem;
    color: var(--gray-400);
    transition: transform 0.2s ease;
}
.faq__item[open] .faq__icon { transform: rotate(45deg); }
.faq__a {
    padding: 0 0 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--ink-muted);
}
.faq__a p { margin: 0 0 0.75rem; }
.faq__a p:last-child { margin-bottom: 0; }
.faq__a a { color: var(--primary-600); text-decoration: underline; text-underline-offset: 2px; }

/* Next-step banner */
.next-step {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-50), rgba(34, 211, 238, 0.1));
    border: 1px solid var(--primary-200);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.next-step:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.next-step__label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary-600);
    margin: 0 0 0.375rem;
}
.next-step__title { font-size: 1.125rem; font-weight: 700; color: var(--primary-950); margin: 0; }
.next-step__text { font-size: 0.875rem; line-height: 1.6; color: var(--ink-subtle); margin: 0.375rem 0 0; }
.next-step__arrow { width: 1.75rem; height: 1.75rem; color: var(--primary-400); flex-shrink: 0; transition: transform 0.15s ease; }
.next-step:hover .next-step__arrow { transform: translateX(3px); }

/* Previous / next pager */
.doc-pager {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-200);
}
@media (min-width: 640px) { .doc-pager { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; } }

.doc-pager__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.125rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.doc-pager__link:hover { border-color: var(--primary-300); background: var(--primary-50); }
.doc-pager__link--next { justify-content: flex-end; text-align: right; }
.doc-pager__icon { width: 1.125rem; height: 1.125rem; color: var(--gray-400); flex-shrink: 0; }
.doc-pager__link:hover .doc-pager__icon { color: var(--primary-500); }
.doc-pager__text { min-width: 0; }
.doc-pager__label { display: block; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-400); }
.doc-pager__title { display: block; font-size: 0.875rem; font-weight: 600; color: var(--gray-700); }
.doc-pager__link:hover .doc-pager__title { color: var(--primary-700); }
.doc-pager__spacer { display: none; }
@media (min-width: 640px) { .doc-pager__spacer { display: block; } }

/* ---------------------------------------------------------------------
   6. Footer
   --------------------------------------------------------------------- */
.site-footer {
    background: var(--primary-950);
    color: #fff;
    padding: 3rem 0 2rem;
}
.site-footer__inner {
    max-width: 88rem;
    margin: 0 auto;
    padding: 0 1.25rem;
}
@media (min-width: 640px)  { .site-footer__inner { padding: 0 2rem; } }
@media (min-width: 1024px) { .site-footer__inner { padding: 0 2.5rem; } }

.site-footer__top {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-bottom: 2.5rem;
}
@media (min-width: 900px) {
    .site-footer__top { grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr); gap: 4rem; }
}

.site-footer__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}
.site-footer__brand-accent { color: var(--accent-400); }
.site-footer__blurb {
    margin: 0.875rem 0 1.25rem;
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--primary-300);
    max-width: 26rem;
}
.site-footer__mail {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.875rem;
    color: var(--accent-400);
    text-decoration: none;
}
.site-footer__mail:hover { color: #fff; }
.site-footer__mail svg { width: 1rem; height: 1rem; }

.site-footer__cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 1.5rem;
}
@media (min-width: 640px) { .site-footer__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.site-footer__heading {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
    margin: 0 0 0.875rem;
}
.site-footer__col ul { list-style: none; margin: 0; padding: 0; }
.site-footer__col li { margin-bottom: 0.5rem; }
.site-footer__col a {
    font-size: 0.875rem;
    color: var(--primary-300);
    text-decoration: none;
    transition: color 0.15s ease;
}
.site-footer__col a:hover { color: #fff; }

.site-footer__bottom {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    text-align: center;
    padding-top: 1.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
@media (min-width: 640px) {
    .site-footer__bottom { flex-direction: row; justify-content: space-between; text-align: left; }
}
.site-footer__copy { font-size: 0.8125rem; color: var(--primary-400); margin: 0; }
