.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    background: var(--bg-active);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-weight: 500;
    transition: background var(--transition-fast);
}

@media (hover: hover) {
    .btn:hover {
        background: var(--bg-hover);
    }
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent-primary);
}

@media (hover: hover) {
    .btn-primary:hover {
        background: var(--accent-hover);
    }
}

.btn-danger {
    background: var(--danger-bg);
}

@media (hover: hover) {
    .btn-danger:hover {
        background: var(--danger-hover);
    }
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-hover);
    flex-shrink: 0;
    overflow: hidden;
    cursor: pointer;
}

.avatargroup {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-xl);
    background: var(--bg-hover);
    flex-shrink: 0;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.avatargroup img,
.avatargroup video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-xl);
}

.avatar, .msg-avatar, .message-avatar, .friend-avatar,
.profile-avatar, .shared-avatar, .theatre-avatar, .modal-friend-avatar {
    cursor: pointer;
}

.avatar:active, .msg-avatar:active, .message-avatar:active, .friend-avatar:active,
.profile-avatar:active, .shared-avatar:active, .theatre-avatar:active, .modal-friend-avatar:active {
    transform: translateY(1px);
}
.status-ring:active{
    transform: translateY(1px);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
}

.avatar-sm {
    width: 28px;
    height: 28px;
}

.avatar-lg {
    width: 48px;
    height: 48px;
}

.avatar-xl {
    width: 96px;
    height: 96px;
}

.status-ring {
    position: relative;
    border-radius: 50%;
    padding: 2px; 
    background: transparent;
}

.status-ring.online { box-shadow: 0 0 0 2px var(--status-online); }
.status-ring.away { box-shadow: 0 0 0 2px var(--status-away); }
.status-ring.dnd { box-shadow: 0 0 0 2px var(--status-dnd); }
.status-ring.offline { box-shadow: 0 0 0 2px var(--status-offline); }
.status-ring.activity { box-shadow: 0 0 0 2px var(--status-activity); }
.status-ring.unknown { box-shadow: 0 0 0 2px var(--status-offline); opacity: 0.6; }
.status-dot.unknown { background: var(--status-offline); opacity: 0.6; }

.topbar-avatar-wrap.status-ring { padding: 0; }

.profile-description {
    margin: 12px 0 0;
    padding: 10px 12px;
    background: var(--bg-overlay);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.profile-description:empty {
    display: none;
}

.profile-description .custom-emoji {
    height: 1.3em;
    vertical-align: middle;
}

.rich-activity {
    margin: 12px 0;
    padding: 12px;
    border-radius: var(--radius-lg);
    background: var(--bg-overlay);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rich-activity-head {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--status-activity);
    font-weight: 700;
}

.rich-activity-body {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.rich-activity-art {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-elevated);
}

.rich-activity-art.game {
    width: 49px;
    height: 49px;
    background-color: var(--bg-overlay);
}

.rich-activity-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rich-activity-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rich-activity-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: rtl;
    text-align: left;
}

.rich-activity-details,
.rich-activity-source {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rich-activity-source {
    color: var(--text-muted);
}

.rich-activity-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.rich-activity-time {
    font-size: 10px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.rich-activity-bar {
    flex: 1;
    height: 4px;
    border-radius: var(--radius-sm);
    background: var(--bg-base);
    position: relative;
}

.rich-activity-fill {
    height: 100%;
    width: 0;
    background: var(--accent-primary);
    transition: width var(--transition-normal);
}

.rich-activity-dot {
    position: absolute;
    top: 50%;
    left: 0;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--accent-primary);
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 2px var(--bg-overlay);
    transition: left var(--transition-normal);
}

.rich-activity-elapsed {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.rich-activity-paused {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}


.badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent-primary);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
}

.notif-numero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1lh;
    height: 1lh;
    padding: 0 4px;
    background: var(--accent-active);
    color: white;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.notif-numero:empty {
    display: none;
}

.list-item.has-mention .notif-numero {
    background: var(--status-dnd);
}

.list-item.has-unread {
    background: var(--bg-overlay);
}

.badge-success {
    background: var(--success);
    color: var(--success-text);
}

.badge-warning {
    background: var(--warning);
    color: var(--warning-text);
}

.badge-danger {
    background: var(--danger);
    color: var(--danger-text);
}

.error-box {
    background: var(--danger);
    color: var(--danger-text);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    text-align: center;
}

.field {
    margin-bottom: 1.25rem;
}

.field input,
.field textarea {
    width: 100%;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

@media (hover: hover) {
    .list-item:hover {
        background: var(--bg-overlay);
    }
}

.list-item.active {
    background: var(--bg-overlay);
}

.item-info {
    flex: 1;
    min-width: 0;
}

.list-close {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    opacity: 0;
    cursor: pointer;
    filter: var(--icon-filter);
    transition: opacity var(--transition-fast);
}

@media (hover: hover) {
    .list-item:hover .list-close {
        opacity: 0.6;
    }
}

@media (hover: hover) {
    .list-close:hover {
        opacity: 1;
    }
}

.list-item-muted .avatar,
.list-item-muted .avatargroup,
.list-item-muted .item-name {
    opacity: 0.5;
}

.list-item-closed {
    display: none !important;
}

.item-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-sub {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-activity {
    font-size: 0.78em;
    font-style: italic;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-activity:empty {
    display: none;
}

.section-title {
    padding: 16px 16px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-faint);
}

.empty-state {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-faint);
}

.scroll {
    overflow-y: auto;
    height: 100%;
}

.pad {
    padding: 16px;
}

input.cb {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    padding: 0;
    margin: 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--bg-elevated);
    cursor: pointer;
}

input.cb:checked {
    border: none;
    background: url('/img/server/icons/checkbox-on.svg') center / 18px 18px no-repeat;
}

html.western input.cb:checked {
    background-image: url('/img/server/icons/checkbox-on-western.svg');
}

input.cb.cb-x:not(:checked) {
    border: none;
    background: url('/img/server/icons/checkbox-x.svg') center / 18px 18px no-repeat;
}

input.cb:disabled {
    cursor: not-allowed;
}

.pie-ring {
    --keep: 1;
    --boost: 0;
    padding: 2px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.pie-ring.speaking {
    background: conic-gradient(
        var(--status-away) 0 calc(var(--boost) * 1turn),
        var(--status-online) calc(var(--boost) * 1turn) calc(var(--keep) * 1turn),
        var(--status-dnd) calc(var(--keep) * 1turn) 1turn
    );
}

.pie-ring.muted {
    background: var(--status-dnd);
}

.belt {
    --v: 50%;
    --p: 50%;
    width: 100%;
    min-width: 0;
    height: 18px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.belt::-webkit-slider-runnable-track {
    height: 8px;
    border: 1px solid var(--accent-active);
    border-radius: var(--radius-sm);
    background: linear-gradient(to right, var(--status-online) 0 var(--v), var(--status-away) var(--v) var(--p), var(--status-dnd) var(--p) 100%);
}

.belt::-moz-range-track {
    height: 8px;
    border: 1px solid var(--accent-active);
    border-radius: var(--radius-sm);
    background: linear-gradient(to right, var(--status-online) 0 var(--v), var(--status-away) var(--v) var(--p), var(--status-dnd) var(--p) 100%);
}

.belt::-webkit-slider-thumb {
    width: 10px;
    height: 18px;
    margin-top: -6px;
    border: none;
    border-radius: 2px;
    background: var(--svgnorm);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    -webkit-appearance: none;
    appearance: none;
}

.belt::-moz-range-thumb {
    width: 10px;
    height: 18px;
    border: none;
    border-radius: 2px;
    background: var(--svgnorm);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.pop-lock {
    position: absolute;
    top: -9px;
    left: -6px;
    display: none;
    width: 20px;
    height: 20px;
    padding: 2px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    transform: rotate(-90deg);
    z-index: 1;
}

.open > .pop-lock {
    display: block;
}

.pop-lock circle {
    fill: none;
    stroke-width: 2.6;
}

.pop-lock-track {
    stroke: var(--border-subtle);
}

.pop-lock-fill {
    stroke: var(--svgnorm);
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
}

.arming > .pop-lock .pop-lock-fill {
    animation: pop-lock-fill 0.7s linear forwards;
}

.locked > .pop-lock .pop-lock-fill {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
}

@keyframes pop-lock-fill {
    to { stroke-dashoffset: 0; }
}
