.docs-page {
    background: #f7f5f1;
}

.docs-main {
    min-height: 100dvh;
}

.docs-hero {
    position: relative;
    min-height: clamp(260px, 44vh, 430px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f2ed 0%, #e7e1d8 52%, #dbd3c7 100%);
    border-bottom: 1px solid rgba(116, 107, 94, 0.22);
}

.docs-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 840px;
}

.docs-eyebrow {
    margin: 0 0 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.78rem;
    font-weight: 700;
    color: #6e675f;
}

.docs-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4.6vw, 3.8rem);
    line-height: 1.06;
    color: #171615;
}

.docs-hero p {
    margin: 0.9rem auto 0;
    max-width: 720px;
    color: #4f4a44;
    line-height: 1.55;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
}

.docs-bg-symbols {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.doc-symbol {
    position: absolute;
    width: clamp(34px, 3.8vw, 58px);
    height: clamp(44px, 4.7vw, 70px);
    border: 1px solid rgba(96, 89, 80, 0.21);
    border-radius: 9px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(233, 225, 216, 0.25));
    box-shadow: 0 10px 24px rgba(80, 72, 63, 0.1);
    transform: rotate(var(--rot, 0deg));
}

.doc-symbol::after {
    content: "";
    position: absolute;
    right: -1px;
    top: -1px;
    width: 13px;
    height: 13px;
    border-left: 1px solid rgba(96, 89, 80, 0.21);
    border-bottom: 1px solid rgba(96, 89, 80, 0.21);
    background: rgba(255, 255, 255, 0.42);
    clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.s1 { top: 12%; left: 7%; --rot: -11deg; }
.s2 { top: 70%; left: 10%; --rot: 12deg; }
.s3 { top: 18%; left: 24%; --rot: -5deg; }
.s4 { top: 66%; left: 31%; --rot: 8deg; }
.s5 { top: 24%; right: 30%; --rot: 9deg; }
.s6 { top: 67%; right: 23%; --rot: -8deg; }
.s7 { top: 15%; right: 10%; --rot: 13deg; }
.s8 { top: 70%; right: 8%; --rot: -10deg; }

.docs-list-section {
    padding: clamp(36px, 7vh, 74px) 0 clamp(54px, 9vh, 92px);
    background: linear-gradient(180deg, #fbfbfa 0%, #f2eeea 32%, #e7e1d8 100%);
}

.docs-list-wrap {
    max-width: 1080px;
}

.docs-search-box {
    margin: 0 auto clamp(18px, 2.4vw, 28px);
    max-width: 640px;
}

.docs-search-box label {
    display: block;
    margin-bottom: 0.48rem;
    font-size: 0.86rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6c655d;
    font-weight: 700;
}

.docs-search-box input {
    width: 100%;
    border: 1px solid rgba(116, 107, 94, 0.35);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    color: #22201d;
    padding: 0.86rem 0.98rem;
    font-size: 0.97rem;
}

.docs-search-box input:focus {
    outline: none;
    border-color: #7f766d;
    box-shadow: 0 0 0 3px rgba(214, 208, 201, 0.58);
}

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

.docs-item {
    border: 1px solid rgba(116, 107, 94, 0.28);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 10px 24px rgba(44, 37, 29, 0.08);
    overflow: hidden;
}

.docs-item-toggle {
    width: 100%;
    min-height: 62px;
    border: 0;
    background: transparent;
    color: #1c1a17;
    display: grid;
    grid-template-columns: 148px 1fr 32px;
    align-items: center;
    gap: 12px;
    text-align: left;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: background 0.24s ease, transform 0.24s ease;
}

.docs-item:hover .docs-item-toggle,
.docs-item:focus-within .docs-item-toggle {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.45);
}

.docs-item-code {
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
    color: #746b60;
}

.docs-item-name {
    font-size: 1rem;
    font-weight: 600;
}

.docs-item-chevron {
    font-size: 1.3rem;
    line-height: 1;
    text-align: center;
    color: #756b60;
    transition: transform 0.25s ease;
}

.docs-item.is-open .docs-item-chevron {
    transform: rotate(45deg);
}

.docs-item-panel {
    border-top: 1px solid rgba(116, 107, 94, 0.2);
    padding: 0.85rem 1rem 1rem;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
    transition: max-height 0.28s ease, opacity 0.22s ease, transform 0.22s ease;
}

.docs-item-panel.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.docs-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.docs-action-btn {
    min-height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(116, 107, 94, 0.35);
    background: linear-gradient(135deg, #faf8f4, #ece5db);
    color: #2a2723;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.docs-action-btn:hover {
    transform: translateY(-2px);
    border-color: #8d8479;
    box-shadow: 0 8px 16px rgba(80, 71, 61, 0.16);
}

.docs-item.is-hidden {
    display: none;
}

.docs-page .footer {
    background: linear-gradient(135deg, #e6dfd5 0%, #d9d1c5 48%, #cdc3b5 100%);
    color: #4f4a43;
}

.docs-page .footer a {
    color: #615a52;
}

[data-theme="dark"] .docs-page {
    background: #111111;
}

[data-theme="dark"] .docs-hero {
    background: linear-gradient(138deg, #0f0e0d 0%, #1f1c18 55%, #37322c 100%);
    border-bottom-color: rgba(181, 171, 157, 0.24);
}

[data-theme="dark"] .docs-eyebrow {
    color: #c9c1b6;
}

[data-theme="dark"] .docs-hero h1 {
    color: #f2ece3;
}

[data-theme="dark"] .docs-hero p {
    color: #d7cfc3;
}

[data-theme="dark"] .doc-symbol {
    border-color: rgba(194, 182, 166, 0.19);
    background: linear-gradient(180deg, rgba(44, 40, 35, 0.65), rgba(23, 21, 19, 0.2));
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.34);
}

[data-theme="dark"] .doc-symbol::after {
    border-left-color: rgba(194, 182, 166, 0.19);
    border-bottom-color: rgba(194, 182, 166, 0.19);
    background: rgba(69, 61, 52, 0.36);
}

[data-theme="dark"] .docs-search-box label {
    color: #bfb7ac;
}

[data-theme="dark"] .docs-search-box input {
    background: rgba(30, 28, 24, 0.8);
    color: #efebe5;
    border-color: rgba(190, 179, 163, 0.31);
}

[data-theme="dark"] .docs-search-box input:focus {
    border-color: #b8ac9d;
    box-shadow: 0 0 0 3px rgba(80, 72, 62, 0.48);
}

[data-theme="dark"] .docs-item {
    background: rgba(34, 31, 27, 0.78);
    border-color: rgba(186, 175, 160, 0.25);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.34);
}

[data-theme="dark"] .docs-list-section {
    background: linear-gradient(180deg, #10100f 0%, #1b1917 35%, #26221e 100%);
}

[data-theme="dark"] .docs-page .footer {
    background: linear-gradient(135deg, #1a1714 0%, #231f1b 52%, #2f2923 100%);
}

[data-theme="dark"] .docs-item-toggle {
    color: #f0ece6;
}

[data-theme="dark"] .docs-item-code {
    color: #bfb6ab;
}

[data-theme="dark"] .docs-item-chevron {
    color: #b8ae9f;
}

[data-theme="dark"] .docs-item-panel {
    border-top-color: rgba(186, 175, 160, 0.2);
}

[data-theme="dark"] .docs-action-btn {
    border-color: rgba(186, 175, 160, 0.28);
    background: linear-gradient(135deg, #2c2925, #24211d);
    color: #ede7df;
}

[data-theme="dark"] .docs-action-btn:hover {
    border-color: #cec2b2;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.36);
}

@media (max-width: 960px) {
    .docs-actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    html,
    body,
    .docs-page,
    .docs-main {
        overflow-x: clip;
    }

    .docs-list-wrap,
    .docs-hero-content {
        width: 100%;
    }

    .docs-item-toggle {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "code icon"
            "name icon";
        row-gap: 4px;
        min-height: 70px;
    }

    .docs-item-code {
        grid-area: code;
    }

    .docs-item-name {
        grid-area: name;
    }

    .docs-item-chevron {
        grid-area: icon;
    }

    .docs-actions-grid {
        grid-template-columns: 1fr;
    }
}
/* High contrast overrides */
html[data-contrast="high"] .docs-page,
html[data-contrast="high"] .docs-main,
html[data-contrast="high"] .navbar,
html[data-contrast="high"] .nav-cluster,
html[data-contrast="high"] .nav-cluster.active,
html[data-contrast="high"] .docs-hero,
html[data-contrast="high"] .docs-list-section,
html[data-contrast="high"] .docs-page .footer {
    background: #000000 !important;
    background-image: none !important;
    color: #ffffff !important;
}

html[data-contrast="high"] .docs-list-wrap,
html[data-contrast="high"] .docs-hero-content,
html[data-contrast="high"] .docs-item,
html[data-contrast="high"] .docs-item-panel,
html[data-contrast="high"] .docs-search-box,
html[data-contrast="high"] .docs-action-btn {
    background: #000000 !important;
    background-image: none !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    box-shadow: none !important;
}

html[data-contrast="high"] .docs-hero h1,
html[data-contrast="high"] .docs-hero p,
html[data-contrast="high"] .docs-eyebrow,
html[data-contrast="high"] .docs-search-box label,
html[data-contrast="high"] .docs-item-toggle,
html[data-contrast="high"] .docs-item-code,
html[data-contrast="high"] .docs-item-name,
html[data-contrast="high"] .docs-item-chevron,
html[data-contrast="high"] .docs-item-panel,
html[data-contrast="high"] .docs-page .footer a {
    color: #ffffff !important;
}

html[data-contrast="high"] .docs-bg-symbols,
html[data-contrast="high"] .doc-symbol,
html[data-contrast="high"] .doc-symbol::after {
    background: transparent !important;
    box-shadow: none !important;
}

html[data-contrast="high"] .docs-search-box label,
html[data-contrast="high"] .docs-item-toggle,
html[data-contrast="high"] .docs-item-code,
html[data-contrast="high"] .docs-item-chevron,
html[data-contrast="high"] .docs-item-panel {
    color: #ffffff !important;
}

html[data-contrast="high"] .docs-search-box input {
    background: #000000 !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
}

html[data-contrast="high"] .docs-search-box input:focus {
    border-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25) !important;
}

html[data-contrast="high"] .docs-action-btn {
    background: #111111 !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    box-shadow: none !important;
}
