.newstok-contents {
    position: fixed;
    z-index: 200;
    inset: 50% auto auto var(--newstok-toc-left);
    transform: translateY(-50%);
    width: var(--newstok-toc-width);
    max-height: max(0px, calc(100dvh - 2 * max(var(--newstok-toc-top), 16px)));
    overflow: auto;
    touch-action: pan-y;
    scrollbar-width: thin;
    overscroll-behavior: contain;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--base-border-color, #ddd);
    border-radius: 8px;
    background: var(--newstok-toc-bg, #fff);
    color: var(--newstok-toc-color, #2c2f34);
    box-shadow: 0 2px 12px #0002;
    font-size: 14px;
    line-height: 1.35;
}

.newstok-contents[hidden] { display: none; }

.newstok-contents-compact {
    inset: auto auto max(14px, env(safe-area-inset-bottom)) 14px;
    transform: none;
    width: max-content;
    max-width: min(340px, calc(100vw - 28px));
    max-height: min(55vh, calc(100vh - var(--newstok-toc-top) - 16px));
}

.newstok-contents summary { cursor: pointer; font-weight: 700; }
.newstok-contents .newstok-contents-title { margin: 8px 0; padding: 0; font-weight: 600; color: #e59544; }
.newstok-contents ol { margin: 8px 0 0; padding: 0; list-style: none; }
.newstok-contents .newstok-contents-subheading { margin-inline-start: 12px; }

.newstok-contents button {
    display: block;
    width: 100%;
    border: 0;
    padding: 5px 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 400;
    text-align: start;
    text-transform: none;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.newstok-contents button[aria-current='location'] { color: #e59544; }

.newstok-contents button:hover,
.newstok-contents button:focus-visible { text-decoration: underline; }

.dark-skin .newstok-contents,
.dark-theme .newstok-contents {
    --newstok-toc-bg: #202124;
    --newstok-toc-color: #f1f1f1;
    --base-border-color: #53565a;
}


