.spo-enc-layout [hidden] {
    display: none !important;
}

.spo-enc-layout-ready {
    --enc-ink: #183e42;
    --enc-accent: #245a63;
    --enc-border: #d1e0dc;
    display: grid;
    grid-template-columns: clamp(225px, 27%, 360px) minmax(0, 1fr);
    gap: clamp(16px, 3vw, 36px);
    align-items: start;
    color: var(--enc-ink);
}

.spo-enc-layout .spo-enc-mobile-bar,
.spo-enc-layout .spo-enc-side-title button {
    display: none;
}

.spo-enc-side {
    --enc-side-top: calc(92px + var(--wp-admin--admin-bar--height, 0px));
    display: flex;
    flex-direction: column;
    position: sticky;
    top: var(--enc-side-top);
    max-height: calc(100vh - var(--enc-side-top) - 12px);
    padding: 14px;
    background: #f4f8f7;
    border: 1px solid var(--enc-border);
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.35;
}

.spo-enc-side-scroll {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.spo-enc-side .spo-enc-side-title h2 {
    margin: 0;
    font-size: 1.04rem;
}

.spo-enc-side-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.spo-enc-side-search {
    margin: 10px 0;
    flex: none;
}

.spo-enc-side .spo-enc-side-search input[type=search] {
    box-sizing: border-box;
    width: 100%;
    height: 38px;
    margin: 0;
    padding: 6px 9px;
    background: #fff;
    border: 1px solid #b4cac5;
    border-radius: 8px;
    color: var(--enc-ink);
    font: inherit;
}

.spo-enc-side .spo-enc-side-search label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    font-size: 12px;
    text-transform: none;
}

.spo-enc-attention-link {
    display: block;
    margin: 0 0 9px;
    font-weight: 700;
    font-size: 13px;
}

.spo-enc-layout .spo-enc-unwritten,
.spo-enc-layout .spo-enc-tree-row a.spo-enc-unwritten,
.spo-enc-attention .spo-enc-unwritten {
    color: #982e31;
}

.spo-enc-unwritten-label {
    display: block;
    line-height: 1.2;
    font-size: 10px;
    font-weight: 600;
}

.spo-enc-side [data-enc-results] .spo-enc-search-snippet {
    color: #273f40;
    margin-bottom: 7px;
}

.spo-enc-related {
    margin-top: 24px;
    padding: 16px 20px;
    background: #f1f7f7;
    border: 1px solid #d1e0dc;
    border-radius: 12px;
}

.spo-enc-related h2 { margin: 0 0 12px; font-size: 1.25rem; }
.spo-enc-related h3 { margin: 12px 0 6px; font-size: 1rem; }
.spo-enc-related ul { margin-block: 0; }
.spo-enc-related li { margin-bottom: 5px; }
.spo-enc-related-images { display: grid; gap: 9px; grid-template-columns: repeat(auto-fit,minmax(min(100%,125px),1fr)); }
.spo-enc-related-images img { display: block; width: 100%; height: 105px; object-fit: contain; border-radius: 7px; background: #e3eeee; }
.spo-enc-related-images span { display: block; font-size: .83rem; line-height: 1.3; }

.spo-attention-filters { display: flex; flex-wrap: wrap; gap: 12px; }
.spo-attention-filters label { flex: 1 1 230px; text-transform: none; }
.spo-attention-filters select, .spo-attention-filters input { display: block; width: 100%; max-width: 100%; }
.spo-enc-attention > ul { padding: 0; list-style: none; }
.spo-enc-attention > ul > li { padding: 11px; margin: 0 0 8px; border: 1px solid #d1e0dc; border-radius: 9px; }
.spo-enc-attention > ul > li > a { font-weight: 700; }
.spo-enc-attention > ul > li > small { display: block; color: #46635f; }
.spo-attention-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.spo-attention-tags span { padding: 3px 7px; color: #245a63; background: #edf5f4; border-radius: 6px; font-size: .75rem; }

.spo-enc-layout .spo-enc-side ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

.spo-enc-layout .spo-enc-side li {
    margin: 0;
    padding: 0;
    font-size: inherit;
    line-height: inherit;
}

.spo-enc-layout .spo-enc-side ul ul {
    margin-inline-start: 12px;
    border-inline-start: 1px solid var(--enc-border);
}

.spo-enc-tree-row {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    align-items: stretch;
}

.spo-enc-tree-row button,
.spo-enc-tree-dot {
    display: grid;
    place-items: center;
    color: var(--enc-accent);
    min-width: 0;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    font: 700 19px/1 system-ui, sans-serif;
}

.spo-enc-tree-row button[aria-expanded="true"] {
    transform: rotate(90deg);
}

.spo-enc-tree-row a,
.spo-enc-side [data-enc-results] a {
    display: block;
    padding: 6px 7px;
    border-radius: 6px;
    line-height: 1.35;
    color: var(--enc-ink);
    text-decoration: none;
    overflow-wrap: anywhere;
    font-size: 14px;
}

.spo-enc-tree-row a[aria-current],
.spo-enc-tree-row a:hover,
.spo-enc-side [data-enc-results] a:hover {
    background: #dceceb;
    color: #123e45;
}

.spo-enc-tree-row a[aria-current] {
    font-weight: 700;
}

.spo-enc-side [data-enc-results] small,
.spo-enc-side [data-enc-search-status] {
    display: block;
    padding: 0 7px 7px;
    margin: 0;
    color: #4a6665;
}

.spo-enc-layout-path {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 8px;
    margin: 0 0 12px;
    color: #46635f;
    font-size: .82rem;
    line-height: 1.4;
}

.spo-enc-layout-main {
    min-width: 0;
}

.spo-enc-pane {
    border-top: 3px solid var(--spo-enc-strata, #4c8389);
    padding-top: 16px;
    overflow-wrap: anywhere;
    scroll-margin-top: 128px;
}

.entry-header:has(+ .entry-content .spo-enc-preview-active) .entry-title {
    display: none;
}

.spo-enc-pane h1 {
    margin: 0 0 12px;
    font-size: clamp(1.4rem, 3.5vw, 2.1rem);
    line-height: 1.15;
}

.spo-enc-pane-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 14px;
    margin-bottom: 16px;
}

.spo-enc-full-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border: 1px solid #b4cac5;
    border-radius: 8px;
    color: #245a63;
    background: #edf5f4;
    font-weight: 700;
    font-size: .83rem;
}

.spo-enc-full-link::after {
    content: '↗';
}

.spo-enc-full-view #content #main.site-main {
    width: 100%;
    max-width: none;
}

#content .spo-enc-content .spo-enc-prose {
    text-align: justify !important;
    text-indent: 1.5em !important;
    hyphens: auto;
    overflow-wrap: anywhere;
}

.spo-enc-section-actions {
    font-size: .82rem;
}

.spo-enc-section-actions summary {
    cursor: pointer;
}

.spo-enc-section-actions a {
    display: inline-block;
    margin: 7px 8px 0 0;
    padding: 5px 8px;
    border: 1px solid var(--enc-border);
    border-radius: 6px;
    background: #fff;
}

@media (max-width: 820px) {
    .spo-enc-layout-ready {
        display: block;
    }

    .spo-enc-layout .spo-enc-mobile-bar {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin: 0 0 12px;
    }

    .spo-enc-layout .spo-enc-mobile-bar button,
    .spo-enc-layout .spo-enc-side-title button {
        display: inline-block;
        min-height: 40px;
        padding: 6px 10px;
        margin: 0;
        font: 600 .85rem/1.2 system-ui, sans-serif;
        color: var(--enc-ink);
        background: #edf5f4;
        border: 1px solid var(--enc-border);
        border-radius: 8px;
    }

    .spo-enc-layout .spo-enc-side {
        display: none;
        position: static;
        max-height: min(62vh, 460px);
        margin-bottom: 12px;
    }

    .spo-enc-panel-open .spo-enc-side {
        display: flex;
    }

    .spo-enc-tree-row a,
    .spo-enc-side [data-enc-results] a {
        padding-block: 10px;
    }

    .spo-enc-side .spo-enc-side-search input[type=search] {
        font-size: 16px;
    }
}

