/* ---------- Modal system ---------- */
.modal-root {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 6, 10, .72);
    backdrop-filter: blur(9px);
    opacity: 0;
    transition: opacity .18s ease;
}

.modal-root.is-open .modal-backdrop {
    opacity: 1;
}

.modal-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(520px, 100%);
    max-height: calc(100dvh - 40px);
    overflow: hidden;
    background:
        radial-gradient(circle at 100% 0%, rgba(139, 109, 255, .055), transparent 36%),
        #1b1d28;
    border: 1px solid rgba(255, 255, 255, .095);
    border-radius: 22px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .05);
    opacity: 0;
    transform: translateY(14px) scale(.982);
    transition: opacity .2s ease, transform .2s cubic-bezier(.2, .8, .2, 1);
}

.modal-root.is-open .modal-card {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.modal-card--sm {
    width: min(424px, 100%);
}

.modal-card--lg {
    width: min(680px, 100%);
}

.modal-card--xl {
    width: min(820px, 100%);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    color: #797b8f;
    background: rgba(255, 255, 255, .035);
    border: 1px solid transparent;
}

.modal-close:hover {
    background: rgba(255, 255, 255, .07);
}

.modal-header {
    display: flex;
    flex: none;
    align-items: flex-start;
    gap: 13px;
    padding: 26px 28px 5px;
    padding-right: 62px;
}

.modal-header h2 {
    font-size: 21px;
    line-height: 1.2;
    letter-spacing: -.035em;
    font-weight: 670;
}

.modal-header p {
    margin-top: 5px;
    color: #8a8c9f;
    font-size: 12px;
    line-height: 1.5;
}

.modal-icon {
    display: grid;
    place-items: center;
    width: 39px;
    height: 39px;
    border-radius: 12px;
    flex: none;
    background: linear-gradient(145deg, rgba(139, 109, 255, .16), rgba(139, 109, 255, .065));
    border: 1px solid rgba(139, 109, 255, .17);
    color: #bfb0ff;
}

.modal-icon .icon {
    width: 19px;
    height: 19px;
}

.modal-icon.is-danger {
    background: rgba(255, 100, 124, .09);
    border-color: rgba(255, 100, 124, .16);
    color: #ff91a6;
}

.modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 28px 26px;
}

.modal-footer {
    flex: none;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 28px 18px;
    border-top: 1px solid var(--line);
    background: rgba(27, 29, 40, .94);
}

.modal-footer .button {
    min-height: 39px;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 7px;
}

.modal-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .026);
    border: 1px solid rgba(255, 255, 255, .055);
    color: #838598;
    font-size: 10.5px;
    line-height: 1.55;
}

.modal-note .icon {
    width: 15px;
    height: 15px;
    flex: none;
    margin-top: 1px;
    color: #9e90d7;
}

.modal-body .form-error {
    margin-bottom: 14px;
}

.confirm-copy {
    color: #a6a7b9;
    font-size: 13px;
    line-height: 1.62;
}

.modal-card .field-label {
    color: #c6c3d3;
}

.modal-card .field-hint {
    color: #7d7f92;
}

.modal-card .input-wrap {
    background: #11131c;
}

.modal-card .input-wrap:focus-within {
    background: #13151f;
}

/* Segmented controls */
.modal-tabs {
    display: flex;
    gap: 3px;
    padding: 3px;
    margin-bottom: 19px;
    border-radius: 9px;
    background: #11131b;
    border: 1px solid var(--line);
}

.modal-tab {
    flex: 1;
    height: 34px;
    border-radius: 7px;
    color: #7f8194;
    font-size: 11.5px;
    font-weight: 650;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.modal-tab:hover {
    color: var(--text-soft);
}

.modal-tab.is-active {
    background: #292c3c;
    color: #f1eef8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .055);
}

.form-pane {
    display: flex;
    flex-direction: column;
    gap: 15px;
    animation: authFormIn .18s ease both;
}

/* Invite modal */
.invite-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 7px 0 16px;
}

.invite-preview-icon {
    position: relative;
    overflow: hidden;
    width: 64px;
    height: 64px;
    border-radius: 19px;
    display: grid;
    place-items: center;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .16), rgba(0, 0, 0, .1)),
        var(--card-color, #7C5CFF);
    color: #fff;
    font-size: 18px;
    font-weight: 760;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .25), inset 0 0 0 1px rgba(255, 255, 255, .12);
}

.invite-preview h3 {
    margin-top: 13px;
    font-size: 17px;
    font-weight: 660;
    letter-spacing: -.025em;
}

.invite-preview p {
    margin-top: 5px;
    color: #85879a;
    font-size: 11.5px;
}

.invite-preview .invite-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 4px 9px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--line);
    color: #8e90a3;
    font-size: 9px;
}

.invite-count .status-dot {
    width: 5px;
    height: 5px;
}

.copy-label {
    font-size: 11px;
    font-weight: 650;
    color: #bab7c7;
    margin-bottom: 7px;
}

.copy-field {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px;
    border-radius: 10px;
    background: #11131b;
    border: 1px solid var(--line-strong);
}

.copy-field input {
    flex: 1;
    min-width: 0;
    height: 32px;
    padding: 0 8px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #9b9dae;
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-overflow: ellipsis;
}

.copy-field .button {
    min-height: 32px;
    border-radius: 7px;
    padding: 0 11px;
    font-size: 10.5px;
}

.invite-share-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: #66687a;
    font-size: 9.5px;
    line-height: 1.5;
}

.invite-share-row .icon {
    width: 13px;
    height: 13px;
    color: #7f8194;
    flex: none;
}

/* Settings */
.settings-modal-body {
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-section + .settings-section {
    padding-top: 23px;
    border-top: 1px solid var(--line);
}

.settings-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.settings-section-head h3 {
    font-size: 12.5px;
    font-weight: 680;
    letter-spacing: -.01em;
}

.settings-section-head p {
    margin-top: 3px;
    color: #77798d;
    font-size: 10px;
    line-height: 1.5;
}

.settings-identity {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .022);
    border: 1px solid var(--line);
}

.settings-identity-icon {
    position: relative;
    overflow: hidden;
    width: 55px;
    height: 55px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .16), rgba(0, 0, 0, .1)),
        var(--card-color, #7C5CFF);
    color: #fff;
    font-size: 15px;
    font-weight: 760;
    flex: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}

.settings-identity-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.settings-identity-copy strong {
    font-size: 14px;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-identity-copy span {
    color: #797b8e;
    font-size: 10px;
}

.server-icon-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}

.server-icon-controls .button {
    min-height: 29px;
    padding: 0 9px;
    font-size: 9.5px;
    border-radius: 7px;
}

.server-icon-remove {
    font-size: 9.5px;
}

.settings-identity-copy .server-icon-hint {
    flex-basis: 100%;
    color: #5e6072;
    font-size: 8px;
}

.settings-identity-copy .settings-role {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--role-color, #9c9eaf);
}

.settings-identity-copy .settings-role .icon {
    width: 11px;
    height: 11px;
}

.palette-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--swatch);
    border: 2px solid transparent;
    box-shadow: inset 0 0 0 2px rgba(21, 23, 32, .95), 0 0 0 1px rgba(255, 255, 255, .08);
    transition: transform var(--transition), box-shadow var(--transition);
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.is-selected {
    box-shadow: inset 0 0 0 2px #15171f, 0 0 0 2px #fff;
}

.profile-preview {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.profile-avatar-slot {
    display: inline-flex;
    flex: none;
}

.profile-preview .avatar {
    width: 64px;
    height: 64px;
    font-size: 19px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 8px 20px rgba(0, 0, 0, .18);
}

.profile-preview-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.profile-preview-copy strong {
    font-size: 15px;
    font-weight: 660;
    letter-spacing: -.02em;
}

.profile-preview-copy > span {
    color: #7e8093;
    font-size: 10.5px;
}

.profile-photo-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 8px;
}

.profile-photo-actions .button {
    min-height: 29px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 10.5px;
}

.profile-photo-actions .button .icon {
    width: 13px;
    height: 13px;
}

.profile-photo-remove {
    font-size: 10.5px;
}

.profile-photo-hint {
    display: block;
    margin-top: 5px;
    color: #66687b;
    font-size: 8.5px;
    line-height: 1.4;
}

.account-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.account-meta > div {
    padding: 11px 12px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .022);
    border: 1px solid var(--line);
}

.account-meta span {
    display: block;
    color: #686a7d;
    font-size: 8.5px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .075em;
}

.account-meta strong {
    display: block;
    margin-top: 3px;
    font-size: 10.5px;
    font-weight: 550;
    color: #bcb9c9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-manage-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 260px;
    overflow-y: auto;
    margin: 0 -5px;
    padding: 0 5px;
}

.member-manage-row {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 5px 7px;
    border-radius: 8px;
}

.member-manage-row:hover {
    background: rgba(255, 255, 255, .03);
}

.member-manage-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.member-manage-info strong {
    font-size: 11px;
    font-weight: 600;
    color: #cfccda;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-manage-info span {
    font-size: 9px;
    color: #6e7083;
}

.member-manage-protection {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #7d738c;
    flex: none;
}

.member-manage-protection .icon {
    width: 12px;
    height: 12px;
}

.member-ban-button {
    color: #8b7480;
}

.member-ban-button:hover {
    color: #ff9baa;
    background: rgba(255, 100, 124, .09);
}

.server-ban-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 260px;
    overflow-y: auto;
    margin: 0 -5px;
    padding: 0 5px;
}

.server-ban-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 8px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .016);
}

.server-ban-row .avatar {
    width: 27px;
    height: 27px;
    font-size: 8px;
}

.server-ban-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.server-ban-copy strong {
    color: #cfccda;
    font-size: 10.5px;
    font-weight: 620;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-ban-copy strong span {
    color: #6e7083;
    font-size: 8.5px;
    font-weight: 500;
}

.server-ban-copy small {
    color: #686a7c;
    font-size: 8.5px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-ban-copy .server-ban-reason {
    color: #9a7f86;
}

.server-ban-row .button {
    flex: none;
    min-height: 27px;
    padding: 0 8px;
    font-size: 9px;
}

.server-ban-empty {
    padding: 14px 9px;
    color: #66687b;
    font-size: 9px;
    text-align: center;
}

.member-manage-role {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .035);
    color: #8d8fa2;
    font-size: 8px;
    font-weight: 650;
}

.danger-zone {
    border: 1px solid rgba(255, 100, 124, .16);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 100, 124, .025);
}

.danger-zone-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 14px;
}

.danger-zone-row + .danger-zone-row {
    border-top: 1px solid rgba(255, 100, 124, .1);
}

.danger-zone-row strong {
    display: block;
    font-size: 11.5px;
    font-weight: 650;
    color: #e3bcc4;
}

.danger-zone-row p {
    margin-top: 2px;
    font-size: 9.5px;
    color: #8b7179;
    line-height: 1.45;
    max-width: 330px;
}

.danger-zone-row .button {
    flex: none;
    min-height: 32px;
    padding: 0 11px;
    font-size: 10.5px;
}

/* Roles & role manager */
.role-color-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: none;
    background: var(--role-color, #99AAB5);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .035);
}

.role-color-dot--large {
    width: 13px;
    height: 13px;
}

.member-manage-role {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-manage-role[style] {
    color: var(--role-color);
    background: rgba(255, 255, 255, .04);
}

.settings-role-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 2px 0;
}

.settings-role-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .025);
    color: var(--role-color, #aaa7b8);
    font-size: 9px;
    font-weight: 600;
}

.settings-role-chip .icon,
.profile-role-chip .icon {
    width: 10px;
    height: 10px;
}

.settings-role-empty {
    color: #66687a;
    font-size: 10px;
}

.profile-role-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 9px;
}

.profile-role-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, .055);
    background: rgba(255, 255, 255, .028);
    color: var(--role-color, #aaa7b8);
    font-size: 8px;
    font-weight: 650;
}

.profile-role-chip .role-color-dot {
    width: 6px;
    height: 6px;
    box-shadow: none;
}

.profile-roles {
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid var(--line);
}

.profile-roles-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.profile-roles-head h4 {
    color: #77798c;
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.profile-roles-head span {
    color: #626476;
    font-size: 8px;
}

.profile-roles .profile-role-list {
    margin-top: 0;
}

.profile-roles-empty {
    color: #707284;
    font-size: 9.5px;
    line-height: 1.5;
}

.profile-role-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 190px;
    overflow-y: auto;
    margin: 0 -4px;
    padding: 0 4px;
}

.profile-role-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 7px;
    border-radius: 7px;
    cursor: pointer;
    transition: background var(--transition);
}

.profile-role-option:hover {
    background: rgba(255, 255, 255, .035);
}

.profile-role-option input[type="checkbox"] {
    width: 13px;
    height: 13px;
    accent-color: var(--accent);
    flex: none;
    cursor: pointer;
}

.profile-role-option-name {
    flex: 1;
    min-width: 0;
    color: #bbb8c9;
    font-size: 9.5px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-role-option-meta {
    color: #646678;
    font-size: 8px;
    flex: none;
}

.profile-roles-hint {
    margin-top: 6px;
    color: #5d5f71;
    font-size: 8px;
    line-height: 1.45;
}

.role-manager-host {
    min-height: 0;
}

.role-manager {
    display: grid;
    grid-template-columns: 246px minmax(0, 1fr);
    gap: 18px;
    height: min(680px, calc(100dvh - 200px));
    min-height: 430px;
}

.role-list-pane {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding-right: 16px;
    border-right: 1px solid var(--line);
}

.role-pane-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 0 2px 10px;
}

.role-pane-head h3 {
    margin-top: 3px;
    font-size: 16px;
    letter-spacing: -.025em;
    font-weight: 660;
}

.role-pane-head .button {
    min-height: 29px;
    padding: 0 9px;
    font-size: 10px;
}

.role-list {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    margin: 9px -5px 0;
    padding: 0 5px;
    overflow-y: auto;
    min-height: 0;
}

.role-row {
    display: flex;
    align-items: stretch;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background var(--transition), border-color var(--transition);
}

.role-row:hover {
    background: rgba(255, 255, 255, .035);
}

.role-row.is-selected {
    background: rgba(139, 109, 255, .1);
    border-color: rgba(139, 109, 255, .18);
}

.role-row-main {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    min-width: 0;
    padding: 8px 8px;
    text-align: left;
}

.role-row-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.role-row-copy strong {
    font-size: 10.5px;
    font-weight: 620;
    color: #c9c6d6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-row-copy small {
    font-size: 8px;
    color: #696b7e;
}

.role-row.is-selected .role-row-copy strong {
    color: #ece8f7;
}

.role-row-order {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    padding-right: 3px;
}

.role-move-button {
    display: grid;
    place-items: center;
    width: 21px;
    height: 16px;
    border-radius: 4px;
    color: #737589;
}

.role-move-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, .07);
    color: #cbc7d9;
}

.role-move-button:disabled {
    opacity: .25;
}

.role-move-button .icon {
    width: 12px;
    height: 12px;
}

.icon.is-flipped {
    transform: rotate(180deg);
}

.role-row-lock {
    display: grid;
    place-items: center;
    width: 26px;
    color: #5c5e70;
}

.role-row-lock .icon {
    width: 12px;
    height: 12px;
}

.role-list-empty {
    padding: 12px 9px;
    color: #646678;
    font-size: 9.5px;
    line-height: 1.5;
}

.role-order-hint {
    margin-top: auto;
    padding: 12px 4px 0;
    color: #5d5f71;
    font-size: 8px;
    line-height: 1.5;
}

.role-editor-pane {
    min-width: 0;
    overflow-y: auto;
    padding-right: 3px;
}

.role-editor {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.role-editor-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--line);
}

.role-editor-head > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.role-editor-head h3 {
    font-size: 17px;
    font-weight: 660;
    letter-spacing: -.025em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-editor-tabs {
    display: flex;
    gap: 3px;
    padding: 3px;
    width: fit-content;
    border-radius: 8px;
    background: #11131b;
    border: 1px solid var(--line);
}

.role-editor-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 29px;
    padding: 0 11px;
    border-radius: 6px;
    color: #7d7f92;
    font-size: 9.5px;
    font-weight: 650;
    transition: color var(--transition), background var(--transition);
}

.role-editor-tab:hover {
    color: #cecada;
}

.role-editor-tab.is-active {
    color: #f1eef8;
    background: #292c3c;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .22);
}

.role-editor-tab span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .07);
    color: #9496a9;
    font-size: 7.5px;
}

.role-editor-tabs + .role-members {
    padding-top: 0;
    border-top: 0;
}

.role-editor-tabs + .role-members .role-member-list {
    max-height: 390px;
}

.role-readonly-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 4px 7px;
    border-radius: 5px;
    background: rgba(255, 255, 255, .045);
    color: #85879a;
    font-size: 8px;
    font-weight: 650;
    flex: none;
}

.role-readonly-badge .icon {
    width: 11px;
    height: 11px;
}

.role-editor-form {
    display: flex;
    flex-direction: column;
    gap: 17px;
}

.role-editor-fields {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 14px;
}

.role-color-control {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
}

.role-color-input {
    width: 38px;
    height: 38px;
    padding: 2px;
    border-radius: 9px;
    border: 1px solid var(--line-strong);
    background: #11131b;
    cursor: pointer;
}

.role-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.role-color-input::-webkit-color-swatch {
    border: 0;
    border-radius: 6px;
}

.role-color-value {
    font-family: var(--font-mono);
    font-size: 9px;
    color: #85879a;
}

.role-color-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.role-color-preset {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--swatch);
    border: 2px solid transparent;
    box-shadow: inset 0 0 0 2px #1b1d28, 0 0 0 1px rgba(255, 255, 255, .07);
    transition: transform var(--transition), box-shadow var(--transition);
}

.role-color-preset:hover:not(:disabled) {
    transform: scale(1.12);
}

.role-color-preset.is-selected {
    box-shadow: inset 0 0 0 2px #1b1d28, 0 0 0 2px #fff;
}

.role-color-preset:disabled {
    opacity: .4;
}

.role-display-setting {
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.role-display-option {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .018);
    border: 1px solid var(--line);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.role-display-option:hover {
    background: rgba(255, 255, 255, .032);
    border-color: var(--line-strong);
}

.role-display-option:has(input:disabled) {
    opacity: .55;
    cursor: not-allowed;
}

.role-display-option > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.role-toggle {
    position: relative;
    width: 31px;
    height: 18px;
    border-radius: 99px;
    background: #2a2c3a;
    border: 1px solid var(--line-strong);
    flex: none;
    margin-top: 1px;
    transition: background var(--transition), border-color var(--transition);
}

.role-toggle > span {
    position: absolute;
    left: 2px;
    top: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #85879a;
    transition: transform var(--transition), background var(--transition);
}

.role-display-option > input:checked + .role-toggle {
    background: var(--accent-strong);
    border-color: var(--accent);
}

.role-display-option > input:checked + .role-toggle > span {
    background: #fff;
    transform: translateX(13px);
}

.role-toggle-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.role-toggle-copy strong {
    color: #c6c2d2;
    font-size: 10px;
    font-weight: 650;
}

.role-toggle-copy small {
    color: #75778a;
    font-size: 8.5px;
    line-height: 1.45;
}

.role-permissions {
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.role-section-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.role-section-title h4 {
    font-size: 11.5px;
    font-weight: 680;
}

.role-section-title p {
    margin-top: 2px;
    color: #74768a;
    font-size: 9px;
    line-height: 1.5;
}

.permission-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.permission-toggle {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-height: 50px;
    padding: 9px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .018);
    border: 1px solid var(--line);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.permission-toggle:hover {
    background: rgba(255, 255, 255, .032);
    border-color: var(--line-strong);
}

.permission-toggle:has(input:disabled) {
    opacity: .55;
    cursor: not-allowed;
}

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

.permission-marker {
    display: grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border-radius: 5px;
    border: 1px solid var(--line-strong);
    background: #11131b;
    color: #fff;
    flex: none;
    margin-top: 1px;
    transition: background var(--transition), border-color var(--transition);
}

.permission-marker .icon {
    width: 11px;
    height: 11px;
    opacity: 0;
    transition: opacity var(--transition);
}

.permission-toggle > input:checked + .permission-marker {
    background: var(--accent-strong);
    border-color: var(--accent);
}

.permission-toggle > input:checked + .permission-marker .icon {
    opacity: 1;
}

.permission-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.permission-copy strong {
    font-size: 9.5px;
    font-weight: 650;
    color: #c2bfce;
}

.permission-copy small {
    font-size: 8px;
    line-height: 1.4;
    color: #6d6f82;
}

.role-editor-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 2px;
}

.role-editor-actions .text-button {
    font-size: 10px;
}

.role-delete-confirm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 11px;
    border-radius: 8px;
    background: rgba(255, 100, 124, .07);
    border: 1px solid rgba(255, 100, 124, .16);
    color: #d7aeb6;
    font-size: 9.5px;
}

.role-delete-confirm > div {
    display: flex;
    gap: 6px;
    flex: none;
}

.role-members {
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.role-member-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 19px;
    padding: 0 6px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .045);
    color: #85879a;
    font-size: 8px;
    font-weight: 650;
}

.role-member-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    max-height: 160px;
    overflow-y: auto;
    margin: 0 -4px;
    padding: 0 4px;
}

.role-member-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    border-radius: 7px;
    cursor: pointer;
    transition: background var(--transition);
}

.role-member-row:hover {
    background: rgba(255, 255, 255, .03);
}

.role-member-row.is-disabled {
    opacity: .4;
    cursor: not-allowed;
}

.role-member-row > input {
    width: 13px;
    height: 13px;
    accent-color: var(--accent);
    flex: none;
}

.role-member-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}

.role-member-copy strong {
    font-size: 9.5px;
    font-weight: 600;
    color: #bdb9ca;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-member-copy small {
    font-size: 8px;
    color: #656779;
}

.role-member-empty {
    padding: 8px 4px;
    color: #626476;
    font-size: 9px;
}

.role-editor-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 320px;
    padding: 30px;
}

.role-editor-empty-icon {
    display: grid;
    place-items: center;
    width: 49px;
    height: 49px;
    border-radius: 14px;
    background: rgba(139, 109, 255, .08);
    border: 1px solid rgba(139, 109, 255, .13);
    color: #a995ed;
}

.role-editor-empty-icon .icon {
    width: 22px;
    height: 22px;
}

.role-editor-empty h3 {
    margin-top: 13px;
    font-size: 14px;
    font-weight: 650;
}

.role-editor-empty p {
    margin-top: 4px;
    max-width: 270px;
    color: #757789;
    font-size: 10px;
    line-height: 1.55;
}

/* Profile card */
.profile-card {
    display: flex;
    flex-direction: column;
}

.profile-banner {
    position: relative;
    height: 92px;
    border-radius: 14px;
    overflow: hidden;
    background:
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, .18), transparent 40%),
        var(--profile-color, #7C5CFF);
}

.profile-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(0, 0, 0, .03), rgba(0, 0, 0, .23)),
        radial-gradient(circle at 18% 100%, rgba(0, 0, 0, .2), transparent 45%);
}

.profile-banner-ring {
    position: absolute;
    width: 130px;
    height: 130px;
    right: -20px;
    top: -60px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 0 0 26px rgba(255, 255, 255, .045);
}

.profile-avatar-wrap {
    position: relative;
    margin: -37px 0 0 16px;
    width: fit-content;
}

.profile-avatar-wrap .avatar {
    width: 76px;
    height: 76px;
    font-size: 23px;
    border: 5px solid #1b1d28;
    box-sizing: content-box;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .34);
}

.profile-avatar-wrap .presence-dot {
    width: 14px;
    height: 14px;
    right: 4px;
    bottom: 4px;
    border: 3px solid #1b1d28;
    box-sizing: content-box;
}

.profile-main {
    padding: 9px 18px 16px;
    border-radius: 0 0 13px 13px;
    background: #171923;
    border: 1px solid var(--line);
    border-top: 0;
    margin-top: -1px;
}

.profile-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.profile-name-row h3 {
    font-size: 19px;
    letter-spacing: -.035em;
    font-weight: 670;
}

.profile-role {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 5px;
    background: rgba(244, 201, 107, .09);
    color: #d7b56c;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.profile-role[style] {
    color: var(--role-color);
    background: rgba(255, 255, 255, .045);
}

.profile-role .icon {
    width: 10px;
    height: 10px;
}

.profile-username {
    margin-top: 2px;
    color: #7c7e91;
    font-size: 11px;
}

.profile-status {
    margin-top: 11px;
    padding: 9px 11px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .026);
    border: 1px solid var(--line);
    color: #aaa7b8;
    font-size: 10.5px;
    line-height: 1.45;
}

.profile-status span {
    color: #67697c;
    margin-right: 3px;
}

.profile-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: #696b7e;
    font-size: 9px;
}

.profile-meta strong {
    color: #9a9cae;
    font-weight: 600;
}

.profile-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 15px;
}

/* Quick switch */
.quick-switch {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quick-search {
    position: relative;
    display: flex;
    align-items: center;
    height: 44px;
    border-radius: 10px;
    background: #11131c;
    border: 1px solid var(--line-strong);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.quick-search:focus-within {
    border-color: rgba(139, 109, 255, .55);
    box-shadow: 0 0 0 3px rgba(139, 109, 255, .09);
}

.quick-search .icon {
    width: 17px;
    height: 17px;
    margin-left: 13px;
    color: #6e7083;
}

.quick-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 13px 0 9px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 12.5px;
    color: var(--text-soft);
}

.quick-search input::placeholder {
    color: #5d5f71;
}

.quick-search kbd {
    margin-right: 10px;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(255, 255, 255, .06);
    color: #66687b;
    font-family: inherit;
    font-size: 8px;
}

.quick-switch-list {
    max-height: min(390px, 50vh);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0 -5px;
    padding: 0 5px;
}

.quick-server-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 8px 5px;
    color: #656779;
    font-size: 8.5px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.quick-switch-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 6px 8px;
    border-radius: 8px;
    text-align: left;
    color: #aaa7b8;
    transition: background var(--transition), color var(--transition);
}

.quick-switch-item:hover,
.quick-switch-item.is-selected {
    background: rgba(139, 109, 255, .1);
    color: var(--text-soft);
}

.quick-switch-item .qs-icon {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .045);
    color: #8d8fa1;
    flex: none;
}

.quick-switch-item .qs-icon .icon {
    width: 15px;
    height: 15px;
}

.quick-switch-item.is-active .qs-icon {
    background: rgba(139, 109, 255, .14);
    color: #c1b1ff;
}

.quick-switch-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.quick-switch-copy strong {
    font-size: 11.5px;
    font-weight: 600;
    color: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-switch-copy span {
    font-size: 9px;
    color: #67697b;
}

.quick-switch-item .qs-enter {
    margin-left: auto;
    color: #5d5f71;
    font-size: 8px;
    opacity: 0;
}

.quick-switch-item.is-selected .qs-enter {
    opacity: 1;
}

.quick-empty {
    padding: 30px 20px;
    text-align: center;
    color: #757789;
    font-size: 11px;
}

.quick-empty .icon {
    width: 25px;
    height: 25px;
    margin: 0 auto 8px;
    color: #5e6073;
}

/* ---------- Popovers ---------- */
.popover-root {
    position: fixed;
    inset: 0;
    z-index: 900;
    pointer-events: none;
}

.popover-panel {
    position: fixed;
    pointer-events: auto;
    padding: 5px;
    border-radius: 12px;
    background: #1c1e2a;
    border: 1px solid rgba(255, 255, 255, .095);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .045);
    opacity: 0;
    transform: translateY(-4px) scale(.99);
    transform-origin: top left;
    transition: opacity .12s ease, transform .12s ease;
}

.popover-root.is-open .popover-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.popover-title {
    padding: 7px 9px 6px;
    color: #6c6e80;
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.popover-heading {
    padding: 6px 9px;
    color: #6c6e80;
    font-size: 8.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.popover-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 34px;
    padding: 6px 9px;
    border-radius: 7px;
    color: #b7b4c5;
    font-size: 11.5px;
    font-weight: 500;
    text-align: left;
    transition: background var(--transition), color var(--transition);
}

.popover-item:hover {
    background: rgba(255, 255, 255, .055);
    color: #f1eef8;
}

.popover-item.is-danger {
    color: #ef899b;
}

.popover-item.is-danger:hover {
    background: rgba(255, 100, 124, .09);
    color: #ffadb9;
}

.popover-item:disabled {
    opacity: .4;
}

.popover-item-icon {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    color: #8b8d9f;
    flex: none;
}

.popover-item.is-danger .popover-item-icon {
    color: #e07d8e;
}

.popover-item-icon .icon {
    width: 15px;
    height: 15px;
}

.popover-item-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.popover-item-meta {
    color: #656779;
    font-size: 8.5px;
}

.popover-separator {
    height: 1px;
    margin: 5px 4px;
    background: var(--line);
}

/* Account menu */
.account-popover-panel {
    padding: 6px;
    max-height: min(440px, calc(100dvh - 24px));
    overflow-y: auto;
}

.account-menu-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 8px 10px;
    border-bottom: 1px solid var(--line);
}

.account-menu-head .avatar {
    width: 34px;
    height: 34px;
    font-size: 10px;
}

.account-menu-head-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.account-menu-head-copy strong {
    color: #e6e2ef;
    font-size: 11.5px;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-menu-head-copy span {
    color: #6c6e80;
    font-size: 9px;
}

.account-menu-status {
    padding: 4px 0 3px;
}

.account-menu-status .status-option {
    min-height: 33px;
    padding-top: 6px;
    padding-bottom: 6px;
}

/* Status picker */
.status-popover-panel {
    padding: 6px;
}

.status-menu-heading {
    padding: 7px 9px 6px;
    color: #77798c;
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.status-options {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.status-option {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 35px;
    padding: 7px 9px;
    border-radius: 8px;
    color: #b7b4c5;
    font-size: 11.5px;
    text-align: left;
    transition: background var(--transition), color var(--transition);
}

.status-option:hover,
.status-option.is-current {
    background: rgba(255, 255, 255, .055);
    color: #f1eef8;
}

.status-option.is-current {
    background: rgba(139, 109, 255, .1);
}

.status-choice-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: none;
    background: var(--status-color, var(--success));
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .025);
}

.status-choice-label {
    flex: 1;
    min-width: 0;
}

.status-choice-check {
    display: grid;
    place-items: center;
    width: 16px;
    height: 16px;
    color: #bfb0ff;
    flex: none;
}

.status-choice-check .icon {
    width: 13px;
    height: 13px;
}

.status-menu-caption {
    margin-top: 5px;
    padding: 8px 9px 5px;
    border-top: 1px solid var(--line);
    color: #616375;
    font-size: 8.5px;
    line-height: 1.45;
}

/* Emoji picker */
.emoji-popover-panel {
    padding: 11px;
}

.emoji-popover-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 1px 3px 9px;
}

.emoji-popover-head strong {
    font-size: 11px;
    font-weight: 650;
    color: #d1cddc;
}

.emoji-popover-head span {
    color: #5d5f70;
    font-size: 8px;
}

.emoji-group + .emoji-group {
    margin-top: 8px;
}

.emoji-group-label {
    padding: 0 3px 5px;
    color: #5f6173;
    font-size: 7.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .075em;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
}

.emoji-choice {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 7px;
    display: grid;
    place-items: center;
    font-size: 18px;
    line-height: 1;
    transition: background var(--transition), transform var(--transition);
}

.emoji-choice:hover {
    background: rgba(139, 109, 255, .11);
    transform: scale(1.08);
}

/* ---------- Toasts ---------- */
.toast-region {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
    max-width: min(370px, calc(100vw - 40px));
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    width: fit-content;
    max-width: 100%;
    padding: 11px 11px 11px 12px;
    border-radius: 11px;
    background: rgba(29, 31, 44, .96);
    border: 1px solid rgba(255, 255, 255, .095);
    box-shadow: 0 17px 40px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .04);
    backdrop-filter: blur(16px);
    color: #d6d2df;
    font-size: 11px;
    line-height: 1.45;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(8px) scale(.98);
    transition: opacity .2s ease, transform .2s ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    flex: none;
    background: rgba(139, 109, 255, .11);
    color: #bcabff;
}

.toast--success .toast-icon {
    background: rgba(91, 214, 162, .1);
    color: #7ee3b8;
}

.toast--error .toast-icon {
    background: rgba(255, 100, 124, .1);
    color: #ff97a9;
}

.toast--mention {
    border-color: rgba(255, 184, 77, .24);
}

.toast--mention .toast-icon {
    background: rgba(255, 184, 77, .12);
    color: #ffc77d;
}

.toast-icon .icon {
    width: 13px;
    height: 13px;
}

.toast-message {
    flex: 1;
    padding-top: 2px;
}

.toast-close {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    color: #6f7183;
    flex: none;
}

.toast-close:hover {
    background: rgba(255, 255, 255, .055);
    color: #b8b5c5;
}

.toast-close .icon {
    width: 12px;
    height: 12px;
}

/* ---------- Channel permissions ---------- */
.channel-permissions-editor {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.channel-permission-target {
    max-width: 480px;
}

.channel-permission-select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border-radius: 9px;
    border: 1px solid var(--line-strong);
    background: #11131c;
    color: var(--text-soft);
    font: inherit;
    font-size: 12px;
    outline: none;
}

.channel-permission-select:focus {
    border-color: rgba(139, 109, 255, .55);
    box-shadow: 0 0 0 3px rgba(139, 109, 255, .09);
}

.channel-permission-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 11px;
    border-radius: 9px;
    background: rgba(139, 109, 255, .055);
    border: 1px solid rgba(139, 109, 255, .12);
    color: #8f91a3;
    font-size: 9.5px;
    line-height: 1.5;
}

.channel-permission-note .icon {
    width: 14px;
    height: 14px;
    flex: none;
    margin-top: 1px;
    color: #b8a8fc;
}

.channel-permission-list {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, .012);
}

.channel-permission-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 14px;
}

.channel-permission-row + .channel-permission-row {
    border-top: 1px solid var(--line);
}

.channel-permission-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.channel-permission-copy strong {
    color: #d9d5e4;
    font-size: 11.5px;
    font-weight: 640;
}

.channel-permission-copy small {
    color: #727486;
    font-size: 9px;
    line-height: 1.45;
}

.channel-permission-choice {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: none;
    padding: 2px;
    border-radius: 8px;
    background: #11131c;
    border: 1px solid var(--line);
}

.channel-permission-state {
    height: 27px;
    padding: 0 9px;
    border-radius: 6px;
    color: #77798c;
    font-size: 9px;
    font-weight: 650;
    transition: background var(--transition), color var(--transition);
}

.channel-permission-state:hover {
    color: #d3cfdf;
    background: rgba(255, 255, 255, .045);
}

.channel-permission-state.is-selected.is-deny {
    color: #ff9baa;
    background: rgba(255, 100, 124, .15);
}

.channel-permission-state.is-selected.is-allow {
    color: #82e5bb;
    background: rgba(91, 214, 162, .14);
}

.channel-permission-state.is-selected.is-inherit {
    color: #d1cddc;
    background: rgba(255, 255, 255, .08);
}

.channel-permission-loading {
    padding: 24px;
    color: #737586;
    font-size: 10px;
    text-align: center;
}

/* ---------- Pinned messages popover ---------- */
.pinned-popover-panel {
    padding: 0;
    overflow: hidden;
}

.pinned-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--line);
}

.pinned-panel-head strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 680;
}

.pinned-panel-head span {
    color: var(--dim);
    font-size: 9px;
    font-weight: 600;
}

.pinned-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: min(420px, 58vh);
    overflow-y: auto;
    padding: 6px;
}

.pinned-item {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    border-radius: 8px;
    transition: background var(--transition);
}

.pinned-item:hover {
    background: rgba(255, 255, 255, .045);
}

.pinned-item-main {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    flex: 1;
    min-width: 0;
    padding: 8px;
    border-radius: inherit;
    text-align: left;
}

.pinned-item-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.pinned-item-meta {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
}

.pinned-item-meta strong {
    color: var(--text-soft);
    font-size: 10.5px;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pinned-item-meta span {
    flex: none;
    color: #5f6172;
    font-size: 8.5px;
}

.pinned-item-text {
    display: -webkit-box;
    overflow: hidden;
    color: #a9a5b8;
    font-size: 10.5px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.pinned-unpin {
    flex: none;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    margin: 6px 4px 0 0;
    border-radius: 6px;
    color: #6e7080;
    transition: background var(--transition), color var(--transition);
}

.pinned-unpin:hover {
    background: rgba(255, 100, 124, .1);
    color: #ff9cae;
}

.pinned-unpin .icon {
    width: 13px;
    height: 13px;
}

.pinned-empty,
.pinned-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 26px 18px;
    color: #656778;
    font-size: 10px;
    text-align: center;
}

.pinned-empty strong {
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 650;
}

.pinned-empty-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: 2px;
    border-radius: 10px;
    color: #a99beb;
    background: rgba(139, 109, 255, .1);
}

.pinned-empty-icon .icon {
    width: 16px;
    height: 16px;
}

/* ---------- Member timeouts ---------- */
.profile-timeout {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.profile-timeout-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.profile-timeout-head h4 {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 680;
}

.profile-timeout-head span {
    color: var(--dim);
    font-size: 9px;
    text-align: right;
}

.profile-timeout-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.profile-timeout-active {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border: 1px solid rgba(240, 184, 90, .2);
    border-radius: 9px;
    background: rgba(240, 184, 90, .06);
    color: #d8b46f;
    font-size: 10px;
}

.profile-timeout-active > .icon {
    width: 13px;
    height: 13px;
    flex: none;
}

.profile-timeout-active > span {
    flex: 1;
}

.profile-timeout-active .button {
    flex: none;
}

@media (max-width: 600px) {
    .channel-permission-target {
        max-width: none;
    }

    .channel-permission-row {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .channel-permission-choice {
        width: 100%;
    }

    .channel-permission-state {
        flex: 1;
    }
}

/* ---------- Category and channel settings ---------- */
.modal-select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border-radius: 9px;
    border: 1px solid var(--line-strong);
    background: #11131c;
    color: var(--text-soft);
    font: inherit;
    font-size: 12px;
    outline: none;
}

.modal-select:focus {
    border-color: rgba(139, 109, 255, .55);
    box-shadow: 0 0 0 3px rgba(139, 109, 255, .09);
}

.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, .018);
    cursor: pointer;
}

.checkbox-field input {
    margin: 2px 0 0;
    accent-color: var(--accent);
}

.checkbox-field > span {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.checkbox-field strong {
    color: var(--text-soft);
    font-size: 11.5px;
    font-weight: 650;
}

.checkbox-field small {
    color: var(--dim);
    font-size: 10px;
    line-height: 1.5;
}

.checkbox-field.is-disabled {
    cursor: default;
    opacity: .55;
}
