#profilePanel { max-width: 1000px; margin-inline: auto; }
#profilePanel .profile-account {
    display: grid; grid-template-columns: 64px minmax(0, 1fr); align-content: start; gap: 8px 18px;
    padding: 24px; border: 1px solid var(--brass-edge); border-image: none;
    border-radius: 18px; background: var(--wood-dark); box-shadow: var(--lift-wood);
    color: var(--cream);
}
.profile-settings-avatar { grid-row: span 2; width: 64px; height: 64px; display: grid; place-items: center; border: 2px solid var(--accent); border-radius: 50%; background: var(--wood); color: var(--cream); font: 400 24px/1 var(--display); overflow: hidden; box-shadow: var(--press); }
.profile-settings-avatar img { width: 100%; height: 100%; object-fit: cover; }
#profilePanel .profile-settings-name { display: block; min-height: 0; margin: 0; padding: 0; border: 0; border-image: none; filter: none; background: none; text-transform: none; text-shadow: none; font: 400 20px/1.4 var(--display); overflow-wrap: anywhere; }
#profilePanel .profile-settings-identity { display: grid; gap: 8px; min-width: 0; padding: 0; }
#profilePanel .profile-settings-identity > div { display: grid; gap: 2px; padding: 0; border: 0; font: 400 13px/1.5 var(--body, system-ui); }
#profilePanel .profile-settings-identity strong { font: inherit; color: var(--cream); overflow-wrap: anywhere; min-width: 0; }
#profilePanel .profile-settings-identity .muted { color: var(--cream); opacity: .7; font-size: 12px; }
.profile-home { display: grid; gap: 24px; margin-top: 28px; }
#profilePanel .profile-settings-group { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
#profilePanel .profile-settings-group-title { margin: 0 0 10px 4px; font: 400 14px/1.5 var(--display); text-shadow: none; color: var(--cream); }
.profile-settings-list { overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--bg); }
#profilePanel .profile-settings-list > section { margin: 0; padding: 0; border: 0; border-image: none; border-radius: 0; background: none; box-shadow: none; }
:is(#profilePanel, #supportPanel) .profile-settings-row {
    display: grid; grid-template-columns: 38px minmax(0, 1fr) 16px; align-items: center;
    width: 100%; min-height: 74px; height: auto; gap: 14px; padding: 14px 18px;
    margin: 0; border: 0; border-radius: 0;
    background: none; box-shadow: none; color: var(--text); text-align: left;
    white-space: normal; transform: none; text-shadow: none;
}
:is(#profilePanel, #supportPanel) .profile-settings-row:hover { background: var(--accent-soft); }
.profile-settings-icon { box-sizing: content-box; width: 34px; height: 34px; padding: 2px; border-radius: 11px; background: none; object-fit: contain; }
.profile-settings-copy { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
:is(#profilePanel, #supportPanel) .profile-settings-label { font: 400 15px/1.5 var(--body, system-ui); color: var(--cream); }
:is(#profilePanel, #supportPanel) .profile-settings-row small { font: 400 13px/1.5 var(--body, system-ui); color: var(--hint); }
.profile-settings-arrow { justify-self: end; color: var(--hint); font: 400 24px/1 system-ui; }
.profile-settings-documents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.profile-settings-document { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--control-bg); color: var(--hint); font: 400 13px/1.5 var(--body, system-ui); overflow-wrap: anywhere; text-decoration: none; }
.profile-settings-document:hover { border-color: var(--accent); color: var(--cream); }
.profile-settings-document-icon { width: 32px; height: 32px; }
#profilePanel #logoutAccount { min-height: 74px; border: 2px solid var(--felt-edge); border-radius: 16px; background: var(--felt); box-shadow: var(--lift-felt), var(--press); color: var(--cream); }
#profilePanel #logoutAccount small, #profilePanel #logoutAccount .profile-settings-arrow { color: var(--cream); }
.profile-promo-form { display: grid; gap: 12px; }

.profile-settings-row:focus-visible, .profile-settings-document:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
#profilePanel[data-settings-view]:not([data-settings-view="home"]) > .profile-account,
#profilePanel[data-settings-view]:not([data-settings-view="home"]) > .profile-home,
#profilePanel.history-open > .profile-home,
#profilePanel.gifts-open > .profile-home { display: none; }
.profile-settings-page > .content-section { margin-top: 12px; }
#profilePanel .profile-settings-page .account-buttons { display: grid; grid-template-columns: 1fr; gap: 12px; }
#profilePanel .profile-settings-page .account-buttons[hidden],
#profilePanel [hidden] { display: none !important; }
@media (min-width: 900px) {
    #profilePanel[data-settings-view="home"]:not(.history-open):not(.gifts-open) { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; }
    #profilePanel .profile-account { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .profile-settings-avatar { grid-row: auto; margin-bottom: 4px; }
    .profile-home { margin-top: 0; }
}
@media (max-width: 420px) {
    #profilePanel .profile-account { padding: 18px; gap: 8px 14px; }
    .profile-settings-documents { grid-template-columns: minmax(0, 1fr); }
    :is(#profilePanel, #supportPanel) .profile-settings-row { gap: 12px; padding-inline: 14px; }
}

#profilePanel .profile-settings-list > :not(:first-child) { border-top: 1px solid var(--border); }

#supportPanel #supportFaq { border: 1px solid var(--border); border-radius: 16px; background: var(--bg); margin-top: 20px; }
#profilePanel .back-button, #serverStatusModal .back-button { width: fit-content; align-self: start; justify-self: start; margin: 0 0 18px; }
.support-inbox .section-heading { flex-wrap: wrap; }

#serverStatusModal .modal { padding-top: 20px; }
#backFromSupport { margin-bottom: 18px; }
