.user-avatar { display: inline-grid; place-items: center; position: relative; width: 30px; height: 30px; flex: none; border-radius: 50%; overflow: hidden; background: linear-gradient(140deg, #218cac, #6052b0); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; text-align: center; vertical-align: middle; letter-spacing: .04em; }
.user-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.user-avatar-large { width: 64px; height: 64px; font-size: 22px; }
.sfactionbar > a.topbar-avatar { display: flex; align-items: center; height: 58px; padding: 0 8px; }
.communication { display: flex; flex-direction: column; height: 100%; min-height: 350px; min-width: 0; gap: .75rem; }
.communication-header { display: flex; align-items: center; min-height: 3.5rem; }
.communication-header h2 { margin: 0; font-size: clamp(1.3rem, 2vw, 1.65rem); }
.communication-header h2 .bi { margin-right: .3rem; color: #53c2e7; }
.communication-header p { margin: .25rem 0 0; color: var(--app-muted); font-size: .875rem; }
.communication-tabs { display: flex; border-bottom: 1px solid var(--app-border-strong); gap: .5rem; }
.communication-tabs button { border: 0; border-bottom: 2px solid transparent; padding: .7rem 1rem; color: var(--app-muted); background: transparent; }
.communication-tabs button .bi { margin-right: .3rem; }
.communication-tabs button:hover { color: var(--app-text); }
.communication-tabs button.active { color: #fff; border-bottom-color: #53c2e7; }
.voice-indicator { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #9fe122; box-shadow: 0 0 8px #9fe122; }
.voice-indicator[hidden], .communication-panel[hidden] { display: none; }
.communication-content { display: flex; flex: 1; min-width: 0; min-height: 0; }
.communication-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: .7rem; }
.communication-panel-title { display: none; }
#textPanel { container-type: inline-size; }
#voicePanel { container-type: inline-size; }
.messages-shell { position: relative; flex: 1; min-height: 0; border: 1px solid var(--app-border); border-radius: var(--app-radius); background: var(--app-surface); overflow: hidden; }
.messages { height: 100%; overflow-y: auto; overflow-anchor: none; padding: .85rem clamp(.7rem, 2vw, 1.4rem); }
.message-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; padding: 1.5rem; color: var(--app-muted); text-align: center; pointer-events: none; }
.message-empty[hidden] { display: none; }
.message-empty .bi { display: grid; place-items: center; width: 4rem; height: 4rem; margin-bottom: .4rem; border-radius: 1rem; color: #53c2e7; background: var(--app-accent-soft); font-size: 1.8rem; }
.message-empty strong { color: var(--app-text); font-size: 1.1rem; }
.message { display: flex; align-items: flex-start; gap: .7rem; max-width: 85%; margin: .4rem 0 1rem; overflow-wrap: anywhere; }
.message-content { min-width: 0; padding: .75rem 1rem; border: 1px solid var(--app-border); border-radius: .25rem 1rem 1rem 1rem; background: var(--app-surface-raised); box-shadow: var(--app-shadow-sm); }
.message.own { margin-left: auto; flex-direction: row-reverse; }
.message.own .message-content { border-color: rgba(83, 194, 231, .2); border-radius: 1rem .25rem 1rem 1rem; background: #1b303a; }
.message-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; margin-bottom: .4rem; color: var(--app-muted); font-size: .78rem; }
.message-meta strong { color: #84d4ee; font-size: .85rem; }
.message-content p { margin-bottom: .5rem; }
.message-content p:last-child { margin-bottom: 0; }
.message-content > div:last-child:empty { display: none; }
.message-image { display: block; max-width: min(100%, 500px); max-height: 400px; border-radius: .5rem; margin-top: .5rem; object-fit: contain; }
.message-form { display: flex; flex-direction: column; gap: .55rem; padding: .85rem; border: 1px solid var(--app-border-strong); border-radius: var(--app-radius); background: var(--app-surface-raised); box-shadow: var(--app-shadow-sm); }
.message-form:focus-within { border-color: rgba(83, 194, 231, .6); }
.message-label { color: var(--app-text); font-size: .85rem; font-weight: 600; }
.message-form textarea { width: 100%; min-height: 4.25rem; max-height: 12rem; resize: vertical; }
.message-actions, .message-buttons { display: flex; align-items: center; gap: .65rem; }
.message-actions { justify-content: space-between; }
.message-hint { color: var(--app-muted); font-size: .78rem; }
.message-buttons { flex: none; }
.message-buttons .btn { white-space: nowrap; }
.message-buttons .btn-primary { min-width: 6.5rem; }
.image-preview { display: flex; align-items: center; gap: .8rem; min-width: 0; padding: .5rem; border: 1px solid var(--app-border-strong); border-radius: .7rem; background: var(--app-bg); }
.image-preview[hidden] { display: none; }
.image-preview img { width: 72px; height: 72px; flex: none; border-radius: .45rem; object-fit: cover; background: var(--app-surface); }
.image-preview-details { display: flex; flex: 1; flex-direction: column; min-width: 0; gap: .2rem; }
.image-preview-details strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-preview-details span { color: var(--app-muted); font-size: .8rem; }
.image-preview .btn { flex: none; }
.voice-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.voice-controls label { display: grid; gap: .35rem; color: var(--app-muted); font-size: .875rem; font-weight: 600; }
.voice-controls select { width: 100%; color: var(--app-text); font-weight: 400; }
.voice-session { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; min-width: 0; }
.voice-settings { display: grid; gap: 1rem; }
.voice-settings[hidden], .voice-join[hidden] { display: none; }
.voice-settings-panel, .voice-participants { padding: 1.25rem; border: 1px solid var(--app-border); border-radius: var(--app-radius); background: var(--app-surface-raised); }
.voice-settings-panel { display: grid; gap: 1rem; min-width: 0; }
.voice-settings-panel h3 { margin: 0; font-size: 1rem; }
.voice-participants { display: flex; flex-direction: column; gap: 1rem; min-width: 0; min-height: 180px; }
.voice-participants.has-members { border-color: #9fe122; }
.voice-participants-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.voice-participants-header h3 { margin: 0; font-size: 1rem; }
.voice-member-count { min-width: 2rem; padding: .2rem .5rem; border-radius: 999px; background: var(--app-accent-soft); color: #a9dce9; text-align: center; font-variant-numeric: tabular-nums; }
.voice-tile { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; min-height: 100px; padding: 1rem; }
.voice-tile .bi { font-size: 2rem; line-height: 1; }
.voice-join { width: 100%; }
.voice-actions { display: flex; gap: .7rem; }
.voice-actions .voice-tile { flex: 1 1 0; min-width: 0; }
.voice-levels { display: grid; gap: .65rem; padding-top: 1rem; border-top: 1px solid var(--app-border); }
.voice-level { display: grid; grid-template-columns: minmax(170px, 220px) minmax(0, 440px) 4rem; align-items: center; gap: 1rem; min-height: 2.25rem; }
.voice-level label { margin: 0; }
.voice-level output { justify-self: end; color: #a9dce9; font-variant-numeric: tabular-nums; }
.voice-level progress, .voice-level input[type="range"] { width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--app-border-strong); }
.voice-level progress { appearance: none; overflow: hidden; }
.voice-level progress::-webkit-progress-bar { border-radius: 999px; background: var(--app-border-strong); }
.voice-level progress::-webkit-progress-value { border-radius: 999px; background: linear-gradient(90deg, #53c2e7, #9fe122); }
.voice-level progress::-moz-progress-bar { border-radius: 999px; background: linear-gradient(90deg, #53c2e7, #9fe122); }
.voice-level input[type="range"] { appearance: none; margin: .65rem 0; cursor: pointer; background: linear-gradient(90deg, #53c2e7 var(--range-progress, 0%), var(--app-border-strong) var(--range-progress, 0%)); }
.voice-level input[type="range"]::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; border: 3px solid var(--app-surface-raised); border-radius: 50%; background: #53c2e7; box-shadow: 0 0 0 1px #53c2e7; }
.voice-level input[type="range"]::-moz-range-track, .voice-level input[type="range"]::-moz-range-progress { background: transparent; border: 0; }
.voice-level input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border: 3px solid var(--app-surface-raised); border-radius: 50%; background: #53c2e7; box-shadow: 0 0 0 1px #53c2e7; }
.voice-level input[type="range"]:focus-visible { outline: 2px solid #53c2e7; outline-offset: 5px; }
.voice-members { display: grid; gap: .5rem; max-height: 55vh; overflow-y: auto; }
.voice-member { display: flex; align-items: center; gap: .6rem; min-width: 0; padding: .6rem; border: 1px solid var(--app-border); border-radius: .7rem; background: rgba(255, 255, 255, .025); }
.voice-member-name { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.voice-member.speaking { border-color: #9fe122; box-shadow: 0 0 10px rgba(159,225,34,.3); }
.voice-member-volume { flex: 0 1 110px; min-width: 65px; margin: 0; }
.voice-member-volume input { display: block; width: 100%; margin: 0; }
.voice-member-mute { display: grid; place-items: center; flex: 0 0 2.25rem; height: 2.25rem; padding: 0; }
.voice-member-mute .bi { font-size: 1.1rem; line-height: 1; }
@container (min-width: 560px) {
    .voice-session.joined { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
    .voice-session.joined .voice-controls { grid-template-columns: minmax(0, 1fr); }
    .voice-session.joined .voice-level { grid-template-columns: minmax(0, 1fr) 4rem; gap: .25rem .75rem; }
    .voice-session.joined .voice-level label { grid-column: 1 / -1; }
    .voice-session.joined .voice-level progress, .voice-session.joined .voice-level input[type="range"] { grid-column: 1; grid-row: 2; }
    .voice-session.joined .voice-level output { grid-column: 2; grid-row: 2; }
}
@container (max-width: 480px) {
    .voice-settings-panel, .voice-participants { padding: 1rem; }
    .voice-controls { grid-template-columns: minmax(0, 1fr); }
    .voice-level { grid-template-columns: minmax(0, 1fr) 4rem; gap: .25rem .75rem; }
    .voice-level label { grid-column: 1 / -1; }
    .voice-level progress, .voice-level input[type="range"] { grid-column: 1; grid-row: 2; }
    .voice-level output { grid-column: 2; grid-row: 2; }
}
@media (min-width: 768px) {
    .communication-tabs { display: none; }
    .communication-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(.75rem, 2vw, 1.5rem); }
    .communication-panel { min-width: 0; }
    #voicePanel { overflow-y: auto; }
    .communication-panel-title { display: flex; align-items: center; gap: .5rem; min-height: 2.5rem; margin: 0; border-bottom: 1px solid var(--app-border-strong); font-size: 1.1rem; }
    .communication-panel-title .bi { color: #53c2e7; }
}
@container (max-width: 720px) {
    .message { max-width: 100%; }
    .message-actions { align-items: stretch; flex-direction: column; }
    .message-buttons { justify-content: space-between; }
    .message-hint { order: 1; }
}
