/*Settings button*/

#settings-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 20000;
    overflow: auto;
}

#settings-modal.active {
    display: block;
}


/* Background */

.settings-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0.55);

    backdrop-filter: blur(4px);
}


/* Panel */

.settings-panel {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 560px;
    max-width: calc(100vw - 40px);

    transform: translate(-50%, -50%);
    box-sizing: border-box;

    background: #111;
    color: #fff;

    border: 1px solid #444;
    border-radius: 12px;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);

    overflow: hidden;
}

.settings-panel *,
.settings-panel * {
    box-sizing: border-box;
}


/* Header */

.settings-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    padding: 16px 20px;

    border-bottom: 1px solid #333;

    font-size: 18px;
    font-weight: bold;
}


/* Close button */

#settings-close {
    border: none;

    background: transparent;
    color: #888;

    font-size: 26px;

    cursor: pointer;

    line-height: 1;
}

#settings-close:hover {
    color: #fff;
}


/* Content */

.settings-content {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    min-height: 190px;
}

/* Section index */

.settings-index {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 10px;
    border-right: 1px solid #333;
    background: #0d0d0d;
}

.settings-index-item {
    padding: 9px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #aaa;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.settings-index-item:hover,
.settings-index-item.active {
    background: #222;
    color: #fff;
}

/* Section content */

.settings-sections {
    min-width: 0;
    padding: 20px;
}

.settings-section {
    margin: 0;
}

.settings-section h2 {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.settings-option {
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 6px 0;
}

@media (max-width: 560px) {
    .settings-panel {
        width: calc(100vw - 40px);
    }

    .settings-content {
        grid-template-columns: 112px minmax(0, 1fr);
    }
}

.view-toggle {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-slider {
    position: relative;

    flex: 0 0 auto;

    width: 42px;
    height: 22px;

    background: #444;
    border-radius: 999px;

    transition: background 0.2s;
}

.toggle-slider::after {
    content: "";

    position: absolute;

    width: 16px;
    height: 16px;

    top: 3px;
    left: 3px;

    background: #fff;
    border-radius: 50%;

    transition: transform 0.2s;
}

.view-toggle input:checked + .toggle-slider {
    background: #666;
}

.view-toggle input:checked + .toggle-slider::after {
    transform: translateX(20px);
}