:root {
    color-scheme: dark;
    --bg: #0b0b0c;
    --surface: #111113;
    --surface-raised: #18181b;
    --surface-soft: #202024;
    --text: #f4f3ef;
    --muted: #8e8e93;
    --faint: #5f5f65;
    --line: rgba(255,255,255,.09);
    --line-strong: rgba(255,255,255,.15);
    --accent: #f0eee7;
    --accent-text: #111113;
    --shadow: 0 24px 70px rgba(0,0,0,.34);
    --sidebar: 286px;
}
html[data-theme="light"] {
    color-scheme: light;
    --bg: #f5f4f0;
    --surface: #fbfaf7;
    --surface-raised: #ffffff;
    --surface-soft: #ecebe7;
    --text: #171719;
    --muted: #6f6f73;
    --faint: #96969a;
    --line: rgba(20,20,24,.09);
    --line-strong: rgba(20,20,24,.16);
    --accent: #1d1d20;
    --accent-text: #ffffff;
    --shadow: 0 24px 70px rgba(35,32,25,.12);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif; overflow: hidden; }
button, input, textarea { font: inherit; }
button { color: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app-shell { display: grid; grid-template-columns: var(--sidebar) 1fr; height: 100vh; height: 100dvh; }
.sidebar { display: flex; flex-direction: column; min-width: 0; padding: 24px 18px 18px; background: var(--surface); border-right: 1px solid var(--line); position: relative; z-index: 30; }
.brand-row, .brand, .identity-button, .sidebar-heading, .quiet-button, .topbar, .room-title-wrap, .topbar-actions, .composer-row, .attachment-preview, .profile-preview { display: flex; align-items: center; }
.brand-row { justify-content: space-between; margin: 0 5px 30px; }
.brand { gap: 11px; color: var(--text); text-decoration: none; font-size: 15px; font-weight: 650; letter-spacing: .03em; }
.brand-mark { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 1px solid var(--line-strong); border-radius: 50%; gap: 2px; }
.brand-mark i { display: block; width: 2px; border-radius: 2px; background: currentColor; }
.brand-mark i:nth-child(1) { height: 5px; }.brand-mark i:nth-child(2) { height: 11px; }.brand-mark i:nth-child(3) { height: 7px; }
.identity-card { padding: 6px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.identity-button { width: 100%; gap: 12px; padding: 7px; background: none; border: 0; text-align: left; cursor: pointer; border-radius: 13px; }
.identity-button:hover { background: var(--surface-soft); }
.identity-copy { display: grid; gap: 3px; min-width: 0; flex: 1; }
.identity-copy strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.identity-copy small, .profile-preview small { color: var(--muted); font-size: 11px; }
.identity-button > svg { width: 16px; color: var(--faint); }
.avatar { --avatar-hue: 20; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 38%; color: rgba(255,255,255,.92); background: linear-gradient(145deg, hsl(var(--avatar-hue) 72% 65%), hsl(calc(var(--avatar-hue) + 45) 60% 42%)); box-shadow: inset 0 1px 0 rgba(255,255,255,.28); overflow: hidden; }
.avatar::before { content: "千"; font-weight: 700; font-size: 44%; text-shadow: 0 1px 4px rgba(0,0,0,.18); }
.avatar-lg { width: 40px; height: 40px; }.avatar-xl { width: 66px; height: 66px; border-radius: 24px; }
.avatar[data-avatar="0"] { --avatar-hue: 12; }.avatar[data-avatar="0"]::before { content: "千"; }
.avatar[data-avatar="1"] { --avatar-hue: 192; }.avatar[data-avatar="1"]::before { content: "白"; }
.avatar[data-avatar="2"] { --avatar-hue: 50; }.avatar[data-avatar="2"]::before { content: "新"; }
.avatar[data-avatar="3"] { --avatar-hue: 208; }.avatar[data-avatar="3"]::before { content: "哆"; }
.avatar[data-avatar="4"] { --avatar-hue: 220; }.avatar[data-avatar="4"]::before { content: "柯"; }
.avatar[data-avatar="5"] { --avatar-hue: 0; }.avatar[data-avatar="5"]::before { content: "路"; }
.avatar[data-avatar="6"] { --avatar-hue: 26; }.avatar[data-avatar="6"]::before { content: "娜"; }
.avatar[data-avatar="7"] { --avatar-hue: 172; }.avatar[data-avatar="7"]::before { content: "卡"; }
.avatar[data-avatar="8"] { --avatar-hue: 188; }.avatar[data-avatar="8"]::before { content: "银"; }
.avatar[data-avatar="9"] { --avatar-hue: 334; }.avatar[data-avatar="9"]::before { content: "神"; }
.avatar[data-avatar="10"] { --avatar-hue: 342; }.avatar[data-avatar="10"]::before { content: "丸"; }
.avatar[data-avatar="11"] { --avatar-hue: 102; }.avatar[data-avatar="11"]::before { content: "森"; }
.sidebar-heading { justify-content: space-between; margin: 30px 8px 10px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-raised); cursor: pointer; transition: background .2s, transform .2s, border-color .2s; }
.icon-button:hover { background: var(--surface-soft); border-color: var(--line-strong); }.icon-button:active { transform: scale(.96); }.icon-button.small { width: 29px; height: 29px; border-radius: 9px; }.icon-button.small svg { width: 15px; }
.room-list { display: grid; gap: 5px; overflow-y: auto; scrollbar-width: none; }.room-list::-webkit-scrollbar { display: none; }
.room-item { display: grid; grid-template-columns: 36px 1fr auto auto; align-items: center; gap: 10px; padding: 9px; border: 0; border-radius: 13px; background: transparent; text-align: left; cursor: pointer; }
.room-item:hover, .room-item.active { background: var(--surface-soft); }.room-item-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--surface-raised); border: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.room-item span:nth-child(2) { min-width: 0; }.room-item strong, .room-item small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.room-item strong { font-size: 13px; }.room-item small { margin-top: 3px; color: var(--muted); font-size: 10px; }.room-item time { color: var(--faint); font-size: 9px; }.room-item-unread { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: 9px; font-weight: 700; line-height: 1; }
.room-empty { display: grid; gap: 6px; padding: 20px 9px; color: var(--muted); font-size: 12px; }.room-empty small { color: var(--faint); line-height: 1.6; }
.sidebar-footer { display: grid; gap: 14px; margin-top: auto; padding: 18px 5px 0; border-top: 1px solid var(--line); }
.quiet-button { gap: 9px; padding: 0; border: 0; color: var(--muted); background: none; font-size: 12px; cursor: pointer; }.quiet-button:hover { color: var(--text); }.quiet-button svg { width: 17px; }.sun-icon { display: none; }html[data-theme="light"] .moon-icon { display: none; }html[data-theme="light"] .sun-icon { display: block; }
.encryption-note { color: var(--faint); font-size: 10px; letter-spacing: .03em; }.encryption-note i { display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: #58b87a; box-shadow: 0 0 8px #58b87a; }
.main-panel { min-width: 0; height: 100vh; height: 100dvh; display: grid; grid-template-rows: 72px 1fr; position: relative; overflow: hidden; background: radial-gradient(circle at 70% 20%, rgba(130,130,140,.045), transparent 36%), var(--bg); }
.topbar { justify-content: space-between; min-width: 0; padding: 0 28px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px); z-index: 10; }
.room-title-wrap { gap: 12px; min-width: 0; }.presence-dot { width: 8px; height: 8px; border-radius: 50%; background: #56b87a; box-shadow: 0 0 10px rgba(86,184,122,.55); }.room-title-wrap h1 { margin: 0 0 3px; font-size: 15px; }.room-title-wrap p { margin: 0; color: var(--muted); font-size: 10px; letter-spacing: .05em; }.topbar-actions { gap: 8px; }
.welcome { display: flex; flex-direction: column; align-items: center; padding: 54px 24px 70px; text-align: center; overflow-y: auto; }
.welcome-orbit { position: relative; flex: 0 0 auto; width: 92px; height: 92px; margin-bottom: 26px; border: 1px solid var(--line-strong); border-radius: 50%; animation: orbit 18s linear infinite; }.welcome-orbit::before, .welcome-orbit::after { content: ""; position: absolute; border-radius: 50%; }.welcome-orbit::before { inset: 16px; border: 1px solid var(--line); }.welcome-orbit::after { width: 18px; height: 18px; top: 36px; left: 36px; background: var(--accent); box-shadow: 0 0 28px rgba(200,200,200,.3); }.welcome-orbit span, .welcome-orbit i, .welcome-orbit b { position: absolute; display: block; border-radius: 50%; background: var(--muted); }.welcome-orbit span { width: 6px; height: 6px; left: 10px; top: 19px; }.welcome-orbit i { width: 4px; height: 4px; right: 15px; bottom: 19px; }.welcome-orbit b { width: 3px; height: 3px; right: 4px; top: 44px; }
@keyframes orbit { to { transform: rotate(360deg); } }
.eyebrow { margin: 0 0 16px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .22em; }
.welcome h1 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(38px, 5.3vw, 68px); font-weight: 400; line-height: 1.22; letter-spacing: -.045em; }
.welcome-copy { max-width: 500px; margin: 24px auto 0; color: var(--muted); font-size: 14px; line-height: 1.85; }
.welcome-actions { display: flex; gap: 12px; margin-top: 34px; }.primary-button, .secondary-button, .danger-button { min-height: 46px; padding: 0 23px; border-radius: 14px; cursor: pointer; font-weight: 650; font-size: 13px; transition: transform .2s, opacity .2s; }.primary-button { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); }.secondary-button { border: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--text); }.danger-button { border: 1px solid rgba(220,74,74,.36); background: rgba(220,74,74,.1); color: #e36b6b; }.primary-button:hover, .secondary-button:hover, .danger-button:hover { transform: translateY(-1px); }.primary-button:disabled, .secondary-button:disabled, .danger-button:disabled { opacity: .55; cursor: wait; }.primary-button.full, .secondary-button.full, .danger-button.full { width: 100%; margin-top: 22px; }
.public-rooms { width: min(760px, 100%); margin-top: 58px; text-align: left; }.public-rooms-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 15px; }.public-rooms-heading .eyebrow { margin-bottom: 7px; }.public-rooms-heading h2 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: 25px; font-weight: 400; }.public-rooms-heading > span { color: var(--faint); font-size: 10px; }.public-room-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }.public-room-card { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-raised); text-align: left; cursor: pointer; transition: transform .2s, border-color .2s; }.public-room-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }.public-room-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--surface-soft); font-size: 15px; font-weight: 700; }.public-room-card > span:nth-child(2) { min-width: 0; }.public-room-card strong, .public-room-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.public-room-card strong { font-size: 13px; }.public-room-card small { margin-top: 5px; color: var(--muted); font-size: 9px; }.public-room-action { color: var(--muted); font-size: 10px; }.public-room-empty { margin: 0; padding: 25px; border: 1px dashed var(--line-strong); border-radius: 16px; color: var(--muted); text-align: center; font-size: 11px; }.feature-strip { display: flex; gap: 28px; margin-top: 58px; color: var(--faint); font-size: 10px; letter-spacing: .04em; }.feature-strip span { display: flex; align-items: center; gap: 7px; }.feature-strip i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.chat-view { min-height: 0; display: grid; grid-template-rows: 1fr auto auto; }.load-zone { display: flex; justify-content: center; height: 36px; align-items: end; }.load-zone button { border: 0; background: none; color: var(--muted); font-size: 11px; cursor: pointer; }.load-zone button:hover { color: var(--text); }
.messages { min-height: 0; overflow-y: auto; padding: 0 clamp(18px, 5vw, 70px) 28px; scroll-behavior: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }.messages > .load-zone { margin: 0 calc(clamp(18px, 5vw, 70px) * -1); }
.message { display: flex; align-items: flex-end; gap: 10px; max-width: 780px; margin: 0 auto 18px; }.message.own { flex-direction: row-reverse; }.message .avatar { width: 30px; height: 30px; border-radius: 11px; }.message-body { position: relative; max-width: min(72%, 620px); }.message-author { display: flex; gap: 8px; align-items: center; margin: 0 5px 6px; color: var(--muted); font-size: 10px; }.message-quote { display: flex; align-items: center; gap: 7px; min-width: 0; margin: -2px 0 9px; padding: 7px 9px; border-left: 3px solid var(--muted); border-radius: 3px 8px 8px 3px; background: rgba(127,127,127,.1); color: var(--muted); font-size: 10px; line-height: 1.45; cursor: pointer; }.message-quote:hover, .message-quote:focus-visible { background: rgba(127,127,127,.18); outline: 0; }.message-quote strong { flex: 0 0 auto; max-width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; font-size: 10px; }.message-quote strong::after { content: '：'; }.message-quote span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.message-target .bubble { animation: message-target 1.8s ease-out; } @keyframes message-target { 0%, 35% { box-shadow: 0 0 0 3px rgba(240,190,72,.75), 0 7px 20px rgba(0,0,0,.05); } 100% { box-shadow: 0 7px 20px rgba(0,0,0,.05); } }.own .message-quote { border-left-color: currentColor; background: rgba(0,0,0,.1); color: inherit; opacity: .72; }.own .message-author { justify-content: flex-end; }.message-author time { color: var(--faint); font-size: 9px; }
.bubble { padding: 11px 14px; border: 1px solid var(--line); border-radius: 7px 17px 17px 17px; background: var(--surface-raised); box-shadow: 0 7px 20px rgba(0,0,0,.05); font-size: 13px; line-height: 1.65; word-break: break-word; white-space: pre-wrap; }.message-emoji { display: inline-block; font-size: 1.45em; line-height: 1; vertical-align: -0.18em; }.own .bubble { border-radius: 17px 7px 17px 17px; background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.message-actions { position: absolute; top: -18px; right: 0; display: flex; gap: 3px; opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .18s, transform .18s; }.message:hover .message-actions, .message:focus-within .message-actions { opacity: 1; pointer-events: auto; transform: translateY(0); }.message.own .message-actions { right: auto; left: 0; }.message-action-button, .message-actions button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-raised); color: var(--muted); cursor: pointer; box-shadow: 0 5px 14px rgba(0,0,0,.12); }.message-action-button:hover, .message-actions button:hover { color: var(--text); background: var(--surface-soft); }.message-actions button[data-message-action="delete"] { color: #d96b6b; }.message-actions button[data-message-action="delete"]:hover { color: #ff8585; background: rgba(220,74,74,.12); }.message-actions svg { width: 14px; height: 14px; }
.message-image-button, .message-video-button { display: block; max-width: 100%; margin: -5px -8px 9px; padding: 0; border: 0; border-radius: 11px; background: none; cursor: zoom-in; overflow: hidden; }.message-image-button:focus-visible, .message-video-button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }.message-image, .message-video { display: block; width: min(330px, 100%); max-width: 100%; max-height: 350px; border-radius: 11px; object-fit: cover; background: var(--surface-soft); }.bubble:has(> .message-image-button:only-child), .bubble:has(> .message-video-button:only-child) { display: flex; width: max-content; max-width: min(100%, 348px); padding: 8px; }.own .bubble:has(> .message-image-button:only-child), .own .bubble:has(> .message-video-button:only-child) { margin-left: auto; }.bubble > .message-image-button:only-child, .bubble > .message-video-button:only-child { width: fit-content; max-width: min(330px, 100%); margin: 0; }.message-file { display: flex; gap: 10px; align-items: center; min-width: 220px; padding: 4px 0; color: inherit; text-decoration: none; }.file-symbol { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 40px; border: 1px solid currentColor; border-radius: 9px; font-size: 10px; opacity: .75; }.message-file span:last-child { min-width: 0; }.message-file strong, .message-file small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.message-file strong { font-size: 12px; }.message-file small { margin-top: 4px; opacity: .6; font-size: 9px; }
.typing-indicator { justify-self: center; padding: 6px 10px; }.typing-indicator i { display: inline-block; width: 4px; height: 4px; margin: 0 2px; border-radius: 50%; background: var(--muted); animation: pulse 1s infinite alternate; }.typing-indicator i:nth-child(2) { animation-delay: .2s; }.typing-indicator i:nth-child(3) { animation-delay: .4s; }@keyframes pulse { to { opacity: .25; transform: translateY(-2px); } }
.composer { position: relative; width: min(820px, calc(100% - 36px)); margin: 0 auto max(18px, env(safe-area-inset-bottom)); padding: 8px; border: 1px solid var(--line-strong); border-radius: 19px; background: var(--surface-raised); box-shadow: var(--shadow); }.composer-row { gap: 8px; }.attach-button { flex: 0 0 auto; border: 0; background: transparent; color: var(--muted); }.emoji-toggle { flex: 0 0 auto; width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); }.emoji-toggle:hover { color: var(--text); }.message-input { flex: 1; min-width: 0; max-height: 130px; min-height: 38px; padding: 10px 4px; overflow-y: auto; outline: 0; color: var(--text); background: transparent; font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }.message-input:empty::before { content: attr(data-placeholder); color: var(--faint); pointer-events: none; }.input-emoji { display: inline-block; font-size: 1.45em; line-height: 1; vertical-align: -0.18em; user-select: none; }.send-button { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border: 0; border-radius: 13px; background: var(--accent); color: var(--accent-text); cursor: pointer; }.send-button svg { width: 17px; }
.emoji-picker { position: absolute; right: 54px; bottom: calc(100% + 8px); z-index: 5; display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; width: min(304px, calc(100vw - 32px)); max-height: 220px; padding: 9px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: 15px; background: var(--surface-raised); box-shadow: var(--shadow); }.emoji-option { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 9px; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; }.emoji-option:hover, .emoji-option:focus-visible { background: var(--surface-soft); outline: 0; }
.attachment-preview { gap: 10px; margin: 0 4px 7px; padding: 8px 10px; border-bottom: 1px solid var(--line); }.quote-preview { display: flex; align-items: center; gap: 10px; margin: 0 4px 7px; padding: 8px 10px 8px 12px; border-left: 3px solid var(--muted); border-bottom: 1px solid var(--line); background: var(--surface); }.quote-preview > span { display: grid; gap: 3px; min-width: 0; flex: 1; }.quote-preview strong, .quote-preview small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.quote-preview strong { font-size: 10px; }.quote-preview small { color: var(--muted); font-size: 10px; }.quote-preview button { width: 26px; height: 26px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; }.quote-preview button:hover { background: var(--surface-soft); color: var(--text); }.attachment-preview .file-symbol { width: 30px; height: 34px; }.attachment-preview > span:nth-child(2) { position: relative; flex: 1; min-width: 0; padding-bottom: 5px; overflow: hidden; }.attachment-preview strong, .attachment-preview small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.attachment-preview strong { font-size: 11px; }.attachment-preview small { margin-top: 3px; color: var(--muted); font-size: 9px; }.attachment-preview i { position: absolute; left: 0; bottom: 0; width: 0; height: 2px; border-radius: 2px; background: #58b87a; transition: width .18s; }.attachment-preview i.failed { width: 100% !important; background: #e36b6b; }.attachment-preview button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 20px; }
dialog { width: min(440px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 24px; color: var(--text); background: var(--surface-raised); box-shadow: var(--shadow); }dialog::backdrop { background: rgba(0,0,0,.62); backdrop-filter: blur(8px); }.dialog-card { position: relative; padding: 32px; }.dialog-card h2 { margin: 0 0 9px; font-family: Georgia, "Noto Serif SC", serif; font-size: 28px; font-weight: 400; }.dialog-copy { margin: 0 0 25px; color: var(--muted); font-size: 12px; line-height: 1.7; }.dialog-close { position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; font-size: 19px; }.field { display: grid; gap: 8px; }.field span, .field-title { color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .08em; }.field input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 13px; outline: 0; color: var(--text); background: var(--surface); font-size: 13px; }.field input:focus { border-color: var(--muted); box-shadow: 0 0 0 3px var(--line); }
.image-preview-dialog { position: fixed; inset: 0; width: auto; max-width: none; height: auto; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: hidden; }.image-preview-dialog[open] { display: flex; align-items: center; justify-content: center; }.image-preview-dialog::backdrop { background: rgba(0,0,0,.88); backdrop-filter: blur(10px); }.media-preview-content { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 20px; box-sizing: border-box; }.image-preview-dialog img, .image-preview-dialog video { display: block; flex: 0 1 auto; max-width: 100%; max-height: 100%; object-fit: contain; }.image-preview-close { position: fixed; top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); z-index: 1; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; background: rgba(0,0,0,.48); color: #fff; cursor: pointer; font-size: 24px; line-height: 1; }
.manage-room-dialog .secondary-button { margin-top: 0; }.manage-room-dialog .secondary-button + .secondary-button { margin-top: 10px; }.manage-room-dialog .danger-button { margin-top: 10px; }.manage-password-field { margin-top: 18px; }
.visibility-options { display: grid; gap: 8px; margin: 20px 0 0; padding: 0; border: 0; }.visibility-options legend { margin-bottom: 9px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .08em; }.visibility-options label { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); cursor: pointer; }.visibility-options label:has(input:checked) { border-color: var(--line-strong); background: var(--surface-soft); }.visibility-options input { accent-color: var(--text); }.visibility-options span { display: grid; gap: 3px; }.visibility-options strong { font-size: 12px; }.visibility-options small { color: var(--muted); font-size: 9px; }
.profile-dialog { max-height: min(720px, 90dvh); overflow-y: auto; }
.profile-preview { gap: 15px; margin: 5px 0 22px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }.profile-preview > div { display: grid; gap: 5px; }.preset-names { display: flex; flex-wrap: wrap; gap: 7px; margin: 11px 0 20px; }.preset-names button { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }.preset-names button:hover { border-color: var(--line-strong); color: var(--text); }.field-title { display: block; margin-bottom: 10px; }.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }.avatar-choice { display: grid; place-items: center; aspect-ratio: 1; padding: 0; border: 1px solid transparent; border-radius: 14px; background: transparent; cursor: pointer; }.avatar-choice:hover, .avatar-choice.selected { border-color: var(--line-strong); background: var(--surface-soft); }.avatar-choice .avatar { width: 38px; height: 38px; border-radius: 13px; }
.message-menu { position: fixed; z-index: 120; display: grid; min-width: 100px; padding: 5px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface-raised); box-shadow: var(--shadow); }.message-menu button { padding: 8px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--text); text-align: left; font-size: 12px; cursor: pointer; }.message-menu button:hover { background: var(--surface-soft); }.message-menu button[data-message-action="delete"] { color: #d96b6b; }.message-menu button[data-message-action="delete"]:hover { background: rgba(220,74,74,.12); color: #ff8585; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 100; max-width: calc(100% - 32px); padding: 11px 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-raised); color: var(--text); box-shadow: var(--shadow); font-size: 11px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s, transform .2s; }.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-only { display: none; }.sidebar-backdrop { display: none; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
    :root { --sidebar: min(86vw, 310px); }
    .app-shell { display: block; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 20; display: block; background: rgba(0,0,0,.48); opacity: 0; pointer-events: none; transition: opacity .25s; }
    body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
    .mobile-only { display: inline-flex; }
    .main-panel { grid-template-rows: 64px 1fr; }
    .topbar { padding: 0 14px; gap: 10px; }.room-title-wrap { flex: 1; }.topbar-actions { gap: 5px; }.topbar .icon-button { width: 38px; height: 38px; }.room-title-wrap h1 { max-width: 33vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .welcome { padding: 30px 20px 70px; }.welcome h1 { font-size: clamp(35px, 11vw, 48px); }.welcome-copy { font-size: 13px; }.welcome-actions { width: 100%; max-width: 330px; flex-direction: column; }.public-rooms { margin-top: 44px; }.public-room-list { grid-template-columns: 1fr; }.feature-strip { gap: 15px; margin-top: 40px; flex-wrap: wrap; justify-content: center; }
    .messages { padding: 0 13px 22px; }.messages > .load-zone { margin: 0 -13px; }.message { margin-bottom: 15px; }.message-body { max-width: 80%; }.message-actions { top: -16px; }.message-actions button { width: 26px; height: 26px; }.bubble { font-size: 13px; }.composer { width: calc(100% - 20px); margin-bottom: max(10px, env(safe-area-inset-bottom)); border-radius: 17px; }
    .dialog-card { padding: 28px 22px; }.avatar-grid { grid-template-columns: repeat(6, 1fr); gap: 4px; }.avatar-choice .avatar { width: 34px; height: 34px; }
}
@media (max-width: 420px) { .avatar-grid { grid-template-columns: repeat(4, 1fr); }.feature-strip { font-size: 9px; }.message .avatar { display: none; }.message-body { max-width: 88%; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
