/* Member profiles and user settings */
.voice-member,
.member-row,
.call-avatar-pill,
.profile-identity-button {
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.voice-member,
.member-row,
.profile-identity-button {
    font: inherit;
}

.call-avatar-pill {
    font-family: inherit;
}

.voice-member:hover {
    background: var(--hover);
    color: var(--dashboard-text-soft);
}

.member-row {
    width: 100%;
}

.call-avatar-pill:hover .call-avatar-circle {
    border-color: var(--dashboard-text-dim);
}

.profile-identity-button {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0;
    color: inherit;
}

.profile-identity-button:hover .profile-name {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.settings-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-settings-overlay);
    background: rgb(4 6 9 / 66%);
}

.profile-card {
    position: fixed;
    z-index: var(--z-profile-popover);
    width: min(344px, calc(100vw - 20px));
    max-height: calc(100dvh - 20px);
    overflow: visible;
    border: 1px solid var(--dashboard-panel-3);
    border-radius: var(--radius-popover);
    background: #11151c;
    box-shadow: 0 24px 72px rgb(0 0 0 / 48%);
}

.profile-card-banner {
    position: relative;
    height: 88px;
    overflow: hidden;
    border-radius: var(--radius-popover) var(--radius-popover) 0 0;
    background: var(--profile-accent);
    background:
        linear-gradient(125deg, color-mix(in srgb, var(--profile-accent) 70%, #111318), #111318 76%);
}

.profile-card-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 58%, rgb(17 21 28 / 64%));
    pointer-events: none;
}

.profile-card-banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-card-close,
.settings-close {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: 50%;
    background: rgb(9 10 13 / 72%);
    color: var(--dashboard-text-soft);
    font: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.profile-card-close {
    position: absolute;
    z-index: 2;
    top: 10px;
    right: 10px;
}

.profile-card-close:hover,
.settings-close:hover {
    background: var(--dashboard-panel-3);
    color: var(--dashboard-text);
}

.profile-card-avatar {
    position: relative;
    z-index: 3;
    width: 68px;
    height: 68px;
    margin: -34px 0 0 14px;
    border: 4px solid #11151c;
    border-radius: 50%;
    background: var(--dashboard-panel-3);
}

.profile-card-avatar-fallback,
.profile-card-avatar-image {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.profile-card-avatar-fallback {
    background: var(--dashboard-panel-3);
    color: var(--dashboard-text);
    font-size: 22px;
    font-weight: 700;
}

.profile-card-avatar-image {
    object-fit: cover;
}

.profile-card-avatar .status-dot {
    right: 2px;
    bottom: 2px;
    width: 13px;
    height: 13px;
    border-width: 3px;
    border-color: #11151c;
}

.profile-card-body {
    display: grid;
    gap: 10px;
    padding: 8px 14px 14px;
}

.profile-card-identity h2 {
    margin: 0;
    color: var(--dashboard-text);
    font-size: 16px;
    line-height: 1.2;
}

.profile-card-username,
.profile-card-display-name {
    margin-top: 2px;
    color: var(--dashboard-text-dim);
    font-size: 11px;
}

.profile-card-bio {
    margin: 0;
    padding: 8px 0;
    border-top: 1px solid var(--dashboard-panel-3);
    border-bottom: 1px solid var(--dashboard-panel-3);
    color: var(--dashboard-text-soft);
    font-size: 11px;
    line-height: 1.55;
    white-space: pre-wrap;
}

.profile-card-bio.empty {
    color: var(--dashboard-text-dim);
    font-style: italic;
}

.profile-card-section {
    display: grid;
    gap: 7px;
}

.profile-card-section-title {
    color: var(--dashboard-text-dim);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.profile-role-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.profile-role-chip,
.profile-role-option {
    --profile-role-color: var(--dashboard-text-dim);
}

.profile-role-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 25px;
    padding: 3px 7px;
    border: 1px solid var(--dashboard-panel-3);
    border-radius: 3px;
    background: var(--dashboard-panel);
    color: var(--dashboard-text-soft);
    font-size: 10px;
}

.profile-role-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--profile-role-color);
}

.profile-role-remove,
.profile-role-add {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: transparent;
    color: var(--dashboard-text-dim);
    font: inherit;
    cursor: pointer;
}

.profile-role-remove {
    margin-right: -3px;
    font-size: 15px;
}

.profile-role-remove:hover {
    background: rgb(224 108 117 / 14%);
    color: var(--danger);
}

.profile-role-add-wrap {
    position: relative;
}

.profile-role-add {
    width: 25px;
    height: 25px;
    border: 1px dashed var(--dashboard-panel-3);
    color: var(--dashboard-text-soft);
    font-size: 16px;
}

.profile-role-add:hover {
    border-style: solid;
    background: var(--dashboard-panel-3);
    color: var(--dashboard-text);
}

.profile-role-menu {
    position: absolute;
    z-index: 5;
    left: 0;
    top: calc(100% + 5px);
    width: 210px;
    max-height: 210px;
    padding: 5px;
    overflow-y: auto;
    border: 1px solid var(--dashboard-panel-3);
    border-radius: var(--radius-popover);
    background: #0e1117;
    box-shadow: 0 12px 32px rgb(0 0 0 / 45%);
}

.profile-role-menu[hidden] {
    display: none;
}

.profile-role-option {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-height: 30px;
    padding: 5px 7px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--dashboard-text-soft);
    font: inherit;
    font-size: 10px;
    text-align: left;
    cursor: pointer;
}

.profile-role-option:hover {
    background: var(--dashboard-panel-3);
    color: var(--dashboard-text);
}

.profile-card-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.profile-card-meta > div {
    display: grid;
    gap: 2px;
    padding: 8px;
    border: 1px solid var(--dashboard-panel-3);
    background: var(--dashboard-panel);
}

.profile-card-meta span {
    color: var(--dashboard-text-dim);
    font-size: 9px;
    text-transform: uppercase;
}

.profile-card-meta strong {
    color: var(--dashboard-text-soft);
    font-size: 10px;
}

.profile-card-edit-self {
    min-height: 32px;
    border: 1px solid var(--dashboard-panel-3);
    border-radius: 3px;
    background: var(--dashboard-panel-2);
    color: var(--dashboard-text-soft);
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}

.profile-card-edit-self:hover {
    background: var(--dashboard-panel-3);
    color: var(--dashboard-text);
}

.settings-overlay {
    display: grid;
    place-items: center;
    padding: 16px;
}

.settings-panel {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    width: min(900px, 100%);
    height: min(660px, calc(100dvh - 32px));
    min-height: 420px;
    overflow: hidden;
    border: 1px solid var(--dashboard-panel-3);
    border-radius: var(--radius-popover);
    background: var(--dashboard-panel);
    box-shadow: 0 24px 72px rgb(0 0 0 / 48%);
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 14px 8px;
    border-right: 1px solid var(--dashboard-panel-3);
    background: var(--dashboard-sidebar);
}

.settings-nav-title {
    padding: 0 8px 10px;
    color: var(--dashboard-text-dim);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.settings-nav-item {
    min-height: 34px;
    padding: 7px 9px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: var(--dashboard-text-dim);
    font: inherit;
    font-size: 11px;
    text-align: left;
    cursor: pointer;
}

.settings-nav-item:hover {
    background: var(--hover);
    color: var(--dashboard-text-soft);
}

.settings-nav-item.active {
    background: var(--dashboard-panel-3);
    color: var(--dashboard-text);
}

.settings-content {
    position: relative;
    min-width: 0;
    overflow-y: auto;
    padding: 36px clamp(20px, 4vw, 46px) 48px;
}

.settings-close {
    position: absolute;
    top: 14px;
    right: 14px;
}

.settings-section {
    width: min(660px, 100%);
}

.settings-section-header {
    margin-bottom: 22px;
    padding-right: 38px;
}

.settings-section-header h2 {
    margin: 0;
    color: var(--dashboard-text);
    font-size: 20px;
}

.settings-section-header p,
.settings-muted {
    margin: 6px 0 0;
    color: var(--dashboard-text-dim);
    font-size: 11px;
    line-height: 1.55;
}

.settings-form {
    display: grid;
    gap: 15px;
}

.settings-field {
    display: grid;
    gap: 6px;
}

.settings-field-label {
    color: var(--dashboard-text-soft);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.settings-field-hint {
    color: var(--dashboard-text-dim);
    font-size: 9px;
}

.settings-input {
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid var(--dashboard-panel-3);
    border-radius: 3px;
    outline: 0;
    background: #101319;
    color: var(--dashboard-text);
    font: inherit;
    font-size: 11px;
}

.settings-input:focus {
    border-color: #394254;
}

.settings-input[readonly] {
    color: var(--dashboard-text-dim);
    cursor: default;
}

.settings-textarea {
    min-height: 110px;
    resize: vertical;
}

.settings-form-actions {
    display: flex;
    justify-content: flex-end;
}

.settings-primary-button,
.settings-secondary-button {
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid var(--dashboard-panel-3);
    border-radius: 3px;
    font: inherit;
    font-size: 10px;
    cursor: pointer;
}

.settings-primary-button {
    background: var(--dashboard-panel-3);
    color: var(--dashboard-text);
}

.settings-secondary-button {
    background: var(--dashboard-panel-2);
    color: var(--dashboard-text-soft);
}

.settings-primary-button:hover,
.settings-secondary-button:hover:not(:disabled) {
    filter: brightness(1.1);
}

.settings-secondary-button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.settings-secondary-button.danger {
    color: #efaab1;
}

.settings-callout,
.settings-runtime-card,
.settings-theme-preview,
.settings-action-row,
.settings-capability-list {
    margin-top: 18px;
    border: 1px solid var(--dashboard-panel-3);
    background: var(--dashboard-panel-2);
}

.settings-callout,
.settings-runtime-card {
    padding: 12px;
}

.settings-callout strong,
.settings-runtime-card strong {
    color: var(--dashboard-text-soft);
    font-size: 11px;
}

.settings-callout p,
.settings-runtime-card span {
    margin: 4px 0 0;
    color: var(--dashboard-text-dim);
    font-size: 10px;
    line-height: 1.5;
}

.settings-runtime-card {
    display: grid;
    gap: 4px;
}

.settings-audio-control {
    margin-top: 18px;
    padding: 12px;
    border: 1px solid var(--dashboard-panel-3);
    background: var(--dashboard-panel-2);
}

.settings-audio-heading {
    display: grid;
    gap: 3px;
}

.settings-audio-heading strong {
    color: var(--dashboard-text-soft);
    font-size: 11px;
}

.settings-audio-heading span,
.settings-audio-status,
.settings-audio-warning {
    color: var(--dashboard-text-dim);
    font-size: 9px;
    line-height: 1.5;
}

.settings-audio-choices {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
}

.settings-audio-choice {
    display: grid;
    align-content: start;
    gap: 4px;
    min-width: 0;
    min-height: 78px;
    padding: 9px;
    border: 1px solid var(--dashboard-panel-3);
    border-radius: 3px;
    background: #101319;
    color: var(--dashboard-text-dim);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.settings-audio-choice strong {
    color: var(--dashboard-text-soft);
    font-size: 10px;
}

.settings-audio-choice span {
    font-size: 9px;
    line-height: 1.4;
}

.settings-audio-choice:hover:not(:disabled) {
    border-color: #394254;
}

.settings-audio-choice.active {
    border-color: #53627a;
    background: var(--dashboard-panel-3);
}

.settings-audio-choice.active strong {
    color: var(--dashboard-text);
}

.settings-audio-choice:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.settings-audio-status,
.settings-audio-warning {
    margin: 8px 0 0;
}

.settings-audio-warning {
    color: #efaab1;
}

.settings-capability-row,
.settings-action-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
}

.settings-capability-row + .settings-capability-row,
.settings-action-row + .settings-action-row {
    border-top: 1px solid var(--dashboard-panel-3);
}

.settings-capability-row > div,
.settings-action-row > div {
    display: grid;
    gap: 2px;
}

.settings-capability-row strong,
.settings-action-row strong {
    color: var(--dashboard-text-soft);
    font-size: 11px;
}

.settings-capability-row div span,
.settings-action-row div span {
    color: var(--dashboard-text-dim);
    font-size: 9px;
}

.settings-capability-state {
    min-width: 66px;
    padding: 3px 5px;
    border-radius: 3px;
    font-size: 9px;
    text-align: center;
}

.settings-capability-state.available {
    background: rgb(71 122 103 / 20%);
    color: #8fcab4;
}

.settings-capability-state.unavailable {
    background: rgb(224 108 117 / 14%);
    color: #efaab1;
}

.settings-theme-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
}

.settings-theme-swatch {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    background: var(--dashboard-bg);
    color: var(--dashboard-text);
    font-size: 18px;
    font-weight: 700;
}

.settings-theme-preview > div:last-child {
    display: grid;
    gap: 3px;
}

.settings-theme-preview strong {
    color: var(--dashboard-text);
    font-size: 12px;
}

.settings-theme-preview span {
    color: var(--dashboard-text-dim);
    font-size: 10px;
}

.settings-action-row {
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: 12px;
    border: 1px solid var(--dashboard-panel-3);
    background: var(--dashboard-panel-2);
}

.settings-action-row.danger {
    border-color: rgb(224 108 117 / 24%);
}

@media (max-width: 720px) {
    .profile-strip {
        margin-bottom: 0;
        margin-left: 0;
        width: auto;
        border-radius: 0;
        background: transparent;
    }

    .profile-card {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
        overflow-y: auto;
    }

    .profile-card-banner {
        height: 92px;
    }

    .profile-card-meta {
        grid-template-columns: 1fr;
    }

    .profile-role-menu {
        left: auto;
        right: 0;
    }

    .settings-overlay {
        padding: 0;
    }

    .settings-panel {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
        width: 100%;
        height: 100dvh;
        border: 0;
        border-radius: 0;
    }

    .settings-nav {
        flex-direction: row;
        gap: 4px;
        overflow-x: auto;
        padding: 8px;
        border-right: 0;
        border-bottom: 1px solid var(--dashboard-panel-3);
    }

    .settings-nav-title {
        display: none;
    }

    .settings-nav-item {
        flex: 0 0 auto;
    }

    .settings-content {
        padding: 40px 16px 30px;
    }

    .settings-audio-choices {
        grid-template-columns: 1fr;
    }

    .settings-audio-choice {
        min-height: 0;
    }

    .settings-action-row {
        grid-template-columns: 1fr;
    }

    .settings-action-row .settings-secondary-button {
        justify-self: start;
    }
}

/* Bottom account identity order: account copy first, avatar second.
   The connected action-button group itself is shell chrome and is styled in
   shell.css, where its geometry is owned by the group container. */
.profile-strip {
    grid-template-columns: auto minmax(0, 1fr);
}

.profile-identity-button {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
}

.profile-identity-button .profile-copy {
    text-align: right;
}


/* Anchored member profiles and the personal account menu intentionally use
   separate interaction surfaces. */
.profile-popover {
    box-shadow: 0 18px 52px rgb(0 0 0 / 52%);
}

.profile-strip {
    position: relative;
    z-index: 5;
    min-height: 58px;
    margin-bottom: 8px;
    margin-left: calc(-1 * var(--server-rail-width) + 8px);
    width: calc(100% + var(--server-rail-width) - 8px);
    padding: 8px 12px 8px 8px;
    border: 0;
    border-radius: var(--radius-pill) 0 0 var(--radius-pill);
    background: var(--dashboard-panel-2);
}

.profile-strip .profile-identity-button {
    gap: 10px;
}

.profile-strip .profile-name {
    font-size: 14px;
}

.profile-strip .profile-status {
    font-size: 11px;
}

.profile-strip .profile-identity-button .avatar {
    width: 38px;
    height: 38px;
    font-size: 12px;
}

.profile-strip .profile-identity-button .status-dot {
    right: -2px;
    bottom: -2px;
    width: 10px;
    height: 10px;
}

.account-menu {
    position: absolute;
    z-index: var(--z-account-menu);
    left: 0;
    bottom: calc(100% + 7px);
    width: min(224px, calc(100vw - 20px));
    padding: 5px;
    border: 1px solid var(--dashboard-panel-3);
    border-radius: var(--radius-popover);
    background: #0e1117;
    box-shadow: 0 14px 38px rgb(0 0 0 / 48%);
}

.account-menu-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 7px 7px 6px;
}

.account-menu-header .avatar {
    width: 34px;
    height: 34px;
}

.account-menu-identity {
    display: grid;
    min-width: 0;
}

.account-menu-identity strong,
.account-menu-identity span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-menu-identity strong {
    color: var(--dashboard-text);
    font-size: 11px;
}

.account-menu-identity span {
    color: var(--dashboard-text-dim);
    font-size: 10px;
}

.account-menu-divider {
    height: 1px;
    margin: 5px 3px;
    background: var(--dashboard-panel-3);
}

.account-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 30px;
    padding: 5px 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--dashboard-text-soft);
    font: inherit;
    font-size: 10px;
    text-align: left;
    cursor: pointer;
}

.account-menu-item:hover {
    background: var(--dashboard-panel-3);
    color: var(--dashboard-text);
}

.account-menu-item.danger {
    color: var(--danger);
}

.account-menu-item.danger:hover {
    background: rgb(224 108 117 / 14%);
}

.account-menu-custom-status {
    margin: 1px 7px 5px;
    padding: 6px 7px;
    border: 1px solid var(--dashboard-panel-3);
    border-radius: 7px;
    color: var(--dashboard-text-soft);
    font-size: 10px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.account-menu-presence-options {
    display: grid;
    gap: 2px;
    padding: 2px;
}

.account-menu-presence {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 30px;
    padding: 5px 7px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--dashboard-text-soft);
    font: inherit;
    font-size: 10px;
    text-align: left;
    cursor: pointer;
}

.account-menu-presence:hover,
.account-menu-presence.active {
    background: var(--dashboard-panel-3);
    color: var(--dashboard-text);
}

.account-menu-presence .status-dot {
    position: static;
    width: 9px;
    height: 9px;
    border: 0;
}

.settings-profile-media {
    position: relative;
    display: grid;
    gap: 10px;
    padding-bottom: 4px;
}

.settings-profile-banner {
    position: relative;
    height: 150px;
    overflow: hidden;
    border: 1px solid var(--dashboard-panel-3);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--dashboard-panel-3), var(--dashboard-panel-2));
    color: var(--dashboard-text-dim);
}

.settings-profile-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.settings-profile-banner > span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 11px;
}

.settings-profile-avatar {
    position: relative;
    width: 82px;
    height: 82px;
    margin-top: -52px;
    margin-left: 18px;
    overflow: hidden;
    border: 5px solid var(--dashboard-panel);
    border-radius: 50%;
    background: var(--dashboard-panel-3);
    color: var(--dashboard-text);
    font-size: 22px;
    font-weight: 700;
}

.settings-profile-avatar img,
.settings-profile-avatar > span {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.settings-profile-media-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.settings-upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.settings-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.profile-card-presence {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--dashboard-text-soft);
    font-size: 10px;
}

.profile-card-presence .status-dot {
    position: static;
    width: 9px;
    height: 9px;
    border: 0;
}

.profile-card-custom-status {
    padding: 7px 8px;
    border: 1px solid var(--dashboard-panel-3);
    border-radius: 6px;
    background: var(--dashboard-panel);
    color: var(--dashboard-text-soft);
    font-size: 10px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.account-menu-presence .status-dot,
.profile-card-presence .status-dot {
    position: relative;
}

.settings-device-grid {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--dashboard-panel-3);
    border-radius: var(--radius-md);
    background: var(--dashboard-panel-2);
}

.settings-select {
    min-height: 36px;
    cursor: pointer;
}

.settings-select:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.settings-device-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
