/* The look of the page: a messenger in the manner of Telegram, kept plain. One system: one radius scale, one button,
   one hairline, one spacing scale (4 8 12 16 24 32). Flat opaque surfaces separated by 1px lines; no gradient, glow or
   shadow on anything that stays on the page — only the layers that float over it (menus, dialogs, toasts) are lifted,
   and lightly frosted. The one accent is a deep raspberry (a rose, not a violet). Hover answers the pointer by a step of
   colour and a 1-2px lift, press by a small sink. Highlight by contrast of weight and ink, not by colour.

   Order: tokens · base · sign-in · layout · sidebar · chat · messages · composer · overlays · side panel · small screens. */

:root {
  /* the accent: one hue (rose); `--fill` carries white text, `--accent` is the same hue as ink on the ground */
  --fill: #c4246b;
  --fill-hover: #ac1d5d;
  --accent: #b01e5f;
  --accent-soft: rgb(196 36 107 / .1);

  /* ink: one near-black, warm, never #000; the hairline is 12% of it */
  --text: #211c22;
  --text-2: #6b6370;
  --text-3: #8f8794;
  --line: rgb(33 28 34 / .12);
  --danger: #c6283a;
  --ok: #19805a;

  /* grounds */
  --ground: #efecee;
  --surface: #ffffff;
  --surface-2: #f6f4f5;
  --hover: rgb(33 28 34 / .05);
  --wall: #e8e4e7;

  /* messages */
  --in: #ffffff;
  --in-ink: var(--text);
  --out: var(--fill);
  --out-ink: #ffffff;
  --quote-in: var(--accent);

  /* the floating layers only */
  --float: rgb(255 255 255 / .94);
  --float-blur: blur(14px) saturate(140%);
  --lift: 0 8px 24px rgb(33 28 34 / .12);

  /* one radius scale: controls, panels and cards, windows */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --head: 56px;
  --ease: cubic-bezier(.25, .8, .3, 1);
  font-family: Inter, "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  letter-spacing: -.005em;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --fill: #b32360;
  --fill-hover: #c42a6c;
  --accent: #f06b9f;
  --accent-soft: rgb(240 107 159 / .14);
  --text: #f1edf2;
  --text-2: #aaa2b0;
  --text-3: #837b89;
  --line: rgb(241 237 242 / .1);
  --danger: #ff6b7d;
  --ok: #4cc08e;
  --ground: #121014;
  --surface: #1a171d;
  --surface-2: #211e25;
  --hover: rgb(241 237 242 / .06);
  --wall: #15131a;
  --in: #25212a;
  --float: rgb(32 28 37 / .94);
  --lift: 0 8px 24px rgb(0 0 0 / .5);
  color-scheme: dark;
}

/* ---- base ----------------------------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--ground); color: var(--text); overflow: hidden; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
#app { height: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { flex: none; }
::selection { background: var(--accent-soft); }
.scroll, .timeline, .emoji-grid, .people, .info-body, .dialog-body, .search-results { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* ---- sign-in -------------------------------------------------------------------------------------------- */
.signin-page { height: 100%; display: grid; place-items: center; padding: 24px; overflow: auto; background: var(--ground); }
.signin { width: min(380px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 32px 32px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.signin .logo { width: 72px; height: 72px; border-radius: var(--r-md); display: grid; place-items: center; color: #fff; background: var(--fill); }
.signin .logo svg { width: 36px; height: 36px; transform: translate(-1px, 1px); }
.signin h1 { margin: 12px 0 0; font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.signin .lead { margin: 0 0 8px; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.signin input { width: 100%; padding: 12px 12px; font-size: 15px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); outline: none; transition: border-color .15s; }
.signin input::placeholder { color: var(--text-3); }
.signin input:focus { border-color: var(--accent); }
.signin .advanced { width: 100%; text-align: left; color: var(--text-2); font-size: 13px; }
.signin .advanced summary { cursor: pointer; padding: 4px 0; list-style: none; }
.signin .advanced summary::before { content: "›"; display: inline-block; margin-right: 8px; transition: transform .15s; }
.signin .advanced[open] summary::before { transform: rotate(90deg); }
.signin .advanced input { margin-top: 8px; font-size: 13px; padding: 8px 12px; }
.signin-btn { width: 100%; height: 44px; border-radius: var(--r-sm); background: var(--fill); color: #fff; font-weight: 600; font-size: 15px; transition: background .15s, transform .15s var(--ease); }
.signin-btn:hover { background: var(--fill-hover); transform: translateY(-1px); }
.signin-btn:active { transform: scale(.985); }
.signin-btn[disabled] { opacity: .6; cursor: default; }
.error { color: var(--danger); font-size: 13px; }

/* ---- layout: a column of chats and a chat, hairline between ---------------------------------------------- */
.app { height: 100%; display: grid; grid-template-columns: minmax(300px, 380px) 1fr; background: var(--surface); }
.main { position: relative; min-width: 0; display: flex; border-left: 1px solid var(--line); }
.chat-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; background: var(--wall); }
.chat-body { flex: 1; min-height: 0; position: relative; --top-h: 56px; --bottom-h: 68px; }

/* ---- sidebar -------------------------------------------------------------------------------------------- */
.sidebar { display: flex; flex-direction: column; min-height: 0; position: relative; background: var(--surface); }
.side-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; color: var(--text-2); flex: none; transition: background .15s, color .15s, transform .1s; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.light { color: #fff; }
.icon-btn.light:hover { background: rgb(255 255 255 / .16); }
.search { flex: 1; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: var(--r-md); background: var(--surface-2); color: var(--text-3); border: 1px solid transparent; transition: border-color .15s, color .15s; }
.search:focus-within { border-color: var(--accent); color: var(--accent); background: var(--surface); }
.search-input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--text); font-size: 14px; }
.search-input::placeholder { color: var(--text-3); }
.search .clear { display: none; width: 28px; height: 28px; margin-right: -8px; }
.sidebar.has-query .search .clear { display: grid; }
.tabs { display: flex; gap: 4px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tab { padding: 8px 12px; color: var(--text-2); font-weight: 500; font-size: 14px; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, background .15s; border-radius: var(--r-sm) var(--r-sm) 0 0; }
.tab:hover { background: var(--hover); }
.tab.active { color: var(--accent); border-bottom-color: var(--fill); }
.status { padding: 4px 12px; font-size: 12px; text-align: center; color: var(--text-2); background: var(--surface-2); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.scroll { flex: 1; overflow-y: auto; padding: 4px 4px 80px; }
.empty-list { padding: 48px 24px; text-align: center; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.empty-list .big { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.section { padding: 12px 12px 4px; font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: .04em; text-transform: uppercase; }

.row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; border-radius: var(--r-md); text-align: left; transition: background .15s; user-select: none; position: relative; }
.row:hover { background: var(--hover); }
.row.active { background: var(--fill); color: #fff; }
.row.active .preview, .row.active .time, .row.active .tick, .row.active .author, .row.active .draft, .row.active .typing, .row.active .title svg, .row.active .tail, .row.active .meta { color: rgb(255 255 255 / .85); }
.row.active .badge { background: #fff; color: var(--fill); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-top, .row-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.title { display: flex; align-items: center; gap: 4px; font-weight: 600; font-size: 15px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title svg { color: var(--text-3); flex: none; }
.meta { display: flex; align-items: center; gap: 4px; flex: none; font-size: 12px; color: var(--text-3); }
.row .tick { color: var(--ok); display: inline-flex; }
.preview { color: var(--text-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.author { color: var(--text); font-weight: 500; }
.draft { color: var(--danger); }
.typing { color: var(--accent); font-weight: 500; }
.tail { display: flex; align-items: center; gap: 4px; flex: none; color: var(--text-3); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-sm); display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff; background: var(--fill); }
.badge.muted { background: var(--text-3); }
.badge.dot { min-width: 10px; width: 10px; height: 10px; padding: 0; border-radius: 50%; }
.row.unread .title { font-weight: 700; }
.row.person { padding: 8px 12px; }
.row.person.selected { background: var(--accent-soft); }
.row .check, .check { width: 22px; height: 22px; border-radius: var(--r-sm); border: 1.5px solid var(--line); display: grid; place-items: center; color: #fff; flex: none; transition: background .15s, border-color .15s; }
.row.selected .check { background: var(--fill); border-color: var(--fill); }
.fab { position: absolute; right: 16px; bottom: 16px; width: 52px; height: 52px; border-radius: var(--r-lg); display: grid; place-items: center; color: #fff; background: var(--fill); z-index: 5; transition: background .15s, transform .15s var(--ease); }
.fab:hover { background: var(--fill-hover); transform: translateY(-2px); }
.fab:active { transform: scale(.96); }

/* ---- avatars: the one round thing — a face is read as a circle ------------------------------------------ */
.avatar { position: relative; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 600; overflow: hidden; user-select: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.saved { background: var(--fill); }
.online-dot { position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid var(--surface); }

/* ---- the chat: the timeline fills it, the two bars lie over it -------------------------------------------- */
.no-chat { flex: 1; display: grid; place-items: center; }
.no-chat-badge { padding: 4px 12px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-size: 13px; }
.timeline-wrap { position: absolute; inset: 0; }
.timeline { position: absolute; inset: 0; overflow-y: auto; padding: calc(var(--top-h) + 8px) 16px calc(var(--bottom-h) + 8px); overflow-anchor: none; }
.chat-top { position: absolute; top: 0; left: 0; right: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); }
.chat-bottom { position: absolute; bottom: 0; left: 0; right: 0; z-index: 4; pointer-events: none; }
.chat-bottom > * { pointer-events: auto; }
.chat-head { height: var(--head); display: flex; align-items: center; gap: 4px; padding: 0 8px; }
.chat-head .back { display: none; }
.head-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; padding: 4px 8px; border-radius: var(--r-md); transition: background .15s; }
.head-main:hover { background: var(--hover); }
.head-text { min-width: 0; }
.head-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-sub { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.2em; }
.head-sub.online, .head-sub.typing { color: var(--accent); }
.call-buttons { display: flex; gap: 0; }
.pinned-bar { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 16px; color: var(--accent); text-align: left; border-top: 1px solid var(--line); transition: background .15s; }
.pinned-bar:hover { background: var(--hover); }
.pinned-text { min-width: 0; border-left: 2px solid var(--accent); padding-left: 8px; }
.pinned-title { font-size: 12px; font-weight: 600; color: var(--accent); }
.pinned-line { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-bar { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 16px; background: var(--fill); color: #fff; font-weight: 500; text-align: left; transition: background .15s; }
.call-bar:hover { background: var(--fill-hover); }
.call-bar-text { flex: 1; }
.call-bar-join { padding: 2px 12px; border-radius: var(--r-sm); background: rgb(255 255 255 / .2); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.search-bar { display: flex; align-items: center; gap: 8px; padding: 4px 12px; color: var(--text-2); border-top: 1px solid var(--line); }
.search-results { max-height: 280px; overflow-y: auto; border-top: 1px solid var(--line); }
.search-hit { display: block; width: 100%; padding: 8px 16px; text-align: left; transition: background .15s; }
.search-hit:hover { background: var(--hover); }
.hit-top { display: flex; justify-content: space-between; font-size: 13px; }
.hit-name { font-weight: 600; color: var(--accent); }
.hit-time { color: var(--text-3); font-size: 12px; }
.hit-text { color: var(--text); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.items { display: flex; flex-direction: column; width: min(100%, 720px); margin: 0 auto; }
.older { text-align: center; color: var(--text-2); font-size: 13px; padding: 8px; }
.to-bottom { position: absolute; right: 16px; bottom: calc(var(--bottom-h) + 12px); width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; color: var(--text-2); z-index: 5; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--lift); transition: color .15s, transform .15s var(--ease); }
.to-bottom:hover { color: var(--accent); transform: translateY(-2px); }
.to-bottom-count { position: absolute; top: -8px; right: -6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-sm); background: var(--fill); color: #fff; font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.day, .service, .unread-divider { display: flex; justify-content: center; margin: 8px 0; position: sticky; top: calc(var(--top-h) + 8px); z-index: 1; }
.day span, .service span { padding: 2px 12px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-size: 12px; font-weight: 500; max-width: 90%; text-align: center; }
.service { position: static; }
.unread-divider { position: static; padding: 4px; font-size: 12px; font-weight: 600; color: var(--accent); margin: 12px -16px; background: var(--accent-soft); }
.drop-zone { position: absolute; inset: 8px; z-index: 6; display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: var(--r-lg); background: var(--surface); opacity: .96; color: var(--accent); font-size: 16px; font-weight: 600; pointer-events: none; text-align: center; }
.drop-zone svg { display: block; margin: 0 auto 8px; }

/* ---- messages ------------------------------------------------------------------------------------------- */
.msg-wrap { display: flex; flex-direction: column; }
.msg-wrap.flash .bubble { animation: flash 1.4s ease; }
@keyframes flash { 0%, 55% { outline: 2px solid var(--accent); outline-offset: 2px; } }
.msg { display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; max-width: 100%; position: relative; }
.msg.joins-prev { margin-top: 2px; }
.msg.mine { justify-content: flex-end; }
.msg-avatar { width: 32px; flex: none; }
.msg-avatar.spacer { height: 1px; }
.bubble { position: relative; max-width: min(76%, 520px); min-width: 64px; padding: 6px 10px 6px; border-radius: var(--r-lg); background: var(--in); color: var(--in-ink); border: 1px solid var(--line); font-size: 15px; line-height: 1.4; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.mine .bubble { background: var(--out); color: var(--out-ink); border-color: transparent; }
.msg.theirs:not(.joins-next) .bubble { border-bottom-left-radius: 4px; }
.msg.mine:not(.joins-next) .bubble { border-bottom-right-radius: 4px; }
.msg.theirs.joins-prev .bubble { border-top-left-radius: 4px; }
.msg.mine.joins-prev .bubble { border-top-right-radius: 4px; }
.msg.theirs.joins-next .bubble { border-bottom-left-radius: 4px; }
.msg.mine.joins-next .bubble { border-bottom-right-radius: 4px; }
.bubble.bare { background: none; border: 0; padding: 0; }
.sender { font-size: 13px; font-weight: 600; margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.forwarded { font-size: 13px; color: var(--quote-in); margin-bottom: 2px; }
.msg.mine .forwarded { color: rgb(255 255 255 / .9); }
.text { white-space: pre-wrap; }
.text.muted { opacity: .7; font-style: italic; }
.text a { color: var(--accent); text-decoration: none; }
.msg.mine .text a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.text a:hover { text-decoration: underline; }
.text code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; padding: 1px 4px; border-radius: 4px; background: var(--hover); }
.msg.mine .text code, .msg.mine .text pre { background: rgb(255 255 255 / .16); }
.text pre { margin: 4px 0; padding: 8px; border-radius: var(--r-sm); background: var(--hover); overflow-x: auto; }
.text pre code { background: none; padding: 0; }
.text blockquote { margin: 2px 0; padding: 2px 8px; border-left: 2px solid var(--quote-in); background: var(--accent-soft); }
.mention { color: var(--accent); }
.msg.mine .mention { color: #fff; font-weight: 600; }
.spoiler { background: var(--text-3); color: transparent; border-radius: 4px; cursor: pointer; user-select: none; }
.spoiler.shown { background: none; color: inherit; user-select: auto; }
.meta { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 6px -2px -4px 12px; font-size: 11px; color: var(--text-3); user-select: none; line-height: 1; height: 16px; }
.msg.mine .meta, .msg.mine .meta .tick { color: rgb(255 255 255 / .8); }
.meta .tick { display: inline-flex; color: var(--text-3); }
.meta .tick.read { color: var(--accent); }
.msg.mine .meta .tick.read { color: #fff; }
.meta .tick.failed { color: var(--danger); }
.meta.on-media { position: absolute; right: 8px; bottom: 8px; float: none; margin: 0; padding: 3px 6px; border-radius: var(--r-sm); background: rgb(20 16 22 / .6); color: #fff; height: auto; }
.meta.on-media .tick, .msg.mine .meta.on-media .tick { color: #fff; }
.views { display: inline-flex; align-items: center; gap: 2px; }
.edited { font-style: italic; }
.bubble::after { content: ""; display: block; clear: both; }

.quote { display: block; width: 100%; text-align: left; margin: 0 0 4px; padding: 2px 8px; border-left: 2px solid var(--quote-in); border-radius: 2px; background: var(--accent-soft); overflow: hidden; transition: background .15s; }
.msg.mine .quote { border-color: rgb(255 255 255 / .8); background: rgb(255 255 255 / .16); }
.quote-name { font-size: 13px; font-weight: 600; color: var(--quote-in); }
.msg.mine .quote-name { color: #fff; }
.quote-text { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9; }

.visual { position: relative; border-radius: var(--r-md); overflow: hidden; background: var(--hover); cursor: zoom-in; max-width: 100%; margin: -2px -6px 4px; }
.bubble > .visual:last-child, .bubble > .visual:nth-last-child(2) { margin-bottom: -4px; }
.visual img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s var(--ease); }
.visual:hover img { transform: scale(1.02); }
.visual.sticker { background: none; margin: 0; }
.visual.sticker img { object-fit: contain; }
.visual.blur img { filter: blur(24px); }
.visual .play { position: absolute; inset: 0; margin: auto; width: 48px; height: 48px; border-radius: 50%; background: rgb(20 16 22 / .6); color: #fff; display: grid; place-items: center; }
.visual .dur { position: absolute; left: 8px; top: 8px; padding: 2px 6px; border-radius: var(--r-sm); background: rgb(20 16 22 / .6); color: #fff; font-size: 12px; }
.doc { display: flex; align-items: center; gap: 12px; padding: 2px; text-align: left; color: inherit; text-decoration: none; min-width: 200px; }
.doc-icon, .play-btn { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--fill); color: #fff; flex: none; transition: background .15s; }
.play-btn:hover, a.doc:hover .doc-icon, button.doc:hover .doc-icon { background: var(--fill-hover); }
.msg.mine .doc-icon, .msg.mine .play-btn { background: rgb(255 255 255 / .22); }
.doc-name, .audio-name { font-weight: 600; font-size: 14px; word-break: break-all; }
.doc-size, .audio-dur { font-size: 12px; color: var(--text-2); }
.msg.mine .doc-size, .msg.mine .audio-dur { color: rgb(255 255 255 / .8); }
.audio { display: flex; align-items: center; gap: 12px; min-width: 200px; padding: 2px; }
.poll { min-width: 240px; }
.poll-q { font-weight: 600; margin-bottom: 2px; }
.poll-kind { font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.msg.mine .poll-kind, .msg.mine .poll-foot { color: rgb(255 255 255 / .8); }
.poll-a { position: relative; overflow: hidden; display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 4px; text-align: left; border-radius: var(--r-sm); transition: background .15s; }
.poll-a:hover { background: var(--hover); }
.poll-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--accent); flex: none; display: grid; place-items: center; color: #fff; }
.msg.mine .poll-dot { border-color: rgb(255 255 255 / .8); }
.poll-a.chosen .poll-dot { background: var(--fill); border-color: var(--fill); }
.msg.mine .poll-a.chosen .poll-dot { background: #fff; color: var(--fill); }
.poll-text { flex: 1; z-index: 1; }
.poll-pct { z-index: 1; font-weight: 600; font-size: 12px; }
.poll-bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--fill); transition: width .3s var(--ease); }
.msg.mine .poll-bar { background: #fff; }
.poll-foot { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.upload { height: 2px; margin: 4px 0 -2px; background: var(--hover); overflow: hidden; }
.upload i { display: block; height: 100%; background: var(--fill); }
.failed-line { font-size: 12px; color: #ffd6dc; margin-top: 4px; }
:root:not([data-theme="dark"]) .msg:not(.mine) .failed-line { color: var(--danger); }
.link { text-decoration: underline; }
.link-card { display: block; margin-top: 4px; padding: 4px 8px; border-left: 2px solid var(--accent); background: var(--accent-soft); border-radius: 2px; color: inherit; text-decoration: none; }
.msg.mine .link-card { border-color: #fff; background: rgb(255 255 255 / .16); }
.link-site { font-size: 12px; font-weight: 600; color: var(--accent); }
.msg.mine .link-site { color: #fff; }
.link-title { font-weight: 600; }
.link-desc { font-size: 13px; opacity: .85; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; clear: both; }
.reaction { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; transition: background .15s, transform .1s; }
.reaction:hover { transform: translateY(-1px); }
.reaction.mine { background: var(--fill); color: #fff; }
.msg.mine .reaction { background: rgb(255 255 255 / .2); color: #fff; }
.msg.mine .reaction.mine { background: #fff; color: var(--fill); }
.reaction .emoji { font-size: 14px; }
.msg-more { position: absolute; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: var(--r-sm); display: none; place-items: center; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); }
.msg.theirs .msg-more { right: -2px; }
.msg.mine .msg-more { left: -2px; }
@media (hover: hover) { .msg:hover .msg-more { display: grid; } .msg.theirs .bubble { margin-right: 28px; } .msg.mine .bubble { margin-left: 28px; } }

/* ---- the field: a flat bar ------------------------------------------------------------------------------- */
.composer { position: relative; padding: 8px 16px 12px; background: var(--surface); border-top: 1px solid var(--line); }
.composer-row { display: flex; align-items: flex-end; gap: 8px; width: min(100%, 720px); margin: 0 auto; }
.composer-box { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 0; padding: 0 4px; border-radius: var(--r-md); min-height: 44px; background: var(--surface-2); border: 1px solid transparent; transition: border-color .15s, background .15s; }
.composer-box:focus-within { border-color: var(--accent); background: var(--surface); }
.composer-box .icon-btn { width: 40px; height: 40px; }
.composer textarea { flex: 1; min-width: 0; max-height: 180px; resize: none; border: 0; background: none; outline: none; padding: 11px 4px; line-height: 1.35; font-size: 15px; }
.composer textarea::placeholder { color: var(--text-3); }
.send-btn { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; color: var(--text-2); background: var(--surface-2); flex: none; transition: background .15s, color .15s, transform .15s var(--ease); }
.send-btn.ready { background: var(--fill); color: #fff; }
.send-btn.ready:hover { background: var(--fill-hover); transform: translateY(-1px); }
.send-btn:active { transform: scale(.96); }
.send-btn svg { transform: translate(1px, 0); }
.send-btn[data-mic="true"] { color: var(--accent); }
.rec-box { flex: 1; display: flex; align-items: center; gap: 12px; padding: 0 4px 0 16px; min-height: 44px; border-radius: var(--r-md); background: var(--surface-2); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1s ease-in-out infinite; }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.rec-hint { flex: 1; color: var(--text-2); font-size: 13px; }
.context-bar { display: flex; align-items: center; gap: 12px; width: min(100%, 720px); margin: 0 auto 8px; padding: 4px 4px 4px 12px; border-radius: var(--r-md); background: var(--surface-2); color: var(--accent); }
.context-text { flex: 1; min-width: 0; border-left: 2px solid var(--accent); padding-left: 8px; }
.context-title { font-size: 13px; font-weight: 600; }
.context-line { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.read-only { padding: 14px; text-align: center; color: var(--text-2); font-size: 14px; background: var(--surface); border-top: 1px solid var(--line); }
.emoji-panel { width: min(100%, 720px); margin: 8px auto 0; height: 280px; display: flex; flex-direction: column; border-radius: var(--r-md); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.emoji-search { margin: 8px; padding: 8px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); outline: none; font-size: 14px; }
.emoji-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); padding: 0 8px; align-content: start; }
.emoji-cell { height: 40px; font-size: 24px; border-radius: var(--r-sm); transition: background .15s; }
.emoji-cell:hover { background: var(--hover); }
.emoji-tabs { display: flex; justify-content: space-around; border-top: 1px solid var(--line); padding: 4px; }
.emoji-tab { flex: 1; padding: 6px 0; font-size: 18px; filter: grayscale(1); opacity: .55; border-radius: var(--r-sm); transition: opacity .15s; }
.emoji-tab.active { filter: none; opacity: 1; background: var(--accent-soft); }

/* ---- the layers that float: menus, dialogs, toasts, the viewer — lightly frosted and lifted ---------------- */
.popup-shield { position: fixed; inset: 0; z-index: 90; }
.popup { position: fixed; z-index: 91; min-width: 200px; padding: 4px; border-radius: var(--r-md); background: var(--float); -webkit-backdrop-filter: var(--float-blur); backdrop-filter: var(--float-blur); border: 1px solid var(--line); box-shadow: var(--lift); animation: pop .15s var(--ease); transform-origin: top left; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.popup-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; border-radius: var(--r-sm); text-align: left; font-size: 14px; font-weight: 500; transition: background .12s; }
.popup-item svg { color: var(--text-2); }
.popup-item:hover, .popup-item:focus-visible { background: var(--hover); outline: none; }
.popup-item.danger, .popup-item.danger svg { color: var(--danger); }
.popup-sep { height: 1px; margin: 4px 0; background: var(--line); }
.react-strip { display: flex; gap: 2px; padding: 2px 2px 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.react-pick { width: 34px; height: 34px; font-size: 20px; border-radius: var(--r-sm); transition: transform .12s var(--ease), background .12s; }
.react-pick:hover { transform: translateY(-2px); background: var(--hover); }
.react-pick.mine { background: var(--accent-soft); }
.dialog-shield { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgb(18 16 20 / .45); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.dialog { width: min(400px, 100%); max-height: min(640px, 92vh); display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; animation: pop .18s var(--ease); background: var(--float); -webkit-backdrop-filter: var(--float-blur); backdrop-filter: var(--float-blur); border: 1px solid var(--line); box-shadow: var(--lift); }
.dialog-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px 4px 8px; }
.dialog-head h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.dialog-body { padding: 4px 16px 12px; overflow-y: auto; flex: 1; min-height: 0; }
.dialog-body p { margin: 8px 0; color: var(--text-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 16px 16px; }
.dialog-input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); outline: none; margin: 4px 0 8px; resize: vertical; transition: border-color .15s; }
.dialog-input:focus { border-color: var(--accent); }
.btn { height: 40px; padding: 0 16px; border-radius: var(--r-sm); font-weight: 600; font-size: 14px; color: var(--accent); transition: background .15s, transform .15s var(--ease); }
.btn:hover { background: var(--accent-soft); transform: translateY(-1px); }
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--fill); color: #fff; }
.btn.primary:hover { background: var(--fill-hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: rgb(198 40 58 / .1); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.field { display: block; margin: 8px 0; }
.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin: 0 0 2px 2px; }
.hint { font-size: 12px; color: var(--text-2); margin: -4px 2px 4px; min-height: 1em; }
.hint.ok { color: var(--ok); }
.hint.bad { color: var(--danger); }
.settings-card { display: grid; place-items: center; padding: 8px 0 4px; }
.settings .btn.danger { margin-top: 8px; width: 100%; border: 1px solid rgb(198 40 58 / .35); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.chip { padding: 2px 8px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.people { margin: 0 -8px; }
.check-line { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; }
.check-line input { width: 16px; height: 16px; accent-color: var(--fill); }
.scheduled-row { display: flex; align-items: center; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.scheduled-main { flex: 1; min-width: 0; }
.scheduled-when { font-weight: 600; color: var(--accent); font-size: 13px; }
.scheduled-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.avatar-edit { position: relative; display: inline-block; cursor: pointer; }
.avatar-edit .avatar-cam { position: absolute; right: -2px; bottom: -2px; width: 32px; height: 32px; border-radius: var(--r-md); display: grid; place-items: center; color: #fff; background: var(--fill); border: 2px solid var(--surface); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 120; padding: 8px 16px; border-radius: var(--r-md); color: var(--text); font-size: 14px; animation: rise .2s var(--ease); max-width: 90vw; background: var(--float); -webkit-backdrop-filter: var(--float-blur); backdrop-filter: var(--float-blur); border: 1px solid var(--line); box-shadow: var(--lift); }
.toast.gone { opacity: 0; transition: opacity .3s; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgb(14 12 16 / .92); cursor: zoom-out; animation: fade .15s; }
.lightbox img { max-width: 94vw; max-height: 92vh; object-fit: contain; border-radius: var(--r-sm); }
.lightbox .icon-btn { position: absolute; top: 12px; right: 12px; }

/* ---- the side panel ----------------------------------------------------------------------------------------- */
.info-panel { width: 340px; flex: none; display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-left: 1px solid var(--line); animation: slide .2s var(--ease); }
@keyframes slide { from { transform: translateX(16px); opacity: 0; } }
.info-head { height: var(--head); display: flex; align-items: center; gap: 8px; padding: 0 8px; flex: none; border-bottom: 1px solid var(--line); }
.info-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.info-body { flex: 1; overflow-y: auto; padding-bottom: 16px; }
.info-card { display: flex; flex-direction: column; align-items: center; padding: 16px 16px 12px; gap: 4px; }
.info-name { font-size: 18px; font-weight: 600; margin-top: 8px; text-align: center; overflow-wrap: anywhere; }
.info-sub { font-size: 13px; color: var(--text-2); }
.info-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 0 12px 12px; border-bottom: 1px solid var(--line); }
.info-action { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 84px; padding: 8px; border-radius: var(--r-md); color: var(--accent); font-size: 12px; font-weight: 600; transition: background .15s, transform .15s var(--ease); }
.info-action:hover { background: var(--accent-soft); transform: translateY(-1px); }
.info-line { display: flex; gap: 16px; padding: 12px 16px; color: var(--text-2); border-bottom: 1px solid var(--line); }
.info-value { color: var(--text); font-size: 15px; overflow-wrap: anywhere; white-space: pre-wrap; }
.info-label { font-size: 12px; }
.members { padding: 4px; }

/* ---- calls ---------------------------------------------------------------------------------------------------- */
.calls-layer { position: fixed; inset: 0; z-index: 70; background: #0f0d11; }
.calls-layer calls-screen { display: block; width: 100%; height: 100%;
  --calls-accent: #c4246b; --calls-accent-fg: #fff; --calls-font: Inter, "SF Pro Text", system-ui, sans-serif; --calls-radius: 10px; --calls-tile-radius: 10px;
  --calls-control-size: 48px; --calls-bg: transparent; --calls-surface: #1c191f; --calls-control-bg: rgb(255 255 255 / .12); }
.calls-layer calls-screen::part(ring) { background: #1c191f; border: 1px solid rgb(255 255 255 / .1); border-radius: var(--r-lg); box-shadow: var(--lift); }

/* ---- a narrow window: the info panel covers the chat; a phone: one column at a time --------------------------- */
@media (max-width: 1100px) {
  .info-panel { position: absolute; inset: 0 0 0 auto; width: min(360px, 100%); z-index: 10; box-shadow: var(--lift); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .app .main { display: none; }
  .app.chat-open .sidebar { display: none; }
  .app.chat-open .main { display: flex; border-left: 0; }
  .chat-head .back { display: grid; }
  .chat-head .icon-btn[title="Chat info"], .chat-head .icon-btn[title="Search in chat"] { display: none; }
  .bubble { max-width: 88%; }
  .timeline { padding-left: 8px; padding-right: 8px; }
  .info-panel { width: 100%; }
  .composer { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
  .fab { bottom: calc(16px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
/* Hover moves only for a fine pointer. */
@media (hover: none) { .btn:hover, .fab:hover, .send-btn.ready:hover, .info-action:hover, .signin-btn:hover, .reaction:hover, .react-pick:hover, .to-bottom:hover { transform: none; } }
/* Without backdrop-filter the floating layers are made opaque, so that text stays legible. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --float: #fff; }
  :root[data-theme="dark"] { --float: #201c25; }
}

/* ---- the chat: a wallpaper under the messages, a floating field, bubbles with tails ------------------------ */
/* The wallpaper is a soft ground (never violet) with a fine pattern drawn in one ink over it; the person chooses one in
   Settings (`html[data-wall]`), and each has a light and a dark grade. */
:root {
  --wall-bg: linear-gradient(165deg, #f8e4d8 0%, #f4d5d8 48%, #d8e7e2 100%);
  --wall-ink: rgb(120 60 70 / .09);
  --chip: rgb(40 28 34 / .42);
}
:root[data-theme="dark"] { --wall-bg: linear-gradient(165deg, #241519 0%, #1c1519 50%, #131f1e 100%); --wall-ink: rgb(255 235 240 / .045); --chip: rgb(0 0 0 / .38); }
:root[data-wall="rose"] { --wall-bg: linear-gradient(165deg, #f9dbe1 0%, #f2c4d0 55%, #f6d6c9 100%); }
:root[data-wall="sand"] { --wall-bg: linear-gradient(165deg, #f4ead9 0%, #ecdcc0 60%, #e8d3b4 100%); --wall-ink: rgb(110 80 40 / .09); }
:root[data-wall="sea"] { --wall-bg: linear-gradient(165deg, #dcebf0 0%, #c8e0e6 55%, #cfe3d9 100%); --wall-ink: rgb(30 80 100 / .09); }
:root[data-wall="moss"] { --wall-bg: linear-gradient(165deg, #e3ecd6 0%, #d3e2c3 55%, #dde5c6 100%); --wall-ink: rgb(50 90 40 / .09); }
:root[data-wall="plain"] { --wall-bg: var(--wall); --wall-ink: transparent; }
:root[data-theme="dark"][data-wall="rose"] { --wall-bg: linear-gradient(165deg, #2b141b 0%, #211017 55%, #1d1316 100%); }
:root[data-theme="dark"][data-wall="sand"] { --wall-bg: linear-gradient(165deg, #231e16 0%, #1d1912 60%, #1a1610 100%); --wall-ink: rgb(255 235 200 / .045); }
:root[data-theme="dark"][data-wall="sea"] { --wall-bg: linear-gradient(165deg, #0f1e26 0%, #0e1a21 55%, #101c1c 100%); --wall-ink: rgb(200 235 255 / .045); }
:root[data-theme="dark"][data-wall="moss"] { --wall-bg: linear-gradient(165deg, #151e13 0%, #121a11 55%, #141a10 100%); --wall-ink: rgb(220 255 210 / .045); }
:root[data-theme="dark"][data-wall="plain"] { --wall-bg: var(--wall); }

.chat-pane { background: var(--wall-bg); }
.timeline-wrap::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--wall-ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 26c6-8 16-8 22 0M84 18l9 9-9 9-9-9zM118 70a9 9 0 1 0 18 0 9 9 0 0 0-18 0zM26 88h14M33 81v14M70 118c9-11 21-11 30 0M16 140l9-9 9 9M112 136h18M140 26l6 6-6 6M52 52l10 0M57 47v10M128 110c4-6 12-6 16 0'/%3E%3C/svg%3E");
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 26c6-8 16-8 22 0M84 18l9 9-9 9-9-9zM118 70a9 9 0 1 0 18 0 9 9 0 0 0-18 0zM26 88h14M33 81v14M70 118c9-11 21-11 30 0M16 140l9-9 9 9M112 136h18M140 26l6 6-6 6M52 52l10 0M57 47v10M128 110c4-6 12-6 16 0'/%3E%3C/svg%3E"); }

/* the date and service chips read over any wallpaper */
.day span, .service span { background: var(--chip); border: 0; color: #fff; font-weight: 500; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.unread-divider { background: var(--chip); color: #fff; }

/* the messages: a little more air, a soft edge instead of a line, tails on the last bubble of a run */
.msg { margin-top: 10px; }
.msg.joins-prev { margin-top: 2px; }
.bubble { padding: 7px 11px 6px; font-size: 15.5px; border: 0; box-shadow: 0 1px 1px rgb(33 28 34 / .1); }
.msg.mine .bubble { box-shadow: 0 1px 1px rgb(33 28 34 / .18); }
:root[data-theme="dark"] .bubble { box-shadow: 0 1px 1px rgb(0 0 0 / .35); }
.bubble.bare { box-shadow: none; }
.msg.theirs:not(.joins-next) .bubble::before, .msg.mine:not(.joins-next) .bubble::before { content: ""; position: absolute; bottom: 0; width: 9px; height: 13px; }
.msg.theirs:not(.joins-next) .bubble::before { left: -8px; background: var(--in); clip-path: path("M9 0 V13 H2.5 C6 12 8 8 9 0 Z"); }
.msg.mine:not(.joins-next) .bubble::before { right: -8px; background: var(--out); clip-path: path("M0 0 V13 H6.5 C3 12 1 8 0 0 Z"); }
.bubble.bare::before { display: none !important; }
.msg.theirs:not(.joins-next) .bubble { border-bottom-left-radius: 2px; }
.msg.mine:not(.joins-next) .bubble { border-bottom-right-radius: 2px; }
.sender { font-weight: 600; }
.meta { margin-top: 5px; }

/* the field floats over the wallpaper: the wallpaper shows round it */
.composer { background: transparent; border-top: 0; padding: 8px 16px 14px; }
.composer-box, .send-btn { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 2px rgb(33 28 34 / .1), 0 6px 18px rgb(33 28 34 / .08); }
:root[data-theme="dark"] .composer-box, :root[data-theme="dark"] .send-btn { box-shadow: 0 1px 2px rgb(0 0 0 / .4), 0 6px 18px rgb(0 0 0 / .3); }
.composer-box:focus-within { border-color: var(--accent); background: var(--surface); }
.send-btn.ready { background: var(--fill); border-color: transparent; }
.rec-box { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 2px rgb(33 28 34 / .1); }
.context-bar { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 2px rgb(33 28 34 / .08); }
.read-only { margin: 8px 16px 14px; border-radius: var(--r-md); border: 1px solid var(--line); }
.to-bottom { box-shadow: 0 2px 10px rgb(33 28 34 / .18); }

/* the header carries a little more of the chat: the avatar larger, the title a step heavier */
.chat-head { padding: 0 8px; }
.head-title { font-size: 15.5px; }

/* wallpaper choice in Settings */
.walls { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 2px; }
.wall-swatch { width: 44px; height: 44px; border-radius: var(--r-md); border: 2px solid transparent; outline: 1px solid var(--line); outline-offset: -1px; background: var(--wall-bg); transition: transform .15s var(--ease), border-color .15s; }
.wall-swatch:hover { transform: translateY(-2px); }
.wall-swatch[aria-checked="true"] { border-color: var(--fill); box-shadow: 0 0 0 2px var(--surface) inset; }
.wall-swatch[data-wall="aurora"] { --wall-bg: linear-gradient(165deg, #f8e4d8, #f4d5d8 48%, #d8e7e2); }
.wall-swatch[data-wall="rose"] { --wall-bg: linear-gradient(165deg, #f9dbe1, #f2c4d0 55%, #f6d6c9); }
.wall-swatch[data-wall="sand"] { --wall-bg: linear-gradient(165deg, #f4ead9, #ecdcc0 60%, #e8d3b4); }
.wall-swatch[data-wall="sea"] { --wall-bg: linear-gradient(165deg, #dcebf0, #c8e0e6 55%, #cfe3d9); }
.wall-swatch[data-wall="moss"] { --wall-bg: linear-gradient(165deg, #e3ecd6, #d3e2c3 55%, #dde5c6); }
.wall-swatch[data-wall="plain"] { --wall-bg: var(--wall); }
:root[data-theme="dark"] .wall-swatch[data-wall="aurora"] { --wall-bg: linear-gradient(165deg, #241519, #1c1519 50%, #131f1e); }
:root[data-theme="dark"] .wall-swatch[data-wall="rose"] { --wall-bg: linear-gradient(165deg, #2b141b, #211017 55%, #1d1316); }
:root[data-theme="dark"] .wall-swatch[data-wall="sand"] { --wall-bg: linear-gradient(165deg, #231e16, #1d1912 60%, #1a1610); }
:root[data-theme="dark"] .wall-swatch[data-wall="sea"] { --wall-bg: linear-gradient(165deg, #0f1e26, #0e1a21 55%, #101c1c); }
:root[data-theme="dark"] .wall-swatch[data-wall="moss"] { --wall-bg: linear-gradient(165deg, #151e13, #121a11 55%, #141a10); }

.sender { color: hsl(var(--h, 330) 55% 36%); }
:root[data-theme="dark"] .sender { color: hsl(var(--h, 330) 70% 72%); }
.join-card p { white-space: pre-wrap; }
.join-head { display: flex; align-items: center; gap: 16px; padding: 8px 0; }
.join-head .info-name { margin: 0; text-align: left; }

/* the chat uses the whole width of its pane: messages run from the left edge (theirs) and the right edge (mine), the field spans */
.items { width: 100%; margin: 0; }
.timeline { padding-left: 20px; padding-right: 20px; }
.composer { padding-left: 20px; padding-right: 20px; }
.composer-row, .context-bar, .emoji-panel { width: 100%; margin-left: 0; margin-right: 0; }
.bubble { max-width: min(72%, 680px); }
.unread-divider { margin-left: -20px; margin-right: -20px; }
@media (max-width: 900px) { .timeline, .composer { padding-left: 8px; padding-right: 8px; } .bubble { max-width: 88%; } .unread-divider { margin-left: -8px; margin-right: -8px; } }
