.room-layout {
    grid-template-columns: minmax(0, 1fr) minmax(225px, 270px);
    gap: 12px;
    align-items: stretch;
}
.room-layout .media-panel { grid-area: 1 / 1; }
.room-layout .live-chat {
    grid-area: 2 / 1;
    min-height: 340px;
    height: clamp(350px, calc(100svh - 520px), 610px);
}
.room-layout:has(#room-camera-grid[hidden]) .live-chat { height: clamp(350px, calc(100svh - 335px), 700px); max-height: none; }
.room-layout .room-roster {
    grid-area: 1 / 2 / span 2;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.room-roster details { min-height: 0; }
#chat-participants { max-height: min(80svh, 690px); }
.camera-heading, .camera-view-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
}
.camera-heading { justify-content: space-between; }
.camera-view-tools { color: var(--quiet); font-size: 12px; }
.camera-view-tools label { display: flex; align-items: center; gap: 5px; }
.camera-view-tools select, .camera-view-tools button { min-height: 30px; padding: 3px 8px; font-size: 12px; }
.room-layout .camera-grid { align-items: start; }
.room-layout .camera-slot {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    aspect-ratio: 1.6;
}
.room-layout .camera-slot:not([class*="finish-"]) { box-shadow: inset 0 1px #ffffff19, 0 5px 14px #05040d83; }
.room-layout .chat-form {
    position: sticky;
    bottom: 0;
    z-index: 7;
    background: #17121f;
    box-shadow: 0 -5px 12px #100b17a8;
}
.room-layout .camera-slot[data-tile-size="-1"] { aspect-ratio: 2; }
.room-layout .camera-slot[data-tile-size="1"] { aspect-ratio: 1.14; }
.room-layout .camera-grid[data-enlarged="true"] { grid-template-columns: minmax(0, 1fr); }
.room-layout .camera-grid[data-enlarged="true"] .camera-slot {
    aspect-ratio: auto;
    height: clamp(180px, 42svh, 410px);
    background: #0b0912;
}
.room-layout .camera-grid[data-enlarged="true"] video { object-fit: contain; }
.camera-tile-tools {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 4;
    display: flex;
    gap: 2px;
}
.camera-tile-tools button {
    border: 1px solid #746081;
    border-radius: 5px;
    min-width: 24px;
    min-height: 25px;
    padding: 0 3px;
    color: #fff1fc;
    background: #1a1127ee;
    cursor: pointer;
}
.camera-tile-tools [data-move] { cursor: grab; touch-action: none; }
.camera-tile-tools [data-move]:active { cursor: grabbing; }
.roster-person [data-watch-camera][aria-pressed="true"] { color: #bff5ff; border-color: #4ea7ba; }
.room-layout .chat-log {
    min-height: 0;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 6px 4px;
}
.room-layout .chat-entry {
    position: relative;
    padding: 8px 43px 8px 8px;
}
.room-layout .chat-entry:hover, .room-layout .chat-entry:focus-within { background-color: #20192fdc; }
.chat-entry [data-message-actions] { position: absolute; right: 4px; top: 4px; margin: 0; }
.chat-entry [data-message-actions] summary {
    display: grid;
    place-items: center;
    min-width: 32px;
    min-height: 28px;
    list-style: none;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #d9bad2;
}
.chat-entry [data-message-actions] summary::-webkit-details-marker { display: none; }
.chat-entry [data-message-actions][open] summary, .chat-entry [data-message-actions] summary:hover {
    background: #322241;
    border-color: #765280;
    color: white;
}
.chat-menu-panel {
    display: grid;
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 115px;
    gap: 3px;
    padding: 4px;
    z-index: 6;
    border: 1px solid #805e88;
    border-radius: 8px;
    background: #22182f;
    box-shadow: 0 9px 18px #040209ba;
}
.chat-menu-panel button { min-height: 27px; white-space: nowrap; }
@media (min-width: 741px) {
    .room-layout .camera-slot { width: 100%; max-height: clamp(104px, 14svh, 145px); }
    .room-layout .camera-slot[data-tile-size="-1"] { max-height: clamp(78px, 10svh, 112px); }
    .room-layout .camera-slot[data-tile-size="1"] { max-height: clamp(132px, 18svh, 190px); }
    .room-layout .camera-grid[data-enlarged="true"] .camera-slot { max-height: none; }
}
@media (hover: hover) {
    .chat-entry [data-message-actions]:not([open]) summary { opacity: .25; }
    .chat-entry:hover [data-message-actions] summary, .chat-entry:focus-within [data-message-actions] summary { opacity: 1; }
}
@media (max-width: 740px) {
    .room-layout .camera-grid { grid-template-columns: repeat(clamp(1, var(--cols), 3), minmax(0, 1fr)); }
    .room-layout .live-chat { height: clamp(330px, 71dvh, 610px); }
    .room-layout:has(#room-camera-grid[hidden]) .live-chat { height: clamp(330px, 75dvh, 650px); }
    .room-layout .room-roster { display: block; }
    .room-layout .camera-slot .camera-invite { top: auto; bottom: 4px; right: 4px; }
    .camera-tile-tools button { min-width: 25px; min-height: 25px; }
}
.room-layout .chat-log { overflow-anchor: none; }
.room-layout .chat-entry { display: grid; grid-template-columns: 29px minmax(0, 1fr); gap: 9px; }
.chat-entry.is-mentioned { background: #39301b; border-left: 2px solid #edba60; }
.chat-author { display: flex; align-items: baseline; gap: 5px 8px; flex-wrap: wrap; }
.chat-author .chat-name {
    margin: 0;
    font-weight: 800;
    color: var(--handle-a, #ffb9dd);
    text-shadow: 0 0 .8em var(--handle-b, transparent);
}
.chat-entry .chat-avatar { border-color: var(--frame-a, #ad6d98); box-shadow: 0 0 8px var(--frame-b, transparent); }
.chat-prestige {
    color: #eed5a0;
    font-size: 10px;
    line-height: 1.2;
    border: 1px solid #725661;
    border-radius: 13px;
    padding: 2px 5px;
}
.chat-heading, .chat-author { justify-content: flex-start; }
.chat-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
#chat-mentions { min-height: 29px; font-size: 12px; border-color: #9a6d4a; color: #ffe6b2; }
.chat-menu-panel a { white-space: nowrap; }
[data-message-actions][data-opens-up=true] .chat-menu-panel { bottom: 100%; top: auto; }
.chat-link-preview {
    display: flex;
    width: max-content;
    max-width: 100%;
    align-items: center;
    gap: 7px;
    margin-top: 5px;
    padding: 4px 8px;
    border: 1px solid #49536e;
    border-radius: 7px;
    color: #b1eeff;
    background: #172031;
    text-decoration: none;
    font-size: 12px;
}
.chat-link-preview span { color: #b8bad1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-log .chat-older { display: block; margin: 4px auto 10px; }
.chat-gift-feed { display: flex; gap: 6px; overflow: hidden; flex-wrap: wrap; }
.chat-gift-feed > span { color: #ffc5e3; border: 1px solid #834667; border-radius: 12px; padding: 2px 7px; font-size: 11px; }
.roster-person .roster-avatar { border-color: var(--frame-a, #ad6d98); box-shadow: 0 0 8px var(--frame-b, transparent); }
.roster-person .roster-name { color: var(--handle-a, #ffe5f5); text-shadow: 0 0 .8em var(--handle-b, transparent); }
.roster-person[class*="finish-"] { border-bottom-color: var(--effect-a, #3e3247); }
.roster-person.roster-arrival { position: relative; isolation: isolate; }
.roster-person.roster-arrival:is(.finish-spotlight-entry,.finish-royal-entrance,.finish-fireworks-entry,.finish-gold-confetti,.finish-diamond-shower,.finish-cosmic-portal)::after {
    position: absolute;
    inset: 0;
    content: '';
    pointer-events: none;
    background: radial-gradient(ellipse at 20% 0, var(--entrance-a, #fc9ddd), transparent 70%);
    opacity: 0;
    animation: rc-sweep-arrival 1.4s ease-out both;
}
@media (prefers-reduced-motion: reduce) {
    .roster-person.roster-arrival::after { animation: none !important; }
}
.camera-slot[data-moving]{opacity:.78;outline:2px solid #ed72b8;outline-offset:-2px}
.camera-slot[data-drop-target]{outline:2px solid #72f4ff;outline-offset:-2px}
.roster-person:where(.finish-golden-aura,.finish-nebula-particles,.finish-crown-effect,.finish-celebration-effect,.finish-hologram-glint,.finish-violet-afterglow) {
    background: linear-gradient(95deg,var(--effect-b,#3d2049),transparent 55%);
    border-radius:8px;
}
.roster-person:where(.finish-golden-aura,.finish-nebula-particles,.finish-crown-effect,.finish-celebration-effect,.finish-hologram-glint,.finish-violet-afterglow) .roster-meta {
    color:#fbebff;
}
.moderation-console{display:grid;gap:10px}.moderation-console section,.moderation-console>form{padding:10px;border:1px solid #584866;border-radius:10px;background:#161722}
.moderation-console h3{margin-bottom:6px}.moderation-console section p,.moderation-console article{margin-top:6px}.moderation-permissions{display:flex;flex-wrap:wrap;gap:6px 12px;padding:5px 0 9px}
.moderation-permissions label{color:var(--muted);font-size:.85rem}.moderation-console [role=status]{color:var(--cyan)}

.room-member-trigger{border:0;background:none;font:inherit;font-weight:750;color:inherit;padding:0;text-align:left;cursor:pointer;overflow-wrap:anywhere}
.room-member-trigger:hover{text-decoration:underline;text-underline-offset:.18em}
#site-dialog:has(.room-member-card){width:min(calc(100vw - 26px),358px);padding:17px;border-color:#ba6297;background:linear-gradient(145deg,#2f1c36,#111b2c 80%);box-shadow:0 16px 42px #050510bf,0 0 20px #ce34803d}
#site-dialog:has(.room-member-card) h2{font-size:1.16rem;margin-bottom:11px;overflow-wrap:anywhere}
.room-member-card{display:grid;grid-template-columns:60px minmax(0,1fr);align-items:center;gap:12px}
.room-member-card>p{grid-column:1/-1;margin:0}
.room-member-portrait{width:60px;height:60px;display:grid;place-items:center;overflow:hidden;border-radius:50%;border:2px solid #f18bc7;background:#322742;box-shadow:0 0 14px #f13b9247;color:#ffe0f4;font-weight:750}
.room-member-portrait img{width:100%;height:100%;object-fit:cover}
.room-member-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin:0}
.room-member-stats>div{min-width:0;padding:5px 3px;border:1px solid #594661;background:#171b2b;border-radius:7px;text-align:center}
.room-member-stats dt{display:grid;justify-items:center;gap:2px;font-size:clamp(.61rem,2.7vw,.72rem);color:#e4cfe6;overflow-wrap:anywhere}
.room-member-stats dt svg{width:13px;height:13px;color:#f789ca}
.room-member-stats dd{margin:2px 0 0;color:#ffe3ac;font-size:.76rem;font-weight:750;overflow-wrap:anywhere}
.room-member-actions{grid-column:1/-1;display:flex;justify-content:flex-end;gap:7px}
.room-member-actions .button{width:40px;min-height:38px;padding:0}

.room-member-actions{flex-wrap:wrap;justify-content:flex-start}
.room-member-actions .button{display:inline-grid;place-items:center;flex:0 0 40px;width:40px;height:38px;padding:0;overflow:visible}
.room-member-actions .button svg{display:block;flex:none;width:19px;height:19px;overflow:visible}
.room-member-actions .sr-only{pointer-events:none}
.room-member-feedback{font-size:.8rem;color:#ebcde6}
.room-layout,.room-layout .live-chat{position:relative}
.chat-gift-effect{left:50%;top:18%;width:min(36%,132px);margin-left:-66px;z-index:3}
