html[data-sidebar-style="glass"] #sidebar {
    --sidebar-glass-base: #f2efe5;
    --sidebar-glass-wash: 247, 246, 236;
    --sidebar-glass-row: 255, 255, 249;
    --sidebar-glass-wash-soft: 0.63;
    --sidebar-glass-wash-strong: 0.76;
    --sidebar-glass-sun-opacity: 1;
    --sidebar-glass-text: #263a30;
    --sidebar-glass-heading: #1f3026;
    --sidebar-glass-line: rgba(89, 100, 66, 0.2);
    --sidebar-glass-edge: rgba(255, 255, 255, 0.74);
    --sidebar-glass-active: 255, 230, 194;
    --sidebar-glass-active-text: #65410f;
    --sidebar-glass-accent: #ad681b;
    --sidebar-glass-shadow: rgba(65, 61, 36, 0.12);
    isolation: isolate;
    overflow: hidden;
    background: var(--sidebar-glass-base);
    border-right-color: var(--sidebar-glass-line);
    box-shadow: inset -1px 0 0 var(--sidebar-glass-edge), 8px 0 30px var(--sidebar-glass-shadow);
}

html[data-sidebar-style="glass"][data-nav-color="grey"] #sidebar {
    --sidebar-glass-base: #e9eeeb;
    --sidebar-glass-wash: 236, 241, 239;
    --sidebar-glass-row: 249, 252, 250;
    --sidebar-glass-text: #2f3e40;
    --sidebar-glass-heading: #1f3026;
    --sidebar-glass-line: rgba(73, 92, 86, 0.2);
}

html[data-sidebar-style="glass"][data-layout-mode="dark_mode"] #sidebar,
html[data-sidebar-style="glass"][data-nav-color="dark"] #sidebar {
    --sidebar-glass-base: #19231f;
    --sidebar-glass-wash: 21, 31, 26;
    --sidebar-glass-row: 25, 35, 30;
    --sidebar-glass-wash-soft: 0.8;
    --sidebar-glass-wash-strong: 0.86;
    --sidebar-glass-sun-opacity: 0.12;
    --sidebar-glass-text: #f0f2e7;
    --sidebar-glass-heading: #e0e5d5;
    --sidebar-glass-line: rgba(218, 226, 196, 0.19);
    --sidebar-glass-edge: rgba(250, 239, 212, 0.15);
    --sidebar-glass-active: 76, 58, 32;
    --sidebar-glass-active-text: #ffdb9f;
    --sidebar-glass-accent: #efbc72;
    --sidebar-glass-shadow: rgba(0, 0, 0, 0.25);
}

html[data-sidebar-style="glass"] #sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-image: linear-gradient(
        180deg,
        rgba(var(--sidebar-glass-wash), var(--sidebar-glass-wash-strong)),
        rgba(var(--sidebar-glass-wash), var(--sidebar-glass-wash-soft)) 32%,
        rgba(var(--sidebar-glass-wash), var(--sidebar-glass-wash-strong)) 72%,
        rgba(var(--sidebar-glass-wash), var(--sidebar-glass-wash-soft))
    ), var(--sidebar-tile-image, none);
    background-repeat: no-repeat, repeat-y;
    background-position: center top, center top;
    background-size: 100% 100%, auto 360px;
}

html[data-sidebar-style="glass"][data-sidebar-sunlight="on"] #sidebar::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: var(--sidebar-glass-sun-opacity);
    pointer-events: none;
    background: radial-gradient(ellipse at 0 0, rgba(255, 234, 169, 0.58), transparent 49%),
        conic-gradient(
            from 88deg at 0 0,
            transparent 0deg,
            rgba(255, 247, 210, 0.2) 9deg,
            transparent 18deg,
            transparent 27deg,
            rgba(255, 240, 185, 0.15) 34deg,
            transparent 43deg,
            transparent 360deg
        );
    background-repeat: no-repeat;
    background-size: 100% 390px;
}

html[data-sidebar-style="glass"] #sidebar .slimScrollDiv,
html[data-sidebar-style="glass"] #sidebar .sidebar-inner {
    background: transparent;
}

html[data-sidebar-style="glass"] #sidebar .slimScrollDiv {
    z-index: 0;
}

html[data-sidebar-style="glass"] #sidebar .sidebar-menu > ul > li.submenu-open > ul {
    border-bottom-color: var(--sidebar-glass-line);
}

html[data-sidebar-style="glass"] #sidebar .sidebar-menu .submenu-hdr {
    color: var(--sidebar-glass-heading);
    letter-spacing: 0.035em;
    text-shadow: 0 1px 8px rgba(var(--sidebar-glass-wash), 0.75);
}

html[data-sidebar-style="glass"] #sidebar .sidebar-menu a {
    min-height: 41px;
    margin-bottom: 4px;
    border: 1px solid var(--sidebar-glass-edge);
    border-radius: 11px;
    background: rgba(var(--sidebar-glass-row), 0.84);
    color: var(--sidebar-glass-text);
    box-shadow: inset 0 1px 0 var(--sidebar-glass-edge), 0 2px 6px var(--sidebar-glass-shadow);
    transition: background-color 160ms ease, border-color 160ms ease;
}

html[data-sidebar-style="glass"] #sidebar .sidebar-menu a span,
html[data-sidebar-style="glass"] #sidebar .sidebar-menu a svg,
html[data-sidebar-style="glass"] #sidebar .sidebar-menu a i {
    color: inherit;
}

html[data-sidebar-style="glass"] #sidebar .sidebar-menu a span:not(.menu-arrow) {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

html[data-sidebar-style="glass"] #sidebar .sidebar-menu a:hover {
    border-color: var(--sidebar-glass-accent);
    background: rgba(var(--sidebar-glass-row), 0.96);
    color: var(--sidebar-glass-text);
}

html[data-sidebar-style="glass"] #sidebar .sidebar-menu li.active > a,
html[data-sidebar-style="glass"] #sidebar .sidebar-menu a.active,
html[data-sidebar-style="glass"] #sidebar .sidebar-menu a.subdrop {
    border-color: var(--sidebar-glass-accent);
    background: rgba(var(--sidebar-glass-active), 0.94);
    color: var(--sidebar-glass-active-text);
    box-shadow: inset 3px 0 0 var(--sidebar-glass-accent), inset 0 1px 0 var(--sidebar-glass-edge),
        0 3px 10px var(--sidebar-glass-shadow);
}

html[data-sidebar-style="glass"] #sidebar .sidebar-menu .menu-arrow {
    background: transparent;
}

html[data-sidebar-style="glass"] #sidebar .sidebar-menu .menu-arrow::before {
    border-color: currentColor;
}

html[data-sidebar-style="glass"] #sidebar .sidebar-menu a:focus-visible {
    outline: 3px solid var(--sidebar-glass-accent);
    outline-offset: 3px;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    html[data-sidebar-style="glass"] #sidebar {
        -webkit-backdrop-filter: blur(18px);
        backdrop-filter: blur(18px);
    }

    html[data-sidebar-style="glass"] #sidebar .sidebar-menu a {
        background: rgba(var(--sidebar-glass-row), 0.72);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }

    html[data-sidebar-style="glass"] #sidebar .sidebar-menu a:hover {
        background: rgba(var(--sidebar-glass-row), 0.9);
    }

    html[data-sidebar-style="glass"] #sidebar .sidebar-menu li.active > a,
    html[data-sidebar-style="glass"] #sidebar .sidebar-menu a.active,
    html[data-sidebar-style="glass"] #sidebar .sidebar-menu a.subdrop {
        background: rgba(var(--sidebar-glass-active), 0.9);
    }
}

#layoutDiv {
    --theme-panel-bg: #fffef9;
    --theme-panel-card: #f5f4ed;
    --theme-panel-text: #263a30;
    --theme-panel-muted: #566250;
    --theme-panel-line: #d8ddd2;
    --theme-panel-accent: #9b5a15;
    --theme-panel-selected: #fff0d6;
    width: min(450px, 100vw);
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: hidden;
    overscroll-behavior: contain;
    background: var(--theme-panel-bg);
    color: var(--theme-panel-text);
}

html[data-layout-mode="dark_mode"] #layoutDiv {
    --theme-panel-bg: #1d2530;
    --theme-panel-card: #26313c;
    --theme-panel-text: #f0f3ed;
    --theme-panel-muted: #c5cfc5;
    --theme-panel-line: #53616a;
    --theme-panel-accent: #ffc77c;
    --theme-panel-selected: #453925;
}

#layoutDiv .sidebar-content {
    position: relative;
    display: flex;
    flex-direction: column;
    max-width: none;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    background: var(--theme-panel-bg);
    color: var(--theme-panel-text);
}

#layoutDiv .sidebar-header {
    position: relative;
    flex-shrink: 0;
    gap: 12px;
    border-bottom: 1px solid var(--theme-panel-line);
    background: var(--theme-panel-bg);
}

#layoutDiv .sidebar-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#layoutDiv .sidebar-header h5,
#layoutDiv .theme-head h6,
#layoutDiv legend,
#layoutDiv .theme-choice-title {
    color: var(--theme-panel-text);
}

#layoutDiv .sidebar-header p,
#layoutDiv .theme-head p,
#layoutDiv .theme-choice-description,
#layoutDiv .theme-setting-note {
    color: var(--theme-panel-muted);
}

#layoutDiv .text-muted {
    color: var(--theme-panel-muted) !important;
}

#layoutDiv .theme-sunlight-choice,
#layoutDiv .theme-sunlight-choice span {
    color: var(--theme-panel-text);
}

#layoutDiv .theme-sunlight-choice input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--theme-panel-accent);
}

#layoutDiv .sidebar-theme-title {
    min-width: 0;
}

#layoutDiv .sidebar-header h5 {
    font-size: 18px;
    line-height: 1.4;
}

#layoutDiv .sidebar-header .close-sidebar-icon {
    flex-shrink: 0;
}

#layoutDiv .sidebar-header .sidebar-close,
#layoutDiv .sidebar-header .sidebar-refresh {
    border-color: var(--theme-panel-line);
    color: var(--theme-panel-text);
}

#layoutDiv .sidebar-header .theme-panel-close {
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--theme-panel-line);
    border-radius: 50%;
    background: var(--theme-panel-card);
    color: var(--theme-panel-text);
    box-shadow: 0 2px 6px rgb(0 0 0 / 8%);
}

#layoutDiv .sidebar-header .theme-panel-close:hover {
    border-color: var(--theme-panel-accent);
    background: var(--theme-panel-selected);
}

#layoutDiv .sidebar-header .theme-panel-close:focus-visible {
    outline: 3px solid var(--theme-panel-accent);
    outline-offset: 3px;
}

#layoutDiv .sidebar-header .theme-panel-close svg {
    pointer-events: none;
}

#layoutDiv fieldset {
    min-width: 0;
}

#layoutDiv legend {
    float: none;
    width: auto;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 700;
}

#layoutDiv .theme-choice-grid,
#layoutDiv .theme-image-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

#layoutDiv .theme-style-choice,
#layoutDiv .theme-image-choice {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    align-content: start;
    align-items: start;
    gap: 9px;
    min-width: 0;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--theme-panel-line);
    border-radius: 12px;
    background: var(--theme-panel-card);
    color: var(--theme-panel-text);
    cursor: pointer;
}

#layoutDiv .theme-style-choice input[type="radio"],
#layoutDiv .theme-image-choice input[type="radio"] {
    position: static;
    display: block;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 3px 0 0;
    opacity: 1;
    visibility: visible;
    accent-color: var(--theme-panel-accent);
    cursor: inherit;
}

#layoutDiv .theme-choice-copy {
    min-width: 0;
}

#layoutDiv .theme-choice-title,
#layoutDiv .theme-choice-description {
    display: block;
    line-height: 1.45;
}

#layoutDiv .theme-choice-title {
    font-size: 14px;
    font-weight: 700;
}

#layoutDiv .theme-choice-description {
    font-size: 12px;
}

#layoutDiv .theme-image-preview {
    grid-column: 1 / -1;
    grid-row: 1;
    display: block;
    width: 100%;
    height: 76px;
    border: 1px solid var(--theme-panel-line);
    border-radius: 8px;
    background: var(--theme-panel-bg);
    object-fit: cover;
}

#layoutDiv .theme-style-choice:has(input:checked),
#layoutDiv .theme-image-choice:has(input:checked) {
    border-color: var(--theme-panel-accent);
    background: var(--theme-panel-selected);
    box-shadow: 0 0 0 1px var(--theme-panel-accent);
}

#layoutDiv input[type="radio"]:focus-visible,
#layoutDiv input[type="checkbox"]:focus-visible,
#layoutDiv button:focus-visible,
#layoutDiv a:focus-visible {
    outline: 3px solid var(--theme-panel-accent);
    outline-offset: 3px;
}

#layoutDiv fieldset:disabled .theme-image-choice,
#layoutDiv fieldset:disabled .theme-style-choice {
    opacity: 0.65;
    cursor: not-allowed;
}

#layoutDiv .sidebar-footer {
    position: relative;
    flex-shrink: 0;
    bottom: auto;
    z-index: 2;
    border-top: 1px solid var(--theme-panel-line);
    background: var(--theme-panel-bg);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.05);
}

@media (max-width: 359px) {
    #layoutDiv .theme-choice-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    #layoutDiv .sidebar-header {
        padding: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html[data-sidebar-style="glass"] #sidebar,
    html[data-sidebar-style="glass"] #sidebar .sidebar-menu a,
    #layoutDiv,
    #layoutDiv.show-settings {
        transition: none;
    }
}
