/* Current-room controls are separate from account-level notifications. */
.room-user-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 6px; }
.room-restoring .chat-room-map-view { display: none !important; }
.room-restoring .chat-room-layout { visibility: hidden; pointer-events: none; }
.room-restoring .chat-room-modal { position: relative; }
.room-restoring .chat-room-modal::after { content: '正在加载聊天室…'; position: absolute; top: 40%; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 14px; }
.room-real-name { overflow-wrap: anywhere; color: var(--zs-ink); font-weight: 600; }
span.chat-room-member { cursor: default; }
span.chat-room-member:hover { background: transparent; }
#roomMemberModeration > input { width: 100%; box-sizing: border-box; margin-bottom: 8px; }
#roomMemberModeration > select { margin-right: 8px; min-height: 36px; }
.chat-room-header { display: grid !important; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; flex: 0 0 auto; min-height: 64px; }
.chat-room-heading { min-width: 0; text-align: center; grid-column: 2; }
.chat-room-heading .eyebrow { display: none; }
.chat-room-heading h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-room-heading .chat-room-status { display: block; min-height: 0; margin: 3px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.chat-room-header-actions { justify-content: end; grid-column: 3; }
#chatRoomMapButton { width: 44px; padding: 0; min-width: 0; }
#chatRoomInfoButton, #closeChatRoomModalButton, #chatRoomLeaveButton { display: none !important; }
.chat-room-layout { grid-template-columns: 220px minmax(0, 1fr); }
.chat-room-main-toolbar, .chat-room-composer { flex-shrink: 0; }
.chat-room-main-toolbar:not(:has(#chatRoomJoinButton:not(.hidden))) { display: none; }
.chat-room-composer textarea { min-width: 0; }
.chat-room-message-row, .chat-room-message-bubble { min-width: 0; }
.chat-room-message-bubble { white-space: pre-wrap; }
.chat-room-message-bubble audio { max-width: 100%; }
#roomSettingsDialog { width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain; }
#roomSettingsDialog > header { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; position: sticky; top: -1px; z-index: 2; background: var(--zs-card); gap: 12px; }
#roomSettingsTitle { min-width: 0; overflow-wrap: anywhere; font-size: 18px; }
#roomSettingsClose { flex-shrink: 0; }
.room-preferences .icon-button { width: auto; padding: 8px; gap: 6px; font-size: 13px; }
#roomSettingsDialog .chat-room-info-panel { position: static; width: auto; max-height: none; padding: 16px 0; border: 0; box-shadow: none; overflow: visible; }
#roomSettingsDialog .chat-room-members { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#roomSettingsDialog .chat-room-member { overflow-wrap: anywhere; }
.room-preferences { display: flex; gap: 10px; padding: 12px 0; }
.room-settings-card, #roomMemberModeration { padding: 16px; margin: 14px 0; background: var(--zs-card); border: 1px solid var(--line); border-radius: 12px; }
.room-settings-card h3, #roomMemberModeration h3 { margin: 0 0 12px; font-size: 15px; }
#roomSettingsName { font-size: 18px; overflow-wrap: anywhere; }
#roomSettingsDialog { background: var(--zs-paper); }
#roomSettingsDialog > header { background: var(--zs-paper); }
#roomSettingsDialog .chat-room-info-panel { padding: 0; }
#roomSettingsDialog .chat-room-info-head strong { font-size: 13px; color: var(--muted); }
#roomSettingsDialog .chat-room-search { margin: 0; }
#roomSettingsDialog .chat-room-search input { height: 42px; font-size: 16px; }
#roomSettingsDialog .chat-room-search-results { margin-top: 10px; max-height: 260px; padding: 4px; }
#roomSettingsDialog .chat-room-search-results button { white-space: normal; overflow-wrap: anywhere; border-bottom: 1px solid var(--line); }
.room-setting-hint { color: var(--muted); font-size: 12px; line-height: 1.6; margin-bottom: 0; }
#roomPreferenceControls { display: grid; gap: 0; padding: 0; }
.room-setting-switch { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.room-setting-switch > span { min-width: 0; display: grid; gap: 5px; }
.room-setting-switch strong { font-size: 14px; }
.room-setting-switch small { font-size: 12px; color: var(--muted); line-height: 1.5; }
.room-switch-indicator { width: 42px; height: 25px; flex: 0 0 42px; border-radius: 20px; background: #a7a5a0; position: relative; }
.room-switch-indicator::after { content: ''; width: 19px; height: 19px; border-radius: 50%; background: white; position: absolute; top: 3px; left: 3px; }
.room-setting-switch[aria-checked=true] .room-switch-indicator { background: var(--primary, #8b6508); }
.room-setting-switch[aria-checked=true] .room-switch-indicator::after { left: 20px; }
.room-setting-switch:disabled { opacity: .55; cursor: not-allowed; }
.chat-room-composer-row { display: flex; }
.chat-room-composer-row textarea { flex: 1; }
.room-attachment-panel { position: absolute; bottom: calc(100% + 4px); right: 8px; width: min(270px, calc(100% - 16px)); display: flex; justify-content: space-around; padding: 12px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 12px; background: var(--zs-card); box-shadow: 0 6px 20px #0002; z-index: 4; }
.room-attachment-panel .icon-button { display: flex; flex-direction: column; width: 64px; height: 64px; gap: 6px; font-size: 13px; }
#roomAttachmentButton { flex-shrink: 0; background: var(--zs-paper); color: var(--zs-ink); border: 1px solid var(--line); }
#notificationEntry { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.notice-badge { background: var(--danger, #c33); color: white; border-radius: 99px; padding: 1px 6px; font-size: 12px; }
.notification-popover { position: fixed; z-index: 150; left: 16px; bottom: 90px; width: min(350px, calc(100vw - 32px)); max-height: min(520px, calc(100dvh - 110px)); overflow-y: auto; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--zs-card); box-shadow: 0 8px 32px #0002; box-sizing: border-box; }
.notification-popover header { display: flex; align-items: center; justify-content: space-between; }
.notice-item { display: block; width: 100%; text-align: left; padding: 12px; margin: 8px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--zs-paper); color: var(--text); overflow-wrap: anywhere; cursor: pointer; }
.notice-item.unread { border-left: 4px solid var(--danger, #c33); font-weight: 600; }
.notice-toast { position: fixed; z-index: 151; left: 16px; bottom: 130px; width: min(320px, calc(100vw - 32px)); padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--zs-card); box-shadow: 0 5px 25px #0002; }
.notice-toast button { border: 0; background: transparent; color: var(--text); cursor: pointer; text-align: left; }
@media (max-width: 820px) {
    .chat-room-layout { grid-template-columns: minmax(0, 1fr); }
    .chat-room-header { padding: 6px 10px; min-height: 60px; }
    .chat-room-header h2 { font-size: 17px; }
    .chat-room-composer { padding: 8px; }
    .chat-room-composer-row { display: flex; gap: 8px; align-items: center; }
    .chat-room-composer-row .icon-button { width: 40px; height: 44px; }
    .chat-room-composer-row .send-button { width: 44px; height: 44px; }
    .chat-room-composer textarea { width: 100%; box-sizing: border-box; padding: 8px; resize: none; max-height: min(100px, 22dvh); }
    .chat-room-message-actions { opacity: 1; }
    #roomSettingsDialog { width: 100vw; height: var(--mobile-visual-height, 100dvh); max-width: 100vw; max-height: var(--mobile-visual-height, 100dvh); margin: 0; top: var(--mobile-visual-top, 0px); border-radius: 0; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
    .mobile-keyboard-open .chat-room-heading .chat-room-status { display: none; }
    .mobile-keyboard-open .chat-room-main-toolbar { display: none; }
    .mobile-workspace-nav:has(#notificationEntry) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    #notificationEntry { position: relative; display: grid; gap: 0; margin: 0; height: auto; padding: 2px; font-size: 16px; }
    #notificationEntry .notice-label { font-size: 10px; }
    #notificationEntry .notice-badge { position: absolute; top: 0; right: 0; }
    .notification-popover { top: 58px; bottom: auto; left: auto; right: 10px; max-height: calc(var(--mobile-visual-height, 100dvh) - 120px); }
    .notice-toast { top: 58px; bottom: auto; left: auto; right: 10px; }
}
@media (max-width: 380px) {
    .chat-room-composer-row .icon-button { width: 34px; }
}

/* Member controls live in a self-hosted sheet to respect the site CSP. */
.moderation-member-row{padding:12px 0;border-bottom:1px solid var(--border-color,#d8ceb5)}.moderation-member-row button{margin:4px}.moderation-member-row input,#accountBanPanel input,#roomMemberModeration input{max-width:100%;padding:8px}#accountBanPanel{width:100%}
