/*
 * SCP: ReEnter documentation theme
 * Retype-inspired information architecture with the game's own visual language.
 */

:root {
    --docs-header: 68px;
    --docs-sidebar: 296px;
    --docs-toc: 248px;
    --docs-canvas: #08090b;
    --docs-surface: #0d0e11;
    --docs-surface-raised: #121318;
    --docs-surface-hover: #16171c;
    --docs-border: #24262d;
    --docs-border-soft: #1a1c21;
    --docs-ink: #f4f4f6;
    --docs-copy: #b2b4bd;
    --docs-muted: #747782;
    --docs-red: #ff3b45;
    --docs-red-bright: #ff5a62;
    --docs-red-wash: rgba(255, 59, 69, 0.1);
    --docs-red-line: rgba(255, 59, 69, 0.34);
    --docs-yellow: #e6a84b;
    --docs-cyan: #38bdf8;
    --docs-green: #79c590;
    --docs-radius: 8px;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #373942 transparent;
}

*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 10px;
    background: #373942;
    background-clip: padding-box;
}

html {
    scroll-padding-top: calc(var(--docs-header) + 28px);
    background: var(--docs-canvas) !important;
}

body {
    display: block !important;
    min-height: 100vh !important;
    height: auto !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background:
        radial-gradient(circle at 48% 0%, rgba(255, 59, 69, 0.055), transparent 28rem),
        var(--docs-canvas) !important;
    color: var(--docs-ink) !important;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

body::before {
    content: "";
    position: fixed;
    inset: var(--docs-header) var(--docs-toc) auto var(--docs-sidebar);
    z-index: 1;
    height: 1px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 59, 69, 0.2), transparent);
}

::selection {
    color: #fff;
    background: rgba(255, 59, 69, 0.4);
}

.docs-media { display: none !important; }

/* Header */
.docs-topbar {
    position: fixed !important;
    inset: 0 0 auto 0 !important;
    z-index: 120 !important;
    width: auto !important;
    max-width: none !important;
    height: var(--docs-header) !important;
    margin: 0 !important;
    padding: 0 22px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 22px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--docs-border) !important;
    background: rgba(8, 9, 11, 0.94) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.16) !important;
    backdrop-filter: blur(18px) saturate(125%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(125%) !important;
}

.docs-topbar-left {
    display: flex !important;
    align-items: center !important;
    min-width: 0;
    gap: 12px !important;
}

.docs-topbar-logo {
    width: 36px !important;
    height: 36px !important;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(255, 59, 69, 0.16));
}

.docs-topbar-title {
    display: flex;
    align-items: center;
    min-width: 0;
    color: var(--docs-ink) !important;
    font-family: "Inter", sans-serif !important;
    font-size: 0.87rem !important;
    font-weight: 720 !important;
    letter-spacing: -0.01em !important;
    text-transform: none !important;
    white-space: nowrap;
}

.docs-topbar-title span {
    color: var(--docs-muted) !important;
    font-weight: 520 !important;
}

.docs-topbar-actions {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.docs-topbar-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 36px !important;
    margin: 0 !important;
    padding: 0 11px !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: transparent !important;
    color: #999ca6 !important;
    font-family: "Inter", sans-serif !important;
    font-size: 0.76rem !important;
    font-weight: 650 !important;
    text-decoration: none !important;
    transition: color 160ms ease, background 160ms ease !important;
}

.docs-topbar-link::after {
    content: "↗";
    margin-left: 6px;
    color: #5d606a;
    font-size: 0.68rem;
}

.docs-topbar-link:first-child::after { content: ""; margin: 0; }
.docs-topbar-link:hover { color: #fff !important; background: var(--docs-surface-hover) !important; }

.docs-mobile-toggle {
    display: none !important;
    width: 38px !important;
    height: 38px !important;
    flex: 0 0 38px;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border: 1px solid var(--docs-border) !important;
    border-radius: 6px !important;
    background: var(--docs-surface) !important;
    color: var(--docs-copy) !important;
    font-size: 0 !important;
    cursor: pointer;
}

.docs-mobile-toggle::before {
    content: "";
    width: 16px;
    height: 12px;
    border-top: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    background: linear-gradient(currentColor, currentColor) center / 16px 1.5px no-repeat;
}

.docs-reading-progress {
    position: fixed;
    z-index: 150;
    inset: calc(var(--docs-header) - 2px) auto auto 0;
    width: 0;
    height: 2px;
    pointer-events: none;
    background: linear-gradient(90deg, #a71921, var(--docs-red-bright));
    box-shadow: 0 0 14px rgba(255, 59, 69, 0.48);
}

/* Left navigation */
.sidebar {
    position: fixed !important;
    z-index: 100 !important;
    inset: var(--docs-header) auto 0 0 !important;
    width: var(--docs-sidebar) !important;
    height: auto !important;
    padding: 20px 14px 26px !important;
    display: block !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    border: 0 !important;
    border-right: 1px solid var(--docs-border) !important;
    background: #0a0b0e !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.sidebar > .back-home,
.sidebar > .docs-brand,
.sidebar > h1 { display: none !important; }

.docs-search {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 0 23px !important;
    padding: 0 !important;
}

.docs-search::before {
    content: "" !important;
    position: absolute !important;
    z-index: 1;
    left: 12px !important;
    top: 50% !important;
    width: 12px;
    height: 12px;
    border: 1.5px solid #686b75;
    border-radius: 50%;
    transform: translateY(-58%) !important;
    pointer-events: none;
}

.docs-search::after {
    content: "";
    position: absolute;
    z-index: 1;
    left: 22px;
    top: 24px;
    width: 5px;
    height: 1.5px;
    background: #686b75;
    transform: rotate(45deg);
    pointer-events: none;
}

.docs-search input {
    width: 100% !important;
    min-width: 0 !important;
    height: 40px !important;
    padding: 0 60px 0 34px !important;
    border: 1px solid #292b32 !important;
    border-radius: 7px !important;
    outline: none !important;
    background: #101115 !important;
    color: #ebebee !important;
    font-family: "Inter", sans-serif !important;
    font-size: 0.78rem !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.015) inset !important;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease !important;
}

.docs-search input::placeholder { color: #656873 !important; }
.docs-search input:focus {
    border-color: rgba(255, 59, 69, 0.58) !important;
    background: #131419 !important;
    box-shadow: 0 0 0 3px rgba(255, 59, 69, 0.08) !important;
}

.docs-search kbd {
    position: absolute !important;
    z-index: 2;
    right: 8px !important;
    top: 50% !important;
    padding: 3px 5px !important;
    border: 1px solid #33353d !important;
    border-radius: 4px !important;
    background: #18191e !important;
    color: #777a84 !important;
    font: 600 0.57rem/1 "Inter", sans-serif !important;
    transform: translateY(-50%) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset !important;
}

.docs-search-empty {
    display: none !important;
    margin: -13px 5px 18px !important;
    padding: 7px 9px !important;
    border: 1px solid rgba(255, 59, 69, 0.18) !important;
    border-radius: 5px !important;
    background: rgba(255, 59, 69, 0.045) !important;
    color: #ba797d !important;
    font-size: 0.7rem !important;
}

.docs-search-empty.show { display: block !important; }

.nav-section { margin: 0 0 24px !important; }
.nav-section[hidden] { display: none !important; }

.nav-section-title {
    margin: 0 9px 8px !important;
    padding: 0 !important;
    color: #656872 !important;
    font-family: "Inter", sans-serif !important;
    font-size: 0.62rem !important;
    font-weight: 760 !important;
    letter-spacing: 0.115em !important;
    text-transform: uppercase !important;
}

.nav-link {
    position: relative !important;
    display: block !important;
    margin: 2px 0 !important;
    padding: 7px 10px 7px 12px !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: transparent !important;
    color: #9497a1 !important;
    font-family: "Inter", sans-serif !important;
    font-size: 0.77rem !important;
    font-weight: 520 !important;
    line-height: 1.42 !important;
    text-decoration: none !important;
    transition: color 150ms ease, background 150ms ease !important;
}

.nav-link:hover {
    padding-left: 12px !important;
    color: #dedee3 !important;
    background: #121319 !important;
}

.nav-link.active {
    color: #fff !important;
    background: linear-gradient(90deg, rgba(255, 59, 69, 0.13), rgba(255, 59, 69, 0.055)) !important;
}

.nav-link.active::before {
    content: "" !important;
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 2px;
    border-radius: 2px;
    background: var(--docs-red);
    box-shadow: 0 0 10px rgba(255, 59, 69, 0.36);
}

.docs-sidebar-footer {
    margin: 30px 8px 0 !important;
    padding: 18px 0 0 !important;
    border-top: 1px solid var(--docs-border-soft) !important;
    color: #5f626c !important;
    font-size: 0.66rem !important;
    line-height: 1.55 !important;
}

.docs-sidebar-footer strong {
    display: block;
    margin-bottom: 2px;
    color: #9497a0 !important;
    font-size: 0.7rem !important;
}

/* Reading area */
.main-content {
    width: auto !important;
    min-width: 0 !important;
    min-height: 100vh !important;
    margin: 0 var(--docs-toc) 0 var(--docs-sidebar) !important;
    padding: var(--docs-header) 0 0 !important;
    overflow: visible !important;
    background: transparent !important;
}

.content-container {
    width: min(100%, 940px) !important;
    max-width: 940px !important;
    margin: 0 auto !important;
    padding: 56px 60px 104px !important;
}

.content-container section {
    position: relative !important;
    margin: 0 0 52px !important;
    padding: 0 0 52px !important;
    overflow: visible !important;
    border: 0 !important;
    border-bottom: 1px solid var(--docs-border-soft) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    animation: none !important;
    scroll-margin-top: calc(var(--docs-header) + 30px) !important;
}

.content-container section:last-child { border-bottom: 0 !important; }

.content-container h1,
.content-container h2,
.content-container h3,
.content-container h4 {
    position: relative;
    color: var(--docs-ink) !important;
    font-family: "Inter", sans-serif !important;
}

.content-container h1,
.content-container h2 {
    margin: 0 0 19px !important;
    padding: 0 !important;
    border: 0 !important;
    font-size: clamp(1.8rem, 3.1vw, 2.35rem) !important;
    font-weight: 770 !important;
    letter-spacing: -0.035em !important;
    line-height: 1.16 !important;
}

.content-container h1::before,
.content-container h1::after,
.content-container h2::before,
.content-container h2::after,
.content-container h3::before,
.content-container h3::after { content: none !important; display: none !important; }

.content-container h3 {
    margin: 36px 0 13px !important;
    font-size: 1.14rem !important;
    font-weight: 720 !important;
    letter-spacing: -0.014em !important;
    line-height: 1.35 !important;
}

.content-container h4 {
    margin: 27px 0 10px !important;
    color: #dddde2 !important;
    font-size: 0.97rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.008em !important;
    line-height: 1.45 !important;
}

.content-container p,
.content-container li,
.content-container td {
    color: var(--docs-copy) !important;
    font-size: 0.92rem !important;
    line-height: 1.76 !important;
}

.content-container p { margin: 0 0 17px !important; }
.content-container ul,
.content-container ol { padding-left: 1.28rem !important; }
.content-container li { margin: 0 0 0.43rem !important; }
.content-container strong { color: #dedee3 !important; font-weight: 660 !important; }

.content-container a {
    color: var(--docs-red-bright) !important;
    text-decoration-color: rgba(255, 90, 98, 0.35) !important;
    text-underline-offset: 3px !important;
    transition: color 140ms ease, text-decoration-color 140ms ease !important;
}

.content-container a:hover {
    color: #ff858a !important;
    text-decoration-color: currentColor !important;
}

/* Documentation landing */
.docs-hero {
    margin-bottom: 58px !important;
    padding: 8px 0 48px !important;
}

.docs-hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: -86px;
    left: -130px;
    width: 520px;
    height: 300px;
    pointer-events: none;
    background: radial-gradient(ellipse, rgba(255, 59, 69, 0.085), transparent 68%);
    filter: blur(2px);
}

.docs-hero h1 {
    max-width: 720px;
    margin-bottom: 20px !important;
    font-size: clamp(2.25rem, 5vw, 3.65rem) !important;
    letter-spacing: -0.052em !important;
    line-height: 1.02 !important;
}

.docs-hero .docs-lead {
    max-width: 720px;
    color: #b9bbc3 !important;
    font-size: 1.01rem !important;
    line-height: 1.72 !important;
}

.docs-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 26px;
}

.docs-hero-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--docs-border) !important;
    border-radius: 6px;
    background: var(--docs-surface) !important;
    color: #c7c8ce !important;
    font-size: 0.76rem;
    font-weight: 680;
    text-decoration: none !important;
}

.docs-hero-button.primary {
    border-color: #d82c35 !important;
    background: #d92d36 !important;
    color: #fff !important;
    box-shadow: 0 7px 24px rgba(217, 45, 54, 0.17);
}

.docs-hero-button:hover { border-color: #3c3e46 !important; background: var(--docs-surface-hover) !important; color: #fff !important; }
.docs-hero-button.primary:hover { border-color: var(--docs-red) !important; background: #ed3640 !important; }

.docs-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 22px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--docs-border-soft);
    color: #747782;
    font-size: 0.7rem;
}

.docs-hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.docs-hero-meta span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: #51545e; }

.section-intro {
    max-width: 690px;
    margin: -6px 0 24px !important;
    color: #8f929c !important;
}

/* Retype-like cards */
.card-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
}

.config-card {
    position: relative !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 19px 19px 17px !important;
    overflow: hidden !important;
    border: 1px solid var(--docs-border) !important;
    border-radius: var(--docs-radius) !important;
    background: linear-gradient(145deg, #0f1014, #0c0d10) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset !important;
    transition: border-color 170ms ease, background 170ms ease, transform 170ms ease !important;
}

.config-card:first-child { grid-row: span 2; }
.config-card:hover {
    border-color: #3a3c44 !important;
    background: linear-gradient(145deg, #121319, #0e0f13) !important;
    transform: translateY(-2px) !important;
}

.config-card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 72px;
    height: 72px;
    pointer-events: none;
    background: radial-gradient(circle at 100% 0%, rgba(255, 59, 69, 0.085), transparent 70%);
}

.config-card h4 { margin: 10px 0 8px !important; font-size: 1rem !important; }
.config-card p,
.config-card li { font-size: 0.81rem !important; line-height: 1.62 !important; }
.config-card ul { margin: 14px 0 0 !important; padding: 13px 0 0 !important; border-top: 1px solid var(--docs-border-soft); list-style: none; }
.config-card li { margin: 0 !important; }
.config-card li + li { margin-top: 7px !important; }
.config-card li a { display: block; position: relative; padding-right: 18px; text-decoration: none !important; }
.config-card li a::after { content: "›"; position: absolute; right: 2px; color: #575a64; }

/* Featured official deployment resource */
.official-resource {
    position: relative;
    margin: 24px 0 30px;
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 59, 69, 0.27);
    border-radius: var(--docs-radius);
    background:
        radial-gradient(circle at 100% 0%, rgba(255, 59, 69, 0.12), transparent 42%),
        linear-gradient(145deg, #111216, #0c0d10);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);
}

.official-resource::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 2px;
    background: linear-gradient(transparent, var(--docs-red), transparent);
}

.official-resource-copy { min-width: 0; }
.official-resource-kicker {
    display: block;
    margin-bottom: 8px;
    color: #db7176;
    font: 700 0.59rem/1 "Share Tech Mono", monospace;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.official-resource h3 {
    margin: 0 0 7px !important;
    font-size: 1.12rem !important;
}

.official-resource p {
    max-width: 560px;
    margin: 0 !important;
    color: #92949d !important;
    font-size: 0.8rem !important;
    line-height: 1.6 !important;
}

.official-resource-link {
    flex: 0 0 auto;
    min-height: 39px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #cf2d36;
    border-radius: 5px;
    background: #d62f38;
    color: #fff !important;
    font-size: 0.7rem;
    font-weight: 720;
    text-decoration: none !important;
    box-shadow: 0 8px 24px rgba(214, 47, 56, 0.16);
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.official-resource-link:hover {
    border-color: var(--docs-red-bright);
    background: #e83a43;
    color: #fff !important;
    transform: translateY(-1px);
}

.egg-feature-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
    margin: 18px 0 26px !important;
    padding: 0 !important;
    list-style: none;
}

.egg-feature-list li {
    position: relative;
    margin: 0 !important;
    padding: 9px 11px 9px 28px;
    border: 1px solid var(--docs-border-soft);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.012);
    font-size: 0.78rem !important;
}

.egg-feature-list li::before {
    content: "✓";
    position: absolute;
    left: 11px;
    color: var(--docs-green);
    font-weight: 750;
}

.badge {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 4px 7px !important;
    border: 1px solid rgba(255, 59, 69, 0.25) !important;
    border-radius: 4px !important;
    background: rgba(255, 59, 69, 0.07) !important;
    color: #d76f74 !important;
    font: 700 0.57rem/1 "Share Tech Mono", monospace !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
}

/* Code, notices, steps and tables */
code {
    padding: 0.16em 0.4em !important;
    border: 1px solid #2b2d34 !important;
    border-radius: 4px !important;
    background: #14151a !important;
    color: #e0a4a7 !important;
    font-family: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace !important;
    font-size: 0.82em !important;
    overflow-wrap: anywhere;
}

pre {
    position: relative !important;
    max-width: 100% !important;
    margin: 20px 0 !important;
    padding: 47px 20px 20px !important;
    overflow: auto !important;
    border: 1px solid #292b32 !important;
    border-radius: 7px !important;
    background: #0b0c0f !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.018) inset !important;
    white-space: pre !important;
}

pre::before {
    content: "COMMAND";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 32px;
    padding-left: 12px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #22242a;
    color: #5f626c;
    background: #0f1014;
    font: 700 0.56rem/1 "Share Tech Mono", monospace;
    letter-spacing: 0.09em;
}

pre code {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #c9cbd2 !important;
    font-size: 0.76rem !important;
    line-height: 1.7 !important;
    overflow-wrap: normal !important;
}

.ini-section { color: #f472b6 !important; font-weight: 600 !important; }
.ini-key { color: #38bdf8 !important; }
.ini-value { color: #a3e635 !important; }
.ini-comment { color: #64748b !important; font-style: italic !important; }

.copy-code {
    z-index: 2 !important;
    top: 5px !important;
    right: 6px !important;
    height: 23px !important;
    padding: 0 8px !important;
    border: 1px solid transparent !important;
    border-radius: 4px !important;
    background: transparent !important;
    color: #6e717b !important;
    font-family: "Inter", sans-serif !important;
    font-size: 0.55rem !important;
    font-weight: 750 !important;
    letter-spacing: 0.06em !important;
    opacity: 1 !important;
    transform: none !important;
    box-shadow: none !important;
}

.copy-code:hover { border-color: #33353d !important; background: #16171c !important; color: #d4d5da !important; }
.copy-code.copied { color: var(--docs-green) !important; }

.alert {
    position: relative !important;
    display: block !important;
    margin: 21px 0 !important;
    padding: 15px 17px !important;
    border: 1px solid #2a2c33 !important;
    border-left-width: 3px !important;
    border-radius: 6px !important;
    background: #101115 !important;
    box-shadow: none !important;
    line-height: 1.6 !important;
    color: var(--docs-copy) !important;
}

.alert.info { border-left-color: var(--docs-cyan) !important; background: rgba(56, 189, 248, 0.045) !important; }
.alert.warning { border-left-color: var(--docs-yellow) !important; background: rgba(230, 168, 75, 0.045) !important; }
.alert.danger { border-left-color: var(--docs-red) !important; background: rgba(255, 59, 69, 0.045) !important; }
.alert.success { border-left-color: var(--docs-green) !important; background: rgba(121, 197, 144, 0.045) !important; }

.alert-title {
    color: #e8e8eb !important;
    font-size: 0.82rem !important;
    font-weight: 650 !important;
    line-height: 1.55 !important;
    margin-bottom: 8px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.alert.info .alert-title { color: #8dd8f8 !important; }
.alert.warning .alert-title { color: #e0b36f !important; }
.alert.danger .alert-title { color: #ee9a9e !important; }
.alert.success .alert-title { color: #85d89f !important; }

.alert > strong:first-child {
    font-weight: 700 !important;
}
.alert.info > strong:first-child { color: #8dd8f8 !important; }
.alert.warning > strong:first-child { color: #e0b36f !important; }
.alert.danger > strong:first-child { color: #ee9a9e !important; }
.alert.success > strong:first-child { color: #85d89f !important; }

.alert > strong:first-child:has(+ p),
.alert > strong:first-child:has(+ ul),
.alert > strong:first-child:has(+ ol),
.alert > strong:first-child:has(+ pre) {
    display: block !important;
    margin-bottom: 8px !important;
}

.alert p {
    margin: 0 0 10px !important;
    line-height: 1.6 !important;
}

.alert ul,
.alert ol {
    margin: 8px 0 0 20px !important;
    padding: 0 !important;
}

.alert li {
    margin-bottom: 4px !important;
    line-height: 1.55 !important;
}

.alert p:last-child,
.alert ul:last-child,
.alert ol:last-child,
.alert pre:last-child,
.alert > :last-child {
    margin-bottom: 0 !important;
}

.solution-step {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 31px minmax(0, 1fr) !important;
    gap: 14px !important;
    margin: 21px 0 !important;
    align-items: start !important;
}

.solution-step::before {
    content: "";
    position: absolute;
    top: 31px;
    bottom: -21px;
    left: 15px;
    width: 1px;
    background: var(--docs-border-soft);
}

.solution-step:last-child::before { display: none; }
.solution-step > div:last-child { min-width: 0 !important; }

.step-number {
    width: 31px !important;
    height: 31px !important;
    margin: 1px 0 0 !important;
    border: 1px solid #383a43 !important;
    border-radius: 50% !important;
    background: #15161b !important;
    color: #e2e2e6 !important;
    font: 700 0.72rem/1 "Inter", sans-serif !important;
    box-shadow: 0 0 0 5px var(--docs-canvas) !important;
}

.solution-step h4 { margin-top: 5px !important; }

.config-table {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 21px 0 !important;
    border: 1px solid #292b32 !important;
    border-radius: 7px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    overflow: hidden !important;
    background: #0d0e12 !important;
}

.config-table th,
.config-table td {
    padding: 11px 13px !important;
    border-bottom: 1px solid #23252b !important;
    text-align: left !important;
    vertical-align: top !important;
    font-size: 0.76rem !important;
}

.config-table th {
    background: #121318 !important;
    color: #d8d9de !important;
    font-weight: 680 !important;
}

.config-table tr:last-child td { border-bottom: 0 !important; }
.var-name { color: #ed7b80 !important; }
.var-type { color: #95bd9d !important; }
.var-default { color: #bda7cc !important; }

.heading-anchor {
    position: absolute;
    left: -24px;
    top: 0.08em;
    display: inline-flex;
    width: 20px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #555861;
    font-size: 0.78rem;
    text-decoration: none !important;
    opacity: 0;
    transition: opacity 140ms ease, color 140ms ease;
}

h2:hover > .heading-anchor,
h3:hover > .heading-anchor,
.heading-anchor:focus { opacity: 1; }
.heading-anchor:hover { color: var(--docs-red-bright) !important; }

/* Contextual table of contents */
.docs-toc {
    position: fixed !important;
    z-index: 80 !important;
    inset: var(--docs-header) 0 0 auto !important;
    width: var(--docs-toc) !important;
    height: auto !important;
    padding: 43px 24px 30px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    border: 0 !important;
    border-left: 1px solid var(--docs-border-soft) !important;
    background: rgba(8, 9, 11, 0.9) !important;
}

.docs-toc-title {
    margin: 0 0 12px !important;
    color: #686b75 !important;
    font-family: "Inter", sans-serif !important;
    font-size: 0.62rem !important;
    font-weight: 760 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
}

.docs-toc a {
    display: block !important;
    margin: 0 !important;
    padding: 5px 0 5px 11px !important;
    overflow-wrap: anywhere !important;
    border: 0 !important;
    border-left: 1px solid #2b2d34 !important;
    background: transparent !important;
    color: #7d808a !important;
    font-family: "Inter", sans-serif !important;
    font-size: 0.7rem !important;
    font-weight: 520 !important;
    line-height: 1.48 !important;
    text-decoration: none !important;
    transition: color 140ms ease, border-color 140ms ease !important;
}

.docs-toc a.toc-depth-4 { padding-left: 21px !important; color: #666973 !important; }
.docs-toc a:hover { color: #c2c3c9 !important; border-left-color: #5c5f69 !important; }
.docs-toc a.active { color: #f1f1f3 !important; border-left-color: var(--docs-red) !important; }

.docs-toc-context {
    margin: 17px 0 0;
    padding: 13px 0 0;
    border-top: 1px solid var(--docs-border-soft);
    color: #565963;
    font-size: 0.64rem;
    line-height: 1.55;
}

.docs-footer {
    width: min(100%, 940px) !important;
    max-width: 940px !important;
    margin: 0 auto !important;
    padding: 0 60px 36px !important;
    border: 0 !important;
    color: #62656f !important;
    font-family: "Inter", sans-serif !important;
    font-size: 0.66rem !important;
}

.docs-footer strong,
.docs-footer a { color: #92949d !important; }

.docs-nav-backdrop {
    position: fixed;
    z-index: 90;
    inset: var(--docs-header) 0 0 0;
    display: none;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

@media (max-width: 1220px) {
    body::before { right: 0; }
    .docs-toc { display: none !important; }
    .main-content { margin-right: 0 !important; }
}

@media (max-width: 840px) {
    :root { --docs-sidebar: min(310px, 88vw); }

    body::before { left: 0; }

    .docs-mobile-toggle { display: inline-flex !important; }
    .docs-topbar { padding: 0 14px !important; gap: 11px !important; }
    .docs-topbar-left { margin-right: auto; }
    .docs-topbar-title { max-width: 44vw; overflow: hidden; text-overflow: ellipsis; }
    .docs-topbar-title::after { display: none; }
    .docs-topbar-actions .docs-topbar-link:not(:first-child) { display: none !important; }

    .sidebar {
        transform: translateX(-102%) !important;
        transition: transform 210ms ease !important;
        box-shadow: 18px 0 52px rgba(0, 0, 0, 0.38) !important;
    }

    body.docs-nav-open { overflow: hidden !important; }
    body.docs-nav-open .sidebar { transform: translateX(0) !important; }
    body.docs-nav-open .docs-nav-backdrop { display: block; }
    body.docs-nav-open .docs-mobile-toggle::before {
        width: 15px;
        height: 15px;
        border: 0;
        background:
            linear-gradient(currentColor, currentColor) center / 16px 1.5px no-repeat;
        transform: rotate(45deg);
        box-shadow: 0 0 0 transparent;
    }
    body.docs-nav-open .docs-mobile-toggle::after {
        content: "";
        position: absolute;
        width: 16px;
        height: 1.5px;
        background: currentColor;
        transform: rotate(-45deg);
    }

    .main-content { margin-left: 0 !important; }
    .content-container { padding: 44px 30px 84px !important; }
    .docs-footer { padding: 0 30px 30px !important; }
}

@media (max-width: 620px) {
    .docs-topbar-logo { width: 31px !important; height: 31px !important; }
    .docs-topbar-title { max-width: 50vw; font-size: 0.78rem !important; }
    .docs-topbar-title span { display: none; }
    .docs-topbar-actions .docs-topbar-link { width: 34px !important; padding: 0 !important; font-size: 0 !important; }
    .docs-topbar-actions .docs-topbar-link::after { content: "↗"; margin: 0; font-size: 0.85rem; }
    .docs-topbar-actions .docs-topbar-link:first-child::after { content: "⌂"; font-size: 0.9rem; }

    .content-container { padding: 36px 18px 72px !important; }
    .content-container section { max-width: 100% !important; min-width: 0 !important; margin-bottom: 42px !important; padding-bottom: 42px !important; overflow-x: hidden !important; }
    .docs-hero { padding-top: 3px !important; }
    .docs-hero h1 { font-size: clamp(2rem, 11vw, 2.75rem) !important; }
    .docs-hero .docs-lead { font-size: 0.94rem !important; }
    .docs-hero-button { flex: 1 1 100%; }
    .official-resource { align-items: stretch; flex-direction: column; gap: 17px; padding: 19px; }
    .official-resource-link { width: 100%; }
    .egg-feature-list { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: 1fr !important; }
    .config-card:first-child { grid-row: auto; }
    .config-table { width: 100% !important; max-width: 100% !important; display: block !important; overflow-x: auto !important; }
    .solution-step { grid-template-columns: 28px minmax(0, 1fr) !important; gap: 11px !important; }
    .step-number { width: 28px !important; height: 28px !important; }
    .solution-step::before { left: 13px; }
    .heading-anchor { display: none; }
    pre { width: auto !important; max-width: 100% !important; margin-right: -4px !important; margin-left: -4px !important; padding-right: 14px !important; padding-left: 14px !important; overflow-x: auto !important; }
    .docs-footer { flex-wrap: wrap !important; padding: 0 18px 28px !important; }
}

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