/* SPDX-License-Identifier: AGPL-3.0-only */
/* ---------- Side panels (shared) & Chat ---------- */

.side-panel {
    position: relative;
    width: 340px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 0;
}

/* Panels take focus when they open (see focusPanel in js/ui/focus.js); the next Tab reaches their controls. */
.side-panel:focus {
    outline: none;
}

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

.panel-header .ghost-btn {
    height: 32px;
    min-width: 32px;
    padding: 0;
    font-size: 14px;
    border: 0;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-inline-end: auto;
}

.panel-header .ghost-btn svg {
    width: 18px;
    height: 18px;
}

.count-pill {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.count-pill:empty {
    display: none;
}

.chat-messages {
    flex: 1;
    list-style: none;
    margin: 0;
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chat-empty {
    margin: auto;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

.chat-empty::before {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    margin: 0 auto 8px;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 2H4a2 2 0 0 0-2 2v18l4-4h14a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2Zm0 14H5.2L4 17.2V4h16v12Z'/%3E%3C/svg%3E")
        center / contain no-repeat;
    opacity: 0.6;
}

/* Message group: avatar + header shown once for consecutive messages from one sender. */
.msg-group {
    display: flex;
    gap: 10px;
    max-width: 88%;
    align-self: flex-start;
}

.msg-group.mine {
    align-self: flex-end;
}

.msg-avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    margin-top: 2px;
    border-radius: 50%;
    background: var(--avatar-bg, var(--primary));
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.msg-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mine .msg-content {
    align-items: flex-end;
}

.msg-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    margin-bottom: 4px;
    font-size: 11px;
    color: var(--muted);
}

.msg-author {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msg-bubbles {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

.mine .msg-bubbles {
    align-items: flex-end;
}

.msg-text {
    max-width: 100%;
    padding: 8px 12px;
    border-radius: 16px;
    background: var(--surface-2);
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Corners facing the sender tighten so stacked bubbles read as one thread. */
.msg-text:not(:first-child) {
    border-start-start-radius: 4px;
}

.msg-text:not(:last-child) {
    border-end-start-radius: 4px;
}

.mine .msg-text {
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
}

.mine .msg-text:not(:first-child) {
    border-start-end-radius: 4px;
}

.mine .msg-text:not(:last-child) {
    border-end-end-radius: 4px;
}

.msg-text a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Emoji-only messages ("😃", "👍🏽🎉") are shown big, without a bubble. */
.msg-text.msg-emoji,
.mine .msg-text.msg-emoji {
    padding: 0 2px;
    background: transparent;
    color: inherit;
    font-size: 36px;
    line-height: 1.2;
}

/* "Message privately" next to the author of a message: shown on hover / focus (always on touch screens). */
.msg-meta .msg-dm {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    min-width: 0;
    margin-inline-start: auto;
    padding: 0;
    border: 0;
    border-radius: 6px;
    color: var(--muted);
    opacity: 0;
    transition: opacity 0.15s;
}

.msg-dm[hidden] {
    display: none;
}

.msg-dm svg {
    width: 14px;
    height: 14px;
}

.msg-group:hover .msg-dm,
.msg-dm:focus-visible {
    opacity: 1;
}

.msg-dm:hover {
    color: var(--private);
}

@media (hover: none) {
    .msg-meta .msg-dm {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .msg-meta .msg-dm {
        transition: none;
    }
}

/* Shared files: an image preview (images only) and a download link with the name and size. */
.msg-file {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
}

.msg-file-preview img {
    display: block;
    max-width: 100%;
    max-height: 180px;
    border-radius: 10px;
}

.msg-text .msg-file-link {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    text-decoration: none;
}

.msg-file-link svg {
    width: 26px;
    height: 26px;
    opacity: 0.9;
}

.msg-file-label {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.msg-file-name {
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msg-file-link:hover .msg-file-name {
    text-decoration: underline;
}

.msg-file-size {
    font-size: 12px;
    opacity: 0.75;
}

.msg-file.failed {
    opacity: 0.6;
}

/* Join/leave activity: quiet, left-aligned rows that stay out of the conversation's way. */
.chat-event {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 2px;
    color: var(--muted);
    font-size: 12px;
}

.chat-event + .chat-event {
    margin-top: -8px;
}

.chat-event-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--surface-2);
}

.chat-event-icon svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chat-event.joined .chat-event-icon {
    color: var(--success);
}

.chat-event-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-event time {
    flex-shrink: 0;
    font-size: 11px;
    opacity: 0.8;
}

.chat-form {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px 12px;
    border-top: 1px solid var(--border);
}

.chat-input-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-input-row #chat-input {
    flex: 1;
    min-width: 0;
    margin-inline: 2px 4px;
}

.chat-attach {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--muted);
}

.chat-attach.active {
    background: var(--surface-2);
    color: var(--text);
}

.chat-attach:disabled {
    opacity: 0.5;
}

.chat-attach svg {
    width: 20px;
    height: 20px;
}

.chat-send {
    color: var(--link);
}

.chat-form.private #chat-input {
    border-color: var(--private);
}

/* ---------- Chat tabs (Everyone / Private) and private chats ---------- */

.chat-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.chat-tab {
    position: relative;
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 42px;
    padding: 0 12px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
}

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

.chat-tab[aria-selected='true'] {
    border-bottom-color: var(--primary);
    color: var(--link);
}

.chat-tab:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.chat-tab .badge,
.chat-dm-side .badge {
    position: static;
    box-shadow: none;
}

.chat-view {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.chat-view[hidden],
.chat-dm-home[hidden],
.chat-dm-thread[hidden] {
    display: none;
}

.chat-dm-home,
.chat-dm-thread,
.chat-dm-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.chat-dm-toolbar {
    padding: 10px 14px;
}

.chat-dm-list {
    flex: 0 1 auto;
    min-height: 0;
    margin: 0;
    padding: 0 6px 6px;
    list-style: none;
    overflow-y: auto;
}

.chat-dm-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: start;
}

.chat-dm-item:hover,
.chat-dm-item:focus-visible {
    background: var(--surface-2);
}

.chat-dm-item .msg-avatar {
    width: 36px;
    height: 36px;
    margin: 0;
    font-size: 13px;
}

.chat-dm-item.gone .msg-avatar {
    opacity: 0.55;
}

.chat-dm-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-dm-item-name,
.chat-dm-preview {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-dm-item-name {
    font-size: 14px;
    font-weight: 500;
}

.chat-dm-preview {
    color: var(--muted);
    font-size: 13px;
}

.chat-dm-preview svg {
    width: 1.1em;
    height: 1.1em;
    margin-inline-end: 3px;
    vertical-align: -0.2em;
}

.chat-dm-item.unread .chat-dm-item-name,
.chat-dm-item.unread .chat-dm-preview {
    color: var(--text);
    font-weight: 600;
}

.chat-dm-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    color: var(--muted);
    font-size: 11px;
}

.chat-dm-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 6px;
    border-bottom: 1px solid var(--border);
}

.chat-dm-back {
    display: grid;
    place-items: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
}

.chat-dm-back svg {
    width: 22px;
    height: 22px;
}

/* The arrows point the right way in right-to-left languages too. */
[dir='rtl'] .chat-dm-back svg,
[dir='rtl'] .chat-send svg {
    transform: scaleX(-1);
}

.chat-dm-header .msg-avatar {
    width: 34px;
    height: 34px;
    margin: 0;
}

.chat-dm-who {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-dm-name {
    overflow: hidden;
    font-size: 15px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-dm-status {
    color: var(--muted);
    font-size: 12px;
}

/* ---------- Emoji picker (chat, emoji-mart) ---------- */

.chat-emoji-picker {
    position: absolute;
    inset-inline: 8px;
    bottom: calc(100% + 6px);
    z-index: 5;
    border-radius: 14px;
    box-shadow: 0 10px 30px var(--shadow);
}

.chat-emoji-picker[hidden] {
    display: none;
}

/* emoji-mart reads its colours from these (as "r, g, b"); they match the app's theme. */
.chat-emoji-picker em-emoji-picker {
    --rgb-accent: 91, 94, 240;
    --rgb-background: 24, 27, 34;
    --rgb-color: 232, 234, 240;
    --rgb-input: 34, 38, 49;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-over: rgba(255, 255, 255, 0.16);
    --border-radius: 14px;
    --shadow: none;
    --font-family: inherit;
    width: 100%;
    height: min(380px, 55vh);
    border: 1px solid var(--border);
}

:root[data-theme='light'] .chat-emoji-picker em-emoji-picker {
    --rgb-background: 255, 255, 255;
    --rgb-color: 26, 29, 36;
    --rgb-input: 236, 238, 243;
    --color-border: rgba(0, 0, 0, 0.06);
    --color-border-over: rgba(0, 0, 0, 0.14);
}

/* ---------- People ---------- */

.people-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

/* Search gets its own row; the host's bulk actions sit below it as compact chips. */
.people-toolbar .ghost-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
}

.people-toolbar .ghost-btn svg {
    width: 16px;
    height: 16px;
}

.people-toolbar .people-more-btn {
    justify-content: center;
    width: 30px;
    min-width: 30px;
    padding: 0;
    /* Pinned to the row's end so it stays put regardless of chip widths. */
    margin-inline-start: auto;
}

.people-more-btn[aria-expanded='true'] {
    background: var(--surface-2);
}

.person-menu button:disabled {
    opacity: 0.5;
    cursor: progress;
}

.people-search {
    position: relative;
    flex: 1 1 100%;
    min-width: 0;
}

.people-search svg {
    position: absolute;
    top: 50%;
    inset-inline-start: 10px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.people-search input {
    height: 36px;
    padding-block: 0;
    padding-inline: 36px 10px;
    font-size: 14px;
}

.people-empty {
    margin: 0;
    padding: 24px 16px;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
    overflow-wrap: anywhere;
}

/* ---------- Waiting room (host) ---------- */

.waiting-section {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    max-height: 40%;
    border-bottom: 1px solid var(--border);
    background: rgba(99, 102, 241, 0.08);
}

.waiting-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px 4px;
    font-size: 14px;
}

.waiting-header strong {
    display: flex;
    align-items: center;
    gap: 8px;
}

.waiting-header .ghost-btn {
    height: 32px;
    padding: 0 12px;
}

.waiting-list {
    min-height: 0;
    list-style: none;
    margin: 0;
    padding: 4px 6px 8px;
    overflow-y: auto;
}

.waiting-person {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    min-height: 52px;
    padding: 6px 8px;
    border-radius: 10px;
}

.waiting-person .person-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
}

.waiting-actions {
    display: flex;
    gap: 6px;
}

.waiting-actions button {
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
}

.waiting-actions .waiting-deny:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* Sized to its rows (scrolling when they overflow) so the empty-search message sits right below. */
.people-list {
    flex: 0 1 auto;
    min-height: 0;
    list-style: none;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
}

/* Badges and mic / camera sit in fixed slots, so they line up on every row whatever the name's length. */
.person {
    --slot: 20px;
    --action-col: 32px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto auto;
    align-items: center;
    column-gap: 8px;
    min-height: 48px;
    padding-block: 6px;
    padding-inline: 8px 4px;
    border-radius: 10px;
    transition: background 0.15s;
}

.person:hover,
.person:focus-within {
    background: var(--surface-2);
}

.person-avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--avatar-bg, var(--primary));
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    transition: box-shadow 0.15s;
}

.person.speaking .person-avatar {
    box-shadow:
        0 0 0 2px var(--surface),
        0 0 0 4px var(--speaking);
}

.person-name {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-inline-start: 2px;
    font-size: 14px;
    font-weight: 500;
}

.person-label {
    min-width: 0;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.you-tag {
    flex-shrink: 0;
    color: var(--muted);
    font-weight: 400;
}

.person-badges,
.person-status {
    display: grid;
    grid-template-columns: repeat(2, var(--slot));
    align-items: center;
    justify-items: center;
}

.person-badges {
    column-gap: 4px;
}

/* Room for the host's 26px buttons that cover each slot. */
.person-status {
    column-gap: 6px;
}

.person-badges > *,
.person-status > * {
    grid-row: 1;
}

.person .host-tag,
.person-mic {
    grid-column: 1;
}

.person .hand-tag,
.person-cam {
    grid-column: 2;
}

/* Webinar attendees: an eye where hosts have their role badge, and no microphone / camera (they can't publish). */
.person .attendee-tag {
    position: relative;
    display: grid;
    place-items: center;
    grid-column: 1;
    width: var(--slot);
    height: var(--slot);
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0;
}

.person .attendee-tag::before {
    content: '';
    position: absolute;
    inset: 0;
    width: 12px;
    height: 12px;
    margin: auto;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5ZM12 17a5 5 0 1 1 0-10 5 5 0 0 1 0 10Zm0-8a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z'/%3E%3C/svg%3E")
        center / contain no-repeat;
}

.person.attendee .person-status {
    visibility: hidden;
}

.person-sep {
    width: 1px;
    height: 16px;
    background: var(--border);
}

/* Icon-only badges; their text stays for screen readers and tooltips. */
.person .host-tag,
.person .hand-tag {
    position: relative;
    display: grid;
    place-items: center;
    width: var(--slot);
    height: var(--slot);
    padding: 0;
    border-radius: 50%;
    font-size: 0;
}

/* Taken out of flow so the hidden text can't push the icon off-centre. */
.person .host-tag::before {
    position: absolute;
    inset: 0;
    width: 12px;
    height: 12px;
    margin: auto;
}

/* Static for everyone else; for the host (and your own hand) it's a "Lower hand" button. */
.person .hand-tag {
    border: 0;
    background: rgba(251, 191, 36, 0.16);
    color: var(--hand-text);
    transition:
        background 0.15s,
        color 0.15s;
}

.person .hand-tag svg {
    width: 12px;
    height: 12px;
}

.person .hand-tag:disabled {
    cursor: default;
}

.person .hand-tag:not(:disabled):is(:hover, :focus-visible) {
    background: var(--hand);
    color: #1f1300;
}

/* Always shown, so every row reads the same: gray when on, red when off. */
.person-mic,
.person-cam {
    display: grid;
    place-items: center;
    width: var(--slot);
    height: var(--slot);
    color: var(--danger);
}

.person-mic.on,
.person-cam.on {
    color: var(--muted);
}

.person-mic svg,
.person-cam svg {
    width: 16px;
    height: 16px;
}

.person-status .icon-on,
.person-status .on .icon-off,
.audio-bars,
.person.speaking .person-mic.on .icon-on {
    display: none;
}

.person-status .on .icon-on {
    display: block;
}

.person.speaking .person-mic.on .audio-bars {
    display: flex;
}

.audio-bars {
    align-items: center;
    gap: 2px;
    height: 12px;
}

.audio-bars i {
    width: 3px;
    height: 100%;
    border-radius: 2px;
    background: var(--speaking);
    transform-origin: center;
    animation: audio-bar 0.9s ease-in-out infinite;
}

.audio-bars i:nth-child(2) {
    animation-delay: -0.3s;
}

.audio-bars i:nth-child(3) {
    animation-delay: -0.6s;
}

@keyframes audio-bar {
    0%,
    100% {
        transform: scaleY(0.35);
    }
    50% {
        transform: scaleY(1);
    }
}

.person-actions {
    display: grid;
    grid-template-columns: var(--action-col);
}

.person-mute,
.person-camera-off,
.person-actions button {
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    transition:
        opacity 0.15s,
        background 0.15s,
        color 0.15s;
}

.person-actions button {
    width: var(--action-col);
    height: var(--action-col);
}

.person-actions svg {
    width: 18px;
    height: 18px;
}

/* The host's mute / camera-off buttons cover the mic / camera slot (only offered while it's on). They show
   the current state, and the "off" icon once pointed at, so on touch screens the status still reads right. */
.person-mute,
.person-camera-off {
    position: relative;
    z-index: 1;
    width: 26px;
    height: 26px;
    background: var(--surface-2);
    color: var(--text);
}

.person-mute {
    grid-column: 1;
}

.person-camera-off {
    grid-column: 2;
}

.person-mute svg,
.person-camera-off svg {
    width: 16px;
    height: 16px;
}

.person-status .action-icon,
.person-status button:is(:hover, :focus-visible) .state-icon {
    display: none;
}

.person-status button:is(:hover, :focus-visible) .action-icon {
    display: block;
}

/* Row actions appear on hover / keyboard focus so long lists stay calm; touch screens always show them. */
.person-mute,
.person-camera-off,
.person-more {
    opacity: 0;
}

.person:is(:hover, :focus-within) :is(.person-mute, .person-camera-off, .person-more),
.person-more[aria-expanded='true'] {
    opacity: 1;
}

@media (hover: none) {
    .person-mute,
    .person-camera-off,
    .person-more {
        opacity: 1;
    }
}

.person-mute:hover,
.person-camera-off:hover,
.person-actions button:hover,
.person-more[aria-expanded='true'] {
    background: var(--surface);
    color: var(--text);
}

.person-mute:disabled,
.person-camera-off:disabled,
.person-actions button:disabled {
    opacity: 0.5;
    cursor: progress;
}

.person-menu {
    position: absolute;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 220px;
    padding: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--shadow);
}

.person-menu button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 14px;
    text-align: start;
}

.person-menu svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--muted);
}

.person-menu button:hover,
.person-menu button:focus-visible {
    background: var(--border);
    outline: none;
}

.person-menu .menu-divider {
    height: 1px;
    margin: 4px 6px;
    background: var(--border);
}

.person-menu .danger,
.person-menu .danger svg {
    color: var(--danger);
}

.person-menu .danger:hover,
.person-menu .danger:focus-visible {
    background: rgba(239, 68, 68, 0.15);
}

@media (prefers-reduced-motion: reduce) {
    .person,
    .person-avatar,
    .person-mute,
    .person-camera-off,
    .person-actions button {
        transition: none;
    }

    .audio-bars i {
        animation: none;
        transform: scaleY(0.7);
    }
}

/* Arrows in the join / leave icons point the way text flows. */
[dir='rtl'] .chat-event-icon svg {
    transform: scaleX(-1);
}

/* ---------- Notes ---------- */

.notes-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
}

.notes-toolbar .ghost-btn {
    display: grid;
    place-items: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
}

.notes-toolbar .ghost-btn:hover {
    color: var(--text);
}

.notes-toolbar .ghost-btn[aria-pressed='true'] {
    background: var(--surface-hover);
    box-shadow: inset 0 0 0 1px var(--border-strong);
    color: var(--text);
}

.notes-toolbar svg {
    width: 20px;
    height: 20px;
}

.notes-sep {
    width: 1px;
    height: 22px;
    margin: 0 4px;
    background: var(--border);
}

.notes-editor {
    position: relative;
    flex: 1;
    min-height: 0;
    padding: 14px 16px;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    outline: none;
}

.notes-editor.is-empty::before {
    content: attr(data-placeholder);
    position: absolute;
    inset-inline: 16px;
    color: var(--muted);
    pointer-events: none;
}

.notes-editor :is(ul, ol) {
    margin: 4px 0;
    padding-inline-start: 24px;
}

.notes-private {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
}

.notes-private svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

[dir='rtl'] .notes-toolbar .flip-rtl svg {
    transform: scaleX(-1);
}
