/* ECHO — warm paper, dark ink, live orange. */
:root {
  --paper: #f3f0e9;
  --paper-deep: #e9e4da;
  --paper-light: #fbf9f4;
  --ink: #20211e;
  --ink-soft: #62625b;
  --line: #cec9bd;
  --line-dark: #a8a397;
  --orange: #f04b23;
  --orange-dark: #c93412;
  --white: #fffdf8;
  --font-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
  --font-display: "Arial Narrow", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Songti SC", "STSong", "SimSun", Georgia, serif;
  --rooms-width: 268px;
  --members-width: 254px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:not(:disabled), a { cursor: pointer; }
button:disabled { cursor: not-allowed; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
::selection { color: var(--white); background: var(--orange); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.app-shell { display: grid; grid-template-columns: var(--rooms-width) minmax(0, 1fr) var(--members-width); height: 100vh; height: 100dvh; }

.rooms-panel, .members-panel { min-width: 0; background: var(--paper); }
.rooms-panel { display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.brand-row { display: flex; align-items: center; justify-content: space-between; height: 91px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { position: relative; display: block; width: 31px; height: 31px; background: var(--orange); }
.brand-mark span { position: absolute; left: 8px; border: 1px solid var(--white); border-radius: 50%; }
.brand-mark span:nth-child(1) { top: 8px; width: 4px; height: 4px; background: var(--white); }
.brand-mark span:nth-child(2) { top: 5px; width: 10px; height: 10px; }
.brand-mark span:nth-child(3) { top: 1px; width: 18px; height: 18px; }
.brand-name { font-family: var(--font-display); font-size: 24px; font-weight: 900; letter-spacing: -.06em; line-height: .9; }
.brand-name > span { display: block; margin-top: 6px; font-family: var(--font-sans); font-size: 8px; font-weight: 700; letter-spacing: .32em; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease; }
.icon-button:hover { color: var(--white); border-color: var(--ink); background: var(--ink); }
.icon-button:active { transform: scale(.95); }
.icon-button svg { width: 17px; height: 17px; }
.drawer-close { display: none; }

.rooms-heading { display: flex; align-items: center; justify-content: space-between; padding: 28px 22px 18px; }
.section-index { margin: 0; color: var(--ink-soft); font-family: Arial, sans-serif; font-size: 9px; font-weight: 700; letter-spacing: .17em; line-height: 1.5; }
.rooms-heading h2, .members-heading h2 { margin: 5px 0 0; font-size: 18px; font-weight: 700; letter-spacing: -.04em; }
.create-room-button { color: var(--white); border-color: var(--orange); background: var(--orange); }
.create-room-button:hover { border-color: var(--ink); }
.room-navigation { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-dark) transparent; }
.room-list { padding: 0 12px 16px; }
.room-item { position: relative; display: grid; grid-template-columns: 25px minmax(0, 1fr) 14px; gap: 7px; width: 100%; min-height: 75px; padding: 15px 10px; text-align: left; border: 0; border-top: 1px solid transparent; border-bottom: 1px solid transparent; background: transparent; transition: background .18s ease, border-color .18s ease; }
.room-item:hover { border-color: var(--line); background: var(--paper-light); }
.room-item[aria-current="true"] { border-color: var(--line); background: var(--paper-deep); }
.room-item[aria-current="true"]::before { position: absolute; top: 15px; bottom: 15px; left: -12px; width: 3px; background: var(--orange); content: ""; }
.room-number { padding-top: 3px; color: var(--ink-soft); font-family: Georgia, serif; font-size: 10px; font-style: italic; }
.room-copy { min-width: 0; }
.room-name { display: block; overflow: hidden; font-size: 14px; font-weight: 650; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.room-description-small { display: block; overflow: hidden; margin-top: 6px; color: var(--ink-soft); font-size: 10px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.room-arrow { align-self: center; width: 13px; height: 13px; color: var(--line-dark); }
.room-item[aria-current="true"] .room-arrow { color: var(--orange); }
.room-list-state { padding: 22px 10px; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.text-button { padding: 3px 0; color: var(--orange-dark); border: 0; border-bottom: 1px solid currentColor; background: none; font-size: 12px; }
.sidebar-note { margin: auto 24px 22px; padding-top: 20px; }
.note-line { display: block; width: 28px; height: 1px; margin-bottom: 12px; background: var(--line-dark); }
.sidebar-note p { margin: 0; color: var(--ink-soft); font-family: var(--font-serif); font-size: 11px; line-height: 1.9; }
.profile-block { display: flex; align-items: center; gap: 10px; min-height: 79px; padding: 14px 18px; border-top: 1px solid var(--line); }
.avatar { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; overflow: hidden; width: 38px; height: 38px; color: var(--paper-light); border-radius: 50%; background: var(--ink); font-family: var(--font-serif); font-size: 15px; }
.profile-avatar { background: var(--orange); }
.profile-copy { min-width: 0; flex: 1; }
.profile-label { display: block; margin-bottom: 3px; color: var(--ink-soft); font-size: 9px; }
.profile-copy strong { display: block; overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.profile-block .icon-button { width: 32px; height: 32px; border: 0; }

.chat-panel { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; background: var(--paper-light); }
.chat-toolbar { display: none; }
.chat-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; min-height: 157px; padding: 30px clamp(24px, 3.4vw, 52px) 25px; border-bottom: 1px solid var(--line); }
.room-heading-main { min-width: 0; }
.room-heading-main h1 { overflow-wrap: anywhere; margin: 11px 0 8px; font-family: var(--font-display); font-size: clamp(28px, 3.1vw, 46px); font-weight: 850; letter-spacing: -.065em; line-height: 1.08; }
.room-description { max-width: 600px; margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.65; }
.chat-header-actions { display: flex; align-items: center; gap: 12px; padding-top: 4px; }
.connection-status { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; padding: 7px 10px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 100px; background: var(--paper); font-size: 9px; white-space: nowrap; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--line-dark); }
.connection-status[data-state="online"] .status-dot { background: #398b57; box-shadow: 0 0 0 3px rgb(57 139 87 / 12%); }
.connection-status[data-state="connecting"] .status-dot { background: var(--orange); animation: status-pulse 1.2s ease infinite; }
.connection-status[data-state="offline"] { color: var(--orange-dark); }
.connection-status[data-state="offline"] .status-dot { background: var(--orange); }
@keyframes status-pulse { 50% { opacity: .35; } }
.members-toggle { position: relative; display: none; }
.member-toggle-count { position: absolute; top: -5px; right: -4px; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; color: white; border: 2px solid var(--paper-light); border-radius: 10px; background: var(--orange); font-family: Arial, sans-serif; font-size: 8px; }

.conversation { position: relative; min-height: 0; overflow: hidden; }
.message-list { height: 100%; overflow-x: hidden; overflow-y: auto; padding: 32px clamp(24px, 3.4vw, 52px) 40px; overscroll-behavior: contain; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--line-dark) transparent; }
.empty-state { display: flex; align-items: center; flex-direction: column; justify-content: center; min-height: 100%; padding: 35px 0; text-align: center; }
.empty-state h2 { margin: 14px 0; font-family: var(--font-serif); font-size: clamp(22px, 2.4vw, 33px); font-weight: 400; letter-spacing: -.05em; line-height: 1.45; }
.empty-state > p:last-child { max-width: 300px; margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.8; }
.empty-orbit { position: relative; width: 88px; height: 72px; margin-bottom: 24px; }
.empty-orbit span { position: absolute; top: 50%; left: 50%; border: 1px solid var(--line); border-radius: 50%; transform: translate(-50%, -50%); }
.empty-orbit span:nth-child(1) { width: 9px; height: 9px; border: 0; background: var(--orange); }
.empty-orbit span:nth-child(2) { width: 40px; height: 40px; }
.empty-orbit span:nth-child(3) { width: 78px; height: 66px; border-color: var(--line-dark); transform: translate(-50%, -50%) rotate(-20deg); }

.message { display: flex; align-items: flex-start; gap: 12px; max-width: 760px; margin: 0 auto 26px; animation: message-in .25s ease both; }
@keyframes message-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.message.is-own { justify-content: flex-end; }
.message.is-own .message-avatar { display: none; }
.message-avatar { width: 34px; height: 34px; margin-top: 20px; color: var(--ink); border: 1px solid var(--line); background: var(--paper-deep); font-size: 12px; }
.message-content { min-width: 0; max-width: min(74%, 560px); }
.message-meta { display: flex; align-items: baseline; gap: 9px; margin: 0 0 7px 2px; }
.message-sender { overflow: hidden; max-width: 220px; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.message-time { color: var(--ink-soft); font-family: Arial, sans-serif; font-size: 8px; letter-spacing: .03em; }
.message-bubble { padding: 13px 16px; border: 1px solid var(--line); border-radius: 2px 13px 13px 13px; background: var(--paper); }
.message-text { overflow-wrap: anywhere; margin: 0; font-size: 13px; line-height: 1.75; white-space: pre-wrap; }
.message.is-own .message-content { display: flex; align-items: flex-end; flex-direction: column; }
.message.is-own .message-meta { flex-direction: row-reverse; margin-right: 2px; }
.message.is-own .message-bubble { color: var(--white); border-color: var(--ink); border-radius: 13px 2px 13px 13px; background: var(--ink); }
.message.is-own .message-time { color: var(--ink-soft); }
.message-system { display: flex; align-items: center; gap: 12px; max-width: 620px; margin: 22px auto; color: var(--ink-soft); font-size: 9px; text-align: center; }
.message-system::before, .message-system::after { flex: 1; height: 1px; background: var(--line); content: ""; }
.message-system span { flex: 0 1 auto; overflow-wrap: anywhere; }
.new-messages-button { position: absolute; right: 50%; bottom: 17px; display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; color: var(--white); border: 0; border-radius: 30px; background: var(--orange); box-shadow: 0 6px 20px rgb(32 33 30 / 14%); font-size: 10px; transform: translateX(50%); }
.new-messages-button svg { width: 13px; height: 13px; }

.composer-wrap { padding: 0 clamp(24px, 3.4vw, 52px) 21px; background: var(--paper-light); }
.composer-hint { min-height: 15px; margin: 0 0 6px; color: var(--ink-soft); font-size: 9px; }
.composer { padding: 15px 15px 12px; border: 1px solid var(--line-dark); border-radius: 3px; background: var(--white); transition: border-color .18s ease, box-shadow .18s ease; }
.composer:focus-within { border-color: var(--ink); box-shadow: 3px 3px 0 var(--paper-deep); }
.composer textarea { display: block; width: 100%; min-height: 25px; max-height: 140px; padding: 0 3px; resize: none; overflow-y: auto; color: var(--ink); border: 0; outline: 0; background: transparent; font-size: 13px; line-height: 1.8; }
.composer textarea::placeholder { color: #939087; }
.composer textarea:disabled { opacity: .55; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.message-counter { color: var(--ink-soft); font-family: Arial, sans-serif; font-size: 9px; }
.message-counter.is-near-limit { color: var(--orange-dark); }
.send-button { display: inline-flex; align-items: center; gap: 24px; height: 35px; padding: 0 12px 0 15px; color: var(--white); border: 0; border-radius: 2px; background: var(--orange); font-size: 11px; font-weight: 650; transition: background .18s ease, transform .18s ease; }
.send-button svg { width: 15px; height: 15px; }
.send-button:not(:disabled):hover { background: var(--ink); }
.send-button:not(:disabled):active { transform: translateY(1px); }
.send-button:disabled { color: #969188; background: var(--paper-deep); }
.composer-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 9px; color: var(--ink-soft); font-size: 8px; }
kbd { padding: 1px 3px; border: 1px solid var(--line); border-radius: 2px; background: var(--paper); font-family: inherit; font-size: .9em; }

.members-panel { display: flex; flex-direction: column; padding: 30px 22px 22px; border-left: 1px solid var(--line); }
.members-topline { display: flex; align-items: center; justify-content: space-between; min-height: 20px; }
.members-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 8px 0 22px; }
.online-count { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-soft); font-size: 9px; white-space: nowrap; }
.online-count i { width: 5px; height: 5px; border-radius: 50%; background: #398b57; }
.member-list { min-height: 0; max-height: 42vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-dark) transparent; }
.member-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.member-item:first-child { border-top: 1px solid var(--line); }
.member-avatar { width: 32px; height: 32px; color: var(--ink); border: 1px solid var(--line-dark); background: transparent; font-size: 12px; }
.member-item.is-self .member-avatar { color: var(--white); border-color: var(--orange); background: var(--orange); }
.member-copy { min-width: 0; flex: 1; }
.member-name-row { display: flex; align-items: center; gap: 6px; }
.member-name { overflow: hidden; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.self-badge { padding: 1px 4px; color: var(--orange-dark); border: 1px solid #e7a18c; border-radius: 2px; font-size: 7px; }
.member-since { display: block; margin-top: 3px; color: var(--ink-soft); font-family: Arial, sans-serif; font-size: 8px; }
.member-presence { width: 5px; height: 5px; border-radius: 50%; background: #398b57; }
.members-empty { padding: 20px 0; color: var(--ink-soft); font-size: 10px; line-height: 1.7; }
.room-poster { position: relative; display: flex; flex-direction: column; min-height: 262px; margin-top: auto; padding: 22px 18px 14px; overflow: hidden; color: var(--paper-light); background: var(--ink); }
.room-poster .section-index { position: relative; z-index: 1; color: #a8a89f; }
.poster-star { position: absolute; top: -28px; right: -20px; color: var(--orange); font-family: Arial, sans-serif; font-size: 126px; font-weight: 400; line-height: 1; transform: rotate(12deg); }
.poster-title { position: relative; margin: 33px 0 13px; font-family: var(--font-serif); font-size: 25px; letter-spacing: -.06em; line-height: 1.45; }
.poster-copy { margin: 0; color: #a8a89f; font-size: 9px; line-height: 1.9; }
.poster-footer { display: flex; justify-content: space-between; margin-top: auto; padding-top: 18px; color: #8b8b83; border-top: 1px solid #454640; font-family: Arial, sans-serif; font-size: 7px; letter-spacing: .12em; }

.drawer-scrim { position: fixed; z-index: 30; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: rgb(32 33 30 / 45%); backdrop-filter: blur(2px); }
.drawer-open { overflow: hidden; }

.dialog { max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); padding: 0; overflow: auto; color: var(--ink); border: 1px solid var(--ink); border-radius: 3px; background: var(--paper-light); box-shadow: 12px 12px 0 rgb(32 33 30 / 16%); }
.dialog::backdrop { background: rgb(32 33 30 / 62%); backdrop-filter: blur(5px); }
.dialog[open] { animation: dialog-in .22s ease both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.welcome-dialog { width: 820px; grid-template-columns: .9fr 1.1fr; }
.welcome-dialog[open] { display: grid; }
.welcome-art { display: flex; flex-direction: column; min-height: 540px; padding: 27px; overflow: hidden; color: var(--paper-light); background: var(--ink); }
.welcome-art-top { display: flex; justify-content: space-between; color: #9d9d94; font-family: Arial, sans-serif; font-size: 8px; letter-spacing: .1em; }
.echo-rings { position: relative; flex: 1; min-height: 300px; }
.echo-rings i { position: absolute; top: 50%; left: 50%; border: 1px solid #55564f; border-radius: 50%; transform: translate(-50%, -50%); }
.echo-rings i:nth-child(1) { width: 120px; height: 120px; border-color: var(--orange); }
.echo-rings i:nth-child(2) { width: 210px; height: 210px; }
.echo-rings i:nth-child(3) { width: 310px; height: 310px; }
.echo-rings b { position: absolute; top: 50%; left: 50%; color: var(--orange); font-family: var(--font-serif); font-size: 58px; font-weight: 400; transform: translate(-50%, -50%); }
.welcome-art > p { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 900; letter-spacing: -.055em; line-height: .95; }
.welcome-content { padding: 52px 48px 28px; }
.welcome-content h2, .compact-dialog h2 { margin: 19px 0 16px; font-family: var(--font-serif); font-size: 35px; font-weight: 400; letter-spacing: -.07em; line-height: 1.35; }
.welcome-content > p:not(.section-index):not(.dialog-footnote), .compact-dialog form > p:not(.section-index):not(.form-error) { margin: 0 0 30px; color: var(--ink-soft); font-size: 11px; line-height: 1.8; }
.dialog form label { display: block; margin-bottom: 8px; font-size: 10px; font-weight: 650; }
.input-with-count { position: relative; }
.input-with-count input { width: 100%; height: 51px; padding: 0 65px 0 0; color: var(--ink); border: 0; border-bottom: 1px solid var(--line-dark); border-radius: 0; outline: 0; background: transparent; font-size: 17px; }
.input-with-count input:focus { border-color: var(--orange); }
.input-with-count input::placeholder { color: #9c988f; font-size: 13px; }
.input-with-count > span { position: absolute; right: 0; bottom: 18px; color: var(--ink-soft); font-family: Arial, sans-serif; font-size: 9px; pointer-events: none; }
.form-error { min-height: 19px; margin: 8px 0 6px !important; color: var(--orange-dark) !important; font-size: 10px !important; line-height: 1.6; }
.primary-button { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 49px; padding: 0 16px 0 19px; color: var(--white); border: 0; border-radius: 2px; background: var(--orange); font-size: 12px; font-weight: 650; transition: background .18s ease; }
.primary-button svg { width: 18px; height: 18px; }
.primary-button:hover:not(:disabled) { background: var(--ink); }
.primary-button:disabled { opacity: .55; }
.dialog-footnote { margin: 17px 0 0; color: var(--ink-soft); font-size: 8px; text-align: center; }
.compact-dialog { width: 470px; }
.compact-dialog form { padding: 30px 36px 36px; }
.dialog-topline { display: flex; align-items: center; justify-content: space-between; }
.dialog-topline .icon-button { width: 32px; height: 32px; }
.compact-dialog h2 { margin-top: 15px; font-size: 32px; }
.compact-dialog form > label { margin-top: 5px; }
.toast-region { position: fixed; z-index: 100; right: 24px; bottom: 24px; display: flex; align-items: flex-end; flex-direction: column; gap: 8px; width: min(340px, calc(100vw - 32px)); pointer-events: none; }
.toast { max-width: 100%; padding: 12px 15px; color: var(--paper-light); border-left: 3px solid var(--orange); border-radius: 2px; background: var(--ink); box-shadow: 0 5px 25px rgb(32 33 30 / 18%); font-size: 11px; line-height: 1.6; animation: toast-in .2s ease both; }
.toast.is-leaving { opacity: 0; transform: translateY(4px); transition: opacity .2s ease, transform .2s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* Private rooms — lock marks and access-code fields. */
.rooms-heading-actions { display: flex; align-items: center; gap: 8px; }
.join-private-button { color: var(--ink); }
.room-group-title { margin: 16px 10px 4px; color: var(--ink-soft); font-family: Arial, sans-serif; font-size: 8px; font-weight: 700; letter-spacing: .16em; line-height: 1.6; }
.room-group-title:first-child { margin-top: 2px; }
.room-name-row { display: flex; align-items: center; gap: 5px; min-width: 0; }
.room-name-row .room-name { min-width: 0; flex: 0 1 auto; }
.room-lock { display: inline-flex; flex: 0 0 auto; color: var(--orange-dark); }
.room-lock svg { width: 11px; height: 11px; stroke-width: 1.9; }
.room-item[aria-current="true"] .room-lock { color: var(--orange); }
.room-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.private-badge { padding: 3px 6px 2px; color: var(--orange-dark); border: 1px solid #e7a18c; border-radius: 2px; font-family: Arial, sans-serif; font-size: 8px; font-weight: 700; letter-spacing: .1em; }
.label-optional { color: var(--ink-soft); font-size: 8px; font-weight: 400; letter-spacing: .04em; }
.compact-dialog form > .input-with-count + label { margin-top: 18px; }
.compact-dialog form > p.dialog-hint:not(.section-index) { margin: 9px 0 14px; color: var(--ink-soft); font-size: 9px; line-height: 1.7; }

@media (max-width: 1180px) {
  :root { --rooms-width: 248px; }
  .app-shell { grid-template-columns: var(--rooms-width) minmax(0, 1fr); }
  .members-panel { position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(330px, 88vw); padding: 24px; border-left: 1px solid var(--ink); box-shadow: -10px 0 35px rgb(32 33 30 / 12%); transform: translateX(105%); transition: transform .25s ease; }
  .members-panel.is-open { transform: translateX(0); }
  .members-panel .drawer-close { display: inline-flex; }
  .members-toggle { display: inline-flex; }
  .member-list { max-height: none; }
  .room-poster { min-height: 245px; margin-top: 30px; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .chat-panel { height: 100vh; height: 100dvh; }
  .rooms-panel { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: min(320px, 88vw); border-right: 1px solid var(--ink); box-shadow: 10px 0 35px rgb(32 33 30 / 12%); transform: translateX(-105%); transition: transform .25s ease; }
  .rooms-panel.is-open { transform: translateX(0); }
  .rooms-panel .drawer-close { display: inline-flex; }
  .brand-row { height: 78px; }
  .chat-toolbar { display: flex; align-items: center; justify-content: space-between; height: 61px; padding: 0 20px; border-bottom: 1px solid var(--line); }
  .chat-toolbar .icon-button { width: 34px; height: 34px; border: 0; }
  .mobile-wordmark { font-family: Arial, sans-serif; font-size: 9px; font-weight: 700; letter-spacing: .14em; }
  .toolbar-spacer { width: 34px; }
  .chat-header { min-height: 131px; padding: 22px 24px 20px; }
  .room-heading-main h1 { margin-top: 8px; font-size: clamp(26px, 5.8vw, 38px); }
  .chat-header-actions { padding-top: 0; }
  .connection-status { padding: 6px 8px; }
  .message-list { padding: 25px 24px 35px; }
  .composer-wrap { padding: 0 24px max(15px, env(safe-area-inset-bottom)); }
}

@media (max-width: 560px) {
  .chat-header { gap: 10px; min-height: 127px; padding: 20px 18px 18px; }
  .room-heading-main h1 { font-size: 29px; }
  .room-description { display: -webkit-box; overflow: hidden; font-size: 10px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .chat-header-actions { align-items: flex-end; flex-direction: column-reverse; gap: 8px; }
  .connection-status { max-width: 135px; overflow: hidden; text-overflow: ellipsis; }
  .members-toggle { width: 32px; height: 32px; }
  .message-list { padding: 23px 17px 30px; }
  .message { gap: 8px; margin-bottom: 23px; }
  .message-avatar { width: 28px; height: 28px; }
  .message-content { max-width: 82%; }
  .message-bubble { padding: 11px 13px; }
  .message-text { font-size: 13px; }
  .composer-wrap { padding-right: 14px; padding-left: 14px; }
  .composer { padding: 12px 12px 10px; }
  .composer-meta { justify-content: center; }
  .composer-meta > span:last-child { display: none; }
  .empty-state h2 { font-size: 24px; }
  .empty-orbit { margin-bottom: 15px; }
  .welcome-dialog[open] { display: block; }
  .welcome-dialog { width: 440px; }
  .welcome-art { display: none; }
  .welcome-content { padding: 36px 27px 24px; }
  .welcome-content h2 { font-size: 31px; }
  .compact-dialog form { padding: 24px 25px 28px; }
  .compact-dialog h2 { font-size: 29px; }
  .dialog { box-shadow: 6px 6px 0 rgb(32 33 30 / 16%); }
  .toast-region { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
