.microlecture-section {
    --microlecture-sidebar-bg: transparent;
    --microlecture-sidebar-fg: #000000;
    margin-top: 0;
}

.microlecture-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
    position: relative;
}

@media (min-width: 901px) {
    .microlecture-layout::before {
        content: "";
        position: absolute;
        top: calc(var(--nav-box-height) + var(--nav-border-bottom-thk) - var(--main-padding-top));
        bottom: 0;
        left: calc(280px + 5px);
        width: 1px;
        background: #000000;
        pointer-events: none;
    }
}

.microlecture-sidebar {
    box-sizing: border-box;
    align-self: stretch;
    margin-top: calc(var(--nav-box-height) + var(--nav-border-bottom-thk) - var(--main-padding-top));
    margin-left: calc(-1 * var(--main-padding-left));
    min-height: 100%;
    padding: var(--box-content-padding);
    background: var(--microlecture-sidebar-bg);
    color: var(--microlecture-sidebar-fg);
}

.microlecture-category-block + .microlecture-category-block {
    margin-top: 4px;
}

.microlecture-category-btn {
    width: 100%;
    display: block;
    text-align: left;
    border: 0;
    padding: 2px 0;
    background: transparent;
    color: var(--microlecture-sidebar-fg);
    cursor: pointer;
    font-size: var(--nav-font-size);
    font-weight: 400;
    line-height: 1.4;
}

.microlecture-category-btn:hover {
    color: var(--microlecture-sidebar-fg);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.microlecture-category-btn.is-open {
    text-decoration: none;
    font-weight: 700;
}

.microlecture-category-code {
    margin-right: 6px;
    white-space: nowrap;
    font-size: var(--nav-font-size);
}

.microlecture-lecture-list {
    display: none;
    margin-left: 2px;
    padding-top: 2px;
    padding-bottom: 0;
}

.microlecture-lecture-list.is-open {
    display: block;
}

.microlecture-lecture-tree {
    list-style: none;
    margin: 0;
    padding: 0 0 0 16px;
    border-left: 1px solid var(--microlecture-sidebar-fg);
}

.microlecture-lecture-item {
    margin: 0;
    padding: 1px 0;
}

.microlecture-lecture-btn {
    width: 100%;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    column-gap: 6px;
    align-items: start;
    text-align: left;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--microlecture-sidebar-fg);
    cursor: pointer;
    font-size: var(--nav-font-size);
    line-height: 1.4;
    font-weight: 400;
}

.microlecture-lecture-btn:hover {
    color: var(--microlecture-sidebar-fg);
    text-decoration: underline;
}

.microlecture-lecture-btn.is-active {
    font-weight: 700;
}

.microlecture-lecture-code {
    font-size: var(--nav-font-size);
    white-space: nowrap;
}

.microlecture-lecture-title {
    min-width: 0;
    font-size: var(--nav-font-size);
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

.microlecture-no-lecture {
    margin: 0;
    padding: 2px 0 2px 16px;
    font-size: var(--nav-font-size);
    line-height: 1.4;
    color: var(--microlecture-sidebar-fg);
}

.microlecture-detail-column {
    border-left: 0;
    padding-left: 10px;
    padding-right: 10px;
    box-sizing: border-box;
    min-height: 320px;
}

.microlecture-home-panel {
    display: none;
}

.microlecture-home-panel.is-active {
    display: block;
}

.microlecture-home-panel h5 {
    margin: 0 0 8px 0;
    font-size: calc(var(--main-font-size) * 1.5);
    font-weight: 700;
    line-height: 1.4;
}

.microlecture-home-panel p {
    margin: 0 0 8px 0;
    font-size: var(--nav-font-size);
    line-height: 1.4;
}

.microlecture-home-table-wrap {
    margin-top: 10px;
    width: calc(100% + var(--main-padding-right) + 10px);
    margin-right: calc(-1 * (var(--main-padding-right) + 10px));
}

.microlecture-home-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--nav-font-size);
    line-height: 1.4;
}

.microlecture-home-table th,
.microlecture-home-table td {
    border-top: 1px solid #000000;
    padding: 4px 8px 4px 0;
    text-align: left;
    vertical-align: top;
    font-size: var(--nav-font-size);
}

/* Category-to-category separators (the three lines in the list) */
.microlecture-home-table tbody tr + tr td {
    border-top: 1px dotted #a0a0a0;
}

.microlecture-home-table th:first-child,
.microlecture-home-table td:first-child {
    width: 36%;
    padding-right: 12px;
}

.microlecture-home-table th {
    font-weight: 700;
}

.microlecture-home-category-line {
    width: 100%;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    column-gap: 6px;
    align-items: start;
    line-height: 1.4;
}

.microlecture-home-category-index {
    display: block;
    font-size: var(--nav-font-size);
    white-space: nowrap;
}

.microlecture-home-category-title {
    display: block;
    min-width: 0;
    font-size: var(--nav-font-size);
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

.microlecture-home-lecture-btn {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    text-align: left;
    cursor: pointer;
    width: 100%;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    column-gap: 6px;
    align-items: start;
    font-size: var(--nav-font-size);
    line-height: 1.4;
}

.microlecture-home-lecture-btn:hover {
    text-decoration: underline;
}

.microlecture-home-lecture-index {
    display: block;
    font-size: var(--nav-font-size);
    white-space: nowrap;
}

.microlecture-home-lecture-title {
    display: block;
    min-width: 0;
    font-size: var(--nav-font-size);
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

.microlecture-panel {
    display: none;
}

.microlecture-panel.is-active {
    display: block;
}

.microlecture-panel h5 {
    margin: 0 0 8px 0;
    font-size: var(--nav-font-size);
    font-weight: 700;
    line-height: 1.4;
}

.microlecture-description-toggle {
    margin: 0 0 8px 0;
}

.microlecture-description-toggle summary {
    display: inline;
    font-size: var(--nav-font-size);
    line-height: 1.4;
    color: #000000;
    cursor: pointer;
    user-select: none;
    list-style: none;
    font-weight: 400;
}

.microlecture-description-toggle summary::-webkit-details-marker {
    display: none;
}

.microlecture-description-label-open {
    display: none;
}

.microlecture-description-label-closed {
    display: inline;
}

.microlecture-description-toggle[open] .microlecture-description-label-open {
    display: inline;
}

.microlecture-description-toggle[open] .microlecture-description-label-closed {
    display: none;
}

.microlecture-description-toggle summary strong {
    font-weight: 700;
}

.microlecture-description-body {
    display: none;
    margin: 8px 0 0 0;
    font-size: var(--nav-font-size);
    line-height: 1.4;
    font-weight: 400;
}

.microlecture-description-toggle[open] .microlecture-description-body {
    display: block;
}

.microlecture-video-area {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0;
    overflow: hidden;
}

.microlecture-video-loading {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 2;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #000000;
    font-size: calc(var(--nav-font-size) * 1.6) !important;
    line-height: 1.3 !important;
    font-weight: 600;
    box-sizing: border-box;
    border: 1px dashed #b8b8b8;
}

.microlecture-video-area.is-loading .microlecture-video-loading {
    display: flex;
}

.microlecture-video-timeout {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 2;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 10px;
    background: #ffffff;
    color: #000000;
    font-size: var(--nav-font-size);
    line-height: 1.4;
    box-sizing: border-box;
    border: 1px dashed #b8b8b8;
}

.microlecture-video-timeout-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.microlecture-video-retry {
    border: 1px solid #000000;
    background: #ffffff;
    color: #000000;
    font-size: var(--nav-font-size);
    line-height: 1.4;
    padding: 2px 8px;
    cursor: pointer;
    font-family: inherit;
}

.microlecture-video-retry:hover,
.microlecture-video-retry:focus-visible {
    text-decoration: underline;
}

.microlecture-video-timeout a {
    color: #000000;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.microlecture-video-area.is-timeout .microlecture-video-timeout {
    display: flex;
}

.microlecture-video-area.is-loading iframe {
    visibility: hidden;
}

.microlecture-video-area.is-timeout iframe {
    visibility: hidden;
}

.microlecture-video-area iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.microlecture-notes-inline {
    margin: 9px 0 10px 0;
    font-size: var(--nav-font-size);
    line-height: 1.4;
}

.microlecture-video-guide {
    margin: 8px 0 6px 0;
    font-size: calc(var(--nav-font-size) * 0.8);
    line-height: 1.4;
    font-style: italic;
}

.microlecture-video-guide a {
    color: #000000;
    text-decoration: none;
    font-size: inherit;
    line-height: inherit;
}

.microlecture-video-guide a:hover,
.microlecture-video-guide a:focus-visible {
    text-decoration: underline;
    font-size: inherit;
}

.microlecture-video-unavailable {
    margin: 8px 0 6px 0;
    font-size: var(--nav-font-size);
    line-height: 1.4;
}

.microlecture-video-unavailable a {
    color: #000000;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.microlecture-notes-inline strong,
.microlecture-notes-inline a {
    font-size: var(--nav-font-size);
}

.microlecture-empty {
    margin: 0;
    padding: 8px 0;
    font-size: var(--nav-font-size);
}

@media (max-width: 900px) {
    .microlecture-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .microlecture-sidebar {
        margin-right: calc(-1 * var(--main-padding-right));
        padding: var(--box-content-padding);
        min-height: auto;
        align-self: auto;
        background: transparent;
        color: #000000;
        border-bottom: 1px solid #000000;
    }

    .microlecture-detail-column {
        border-left: 0;
        border-top: 0;
        padding-left: 10px;
        padding-right: 10px;
        padding-top: 10px;
        min-height: 0;
    }

    .microlecture-lecture-btn {
        grid-template-columns: 34px minmax(0, 1fr);
    }

}

@media (max-width: 650px) {
    .microlecture-home-table th:first-child,
    .microlecture-home-table td:first-child {
        width: 36%;
        padding-right: 12px;
    }

    .microlecture-home-category-line {
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr);
        column-gap: 6px;
        align-items: start;
        min-height: 0;
        text-align: left;
    }

    .microlecture-home-category-index {
        align-self: auto;
        text-align: left;
        white-space: nowrap;
        line-height: 1.4;
    }

    .microlecture-home-category-title {
        writing-mode: horizontal-tb;
        text-orientation: mixed;
        transform: none;
        white-space: normal;
        word-break: normal;
        overflow-wrap: break-word;
        line-height: 1.4;
        text-align: left;
    }
}
