.page-content--guide {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 1.5rem 1rem 3rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Self-contained card surface — do not rely on base.css .content-card being deployed. */
.page-content--guide .guide-chapter-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    text-align: left;
    padding: 1.35rem 1.75rem 2rem;
    background: linear-gradient(
        180deg,
        var(--lyutils-card-fill-top) 0%,
        var(--lyutils-card-fill-bottom) 100%
    );
    border: 1px solid var(--lyutils-card-border);
    border-radius: 0.75rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.page-content--guide .guide-toc__card {
    padding: 1.25rem 1.1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.guide-layout {
    width: min(100%, 1080px);
    max-width: 100%;
    min-width: 0;
    margin: 0 auto;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "lang"
        "toc"
        "main";
    box-sizing: border-box;
}

.guide-layout > .guide-lang-switch-wrap {
    grid-area: lang;
}

.guide-layout > .guide-toc {
    grid-area: toc;
}

.guide-layout > .guide-main {
    grid-area: main;
}

@media (min-width: 960px) {
    .guide-layout {
        grid-template-columns: 220px minmax(0, 1fr);
        grid-template-rows: auto auto;
        grid-template-areas:
            ". lang"
            "toc main";
        row-gap: 0.85rem;
        column-gap: 1.5rem;
        align-items: start;
    }
}

.guide-toc {
    position: sticky;
    top: 1rem;
}

/* content-card is left-aligned; only section titles stay centered. */
.page-content--guide .guide-chapter-card > .guide-chapter__title,
.page-content--guide .guide-hero > .guide-hero__eyebrow,
.page-content--guide .guide-hero > h1 {
    text-align: center;
}

.page-content--guide .guide-chapter-card p,
.page-content--guide .guide-chapter-card .guide-chapter__lead,
.page-content--guide .guide-chapter-card ul,
.page-content--guide .guide-chapter-card ol,
.page-content--guide .guide-chapter-card li,
.page-content--guide .guide-chapter-card h3,
.page-content--guide .guide-chapter-card h4,
.page-content--guide .guide-chapter-card .guide-callout,
.page-content--guide .guide-chapter-card .guide-callout p,
.page-content--guide .guide-chapter-card .guide-steps,
.page-content--guide .guide-chapter-card .guide-steps li,
.page-content--guide .guide-chapter-card .guide-steps li > div,
.page-content--guide .guide-chapter-card .guide-page-card,
.page-content--guide .guide-chapter-card .guide-page-card p,
.page-content--guide .guide-chapter-card table,
.page-content--guide .guide-chapter-card th,
.page-content--guide .guide-chapter-card td {
    text-align: left;
}

.guide-toc__title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8b93b8;
    margin-bottom: 0.75rem;
}

.guide-toc__list,
.guide-toc__sublist {
    list-style: none;
    display: grid;
    gap: 0.35rem;
    text-align: left;
}

.guide-toc__sublist {
    margin-top: 0.35rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.guide-toc__link {
    color: #b8c0e0;
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.4;
    display: block;
    padding: 0.15rem 0;
    transition: color 0.15s ease;
}

.guide-toc__link:hover {
    color: #fff;
}

.guide-toc__link--patreon {
    color: #e8c56a;
    font-weight: 600;
}

.guide-toc__link--patreon:hover {
    color: #f5d98a;
}

.guide-main {
    display: grid;
    gap: 1.25rem;
    min-width: 0;
    max-width: 100%;
}

.guide-chapter {
    scroll-margin-top: 1rem;
}

.guide-chapter__title {
    font-size: 1.45rem;
    margin-top: 0;
    margin-bottom: 1.15rem;
    line-height: 1.25;
}

.page-content--guide .guide-chapter--patreon {
    border-color: rgba(212, 175, 55, 0.45);
    background:
        linear-gradient(165deg, rgba(212, 175, 55, 0.12) 0%, rgba(255, 255, 255, 0.04) 42%, rgba(255, 255, 255, 0.05) 100%);
    box-shadow:
        0 10px 32px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(232, 197, 106, 0.12),
        inset 0 1px 0 rgba(245, 217, 138, 0.18);
}

.page-content--guide .guide-chapter--patreon > .guide-chapter__title {
    color: #f0d78c;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.page-content--guide .guide-chapter--patreon h4 {
    color: #e8c56a;
}

.page-content--guide .guide-chapter--patreon .guide-inline-link {
    color: #f5d98a;
}

.page-content--guide .guide-chapter--patreon .guide-steps__num {
    background: linear-gradient(135deg, #f0d78c, #c9a227);
    color: #2a2108;
}

.guide-chapter__lead {
    color: #9aa3c4;
    line-height: 1.55;
    margin-bottom: 0;
    text-align: left;
}

.guide-chapter__lead:last-child {
    margin-bottom: 0;
}

.guide-hero {
    padding: 2.25rem 2rem;
}

.guide-hero__eyebrow {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7ec8ff;
    margin-bottom: 0.5rem;
}

.guide-hero h1 {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.guide-hero__lead {
    color: #b0b8d8;
    line-height: 1.6;
}

.guide-chapter h3 {
    font-size: 1.05rem;
    margin: 0 0 0.5rem;
    color: #f0f2ff;
    text-align: left;
}

.guide-chapter p,
.guide-chapter li {
    color: #c4cbe4;
    line-height: 1.65;
    text-align: left;
}

.guide-chapter p {
    margin-bottom: 0.75rem;
}

.guide-chapter p:last-child {
    margin-bottom: 0;
}

.guide-chapter ul,
.guide-chapter ol:not(.guide-steps) {
    margin: 0.5rem 0 0.85rem 1.25rem;
    padding-left: 1.1rem;
    text-align: left;
}

.guide-chapter ul {
    list-style: disc;
}

.guide-chapter ol:not(.guide-steps) {
    list-style: decimal;
}

.guide-chapter li + li {
    margin-top: 0.35rem;
}

.guide-chapter h4 {
    font-size: 0.95rem;
    margin: 1.25rem 0 0.4rem;
    color: #dce2ff;
    text-align: left;
}

.guide-chapter h4:first-of-type {
    margin-top: 0.5rem;
}

.guide-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    margin: 1.75rem 0;
}

.guide-steps {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.85rem;
}

.guide-steps li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.85rem;
    align-items: start;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
}

.guide-steps li > div {
    text-align: left;
}

.guide-steps__num {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #16213e;
    background: linear-gradient(135deg, #7ec8ff, #5a9fd4);
    flex-shrink: 0;
}

.guide-callout {
    margin: 1rem 0;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(126, 200, 255, 0.25);
    background: rgba(126, 200, 255, 0.08);
}

.guide-callout--tip {
    border-color: rgba(120, 220, 160, 0.28);
    background: rgba(120, 220, 160, 0.08);
}

.guide-callout--warn {
    border-color: rgba(255, 200, 120, 0.28);
    background: rgba(255, 200, 120, 0.08);
}

.guide-callout__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
    color: #9ed8ff;
}

.guide-callout--tip .guide-callout__label {
    color: #9ee8b8;
}

.guide-callout--warn .guide-callout__label {
    color: #ffd89a;
}

.guide-callout p {
    margin: 0;
    color: #d8e0f8;
}

.guide-page-grid {
    display: grid;
    gap: 0.85rem;
    margin-top: 0.75rem;
}

@media (min-width: 640px) {
    .guide-page-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.guide-page-card {
    padding: 1rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.guide-page-card h4 {
    margin-top: 0;
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.guide-page-card p {
    margin: 0;
    font-size: 0.92rem;
}

.guide-table-wrap {
    overflow-x: auto;
    max-width: 100%;
    min-width: 0;
    margin: 0.85rem 0 0.25rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    -webkit-overflow-scrolling: touch;
}

.guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.guide-table th,
.guide-table td {
    padding: 0.7rem 0.85rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.guide-table th {
    background: rgba(0, 0, 0, 0.22);
    color: #e8ecff;
    font-weight: 600;
    white-space: nowrap;
}

.guide-table tr:last-child td {
    border-bottom: none;
}

.guide-table code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.88em;
    color: #9ed8ff;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.guide-inline-link {
    color: #7ec8ff;
    text-decoration: none;
}

.guide-inline-link:hover {
    text-decoration: underline;
}

.guide-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(126, 200, 255, 0.15);
    color: #9ed8ff;
    vertical-align: middle;
    margin-left: 0.35rem;
}

.guide-badge--discord {
    background: rgba(114, 137, 218, 0.2);
    color: #c8d4ff;
}

.guide-lang-switch-wrap {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin: 0;
}

.guide-lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.15rem;
    border-radius: 999px;
    background: rgba(12, 16, 28, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@media (max-width: 640px) {
    .page-content--guide {
        padding: 0.85rem 0.75rem 1.5rem;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        align-items: stretch;
        overflow-x: hidden;
    }

    .guide-layout {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: 0.85rem;
    }

    .guide-layout > .guide-lang-switch-wrap,
    .guide-layout > .guide-toc,
    .guide-layout > .guide-main {
        min-width: 0;
        max-width: 100%;
    }

    .guide-lang-switch-wrap {
        justify-content: center;
    }

    .guide-lang-switch {
        min-height: 2.5rem;
        padding: 0.2rem;
    }

    .guide-lang-switch__btn {
        min-width: 2.5rem;
        min-height: 2.1rem;
        padding: 0.35rem 0.7rem;
        font-size: 0.78rem;
        box-sizing: border-box;
    }

    .guide-toc {
        position: static;
        top: auto;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .page-content--guide .guide-toc__card {
        width: 100%;
        max-width: 100%;
        max-height: min(42vh, 18rem);
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 0.9rem 0.85rem 1rem;
        border-radius: 12px;
        border-color: rgba(42, 138, 170, 0.65);
        box-sizing: border-box;
    }

    .guide-toc__title {
        margin-bottom: 0.55rem;
        font-size: 0.7rem;
    }

    .guide-toc__list,
    .guide-toc__sublist {
        gap: 0.2rem;
        min-width: 0;
    }

    .guide-toc__sublist {
        margin-top: 0.25rem;
        padding-left: 0.65rem;
    }

    .guide-toc__link {
        font-size: 0.88rem;
        line-height: 1.35;
        padding: 0.35rem 0.15rem;
        min-height: 2.25rem;
        display: flex;
        align-items: center;
        box-sizing: border-box;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .guide-main {
        gap: 0.75rem;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .page-content--guide .guide-chapter-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 1.05rem 0.95rem 1.15rem;
        border-radius: 12px;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .guide-hero {
        padding: 1.15rem 0.95rem 1.25rem;
    }

    .guide-hero__eyebrow {
        font-size: 0.72rem;
        margin-bottom: 0.35rem;
    }

    .guide-hero h1 {
        font-size: 1.35rem;
        line-height: 1.25;
        margin-bottom: 0.55rem;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .guide-hero__lead {
        font-size: 0.92rem;
        line-height: 1.5;
        margin: 0;
    }

    .guide-chapter {
        scroll-margin-top: 0.75rem;
    }

    .guide-chapter__title {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
        line-height: 1.3;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .guide-chapter__lead {
        font-size: 0.92rem;
        line-height: 1.5;
    }

    .guide-chapter h3 {
        font-size: 1rem;
    }

    .guide-chapter h4 {
        font-size: 0.9rem;
        margin: 1rem 0 0.35rem;
    }

    .guide-chapter p,
    .guide-chapter li {
        font-size: 0.92rem;
        line-height: 1.55;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .guide-chapter ul,
    .guide-chapter ol:not(.guide-steps) {
        margin: 0.4rem 0 0.7rem 0.85rem;
        padding-left: 0.85rem;
        max-width: 100%;
        box-sizing: border-box;
    }

    .guide-steps {
        gap: 0.55rem;
        margin-top: 0.75rem;
        max-width: 100%;
    }

    .guide-steps li {
        gap: 0.65rem;
        padding: 0.75rem 0.8rem;
        border-radius: 0.55rem;
        max-width: 100%;
        box-sizing: border-box;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .guide-steps__num {
        width: 1.6rem;
        height: 1.6rem;
        font-size: 0.8rem;
    }

    .guide-callout {
        margin: 0.75rem 0;
        padding: 0.75rem 0.8rem;
        border-radius: 0.55rem;
        max-width: 100%;
        box-sizing: border-box;
    }

    .guide-callout__label {
        font-size: 0.7rem;
        margin-bottom: 0.25rem;
    }

    .guide-callout p {
        font-size: 0.9rem;
        line-height: 1.45;
    }

    .guide-page-grid {
        gap: 0.65rem;
        margin-top: 0.55rem;
        max-width: 100%;
        min-width: 0;
    }

    .guide-page-card {
        padding: 0.85rem 0.8rem;
        border-radius: 0.55rem;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .guide-page-card h4 {
        font-size: 0.95rem;
    }

    .guide-page-card p {
        font-size: 0.88rem;
        line-height: 1.45;
    }

    .guide-table-wrap {
        margin: 0.65rem 0 0.15rem;
        border-radius: 0.55rem;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    .guide-table {
        font-size: 0.84rem;
        width: max-content;
        max-width: none;
        min-width: 100%;
    }

    .guide-table th,
    .guide-table td {
        padding: 0.55rem 0.65rem;
    }

    .guide-divider {
        margin: 1.1rem 0;
    }

    .guide-badge {
        font-size: 0.68rem;
        margin-left: 0.25rem;
        white-space: normal;
    }
}

.guide-lang-switch__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-decoration: none;
    color: #b8bfd6;
    line-height: 1;
    transition: color 0.15s ease, background 0.15s ease;
}

.guide-lang-switch__btn:hover {
    color: #eef1ff;
    background: rgba(255, 255, 255, 0.06);
}

.guide-lang-switch__btn--active {
    color: #f2f2f5;
    background: rgba(88, 101, 242, 0.55);
    box-shadow: inset 0 0 0 1px rgba(120, 150, 255, 0.35);
}

.guide-lang-switch__btn--active:hover {
    color: #ffffff;
    background: rgba(88, 101, 242, 0.65);
}
