:root {
    color-scheme: dark;

    --bg: #191e21;
    --surface: #202428;
    --surface-hover: #252b31;
    --surface-control: #20252a;
    --surface-control-hover: #252b31;

    --border: #343e48;
    --border-strong: #3b4651;

    --fg: #f0f0f1;
    --fg-muted: #8f969d;
    --label: #8ea4cf;

    --primary: #6eb9ff;
    --primary-hover: #8bc7ff;

    --button-bg: #20252a;
    --button-bg-hover: #2a3138;
    --button-border: #3a4550;
}

* {
    box-sizing: border-box;
}

html {
    font-family: Inter, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--fg);
}

body {
    margin: 0;
    background: var(--bg);
}


/* ------------------------------------------------------------------------------------------------------------------ */
/* Top bar                                                                                                            */
/* ------------------------------------------------------------------------------------------------------------------ */

.topbar {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.topbar-inner {
    margin: 0 auto;
    padding: 18px 24px;

    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.brand-logo img {
    display: block;
    height: 42px;
    width: auto;
}

.brand-title {
    font-size: 1.3rem;
    font-weight: 700;
}

.brand-subtitle {
    margin-top: 4px;
    color: var(--fg-muted);
    font-size: 0.9rem;
}


/* ------------------------------------------------------------------------------------------------------------------ */
/* Page                                                                                                               */
/* ------------------------------------------------------------------------------------------------------------------ */

.page {
    margin: 0 auto;
    padding: 30px 24px;
}

.intro {
    margin-bottom: 10px;
}

.intro p {
    margin: 0;
    color: var(--fg-muted);
    font-size: 1.05rem;
}


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

.docs-search {
    margin-top: 10px;
    margin-bottom: 48px;
}

.docs-search input {
    width: 100%;
    max-width: 520px;

    padding: 12px 15px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--surface);
    color: var(--fg);

    font-family: inherit;
    font-size: 0.95rem;

    outline: none;
}

.docs-search input:focus {
    border-color: var(--border-strong);
}

.docs-search input::placeholder {
    color: var(--fg-muted);
}


/* ------------------------------------------------------------------------------------------------------------------ */
/* Groups                                                                                                             */
/* ------------------------------------------------------------------------------------------------------------------ */

.group-count {
    margin-left: 8px;
    color: var(--fg-muted);
    font-size: 0.8em;
    font-weight: 500;
}

.documentation-group {
    margin-bottom: 50px;
}

.services {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}


/* ------------------------------------------------------------------------------------------------------------------ */
/* Service card                                                                                                       */
/* ------------------------------------------------------------------------------------------------------------------ */

.service-card {
    width: 100%;
    padding: 20px 22px 24px;

    border: 1px solid var(--border);
    border-radius: 24px;

    background: var(--surface);
}

.service-header {
    margin-bottom: 24px;
}

.service-header h3 {
    margin: 0;

    color: var(--fg);
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}


/* ------------------------------------------------------------------------------------------------------------------ */
/* Documentation controls                                                                                             */
/* ------------------------------------------------------------------------------------------------------------------ */

.service-docs-controls {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 0.92fr) minmax(0, 1.16fr);
    align-items: end;
    gap: 16px;
}

.docs-control-field {
    min-width: 0;
}

.docs-control-label {
    display: block;

    color: var(--label);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.2;
}

.docs-select-shell {
    position: relative;

    display: block;
    width: 100%;

    margin-top: 9px;
}

.docs-select {
    width: 100%;
    height: 62px;

    padding: 0 48px 0 18px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface-control);
    color: var(--fg);

    font-family: inherit;
    font-size: 1.06rem;
    font-weight: 400;

    cursor: pointer;
    outline: none;

    appearance: none;
    -webkit-appearance: none;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.docs-version-select-shell .docs-select {
    padding-right: 128px;
}

.docs-select:hover,
.docs-select:focus {
    border-color: var(--border-strong);
    background: var(--surface-control-hover);
}

.docs-select option {
    padding: 12px 16px;

    background: #1b2025;
    color: var(--fg);

    font-size: 1rem;
    line-height: 1.5;
}

.docs-select option:checked {
    background: #2a3542;
    color: #ffffff;
}

.docs-select option:hover {
    background: #252d35;
}

.docs-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.docs-select-arrow {
    position: absolute;
    top: 50%;
    right: 18px;

    transform: translateY(-50%);

    color: #d7d9dc;
    font-size: 0.85rem;

    pointer-events: none;
}

.latest-badge {
    position: absolute;
    top: 50%;
    right: 50px;

    transform: translateY(-50%);

    min-width: 78px;
    padding: 9px 12px;

    border-radius: 999px;

    background: #75baff;
    color: #252627;

    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;

    pointer-events: none;
}

.latest-badge[hidden] {
    display: none;
}

.docs-read-action {
    min-width: 0;
}

.read-docs-button {
    width: 100%;
    height: 62px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 0 20px;

    border: 1px solid var(--button-border);
    border-radius: 10px;

    background: var(--button-bg);
    color: var(--fg);

    text-decoration: none;
    font-size: 1.02rem;
    font-weight: 700;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

.read-docs-button:hover {
    border-color: #4b5865;
    background: var(--button-bg-hover);
}

.read-docs-button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.read-docs-button:active {
    transform: translateY(1px);
}

.read-docs-button.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.read-docs-arrow {
    flex-shrink: 0;

    color: #dfe2e5;
    font-size: 1.65rem;
    font-weight: 300;
    line-height: 1;
}




/* Native dropdown popup styling (best-effort across browsers/OSes). */
.docs-select {
    color-scheme: dark;
}


/* ------------------------------------------------------------------------------------------------------------------ */
/* Footer / width                                                                                                     */
/* ------------------------------------------------------------------------------------------------------------------ */

.footer {
    margin: 20px auto 0;
    padding: 30px 24px;

    border-top: 1px solid var(--border);

    color: var(--fg-muted);
    font-size: 0.85rem;
}

.page,
.topbar-inner,
.footer {
    max-width: 1700px;
}


/* ------------------------------------------------------------------------------------------------------------------ */
/* Responsive                                                                                                         */
/* ------------------------------------------------------------------------------------------------------------------ */

@media (max-width: 1250px) {
    .services {
        grid-template-columns: 1fr;
    }

    .service-card {
        padding: 34px 38px 38px;
    }

    .service-docs-controls {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(260px, 1fr);
        gap: 20px;
    }
}

@media (max-width: 760px) {
    .page {
        padding-left: 16px;
        padding-right: 16px;
    }

    .service-card {
        padding: 24px 20px 26px;
        border-radius: 18px;
    }

    .service-header {
        margin-bottom: 24px;
    }

    .service-header h3 {
        font-size: 1.35rem;
    }

    .service-docs-controls {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .docs-read-action {
        grid-column: auto;
    }

    .docs-control-label {
        font-size: 1.05rem;
    }

    .docs-select,
    .read-docs-button {
        height: 58px;
        font-size: 1rem;
    }

    .docs-version-select-shell .docs-select {
        padding-right: 132px;
    }

    .latest-badge {
        right: 54px;
        min-width: 82px;
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .docs-select-arrow {
        right: 18px;
    }

    .read-docs-arrow {
        font-size: 1.7rem;
    }
}
