.em-body .em-page-wrap {
    background: #f7f7f8;
}
.em-page {
    --em-ink: #1d1b20;
    --em-muted: #5c5666;
    --em-line: rgba(29, 27, 32, 0.1);
    --em-card: #fff;
    --em-pred: #2563eb;
    --em-type: color-mix(in srgb, var(--gs-brand) 18%, #fff);
    color: var(--em-ink);
    background: #fff;
}
.em-hero {
    padding: 48px 24px 32px;
    border-bottom: 1px solid var(--em-line);
    background: #fff;
}
.em-hero__inner {
    width: min(1080px, 100%);
    margin: 0 auto;
}
.em-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    letter-spacing: -0.03em;
}
.em-hero > .em-hero__inner > p:not(.em-hero__meta) {
    margin: 0 0 16px;
    max-width: 62ch;
    color: var(--em-muted);
    font-size: 16px;
    line-height: 1.55;
}
.em-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 0;
    color: var(--em-muted);
    font-size: 14px;
}
.em-hero__meta a {
    color: var(--em-pred);
    font-weight: 600;
    text-decoration: none;
}
.em-hero__meta a:hover { text-decoration: underline; }
.em-layout {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 32px 24px 80px;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}
.em-toc {
    --em-scroll-bg: transparent;
    --em-scroll-border: rgba(29, 27, 32, 0.18);
    --em-scroll-thumb: var(--gs-muted, #a7a7a7);
    --em-scroll-thumb-hover: var(--gs-brand-soft, var(--gs-brand));
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-right: 0;
}
.em-toc__label {
    margin: 0 0 12px;
    color: var(--em-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    flex-shrink: 0;
}
.em-toc__viewport {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-right: 10px;
    /* Dashboard menu scroller — hide native, use .em-scroll-track */
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
.em-toc__viewport::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}
.em-toc__viewport::-webkit-scrollbar-button {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}
.em-scroll-track {
    position: absolute;
    top: 28px;
    right: 0;
    bottom: 0;
    width: 2px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: var(--em-scroll-bg);
    box-shadow: inset 0 0 5px var(--em-scroll-border);
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
    display: flex;
    touch-action: none;
    user-select: none;
    z-index: 2;
}
@supports (color: color-mix(in lab, red, red)) {
    .em-scroll-track {
        box-shadow: inset 0 0 5px color-mix(in srgb, var(--em-scroll-border) 65%, transparent);
    }
}
.em-toc.is-scrollable .em-scroll-track {
    opacity: 1;
    pointer-events: auto;
}
.em-toc.em-scrolling .em-scroll-track {
    opacity: 1;
}
.em-scroll-thumb {
    width: 2px;
    position: relative;
    flex: none;
    border-radius: 10px;
    background: var(--em-scroll-thumb);
}
.em-scroll-thumb:hover {
    background: var(--em-scroll-thumb-hover);
}
.em-toc__list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.em-toc__list a {
    display: block;
    padding: 6px 0;
    color: var(--em-ink);
    font-size: 13px;
    line-height: 1.35;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}
.em-toc__list a:hover {
    color: var(--gs-brand);
}
.em-entities {
    display: flex;
    flex-direction: column;
    gap: 40px;
}
.em-entity {
    scroll-margin-top: 120px;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--em-line);
}
.em-entity:last-child { border-bottom: 0; }
.em-entity__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin-bottom: 10px;
}
.em-entity__head h2 {
    margin: 0;
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 700;
    letter-spacing: -0.03em;
}
.em-entity__type {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 8px;
    background: var(--em-type);
    color: var(--gs-hover);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
}
.em-entity__desc {
    margin: 0 0 10px;
    color: var(--em-muted);
    font-size: 15px;
    line-height: 1.55;
    max-width: 70ch;
}
.em-entity__url {
    margin: 0 0 16px;
    font-size: 13px;
}
.em-entity__url a {
    color: var(--em-pred);
    word-break: break-all;
}
.em-rels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}
.em-rel {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid var(--em-line);
    background: #f4f5f7;
    color: inherit;
    text-decoration: none;
    font-size: 13px;
}
.em-rel:hover {
    border-color: color-mix(in srgb, var(--gs-brand) 40%, transparent);
    background: color-mix(in srgb, var(--gs-brand) 8%, #fff);
}
.em-rel__pred {
    color: var(--em-pred);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.04em;
}
.em-rel__name { font-weight: 600; }
.em-chunks {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.em-chunk {
    margin: 0;
    padding: 16px 18px;
    border-radius: 14px;
    background: #f4f5f7;
    border: 1px solid var(--em-line);
}
.em-chunk p {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--em-ink);
}
.em-chunk footer {
    color: var(--em-muted);
    font-size: 12px;
    line-height: 1.4;
}
.em-chunk footer a {
    color: var(--em-pred);
    font-weight: 600;
    text-decoration: none;
}
.em-chunk footer a:hover { text-decoration: underline; }
@media (max-width: 900px) {
    .em-layout { grid-template-columns: 1fr; }
    .em-toc {
        position: static;
        max-height: none;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--em-line);
    }
    .em-toc__viewport {
        overflow: visible;
        padding-right: 0;
    }
    .em-scroll-track { display: none !important; }
    .em-toc__list {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 14px;
    }
}
html.ld-theme-dark .em-toc {
    --em-scroll-border: rgba(191, 171, 159, 0.28);
    --em-scroll-thumb: var(--gs-muted, #a7a7a7);
    --em-scroll-thumb-hover: var(--gs-brand-soft, #bfab9f);
}
html.ld-theme-light .em-page {
    --em-ink: #1d1b20;
    --em-muted: #5c5666;
}
