:root {
  color-scheme: dark;
  --bg: #10131d;
  --side: #121723;
  --panel: #1b2232;
  --line: #293247;
  --text: #e8edf7;
  --muted: #929db5;
  --accent: #75a7ff;
  --accent-soft: #202d49;
  --accent-ink: #101827;
  --danger: #ff777a;
  --danger-soft: #40252f;
  font-family: 'Cascadia Code', 'Lucida Console', ui-monospace, monospace;
  font-size: 14px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb;
  --side: #e9edf5;
  --panel: #e0e6f1;
  --line: #cbd3e2;
  --text: #20283a;
  --muted: #66728b;
  --accent: #315da8;
  --accent-soft: #dce7fa;
  --accent-ink: #ffffff;
  --danger: #a92d42;
  --danger-soft: #f7e1e5;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr) 248px; height: 100dvh; min-height: 480px; }
.sidebar { display: flex; flex-direction: column; overflow: auto; background: var(--side); border-right: 1px solid var(--line); padding: 30px 20px 0; }
.brand { display: flex; align-items: center; font-size: 23px; font-weight: 650; letter-spacing: -1px; }
.brand-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-right: 10px; background: var(--accent); color: var(--accent-ink); border-radius: 9px; font-size: 25px; letter-spacing: -3px; padding-right: 3px; }
.brand-icon span { font-size: 15px; align-self: flex-start; }
.brand-dot { color: var(--accent); }
.sidebar-intro { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 13px 0 38px; }
.section-label { display: flex; justify-content: space-between; margin: 0 10px 10px; color: var(--muted); font-size: 12px; font-weight: 550; }
.nav-room, .dm-room { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 10px; margin-bottom: 4px; border-radius: 6px; background: transparent; color: var(--muted); text-align: left; font-size: 13px; }
.nav-room:hover, .dm-room:hover, .person:not(:disabled):hover { background: var(--panel); }
.nav-room.active, .dm-room.active { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
.hash { font-size: 18px; font-weight: 400; }
.name { flex: 1; overflow-wrap: anywhere; }
.count { font-size: 11px; }
.dm-label { margin-top: 30px; }
.aside-hint { margin: 0 10px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.sidebar-bottom { margin-top: auto; padding-top: 32px; }
.admin-link { display: flex; align-items: center; gap: 8px; width: 100%; padding: 17px 0; background: transparent; color: var(--muted); font-size: 12px; }
.admin-link span:last-child { margin-left: auto; }
.identity { display: flex; align-items: center; gap: 10px; padding: 20px 0; border-top: 1px solid var(--line); }
.identity strong { display: block; font-size: 12px; font-weight: 550; overflow-wrap: anywhere; }
.identity small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--panel); color: var(--muted); font-size: 11px; font-weight: 600; }
.me-avatar { background: var(--accent-soft); color: var(--accent); }
main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 12px 32px; border-bottom: 1px solid var(--line); }
.connection { color: var(--muted); font-size: 12px; white-space: nowrap; }
.connection.live::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--accent); }
#theme-select { min-height: 34px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--muted); font-size: 12px; cursor: pointer; }
.room-heading { display: flex; align-items: center; gap: 12px; padding: 25px 32px; border-bottom: 1px solid var(--line); }
.room-heading > div:nth-child(2) { min-width: 0; }
.room-symbol { color: var(--muted); font-size: 26px; font-weight: 300; }
.room-heading .eyebrow, .room-badge { display: none; }
h1 { margin: 0 0 5px; font-size: 21px; font-weight: 600; letter-spacing: -.6px; overflow-wrap: anywhere; }
.room-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.chat-scroll { flex: 1; min-height: 0; overflow: auto; padding: 0 32px 16px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.welcome { max-width: 430px; padding: 58px 0 34px; }
.welcome h2 { margin: 0 0 12px; font-size: clamp(24px, 2.5vw, 32px); font-weight: 500; letter-spacing: -1px; }
.welcome p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; white-space: pre-line; }
.day-divider { display: flex; align-items: center; gap: 14px; margin: 20px 0 28px; color: var(--muted); font-size: 11px; }
.day-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.empty-chat { padding: 20px 0; color: var(--muted); font-size: 13px; text-align: center; }
.chat-message { display: flex; gap: 12px; margin: 0 0 25px; }
.message-content { flex: 1; min-width: 0; }
.message-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 9px; margin: 0 0 6px; }
.message-name { font-size: 13px; font-weight: 600; }
span.admin-name { color: var(--danger); font-weight: 800; }
.admin-name .admin-badge { display: inline-block; margin: 0 0 0 6px; color: inherit; font-size: 9px; font-weight: 800; letter-spacing: .04em; vertical-align: middle; }
.admin-appearance { margin-bottom: 20px; }
.admin-appearance .admin-toggle { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.admin-toggle input { width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--danger); }
.admin-appearance p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.message-time { color: var(--muted); font-size: 11px; }
.message-text { margin: 0; font-size: 14px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.you-tag { color: var(--muted); font-size: 10px; text-transform: lowercase; }
.composer-wrap { padding: 14px 32px 22px; }
.private-note { margin-bottom: 10px; color: var(--muted); font-size: 12px; line-height: 1.6; }
#composer { display: flex; align-items: flex-end; gap: 12px; padding: 8px 9px 8px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
#composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
textarea { width: 100%; min-height: 38px; max-height: 150px; padding: 8px 0; resize: none; border: 0; outline: 0; background: transparent; line-height: 1.6; }
textarea::placeholder { color: var(--muted); }
.send-button { flex-shrink: 0; width: 36px; height: 36px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font-size: 23px; }
.composer-caption { display: flex; justify-content: space-between; gap: 12px; margin-top: 11px; color: var(--muted); font-size: 11px; }
.tiny-spark { display: none; }
.key { margin-left: 3px; }
.people-sidebar { display: flex; flex-direction: column; overflow: auto; padding: 27px 20px; border-left: 1px solid var(--line); }
.people-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.people-header h2 { margin: 0; font-size: 13px; font-weight: 600; }
.people-header > span { color: var(--muted); font-size: 12px; }
.people-caption { margin: 10px 0 24px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.person { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 5px; border-radius: 6px; background: transparent; text-align: left; }
.person-name { flex: 1; font-size: 12px; overflow-wrap: anywhere; }
.person-arrow, .person small { color: var(--muted); font-size: 11px; }
.person:disabled { opacity: 1; }
.room-note { margin-top: auto; padding-top: 28px; }
.note-icon, .note-rule, .footer-wordmark { display: none; }
.room-note h3 { margin: 0 0 8px; font-size: 12px; font-weight: 550; }
.room-note p { margin: 8px 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.room-note .privacy-copy { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 20px; }
.room-note button { padding: 4px 0; background: transparent; color: var(--accent); font-size: 12px; }
dialog { width: min(480px, calc(100% - 32px)); max-height: 85dvh; padding: 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); box-shadow: 0 24px 80px #0003; }
dialog::backdrop { background: #10181380; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
dialog h2 { font-size: 22px; font-weight: 550; letter-spacing: -.5px; }
.eyebrow { color: var(--muted); font-size: 10px; letter-spacing: 1px; }
.close-dialog { padding: 5px; background: transparent; color: var(--muted); font-size: 26px; }
dialog p { color: var(--muted); font-size: 14px; line-height: 1.8; }
dialog label { display: block; margin: 18px 0 8px; }
dialog label span { color: var(--muted); }
dialog input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--side); }
.primary { width: 100%; margin: 20px 0; padding: 13px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-weight: 550; }
.admin-room, .admin-person { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
.admin-section { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.admin-section h3 { margin: 0 0 10px; font-size: 14px; }
.admin-empty { color: var(--muted); font-size: 13px; }
.delete-room, .text-button { padding: 8px 0; background: transparent; color: var(--accent); font-size: 13px; }
.delete-room { color: var(--danger); }
.danger, .danger-small, .message-remove { flex-shrink: 0; padding: 10px 14px; border-radius: 6px; background: var(--danger-soft); color: var(--danger); }
.danger-small, .message-remove { padding: 5px 9px; font-size: 12px; }
.message-remove { margin-left: auto; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 24px; }
#error, #admin-error, #delete-error, #ban-error { color: var(--danger); font-size: 13px; }
.unread { min-width: 19px; padding: 3px; border-radius: 20px; background: var(--accent); color: var(--accent-ink); font-size: 11px; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (min-width: 1500px) {
  .app { grid-template-columns: 260px minmax(0, 1fr) 280px; }
  .chat-scroll, .composer-wrap, .room-heading, .topbar { padding-left: max(40px, calc((100% - 800px) / 2)); padding-right: max(40px, calc((100% - 800px) / 2)); }
}
@media (max-width: 1050px) {
  .app { grid-template-columns: 200px minmax(0, 1fr); height: auto; min-height: 100dvh; }
  .sidebar, main { height: 100dvh; min-height: 480px; }
  .sidebar { padding-left: 16px; padding-right: 16px; }
  .people-sidebar { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); padding: 22px; }
  .people-header { justify-content: flex-start; }
  .people-caption { margin-bottom: 12px; }
  #people { display: flex; flex-wrap: wrap; gap: 8px 20px; }
  .person { width: auto; min-width: 170px; }
  .room-note { padding-top: 12px; }
  .room-note h3, .room-note > p:first-of-type { display: none; }
  .room-note .privacy-copy { margin-top: 8px; padding-top: 12px; }
}
@media (max-width: 600px) {
  .app { display: flex; flex-direction: column; }
  .sidebar { position: relative; height: auto; min-height: 0; padding: 18px 16px 10px; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .brand { width: fit-content; font-size: 22px; }
  .sidebar-intro, .section-label, .aside-hint, .identity { display: none; }
  .sidebar-bottom { position: absolute; right: 16px; top: 15px; margin: 0; padding: 0; }
  .admin-link { padding: 8px 0; font-size: 11px; }
  .admin-link span { display: none; }
  #rooms, #dms { display: flex; gap: 6px; overflow: auto; }
  #rooms { margin-top: 18px; }
  .nav-room, .dm-room { width: auto; flex-shrink: 0; padding: 8px 10px; font-size: 12px; }
  .nav-room .count { display: none; }
  .dm-room { margin-top: 6px; }
  main { height: calc(100dvh - 118px); min-height: 440px; }
  .topbar { min-height: 58px; padding: 10px 20px; }
  .room-heading { padding: 20px; }
  h1 { font-size: 20px; }
  .chat-scroll { padding: 0 20px 12px; }
  .welcome { padding: 32px 0 18px; }
  .composer-wrap { padding: 12px 16px max(16px, env(safe-area-inset-bottom)); }
  .composer-caption > span:last-child { display: none; }
  textarea, dialog input { font-size: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  button, a { transition: background .15s, color .15s; }
  .chat-message { animation: arrive .2s ease-out; }
  @keyframes arrive { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
}

.composer-wrap { position: relative; }
.message-reply { padding: 3px 6px; background: transparent; color: var(--accent); font-size: 12px; }
.reply-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 9px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 5px; font-size: 12px; }
.reply-preview span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-preview button { background: transparent; color: var(--accent); font-size: 22px; }
.reply-quote { display: block; max-width: 100%; margin: 7px 0; padding: 6px 10px; border-left: 3px solid var(--accent); background: var(--panel); color: var(--muted); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.mention { background: var(--accent-soft); color: var(--accent); border-radius: 3px; }
.chat-message.mentioned { border-left: 3px solid var(--accent); padding-left: 10px; }
#emoji-toggle { flex-shrink: 0; width: 36px; height: 36px; border-radius: 7px; background: var(--panel); color: var(--accent); font-size: 24px; }
#suggestions, #emoji-picker { position: absolute; bottom: calc(100% - 12px); left: 16px; width: min(360px, calc(100% - 32px)); max-height: 280px; overflow: auto; z-index: 2; padding: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px #0002; }
#suggestions button { display: block; width: 100%; padding: 10px; background: transparent; text-align: left; border-radius: 5px; overflow-wrap: anywhere; }
#suggestions button.selected, #suggestions button:hover, #emoji-grid button:hover { background: var(--accent-soft); color: var(--accent); }
#emoji-picker label { display: block; margin-bottom: 8px; font-size: 12px; }
#emoji-search { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); }
#emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 8px; }
#emoji-grid button { min-height: 40px; background: transparent; border-radius: 5px; font-size: 24px; }
#emoji-grid p { grid-column: 1 / -1; color: var(--muted); }
#command-status { color: var(--accent); font-size: 12px; line-height: 1.6; }

#attach-image { flex-shrink: 0; width: 36px; height: 36px; background: var(--panel); color: var(--accent); border-radius: 7px; font-size: 24px; }
#verify-identity { background: transparent; color: var(--accent); text-decoration: underline; padding: 4px; }
#image-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 8px; background: var(--panel); border-radius: 8px; }
#image-preview img { width: 64px; height: 64px; object-fit: contain; border-radius: 5px; }
#image-preview span { flex: 1; font-size: 12px; color: var(--muted); }
#image-preview button { padding: 8px; background: transparent; font-size: 24px; }
.private-image { display: block; max-width: min(100%, 420px); height: auto; max-height: 420px; object-fit: contain; border-radius: 8px; margin-top: 8px; }
.image-note { color: var(--muted); font-size: 11px; }
#verification-code { white-space: pre-wrap; overflow-wrap: anywhere; padding: 16px; background: var(--panel); border-radius: 8px; line-height: 1.8; }
@media (max-width: 600px) { #composer { gap: 5px; padding-left: 10px; } }

body { background: var(--bg); }
.app { background-image: linear-gradient(#ffffff04 1px, transparent 1px), linear-gradient(90deg, #ffffff04 1px, transparent 1px); background-size: 24px 24px; }
.sidebar { position: relative; background: var(--side); border-right: 3px solid var(--line); padding-top: 28px; }
.sidebar::after { content: ''; position: absolute; top: 102px; right: 18px; width: 8px; height: 8px; background: var(--accent); box-shadow: -12px 0 var(--accent), 0 12px var(--accent), -12px 12px var(--accent); opacity: .34; pointer-events: none; }
.brand { gap: 0; color: var(--text); font-family: 'Cascadia Code', 'Lucida Console', monospace; font-size: 17px; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
.brand-icon { width: 34px; height: 34px; margin-right: 10px; border: 2px solid var(--accent); border-radius: 0; background: var(--accent); color: var(--accent-ink); font-size: 21px; letter-spacing: 0; padding: 0; image-rendering: pixelated; }
.brand-icon span { align-self: auto; margin-left: 1px; font-size: 10px; }
.brand-dot { color: var(--accent); }
.sidebar-intro, .section-label, .aside-hint, .identity small, .connection, .room-heading p, .people-caption, .room-note p, .composer-caption { font-size: 11px; }
.section-label { text-transform: uppercase; letter-spacing: 1px; }
.nav-room, .dm-room, .person { border-radius: 0; }
.nav-room.active, .dm-room.active { box-shadow: inset 3px 0 var(--accent); }
.avatar { border-radius: 0; }
.me-avatar { background: var(--accent); color: var(--accent-ink); }
.topbar { min-height: 62px; border-bottom: 3px solid var(--line); }
.connection.live::before { width: 8px; height: 8px; border-radius: 0; box-shadow: 3px 3px 0 #39735e; }
#theme-select, .faq-link { border-radius: 0; }
#theme-select { background: var(--side); }
.faq-link { color: var(--text); }
.faq-link:hover { color: var(--accent); }
.room-heading { position: relative; gap: 16px; border-bottom: 1px solid var(--line); }
.room-symbol { display: grid; place-items: center; width: 42px; height: 42px; border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent); font-family: monospace; font-size: 25px; }
.room-heading .eyebrow { display: block; margin-bottom: 5px; color: var(--accent); font-size: 9px; letter-spacing: 1.5px; }
h1 { font-size: 19px; font-weight: 700; letter-spacing: 0; }
.room-badge { display: inline-block; margin-left: auto; padding: 6px 8px; border: 1px solid var(--line); color: var(--muted); font-size: 9px; letter-spacing: 1px; }
.welcome { padding-top: 44px; }
.welcome h2 { max-width: 520px; font-size: clamp(20px, 2.2vw, 27px); font-weight: 700; letter-spacing: 0; }
.welcome h2::before { content: '> '; color: var(--accent); }
.day-divider { text-transform: uppercase; letter-spacing: 1px; }
.chat-message { gap: 14px; }
.message-name { color: var(--accent); }
.you-tag { padding: 2px 4px; background: var(--accent-soft); color: var(--accent); }
.composer-wrap { padding-top: 12px; }
#composer { gap: 8px; padding: 8px; border: 2px solid var(--line); border-radius: 0; background: var(--side); }
#composer:focus-within { border-color: var(--accent); box-shadow: 3px 3px 0 var(--accent-soft); }
textarea { padding-left: 5px; }
.send-button, #emoji-toggle, #attach-image { border-radius: 0; }
.send-button { width: 38px; height: 38px; background: var(--accent); color: var(--accent-ink); }
#emoji-toggle, #attach-image { background: var(--panel); color: var(--text); }
.people-sidebar { background: var(--side); border-left: 3px solid var(--line); }
.people-header h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.people-header > span { min-width: 22px; padding: 4px; border: 1px solid var(--line); text-align: center; }
.person { border-bottom: 1px solid var(--line); }
.person .avatar { border: 1px solid var(--line); }
.room-note .privacy-copy { border-top-style: dashed; }
button, input, textarea, select, dialog { border-radius: 0; }
button:hover:not(:disabled) { filter: brightness(1.12); }
dialog { border: 2px solid var(--accent); box-shadow: 8px 8px 0 #0008; }
dialog::backdrop { background: #080b13cc; }
dialog h2 { font-weight: 700; letter-spacing: 0; }
dialog input, #emoji-search { border: 1px solid var(--line); border-radius: 0; background: var(--side); }
.primary { border-radius: 0; box-shadow: 3px 3px 0 var(--accent-soft); }
.danger, .danger-small, .message-remove { border-radius: 0; }
.unread { border-radius: 0; background: var(--accent); color: var(--accent-ink); }
.reply-preview { border-radius: 0; }
.reply-quote { border-radius: 0; }
#suggestions, #emoji-picker { border: 2px solid var(--line); border-radius: 0; background: var(--side); }
#suggestions button, #emoji-grid button, #emoji-search, #image-preview { border-radius: 0; }
#image-preview img, .private-image { border-radius: 0; }
#verification-code { border-radius: 0; border-left: 3px solid var(--accent); }
.faq-dialog h2 { font-size: 22px; }
.faq-section h3 { text-transform: uppercase; letter-spacing: .6px; }
.faq-section details { border-top-style: dashed; }
@media (max-width: 1050px) {
  .people-sidebar { border-left: 0; border-top: 3px solid var(--line); }
}
@media (max-width: 600px) {
  .sidebar { border-right: 0; border-bottom: 3px solid var(--line); }
  .brand { font-size: 15px; }
  .brand-icon { width: 30px; height: 30px; }
  .sidebar::after { display: none; }
  .room-badge { display: none; }
  .topbar { border-bottom-width: 2px; }
}


.topbar-actions { display: flex; align-items: center; gap: 12px; }
.faq-link { padding: 8px 10px; border-radius: 6px; background: transparent; color: var(--accent); font-size: 12px; }
.faq-link:hover { background: var(--accent-soft); }
.faq-dialog { width: min(680px, calc(100% - 32px)); padding: 24px; }
.faq-dialog h2 { margin: 8px 0; font-size: clamp(20px, 4vw, 26px); }
.faq-dialog .close-dialog { flex-shrink: 0; }
.faq-section { margin-top: 28px; }
.faq-section h3 { margin: 0 0 12px; color: var(--accent); font-size: 13px; font-weight: 600; }
.faq-section details { border-top: 1px solid var(--line); }
.faq-section summary { padding: 16px 0; cursor: pointer; font-size: 14px; font-weight: 550; line-height: 1.6; }
.faq-section summary::marker { color: var(--accent); }
.faq-section summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.faq-section details[open] summary { color: var(--accent); }
.faq-section details p { margin: 0 0 16px; }
@media (max-width: 600px) {
  .topbar-actions { gap: 4px; }
  .faq-dialog { padding: 20px; }
}

:root {
  --bg: #10131d;
  --side: #121723;
  --panel: #1b2232;
  --line: #293247;
  --text: #e8edf7;
  --muted: #929db5;
  --accent: #8298d5;
  --accent-soft: #252e47;
  --accent-ink: #111827;
  --danger: #ef8f96;
  --danger-soft: #402b32;
  font-family: 'Segoe UI', Aptos, ui-sans-serif, system-ui, sans-serif;
}
:root[data-theme="light"] {
  --bg: #f4f6fb;
  --side: #e9edf5;
  --panel: #e0e6f1;
  --line: #cbd3e2;
  --text: #20283a;
  --muted: #66728b;
  --accent: #536da9;
  --accent-soft: #dce5f6;
  --accent-ink: #ffffff;
  --danger: #a92d42;
  --danger-soft: #f7e1e5;
}
.app { background-image: linear-gradient(145deg, #ffffff04, transparent 42%); background-size: auto; }
.sidebar { border-right-width: 2px; }
.sidebar::after { display: none; }
.brand { gap: 0; font-family: inherit; font-size: 18px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.brand-icon { width: 32px; height: 32px; border: 0; border-radius: 3px; box-shadow: 2px 2px 0 var(--accent-soft); font-family: ui-monospace, monospace; }
.brand-icon span { font-size: 11px; }
.brand-dot { color: var(--accent); }
.sidebar-intro, .section-label, .aside-hint, .identity small, .connection, .room-heading p, .people-caption, .room-note p, .composer-caption { font-size: 12px; }
.section-label { text-transform: none; letter-spacing: 0; font-weight: 600; }
.nav-room, .dm-room, .person { border-radius: 7px; }
.nav-room.active, .dm-room.active { box-shadow: inset 2px 0 var(--accent); }
.avatar { border-radius: 50%; }
.me-avatar { background: var(--accent-soft); color: var(--accent); }
.topbar { border-bottom-width: 2px; }
.connection.live::before { width: 7px; height: 7px; border-radius: 50%; box-shadow: none; }
#theme-select, .faq-link { border-radius: 7px; }
#theme-select { background: var(--side); }
.room-heading { gap: 13px; }
.room-symbol { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 5px; font-family: inherit; font-size: 21px; }
.room-heading .eyebrow { display: none; }
h1 { font-size: 21px; font-weight: 650; letter-spacing: 0; }
.room-badge { display: inline-block; border: 1px solid var(--line); border-radius: 999px; background: var(--side); font-size: 10px; letter-spacing: 0; text-transform: lowercase; }
.welcome { padding-top: 50px; }
.welcome h2 { font-size: 27px; font-weight: 650; letter-spacing: 0; }
.welcome h2::before { content: none; }
.day-divider { font-size: 12px; text-transform: none; letter-spacing: 0; }
.chat-message { gap: 12px; }
.message-name { color: var(--text); }
.you-tag { padding: 0; background: transparent; color: var(--muted); }
.composer-wrap { padding-top: 14px; }
#composer { gap: 10px; padding: 8px 9px 8px 14px; border-width: 1px; border-radius: 12px; background: var(--side); }
#composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { padding-left: 0; }
.send-button, #emoji-toggle, #attach-image { border-radius: 8px; }
.send-button { width: 38px; height: 38px; }
#emoji-toggle, #attach-image { background: var(--panel); color: var(--muted); }
.people-sidebar { border-left-width: 2px; }
.people-header h2 { font-size: 13px; text-transform: none; letter-spacing: 0; }
.people-header > span { min-width: 22px; padding: 3px 6px; border: 0; border-radius: 999px; background: var(--panel); text-align: center; }
.person { border-bottom: 0; }
.person .avatar { border: 0; }
.room-note .privacy-copy { border-top-style: solid; }
button, input, textarea, select { border-radius: 7px; }
button:hover:not(:disabled) { filter: none; }
dialog { border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 80px #0005; }
dialog::backdrop { background: #080b1380; }
dialog h2 { font-weight: 600; letter-spacing: 0; }
dialog input, #emoji-search { border-radius: 7px; background: var(--side); }
.primary { border-radius: 7px; box-shadow: none; }
.danger, .danger-small, .message-remove { border-radius: 7px; }
.unread { border-radius: 10px; }
.reply-preview, .reply-quote { border-radius: 7px; }
#suggestions, #emoji-picker { border-width: 1px; border-radius: 10px; background: var(--side); }
#suggestions button, #emoji-grid button, #emoji-search, #image-preview { border-radius: 7px; }
#image-preview img, .private-image { border-radius: 7px; }
#verification-code { border-radius: 8px; border-left-width: 2px; }
.faq-section h3 { text-transform: none; letter-spacing: 0; }
.faq-section details { border-top-style: solid; }
@media (max-width: 1050px) {
  .people-sidebar { border-top-width: 2px; }
}
@media (max-width: 600px) {
  .sidebar { border-bottom-width: 2px; }
  .brand { font-size: 17px; }
  .brand-icon { width: 30px; height: 30px; }
  .room-badge { display: none; }
  .topbar { border-bottom-width: 2px; }
}

/* Temporary encrypted rooms */
.group-label { align-items: center; gap: 6px; }
#create-group { padding: 5px; background: var(--accent-soft); color: var(--accent); font-size: 12px; white-space: nowrap; }
.group-hint { color: var(--muted); font-size: 12px; line-height: 1.6; }
#group-dialog { width: min(620px, calc(100vw - 32px)); }
#group-dialog textarea, #group-dialog select { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--side); }
#group-dialog textarea { min-height: 90px; resize: vertical; }
#group-dialog .primary { margin-top: 12px; }
.group-invite { display: flex; gap: 8px; }
.group-member { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.group-member-info { min-width: 0; overflow-wrap: anywhere; }
.group-member-info > small { display: block; margin-top: 5px; color: var(--muted); }
.group-member-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#group-error { color: var(--danger); font-size: 13px; }
#group-details { margin-left: auto; }
#room-rules { margin: 0; padding: 12px 32px; border-bottom: 1px solid var(--line); color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 120px; overflow: auto; }
@media (max-width: 600px) {
  .sidebar .group-label { display: flex; margin: 8px 0; }
  #groups { display: flex; flex-wrap: wrap; gap: 4px; }
  #groups .group-room { width: auto; max-width: 100%; }
  .room-heading { flex-wrap: wrap; }
  #group-details { margin-left: 0; }
  #room-rules { padding: 10px 20px; }
  #group-dialog select, #group-dialog textarea { font-size: 16px; }
}