.doc-hero {
    background: linear-gradient(180deg, #EFF6FF 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    padding: 64px 0 48px;
    position: relative;
}

.doc-hero::before {
    background-image:
        radial-gradient(circle at 80% 20%, rgba(20, 184, 166, .15), transparent 40%),
        radial-gradient(circle at 10% 90%, rgba(124, 58, 237, .1), transparent 40%);
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.docs-relative {
    position: relative;
}

.docs-hero-copy {
    margin: 0 auto;
    max-width: 760px;
    text-align: center;
}

.docs-hero-copy h1 {
    font-size: clamp(34px, 4.4vw, 52px);
    margin-top: 14px;
}

.docs-hero-copy .lead {
    margin-top: 14px;
}

.search-box {
    margin: 28px auto 0;
    max-width: 640px;
    position: relative;
}

.search-box input {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    font: inherit;
    font-size: 15px;
    padding: 16px 52px;
    transition: box-shadow .2s, border-color .2s;
    width: 100%;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
    outline: none;
}

.search-box svg {
    color: var(--text-mute);
    inset-inline-start: 18px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.search-box .kbd {
    font-size: 11px;
    inset-inline-end: 14px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.doc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 18px;
}

.doc-tags a {
    background: rgba(255, 255, 255, .6);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-dim);
    font-size: 12.5px;
    padding: 6px 12px;
    transition: background .15s, color .15s, border-color .15s;
}

.doc-tags a:hover {
    background: #fff;
    border-color: var(--border-strong);
    color: var(--text);
}

.docs-hero-actions {
    justify-content: center;
    margin-top: 28px;
}

.docs-preview {
    padding: 32px 0 0;
}

.docs-stat-grid {
    gap: 12px;
}

.docs-stat-card {
    align-items: center;
    display: flex;
    gap: 12px;
    padding: 16px;
}

.docs-icon-small {
    height: 36px;
    width: 36px;
}

.docs-stat-value {
    font-size: 14px;
    font-weight: 600;
}

.docs-stat-card .muted {
    font-size: 12.5px;
}

.docs-category-grid {
    gap: 18px;
}

.cat-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    padding: 24px;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

.cat-card:hover {
    border-color: #C7D2FE;
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.cat-card ul {
    display: flex;
    flex-direction: column;
    gap: 6px;
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
}

.cat-card ul a {
    align-items: center;
    border-radius: 8px;
    color: var(--text-dim);
    display: flex;
    font-size: 13.5px;
    gap: 8px;
    padding: 8px 10px;
    transition: background .15s, color .15s;
}

.cat-card ul a:hover {
    background: var(--bg-soft);
    color: var(--text);
}

.cat-card ul svg {
    color: var(--text-mute);
    flex: none;
    height: 12px;
    width: 12px;
}

.cat-card .footer {
    align-items: center;
    border-top: 1px solid var(--border);
    color: var(--text-mute);
    display: flex;
    font-size: 12.5px;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 14px;
}

.cat-card .footer a {
    color: var(--primary);
    font-weight: 550;
}

.danger-tile {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #B91C1C;
}

.pink-tile {
    background: #FCE7F3;
    border-color: #FBCFE8;
    color: #BE185D;
}

.badge.pink {
    background: #FCE7F3;
    border-color: #FBCFE8;
    color: #BE185D;
}

.badge.error,
.eyebrow.danger {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #B91C1C;
}

.docs-api-section {
    background: #fff;
    border-bottom: 1px solid var(--border);
    border-top: 1px solid var(--border);
}

.api-grid {
    align-items: center;
    display: grid;
    gap: 56px;
    /* minmax(0, …): the right-hand column holds a code sample whose intrinsic min-width would
       otherwise push the track — and the page — wider than the viewport. */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
}

.api-grid h2 {
    margin-top: 14px;
}

.api-grid p {
    margin-top: 14px;
}

.codeblock {
    margin-top: 24px;
}

.docs-api-actions {
    margin-top: 24px;
}

.docs-endpoint-card {
    overflow: hidden;
    padding: 0;
}

.docs-endpoint-card__head {
    align-items: center;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    display: flex;
    font-size: 14px;
    font-weight: 600;
    justify-content: space-between;
    padding: 14px 18px;
}

.endpoint-row {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    transition: background .15s;
}

.endpoint-row:last-child {
    border-bottom: none;
}

.endpoint-row:hover {
    background: var(--bg-soft);
}

.endpoint-row > div {
    flex: 1;
}

.verb {
    border-radius: 6px;
    flex: none;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 650;
    min-width: 50px;
    padding: 4px 8px;
    text-align: center;
}

.verb.post {
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #047857;
}

.verb.get {
    background: var(--primary-50);
    border: 1px solid #DBEAFE;
    color: var(--primary-700);
}

.path {
    color: var(--text);
    flex: 1;
    font-family: var(--font-mono);
    font-size: 13px;
}

.endpoint-row .desc {
    color: var(--text-mute);
    font-size: 12.5px;
}

.feature {
    height: 100%;
}

.docs-plan-section {
    background: var(--bg-soft);
}

.plan-steps {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(6, 1fr);
}

.step-chip {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
}

.step-chip .n {
    background: var(--primary);
    border-radius: 999px;
    color: #fff;
    display: grid;
    font-size: 13px;
    font-weight: 600;
    height: 26px;
    place-items: center;
    width: 26px;
}

.step-chip h4 {
    font-size: 14px;
    margin-top: 10px;
}

.step-chip p {
    color: var(--text-mute);
    font-size: 12.5px;
}

.docs-plan-action {
    margin-top: 28px;
}

.docs-guide-grid {
    gap: 14px;
}

.guide-row {
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    display: flex;
    gap: 14px;
    padding: 16px;
    transition: border-color .15s, transform .15s;
}

.guide-row:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.guide-row .num {
    background: var(--primary-50);
    border-radius: 8px;
    color: var(--primary-700);
    display: grid;
    flex: none;
    font-weight: 600;
    height: 32px;
    place-items: center;
    width: 32px;
}

.guide-title {
    font-size: 15px;
    font-weight: 600;
}

.cta-banner {
    background: var(--primary-700);
    border-radius: 20px;
    color: #fff;
    padding: 36px;
}

.cta-banner .eyebrow {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .16);
    color: #fff;
}

.cta-banner h2 {
    color: #fff;
    margin-top: 16px;
}

.cta-banner p {
    color: #fff;
    margin-top: 12px;
    max-width: 640px;
}

.cta-banner .row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.cta-banner .btn:not(.ghost) {
    background: #fff;
    border-color: #fff;
    color: var(--primary-700);
}

.doc-layout {
    align-items: start;
    display: grid;
    gap: 24px;
    grid-template-columns: 280px minmax(0, 1fr);
}

.doc-sidebar {
    display: grid;
    gap: 10px;
    position: sticky;
    top: 96px;
}

.doc-sidebar a {
    border-radius: 8px;
    color: var(--text-dim);
    padding: 8px 10px;
}

.doc-sidebar a:hover,
.doc-sidebar a.active {
    background: var(--primary-50);
    color: var(--primary-700);
}

.doc-sidebar__back {
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.doc-content {
    line-height: 1.75;
}

.docs-search-section {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 48px 0;
}

.docs-search-head {
    margin-bottom: 24px;
}

.docs-search-results {
    display: grid;
    gap: 14px;
}

.docs-search-result {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    display: grid;
    gap: 8px;
    padding: 18px;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.docs-search-result:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.docs-search-result h3 {
    font-size: 18px;
}

.docs-search-result p {
    color: var(--text-dim);
}

.docs-search-result__meta {
    align-items: center;
    color: var(--text-mute);
    display: flex;
    flex-wrap: wrap;
    font-size: 12.5px;
    gap: 8px;
}

.docs-search-result__route {
    color: var(--primary-700);
    font-family: var(--font-mono);
    font-size: 12.5px;
    overflow-wrap: anywhere;
}

.docs-empty-state {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
}

.docs-empty-state p {
    margin-top: 8px;
}

.doc-page-hero__copy {
    max-width: 850px;
    position: relative;
}

.doc-page-hero__copy h1 {
    font-size: clamp(32px, 4vw, 52px);
    margin-top: 16px;
}

.doc-page-hero__copy .lead {
    margin-top: 14px;
    max-width: 720px;
}

.docs-page-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.doc-page-hero .docs-page-actions {
    justify-content: flex-start;
}

.doc-page-section {
    padding-top: 48px;
}

.doc-layout--detail {
    grid-template-columns: 300px minmax(0, 1fr);
}

.doc-sidebar--detail {
    max-height: calc(100vh - 120px);
    overflow: auto;
}

.doc-content--article {
    max-width: 860px;
    min-width: 0;
    overflow-x: auto;
    overflow-wrap: anywhere;
    padding: clamp(24px, 4vw, 40px);
}

.doc-content--article > :first-child {
    margin-top: 0;
}

.doc-content--article h1 {
    font-size: clamp(28px, 3vw, 40px);
}

.doc-content--article h2 {
    border-top: 1px solid var(--border);
    font-size: clamp(22px, 2vw, 30px);
    margin-top: 32px;
    padding-top: 28px;
}

.doc-content--article :is(p, li, blockquote) {
    max-width: 75ch;
}

.doc-content--article :is(ul, ol) {
    padding-inline-start: 1.4rem;
}

.doc-content--article blockquote {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 24px 0;
    padding: 16px 18px;
}

.doc-content--article pre {
    background: #111827;
    border-radius: 8px;
    color: #f8fafc;
    direction: ltr;
    max-width: 100%;
    overflow-x: auto;
    padding: 18px;
    text-align: left;
}

.doc-content--article table {
    border-collapse: collapse;
    margin: 24px 0;
    min-width: 32rem;
    width: 100%;
}

.doc-content--article :is(th, td) {
    border: 1px solid var(--border);
    overflow-wrap: anywhere;
    padding: 10px 12px;
    text-align: start;
    vertical-align: top;
    white-space: normal;
}

.doc-content--article th {
    background: var(--bg-soft);
    color: var(--text);
    font-weight: 700;
}

.doc-content--article code {
    background: var(--bg-soft);
    border-radius: 5px;
    color: var(--primary-700);
    font-size: .92em;
    padding: 2px 5px;
}

.doc-content--article pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.doc-content--article li + li {
    margin-top: 6px;
}

.docs-related {
    margin-top: 42px;
}

.docs-related .section-head {
    margin-bottom: 20px;
}

.docs-related-grid {
    max-width: 900px;
}

.faq-hero .docs-page-actions {
    justify-content: center;
}

.faq-section {
    padding-bottom: 64px;
}

.faq-groups {
    display: grid;
    gap: 28px;
    max-width: 960px;
}

.faq-group {
    display: grid;
    gap: 14px;
}

.faq-group__head {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
}

.faq-group__head h2 {
    font-size: 24px;
}

.faq-list {
    display: grid;
    gap: 12px;
}

html[dir="rtl"] .codeblock {
    direction: ltr;
    text-align: left;
}

html[dir="rtl"] .path {
    direction: ltr;
    text-align: right;
    unicode-bidi: plaintext;
}

html[dir="rtl"] .guide-row,
html[dir="rtl"] .endpoint-row {
    text-align: right;
}

html[dir="rtl"] .doc-page-hero__copy {
    text-align: right;
}

html[dir="rtl"] .doc-page-hero .docs-page-actions {
    justify-content: flex-start;
}

@media (max-width: 900px) {
    .api-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .plan-steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 980px) {
    .doc-layout {
        grid-template-columns: 1fr;
    }

    .doc-sidebar {
        position: static;
    }

    .doc-sidebar--detail {
        max-height: none;
    }

    .doc-content--article {
        max-width: none;
    }
}

@media (max-width: 640px) {
    .doc-hero {
        padding-top: 58px;
    }

    .docs-stat-grid,
    .plan-steps {
        grid-template-columns: 1fr;
    }

    .cta-banner {
        border-radius: 16px;
        padding: 24px;
    }

    .docs-page-actions,
    .doc-page-hero .docs-page-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .docs-page-actions .btn {
        width: 100%;
    }

    .faq-group__head {
        align-items: flex-start;
        flex-direction: column;
    }
}
