/* ============================================
   User Settings - Discord-Quality Fullscreen
   ============================================ */

/* ── Fullscreen Overlay ── */
.user-settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.user-settings-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ── Sidebar ── */
.us-sidebar {
    width: 218px;
    min-width: 218px;
    background: var(--bg-tertiary, #1e1f22);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 60px 6px 20px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.us-sidebar::-webkit-scrollbar {
    width: 4px;
}

.us-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

.us-nav-section {
    margin-bottom: 8px;
}

.us-nav-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted, #949ba4);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 6px 10px 6px 10px;
    margin-bottom: 2px;
}

.us-nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #b5bac1);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
    margin-bottom: 2px;
    line-height: 20px;
    font-family: inherit;
}

.us-nav-btn:hover {
    background: var(--bg-modifier-hover, rgba(255, 255, 255, 0.06));
    color: var(--text-primary, #f2f3f5);
}

.us-nav-btn.active {
    background: var(--bg-modifier-selected, rgba(255, 255, 255, 0.1));
    color: var(--text-primary, #fff);
}

.us-nav-btn.danger {
    color: #f23f43;
}

.us-nav-btn.danger:hover {
    background: rgba(242, 63, 67, 0.12);
    color: #fff;
}

.us-nav-separator {
    height: 1px;
    background: var(--bg-modifier-accent, rgba(255, 255, 255, 0.06));
    margin: 8px 10px;
}

/* ── Content Area ── */
.us-content-wrapper {
    flex: 1;
    background: var(--bg-secondary, #313338);
    display: flex;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
}

.us-content {
    width: 100%;
    max-width: 740px;
    padding: 60px 40px 80px 40px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.us-content::-webkit-scrollbar {
    width: 8px;
}

.us-content::-webkit-scrollbar-track {
    background: transparent;
}

.us-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* ESC close button */
.us-close-area {
    position: absolute;
    top: 60px;
    right: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 1;
}

.us-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--text-muted, #949ba4);
    background: transparent;
    color: var(--text-muted, #949ba4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.us-close-btn:hover {
    border-color: var(--text-primary, #fff);
    color: var(--text-primary, #fff);
}

.us-close-keybind {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, #949ba4);
}

/* ── Tab Panels ── */
.us-tab-panel {
    display: none;
    animation: usFadeIn 0.15s ease;
}

.us-tab-panel.active {
    display: block;
}

@keyframes usFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Page Title ── */
.us-page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary, #f2f3f5);
    margin: 0 0 20px 0;
    line-height: 24px;
}

/* ── Sections ── */
.us-section {
    margin-bottom: 40px;
}

.us-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted, #949ba4);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 16px;
}

.us-section-desc {
    font-size: 14px;
    color: var(--text-secondary, #b5bac1);
    line-height: 1.4;
    margin-bottom: 16px;
}

.us-divider {
    height: 1px;
    background: var(--bg-modifier-accent, rgba(255, 255, 255, 0.06));
    margin: 16px 0;
}

/* ── Account Info Card ── */
.us-account-card {
    background: var(--bg-tertiary, #1e1f22);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.us-account-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.us-account-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5865f2, #3b82f6);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.15s ease;
}

.us-account-avatar:hover {
    transform: scale(1.03);
}

.us-account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.us-account-avatar-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 600;
    color: #fff;
}

.us-account-info {
    flex: 1;
    min-width: 0;
}

.us-account-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary, #f2f3f5);
    line-height: 1.2;
}

.us-account-discrim {
    font-size: 14px;
    color: var(--text-muted, #949ba4);
    margin-top: 2px;
}

.us-account-fields {
    display: grid;
    gap: 0;
}

.us-account-field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.us-account-field-row:first-child {
    border-top: none;
}

.us-account-field-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted, #949ba4);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 4px;
}

.us-account-field-value {
    font-size: 16px;
    color: var(--text-primary, #f2f3f5);
}

.us-edit-btn {
    padding: 2px 16px;
    height: 32px;
    border-radius: 3px;
    border: none;
    background: var(--bg-modifier-hover, rgba(255, 255, 255, 0.1));
    color: var(--text-primary, #fff);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s ease;
    font-family: inherit;
}

.us-edit-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* ── Profile Section ── */
.us-profile-preview {
    background: var(--bg-tertiary, #1e1f22);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
}

.us-profile-banner {
    width: 100%;
    height: 100px;
    background: linear-gradient(135deg, #5865f2 0%, #eb459e 100%);
    position: relative;
}

.us-profile-banner-edit {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease;
    cursor: pointer;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

.us-profile-banner:hover .us-profile-banner-edit {
    opacity: 1;
}

.us-profile-avatar-area {
    position: relative;
    margin-top: -40px;
    padding: 0 16px;
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.us-profile-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.us-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 6px solid var(--bg-tertiary, #1e1f22);
    background: linear-gradient(135deg, #5865f2, #3b82f6);
    background-size: cover;
    background-position: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.us-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.us-avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s ease;
    cursor: pointer;
    pointer-events: none;
}

.us-profile-avatar:hover .us-avatar-overlay,
.us-account-avatar:hover .us-avatar-overlay {
    opacity: 1;
    pointer-events: auto;
}

.us-avatar-overlay-icon {
    font-size: 20px;
    color: #fff;
}

.us-avatar-overlay-text {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
}

.us-profile-status-dot {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 4px solid var(--bg-tertiary, #1e1f22);
    background: #23a55a;
}

.us-profile-info-area {
    padding: 8px 16px 16px;
}

.us-profile-display-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary, #f2f3f5);
}

.us-profile-username {
    font-size: 14px;
    color: var(--text-muted, #949ba4);
    margin-top: 2px;
}

.us-profile-bio {
    font-size: 14px;
    color: var(--text-secondary, #b5bac1);
    margin-top: 12px;
    line-height: 1.4;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Form Controls ── */
.us-form-group {
    margin-bottom: 20px;
}

.us-form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted, #949ba4);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}

.us-form-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary, #1e1f22);
    border: none;
    border-radius: 3px;
    color: var(--text-primary, #f2f3f5);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: box-shadow 0.15s ease;
    box-sizing: border-box;
}

.us-form-input:focus {
    box-shadow: 0 0 0 2px var(--accent-color, #5865f2);
}

.us-form-input::placeholder {
    color: var(--text-muted, #949ba4);
}

.us-form-textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px 12px;
    background: var(--bg-tertiary, #1e1f22);
    border: none;
    border-radius: 3px;
    color: var(--text-primary, #f2f3f5);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    resize: vertical;
    transition: box-shadow 0.15s ease;
    box-sizing: border-box;
    line-height: 1.4;
}

.us-form-textarea:focus {
    box-shadow: 0 0 0 2px var(--accent-color, #5865f2);
}

.us-form-hint {
    font-size: 12px;
    color: var(--text-muted, #949ba4);
    margin-top: 8px;
    line-height: 1.3;
}

.us-char-counter {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted, #949ba4);
    margin-top: 4px;
}

.us-form-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary, #1e1f22);
    border: none;
    border-radius: 3px;
    color: var(--text-primary, #f2f3f5);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='%23949ba4' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    box-sizing: border-box;
}

/* ── Toggle Switch ── */
.us-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.us-toggle-row:last-child {
    border-bottom: none;
}

.us-toggle-info {
    flex: 1;
    padding-right: 16px;
}

.us-toggle-label {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary, #f2f3f5);
    line-height: 1.2;
}

.us-toggle-desc {
    font-size: 14px;
    color: var(--text-muted, #949ba4);
    margin-top: 4px;
    line-height: 1.3;
}

.us-toggle {
    position: relative;
    width: 40px;
    height: 24px;
    flex-shrink: 0;
}

.us-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.us-toggle-slider {
    position: absolute;
    inset: 0;
    background: #80848e;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.us-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.us-toggle input:checked+.us-toggle-slider {
    background: #23a55a;
}

.us-toggle input:checked+.us-toggle-slider::before {
    transform: translateX(16px);
}

/* ── Status Options ── */
.us-status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.us-status-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 2px solid transparent;
    background: var(--bg-tertiary, #1e1f22);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.12s ease;
    color: var(--text-secondary, #b5bac1);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
}

.us-status-option:hover {
    background: rgba(255, 255, 255, 0.04);
}

.us-status-option.active {
    border-color: var(--accent-color, #5865f2);
    background: rgba(88, 101, 242, 0.08);
    color: var(--text-primary, #f2f3f5);
}

.us-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.us-status-dot.online {
    background: #23a55a;
}

.us-status-dot.idle {
    background: #f0b232;
}

.us-status-dot.dnd {
    background: #f23f43;
}

.us-status-dot.invisible {
    background: #80848e;
}

/* ── Theme Cards ── */
.us-theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.us-theme-card {
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--bg-tertiary, #1e1f22);
    font-family: inherit;
}

.us-theme-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.us-theme-card.active {
    border-color: var(--accent-color, #5865f2);
}

.us-theme-preview {
    height: 80px;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
}

.us-theme-preview.dark {
    background: linear-gradient(135deg, #1e1f22, #2b2d31);
}

.us-theme-preview.dim {
    background: linear-gradient(135deg, #2f3136, #36393f);
}

.us-theme-preview.neon {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a2e 50%, #0a0a0a 100%);
}

.us-theme-preview.light {
    background: linear-gradient(135deg, #ffffff, #f2f3f5);
}

/* Mini sidebar preview */
.us-theme-mini-sidebar {
    width: 24px;
    height: 56px;
    border-radius: 4px;
    flex-shrink: 0;
}

.us-theme-preview.dark .us-theme-mini-sidebar {
    background: rgba(255, 255, 255, 0.06);
}

.us-theme-preview.dim .us-theme-mini-sidebar {
    background: rgba(255, 255, 255, 0.08);
}

.us-theme-preview.neon .us-theme-mini-sidebar {
    background: rgba(0, 255, 255, 0.08);
}

.us-theme-preview.light .us-theme-mini-sidebar {
    background: rgba(0, 0, 0, 0.06);
}

/* Mini chat area preview */
.us-theme-mini-chat {
    flex: 1;
    height: 56px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 0 8px;
}

.us-theme-mini-line {
    height: 4px;
    border-radius: 2px;
}

.us-theme-preview.dark .us-theme-mini-line {
    background: rgba(255, 255, 255, 0.06);
}

.us-theme-preview.dim .us-theme-mini-line {
    background: rgba(255, 255, 255, 0.08);
}

.us-theme-preview.neon .us-theme-mini-line {
    background: rgba(0, 255, 255, 0.06);
}

.us-theme-preview.light .us-theme-mini-line {
    background: rgba(0, 0, 0, 0.06);
}

.us-theme-mini-line:nth-child(2) {
    width: 75%;
}

.us-theme-mini-line:nth-child(3) {
    width: 50%;
}

.us-theme-card-label {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.us-theme-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #80848e;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.15s ease;
}

.us-theme-card.active .us-theme-radio {
    border-color: var(--accent-color, #5865f2);
}

.us-theme-card.active .us-theme-radio::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-color, #5865f2);
}

.us-theme-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #f2f3f5);
}

/* ── Buttons ── */
.us-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 2px 16px;
    min-height: 38px;
    border-radius: 3px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.12s ease, opacity 0.12s ease;
    line-height: 1;
}

.us-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.us-btn-primary {
    background: var(--accent-color, #5865f2);
    color: #fff;
}

.us-btn-primary:hover:not(:disabled) {
    background: #4752c4;
}

.us-btn-secondary {
    background: transparent;
    color: var(--text-primary, #fff);
}

.us-btn-secondary:hover:not(:disabled) {
    text-decoration: underline;
}

.us-btn-danger {
    background: #f23f43;
    color: #fff;
}

.us-btn-danger:hover:not(:disabled) {
    background: #da373c;
}

.us-btn-outline {
    background: transparent;
    border: 1px solid var(--text-muted, #949ba4);
    color: var(--text-primary, #fff);
}

.us-btn-outline:hover:not(:disabled) {
    border-color: var(--text-primary, #fff);
}

.us-actions-row {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
}

/* ── Password Change ── */
.us-password-section {
    background: var(--bg-tertiary, #1e1f22);
    border-radius: 8px;
    padding: 20px;
    margin-top: 16px;
}

.us-password-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.us-password-status {
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

.us-password-status.loading {
    display: block;
    background: rgba(88, 101, 242, 0.15);
    color: #5865f2;
}

.us-password-status.success {
    display: block;
    background: rgba(35, 165, 90, 0.15);
    color: #23a55a;
}

.us-password-status.error {
    display: block;
    background: rgba(242, 63, 67, 0.15);
    color: #f23f43;
}

/* ── Slider ── */
.us-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.us-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    cursor: pointer;
    outline: none;
}

.us-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent-color, #5865f2);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.us-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.us-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--accent-color, #5865f2);
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.us-slider-value {
    min-width: 40px;
    text-align: right;
    font-size: 14px;
    color: var(--text-secondary, #b5bac1);
    font-weight: 500;
}

/* ── Blocked Users ── */
.us-blocked-list {
    margin-top: 16px;
}

.us-blocked-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 4px;
    transition: background 0.12s ease;
}

.us-blocked-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.us-blocked-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #5865f2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    flex-shrink: 0;
}

.us-blocked-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.us-blocked-name {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary, #f2f3f5);
    font-weight: 500;
}

.us-blocked-unblock {
    padding: 4px 14px;
    border-radius: 3px;
    border: 1px solid rgba(242, 63, 67, 0.5);
    background: transparent;
    color: #f23f43;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.12s ease;
    font-family: inherit;
}

.us-blocked-unblock:hover {
    background: rgba(242, 63, 67, 0.15);
}

.us-empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted, #949ba4);
    font-size: 14px;
}

.us-empty-state-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

/* ── Account Date ── */
.us-account-date {
    font-size: 12px;
    color: var(--text-muted, #949ba4);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
}

/* ── Avatar Upload Status ── */
.us-avatar-status {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 8px;
    display: none;
}

.us-avatar-status.loading {
    display: block;
    background: rgba(88, 101, 242, 0.15);
    color: #5865f2;
}

.us-avatar-status.success {
    display: block;
    background: rgba(35, 165, 90, 0.15);
    color: #23a55a;
}

.us-avatar-status.error {
    display: block;
    background: rgba(242, 63, 67, 0.15);
    color: #f23f43;
}

/* ============================================
   MOBILE RESPONSIVE — Settings Panel
   ============================================ */

/* ── Tablet (≤1024px) ── */
@media (max-width: 1024px) {
    .us-sidebar {
        width: 200px;
        min-width: 200px;
        padding: 40px 6px 20px 12px;
    }

    .us-close-area {
        top: 16px;
        right: 16px;
    }

    .us-content {
        padding: 40px 24px 60px 24px;
    }

    .us-nav-btn {
        font-size: 13px;
        padding: 8px 10px;
        min-height: 36px;
    }
}

/* ── Phone (≤768px) — Discord Mobile Layout ── */
@media (max-width: 768px) {
    .user-settings-overlay {
        flex-direction: column;
    }

    /* Sidebar → Horizontal top tab bar */
    .us-sidebar {
        width: 100% !important;
        min-width: unset !important;
        height: auto !important;
        max-height: none;
        padding: 8px 8px 0 8px;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-shrink: 0;
        background: var(--bg-tertiary, #1e1f22);
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .us-sidebar::-webkit-scrollbar {
        display: none;
    }

    .us-nav-section {
        display: flex;
        gap: 2px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .us-nav-title {
        display: none;
    }

    .us-nav-separator {
        width: 1px;
        height: 24px;
        margin: 4px 6px;
        align-self: center;
    }

    .us-nav-btn {
        white-space: nowrap;
        font-size: 13px;
        font-weight: 600;
        padding: 10px 14px;
        border-radius: 0;
        border-bottom: 2px solid transparent;
        margin-bottom: 0;
        min-height: 44px;
        -webkit-tap-highlight-color: transparent;
    }

    .us-nav-btn.active {
        background: transparent;
        border-bottom-color: var(--accent-color, #5865f2);
        color: var(--text-primary, #fff);
    }

    .us-nav-btn:hover {
        background: transparent;
    }

    .us-nav-btn.danger {
        margin-left: auto;
    }

    /* Content full width */
    .us-content-wrapper {
        flex: 1;
        overflow: hidden;
    }

    .us-content {
        max-width: 100%;
        padding: 20px 16px 100px 16px;
    }

    /* Close button — fixed top-right */
    .us-close-area {
        position: fixed;
        top: 8px;
        right: 8px;
        z-index: 10;
    }

    .us-close-btn {
        width: 44px;
        height: 44px;
        background: var(--bg-tertiary, #1e1f22);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .us-close-keybind {
        display: none;
    }

    /* Account card mobile */
    .us-account-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .us-account-avatar {
        width: 72px;
        height: 72px;
    }

    .us-account-avatar-initial {
        font-size: 28px;
    }

    .us-account-info {
        text-align: center;
    }

    .us-account-field-row {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .us-edit-btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    /* Profile preview mobile */
    .us-profile-banner {
        height: 80px;
    }

    .us-profile-avatar {
        width: 68px;
        height: 68px;
    }

    .us-profile-avatar-area {
        margin-top: -34px;
        padding: 0 12px;
    }

    .us-profile-info-area {
        padding: 8px 12px 12px;
    }

    .us-profile-display-name {
        font-size: 18px;
    }

    /* Form controls — touch friendly */
    .us-form-input,
    .us-form-textarea,
    .us-form-select {
        font-size: 16px;
        padding: 12px 14px;
        min-height: 44px;
        border-radius: 8px;
    }

    .us-form-textarea {
        min-height: 80px;
    }

    /* Password grid single column */
    .us-password-grid {
        grid-template-columns: 1fr;
    }

    .us-password-section {
        padding: 16px;
    }

    /* Status grid single column */
    .us-status-grid {
        grid-template-columns: 1fr;
    }

    .us-status-option {
        padding: 14px 16px;
        min-height: 44px;
    }

    /* Theme grid 2 columns */
    .us-theme-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .us-theme-preview {
        height: 64px;
    }

    /* Toggle — bigger touch target */
    .us-toggle {
        width: 48px;
        height: 28px;
    }

    .us-toggle-slider::before {
        width: 22px;
        height: 22px;
    }

    .us-toggle input:checked+.us-toggle-slider::before {
        transform: translateX(20px);
    }

    .us-toggle-row {
        padding: 14px 0;
    }

    /* Buttons — full width on mobile */
    .us-actions-row {
        flex-direction: column-reverse;
    }

    .us-btn {
        width: 100%;
        min-height: 44px;
        font-size: 15px;
        border-radius: 8px;
    }

    /* Slider — bigger thumb */
    .us-slider {
        height: 8px;
    }

    .us-slider::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
    }

    .us-slider::-moz-range-thumb {
        width: 20px;
        height: 20px;
    }

    /* Blocked users — touch friendly */
    .us-blocked-item {
        padding: 12px;
        min-height: 48px;
    }

    .us-blocked-unblock {
        min-height: 36px;
        padding: 6px 16px;
    }

    /* Page title */
    .us-page-title {
        font-size: 18px;
        margin-bottom: 16px;
    }

    /* Section spacing */
    .us-section {
        margin-bottom: 28px;
    }
}

/* ── Small Phone (≤480px) ── */
@media (max-width: 480px) {
    .us-content {
        padding: 16px 12px 80px 12px;
    }

    .us-nav-btn {
        font-size: 12px;
        padding: 8px 10px;
    }

    .us-account-card {
        padding: 12px;
    }

    .us-account-avatar {
        width: 60px;
        height: 60px;
    }

    .us-account-avatar-initial {
        font-size: 24px;
    }

    .us-account-name {
        font-size: 17px;
    }

    .us-profile-avatar {
        width: 56px;
        height: 56px;
        border-width: 4px;
    }

    .us-profile-avatar-area {
        margin-top: -28px;
    }

    .us-profile-banner {
        height: 60px;
    }

    .us-theme-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .us-theme-preview {
        height: 52px;
        padding: 0 8px;
    }

    .us-theme-card-label {
        padding: 8px 10px;
    }

    .us-theme-name {
        font-size: 12px;
    }

    .us-theme-radio {
        width: 16px;
        height: 16px;
    }

    .us-theme-card.active .us-theme-radio::after {
        top: 2px;
        left: 2px;
        width: 8px;
        height: 8px;
    }

    .us-toggle-label {
        font-size: 14px;
    }

    .us-toggle-desc {
        font-size: 12px;
    }

    .us-close-btn {
        width: 38px;
        height: 38px;
    }
}

/* ── iOS Safe Area ── */
@supports (padding-top: env(safe-area-inset-top)) {
    @media (max-width: 768px) {
        .us-sidebar {
            padding-top: calc(8px + env(safe-area-inset-top));
        }

        .us-close-area {
            top: calc(8px + env(safe-area-inset-top));
        }

        .us-content {
            padding-bottom: calc(80px + env(safe-area-inset-bottom));
        }
    }
}

/* ── Touch Improvements ── */
@media (max-width: 1024px) {

    .us-nav-btn,
    .us-edit-btn,
    .us-btn,
    .us-status-option,
    .us-blocked-unblock,
    .us-theme-card {
        -webkit-tap-highlight-color: transparent;
    }

    .us-account-avatar,
    .us-profile-avatar {
        -webkit-tap-highlight-color: transparent;
    }
}

/* ── Landscape Mode ── */
@media (max-width: 768px) and (orientation: landscape) {
    .us-sidebar {
        max-height: 44px;
    }

    .us-nav-btn {
        min-height: 36px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .us-content {
        padding-top: 12px;
    }
}

/* ── Legacy compatibility for existing drawer-based code ── */
.ui-drawer.open {
    display: flex !important;
}