.settings-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.settings-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}
.settings-popup-content {
    background: #1e2433;
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    overflow: hidden;
}
.settings-popup-overlay.show .settings-popup-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}
.settings-popup-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.settings-popup-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}
.settings-popup-icon {
    font-size: 22px;
    color: #4a9eff;
}
.settings-popup-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}
.settings-popup-subtitle {
    margin: 2px 0 0;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}
.settings-popup-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.15s;
    display: flex;
}
.settings-popup-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.settings-popup-body {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
}
.settings-popup-body::-webkit-scrollbar {
    width: 5px;
}
.settings-popup-body::-webkit-scrollbar-track {
    background: transparent;
}
.settings-popup-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
.settings-group {
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    overflow: hidden;
}
.settings-group:last-child {
    margin-bottom: 0;
}
.settings-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.settings-group-header:hover {
    background: rgba(255, 255, 255, 0.03);
}
.settings-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}
.settings-group-title i {
    color: #4a9eff;
    font-size: 14px;
}
.settings-group-chevron {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    transition: transform 0.2s ease;
}
.settings-group-chevron.open {
    transform: rotate(180deg);
}
.settings-group-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.settings-group-content.open {
    max-height: 800px;
}
/* Subsection (nested) styles */
.settings-subsection {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.settings-subsection:first-child {
    border-top: none;
}
.settings-subsection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.settings-subsection-header:hover {
    background: rgba(255, 255, 255, 0.02);
}
.settings-subsection-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.settings-subsection-title {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}
.settings-subsection-desc {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
}
.settings-subsection-chevron {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    transition: transform 0.2s ease;
}
.settings-subsection-chevron.open {
    transform: rotate(180deg);
}
.settings-subsection-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    background: rgba(0, 0, 0, 0.15);
}
.settings-subsection-content.open {
    max-height: 500px;
}
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.settings-row span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
}
.settings-row-reactions {
    flex-wrap: wrap;
}
.settings-row-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.settings-customize-link {
    font-size: 10px;
    color: #4a9eff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    opacity: 0.8;
    transition: opacity 0.15s;
}
.settings-customize-link:hover {
    opacity: 1;
}
.settings-customize-link i {
    font-size: 9px;
    transition: transform 0.2s ease;
}
.settings-customize-link i.open {
    transform: rotate(180deg);
}
.settings-switch {
    position: relative;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}
.settings-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.settings-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    transition: background 0.2s;
}
.settings-switch .slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.settings-switch input:checked + .slider {
    background: #4a9eff;
}
.settings-switch input:checked + .slider:before {
    transform: translateX(16px);
}
.settings-reactions-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.settings-reactions-wrapper.open {
    max-height: 200px;
    overflow-y: auto;
}
.settings-reactions-wrapper::-webkit-scrollbar {
    width: 4px;
}
.settings-reactions-wrapper::-webkit-scrollbar-track {
    background: transparent;
}
.settings-reactions-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}
.settings-reactions-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 8px 14px 12px;
}
.reaction-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 2px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    transition: opacity 0.15s;
}
.reaction-toggle span {
    font-size: 16px;
    line-height: 1;
}
.reaction-toggle img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}
.settings-switch-sm {
    position: relative;
    width: 24px;
    height: 14px;
    flex-shrink: 0;
}
.settings-switch-sm input {
    opacity: 0;
    width: 0;
    height: 0;
}
.settings-switch-sm .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    transition: background 0.2s;
}
.settings-switch-sm .slider:before {
    position: absolute;
    content: "";
    height: 10px;
    width: 10px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.settings-switch-sm input:checked + .slider {
    background: #4a9eff;
}
.settings-switch-sm input:checked + .slider:before {
    transform: translateX(10px);
}
@media (max-width: 480px) {
    .settings-popup-content {
        width: 95%;
        max-height: 85vh;
    }
    .settings-reactions-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .settings-popup-header {
        padding: 14px 16px;
    }
    .settings-popup-body {
        padding: 10px;
    }
}
