.toc01-box {
    box-sizing: border-box;
    width: 100%;
    margin: 0 0 1.5rem;
    padding: 1rem 1.1rem;
    border: 1px solid #d7dbe0;
    border-radius: 8px;
    background: #ffffff;
    color: #202124;
    line-height: 1.65;
}

.toc01-box .toc01-title {
    margin: 0 0 .65rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #202124;
}

.toc01-box .toc01-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc01-box .toc01-list .toc01-list {
    margin-top: .25rem;
    padding-left: 1.15rem;
}

.toc01-box .toc01-item {
    margin: .2rem 0;
    padding: 0;
}

.toc01-box .toc01-link {
    display: inline-flex;
    gap: .45em;
    align-items: baseline;
    color: #0b57d0;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.toc01-box .toc01-link:hover,
.toc01-box .toc01-link:focus {
    color: #073b8c;
    text-decoration: underline;
}

.toc01-box .toc01-link:focus-visible {
    outline: 2px solid #0b57d0;
    outline-offset: 3px;
}

.toc01-box .toc01-number {
    flex: 0 0 auto;
    min-width: 1.7em;
    color: #5f6368;
    font-variant-numeric: tabular-nums;
}

.toc01-box .toc01-text {
    color: inherit;
}

/* ヘッダー最下部配置。JSでheader直後へ移動するまでフッター側では非表示。 */
.toc01-header-wrap {
    box-sizing: border-box;
    display: none;
    width: 100%;
    padding: 1rem 16px 0;
}

.toc01-header-wrap.toc01-header-ready {
    display: flex;
}

.toc01-header-wrap .toc01-box {
    width: min(100%, 720px);
    margin-bottom: 1.5rem;
}

.toc01-header-wrap.toc01-align-left {
    justify-content: flex-start;
}

.toc01-header-wrap.toc01-align-center {
    justify-content: center;
}

.toc01-header-wrap.toc01-align-right {
    justify-content: flex-end;
}

/* ウインドウ左右端の固定目次 */
.toc01-fixed-wrap {
    position: fixed;
    top: 120px;
    z-index: 9998;
    display: flex;
    align-items: flex-start;
    max-width: calc(100vw - 48px);
    color: #202124;
    font-size: 14px;
}

.toc01-fixed-wrap.toc01-fixed-left {
    left: 0;
    flex-direction: row-reverse;
}

.toc01-fixed-wrap.toc01-fixed-right {
    right: 0;
    flex-direction: row;
}

.toc01-fixed-panel {
    box-sizing: border-box;
    width: 320px;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #ffffff;
    border: 1px solid #c7cdd4;
    box-shadow: 0 6px 24px rgba(32, 33, 36, .18);
}

.toc01-fixed-left .toc01-fixed-panel {
    border-left: 0;
    border-radius: 0 8px 8px 0;
}

.toc01-fixed-right .toc01-fixed-panel {
    border-right: 0;
    border-radius: 8px 0 0 8px;
}

.toc01-fixed-panel .toc01-box {
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.toc01-fixed-toggle {
    box-sizing: border-box;
    min-width: 42px;
    min-height: 42px;
    padding: 8px 9px;
    border: 1px solid #0b57d0;
    background: #0b57d0;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.toc01-fixed-left .toc01-fixed-toggle {
    border-left: 0;
    border-radius: 0 8px 8px 0;
}

.toc01-fixed-right .toc01-fixed-toggle {
    border-right: 0;
    border-radius: 8px 0 0 8px;
}

.toc01-fixed-toggle:hover,
.toc01-fixed-toggle:focus {
    background: #073b8c;
    border-color: #073b8c;
    color: #ffffff;
}

.toc01-fixed-toggle:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: -5px;
}

.toc01-toggle-closed-label,
.toc01-toggle-mobile-label {
    display: none;
}

.toc01-fixed-wrap.is-closed .toc01-fixed-panel {
    display: none;
}

.toc01-fixed-wrap.is-closed .toc01-toggle-open-label {
    display: none;
}

.toc01-fixed-wrap.is-closed .toc01-toggle-closed-label {
    display: inline;
}

/* スマホでは固定サイド目次を小型ボタン＋下部パネルに切り替える。 */
@media (max-width: 782px) {
    .toc01-fixed-wrap {
        display: flex;
        top: auto !important;
        bottom: 16px;
        max-width: none;
        align-items: flex-end;
        z-index: 9999;
    }

    .toc01-fixed-wrap.toc01-fixed-left {
        left: 16px;
        right: auto;
        flex-direction: row;
    }

    .toc01-fixed-wrap.toc01-fixed-right {
        right: 16px;
        left: auto;
        flex-direction: row;
    }

    .toc01-fixed-panel {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 72px;
        width: auto !important;
        max-width: none;
        max-height: min(68vh, 560px);
        border-width: 1px !important;
        border-style: solid !important;
        border-radius: 12px !important;
        box-shadow: 0 8px 28px rgba(32, 33, 36, .24);
    }

    .toc01-fixed-panel .toc01-box {
        max-width: none !important;
    }

    .toc01-fixed-toggle {
        min-width: 72px;
        min-height: 44px;
        padding: 9px 16px;
        border-width: 1px !important;
        border-style: solid !important;
        border-radius: 999px !important;
        writing-mode: horizontal-tb;
        text-orientation: mixed;
        box-shadow: 0 4px 16px rgba(32, 33, 36, .22);
    }

    .toc01-toggle-open-label,
    .toc01-toggle-closed-label {
        display: none !important;
    }

    .toc01-toggle-mobile-label,
    .toc01-fixed-wrap.is-closed .toc01-toggle-mobile-label {
        display: inline;
    }
}

/* 現在読んでいる見出しを目次内で強調する。 */
.toc01-box .toc01-link.is-active {
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: .18em;
}

.toc01-box .toc01-item.is-active > .toc01-link {
    padding-inline-start: .45rem;
    border-inline-start: 3px solid currentColor;
}

.toc01-box .toc01-item.is-active-parent > .toc01-link {
    font-weight: 600;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: .18em;
}
