:root {
    --font-sans: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
    --color-background: #f8f2f6;
    --color-surface: #ffffff;
    --color-surface-elevated: #fdf2f8;
    --color-text: #2c0f26;
    --color-text-subtle: #6b5263;
    --color-border: rgba(204, 149, 174, 0.28);
    --color-brand: #dc2c5d;
    --color-brand-alt: #c72177;
    --color-brand-gradient: linear-gradient(135deg, #dc2c5d 0%, #c72177 100%);
    --color-brand-muted: rgba(220, 44, 93, 0.12);
    --color-brand-line: rgba(199, 33, 119, 0.32);
    --shadow-soft: 0 24px 48px rgba(79, 18, 60, 0.12);
    --shadow-hover: 0 32px 72px rgba(79, 18, 60, 0.16);
    --topbar-height: 88px;
    color-scheme: light;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--color-background);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-brand-alt);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    backdrop-filter: blur(18px);
    background: linear-gradient(125deg, #240b1e 0%, #451a36 70%, #5f1f52 100%);
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 26px 54px rgba(36, 8, 29, 0.4);
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: var(--topbar-height);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 48px);
    width: 100%;
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: var(--topbar-height);
    padding: 10px 0;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.brand span {
    letter-spacing: 0.14em;
}

.nav-links {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    font-size: 0.92rem;
    margin-left: auto;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.86);
    font-weight: 500;
    position: relative;
    padding-bottom: 3px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.nav-links a[aria-current="page"]::after,
.nav-links a:hover::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    height: 2px;
    bottom: -3px;
    background: #ffd1e6;
    border-radius: 999px;
}

@media (max-width: 768px) {
    .topbar__inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 0 14px;
        gap: 12px;
    }

    .brand {
        font-size: 0.88rem;
        gap: 10px;
    }

    .nav-links {
        gap: 12px;
        flex-wrap: wrap;
        font-size: 0.82rem;
        margin-left: 0;
    }

    .nav-links a {
        padding-bottom: 1px;
        letter-spacing: 0.05em;
    }

    .nav-links a[aria-current="page"]::after,
    .nav-links a:hover::after {
        bottom: -1px;
    }
}


main {
    padding: 64px 0 88px;
}

main.reference-main {
    padding: 0;
}

.reference-main {
    flex: 1;
    display: flex;
    padding: 0 clamp(20px, 5vw, 48px) 40px;
    box-sizing: border-box;
    background: var(--color-background);
}

.hero {
    background: linear-gradient(135deg, rgba(220, 44, 93, 0.12), rgba(199, 33, 119, 0.08));
    border-radius: 32px;
    padding: 54px;
    margin-top: 40px;
    border: 1px solid rgba(220, 44, 93, 0.28);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(199, 33, 119, 0.28) 0%, rgba(255, 255, 255, 0) 70%);
    top: -120px;
    right: -120px;
    pointer-events: none;
}

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    background: rgba(220, 44, 93, 0.18);
    border: 1px solid rgba(220, 44, 93, 0.32);
    color: var(--color-brand);
    border-radius: 999px;
    padding: 6px 16px;
}

.hero h1 {
    margin: 18px 0 12px;
    font-size: 3rem;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.hero p {
    margin: 0;
    max-width: 640px;
    color: var(--color-text-subtle);
    font-size: 1.12rem;
    line-height: 1.7;
}

.action-links {
    margin-top: 26px;
    display: inline-flex;
    gap: 16px;
    flex-wrap: wrap;
}

.action-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--color-surface);
    border-radius: 16px;
    border: 1px solid rgba(220, 44, 93, 0.16);
    font-weight: 600;
    color: var(--color-text);
    box-shadow: 0 16px 36px rgba(220, 44, 93, 0.16);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.action-link svg {
    width: 18px;
    height: 18px;
}

.action-link:hover {
    transform: translateY(-2px);
    text-decoration: none;
    box-shadow: var(--shadow-hover);
}

.section-heading {
    margin: 72px 0 28px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.section-heading h2 {
    margin: 0;
    font-size: 2rem;
    letter-spacing: -0.02em;
}

.section-heading p {
    margin: 0;
    max-width: 500px;
    color: var(--color-text-subtle);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.card {
    background: var(--color-surface);
    border-radius: 24px;
    padding: 28px;
    border: 1px solid var(--color-brand-line);
    box-shadow: 0 22px 40px rgba(199, 33, 119, 0.12);
    display: grid;
    gap: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card h3 {
    margin: 0;
    font-size: 1.35rem;
}

.card p {
    margin: 0;
    color: var(--color-text-subtle);
}

.guides-list {
    display: grid;
    gap: 20px;
}

.guide-card {
    background: var(--color-surface);
    border-radius: 22px;
    padding: 26px 30px;
    border: 1px solid rgba(220, 44, 93, 0.18);
    box-shadow: 0 22px 42px rgba(220, 44, 93, 0.12);
    display: grid;
    gap: 14px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.guide-card:hover {
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.guide-meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: rgba(220, 44, 93, 0.85);
}

.guide-title {
    margin: 0;
    font-size: 1.3rem;
    letter-spacing: -0.01em;
    color: var(--color-text);
}

.guide-summary {
    margin: 0;
    color: var(--color-text-subtle);
}

.empty-state {
    padding: 52px;
    text-align: center;
    border-radius: 24px;
    border: 2px dashed rgba(220, 44, 93, 0.32);
    background: rgba(220, 44, 93, 0.08);
    color: var(--color-text-subtle);
}

.article-shell {
    margin-top: 48px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--color-text-subtle);
}

.article-header {
    margin: 16px 0 28px;
}

.article-header h1 {
    margin: 0 0 12px;
    font-size: 2.4rem;
    letter-spacing: -0.03em;
}

.article-header p {
    margin: 0;
    color: var(--color-text-subtle);
}

.article-body {
    background: var(--color-surface);
    border-radius: 32px;
    border: 1px solid var(--color-brand-line);
    box-shadow: var(--shadow-soft);
    padding: 50px;
    line-height: 1.75;
    font-size: 1.04rem;
}

.article-body h2 {
    margin-top: 2.8rem;
    font-size: 1.6rem;
    letter-spacing: -0.01em;
}

.article-body h3 {
    margin-top: 2rem;
    font-size: 1.25rem;
}

.article-body code {
    font-family: var(--font-mono);
    background: rgba(220, 44, 93, 0.08);
    padding: 3px 6px;
    border-radius: 6px;
}

.article-body pre {
    background: #2c0f26;
    color: #fce7f3;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 22px;
    overflow-x: auto;
    box-shadow: inset 0 0 0 1px rgba(220, 44, 93, 0.16);
}

.article-body pre code {
    background: transparent;
    padding: 0;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 28px 0;
    font-size: 0.98rem;
}

.article-body th,
.article-body td {
    border: 1px solid var(--color-border);
    padding: 14px 16px;
    text-align: left;
}

.article-body blockquote {
    margin: 1.8rem 0;
    padding: 1.1rem 1.5rem;
    border-left: 4px solid var(--color-brand);
    background: rgba(37, 99, 235, 0.1);
    border-radius: 0 18px 18px 0;
}

.doc-panels {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--topbar-height));
    width: 100%;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.doc-panels__tabs {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    justify-content: center;
    width: 100%;
    pointer-events: none;
}

.doc-tabs {
    pointer-events: auto;
    display: inline-flex;
    padding: 0;
    border-radius: 999px;
    background: transparent;
    border: 0;
    gap: 6px;
}

.doc-tab {
    border: 0;
    background: rgba(255, 255, 255, 0.0);
    padding: 10px 20px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(44, 15, 38, 0.65);
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.doc-tab:hover {
    color: rgba(44, 15, 38, 0.9);
}

.doc-tab[aria-selected="true"] {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: 0 16px 32px rgba(220, 44, 93, 0.16);
    transform: translateY(-1px);
}

.doc-panels__body {
    flex: 1;
    display: flex;
    min-height: 0;
    width: 100%;
    background: var(--color-surface);
    border-radius: 32px 32px 0 0;
    box-shadow: var(--shadow-soft);
    padding: 56px clamp(24px, 5vw, 56px) 40px;
    box-sizing: border-box;
    overflow: visible;
}

#redoc-panel,
#swagger-panel {
    flex: 1;
    min-width: 0;
    min-height: 0;
}

#redoc-panel redoc,
#redoc-panel redoc > div {
    height: 100% !important;
}

#swagger-panel,
#swagger-ui {
    height: 100%;
}

.swagger-ui .topbar {
    display: none;
}

.swagger-ui .opblock-tag {
    border-radius: 16px;
    font-size: 1.05rem;
    padding: 10px 14px;
}

.swagger-ui .information-container,
.swagger-ui .scheme-container,
.swagger-ui .models-control {
    border-radius: 18px;
}

.swagger-ui .btn {
    border-radius: 10px;
    font-weight: 600;
}

.redoc-wrap .redoc-branding,
.redoc-wrap .redoc-branding a {
    display: none !important;
}

.footer {
    padding: 32px 0 48px;
    color: var(--color-text-subtle);
    font-size: 0.92rem;
    border-top: 1px solid rgba(220, 44, 93, 0.16);
    background: linear-gradient(135deg, rgba(220, 44, 93, 0.08), rgba(199, 33, 119, 0.08));
}

.footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

@media (max-width: 1024px) {
    .hero {
        padding: 40px;
    }

    .article-body {
        padding: 36px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .topbar__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 16px;
    }

    .hero h1 {
        font-size: 2.4rem;
    }

    .doc-tabs {
        width: 100%;
    }

    .doc-tab {
        flex: 1;
        text-align: center;
    }
}

@media (max-width: 520px) {
    .hero,
    .article-body {
        padding: 26px;
    }

    .section-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-links {
        width: 100%;
    }

    .action-link {
        justify-content: center;
        width: 100%;
    }
}
