:root {
  --bg: #0f1020;
  --bg2: #17182b;
  --panel: rgba(25, 27, 46, 0.76);
  --panel-solid: #191b2e;
  --border: rgba(255,255,255,.1);
  --text: #f7f7fb;
  --muted: #a5abc8;
  --accent: #ff3868;
  --accent2: #7c3aed;
  --mine1: #ff3868;
  --mine2: #7c3aed;
  --other: rgba(255,255,255,.08);
  --shadow: 0 24px 80px rgba(0,0,0,.35);
  color-scheme: dark;
}

body[data-theme="light"] {
  --bg: #f4f5fb;
  --bg2: #ffffff;
  --panel: rgba(255,255,255,.78);
  --panel-solid: #ffffff;
  --border: rgba(20,22,40,.1);
  --text: #141629;
  --muted: #626981;
  --accent: #e11d48;
  --accent2: #2563eb;
  --mine1: #f43f5e;
  --mine2: #2563eb;
  --other: rgba(20,22,40,.06);
  color-scheme: light;
}

body[data-theme="aurora"] {
  --bg: #10091b;
  --bg2: #17132b;
  --accent: #22c55e;
  --accent2: #06b6d4;
  --mine1: #22c55e;
  --mine2: #06b6d4;
}

body[data-theme="ocean"] {
  --bg: #06131f;
  --bg2: #0b2035;
  --accent: #38bdf8;
  --accent2: #6366f1;
  --mine1: #38bdf8;
  --mine2: #6366f1;
}

body[data-theme="sunset"] {
  --bg: #1f1020;
  --bg2: #32122a;
  --panel: rgba(44, 20, 42, .78);
  --panel-solid: #271427;
  --border: rgba(255, 198, 165, .14);
  --text: #fff7ed;
  --muted: #d9b6a6;
  --accent: #fb7185;
  --accent2: #f97316;
  --mine1: #fb7185;
  --mine2: #f97316;
  --other: rgba(255, 237, 213, .08);
}

body[data-theme="cyber"] {
  --bg: #050816;
  --bg2: #111827;
  --panel: rgba(10, 15, 35, .78);
  --panel-solid: #090d1f;
  --border: rgba(34, 211, 238, .16);
  --text: #ecfeff;
  --muted: #94a3b8;
  --accent: #22d3ee;
  --accent2: #a855f7;
  --mine1: #06b6d4;
  --mine2: #a855f7;
  --other: rgba(34, 211, 238, .08);
}

body[data-theme="amethyst"] {
  --bg: #120a24;
  --bg2: #21103c;
  --panel: rgba(31, 17, 58, .8);
  --panel-solid: #1e1238;
  --border: rgba(216, 180, 254, .14);
  --text: #faf5ff;
  --muted: #c4b5fd;
  --accent: #a855f7;
  --accent2: #ec4899;
  --mine1: #8b5cf6;
  --mine2: #ec4899;
  --other: rgba(216, 180, 254, .08);
}

body[data-theme="forest"] {
  --bg: #06150f;
  --bg2: #10261b;
  --panel: rgba(10, 35, 24, .78);
  --panel-solid: #0b2117;
  --border: rgba(134, 239, 172, .14);
  --text: #f0fdf4;
  --muted: #9dc6aa;
  --accent: #22c55e;
  --accent2: #84cc16;
  --mine1: #16a34a;
  --mine2: #65a30d;
  --other: rgba(220, 252, 231, .08);
}

body[data-theme="ruby"] {
  --bg: #19070d;
  --bg2: #2a0d17;
  --panel: rgba(43, 13, 24, .8);
  --panel-solid: #250b14;
  --border: rgba(251, 113, 133, .18);
  --text: #fff1f2;
  --muted: #f0a8b5;
  --accent: #f43f5e;
  --accent2: #be123c;
  --mine1: #f43f5e;
  --mine2: #be123c;
  --other: rgba(255, 228, 230, .08);
}

body[data-theme="graphite"] {
  --bg: #0b0f14;
  --bg2: #171b22;
  --panel: rgba(23, 27, 34, .82);
  --panel-solid: #161a21;
  --border: rgba(226, 232, 240, .11);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #64748b;
  --accent2: #0ea5e9;
  --mine1: #475569;
  --mine2: #0284c7;
  --other: rgba(226, 232, 240, .07);
}

body[data-theme="champagne"] {
  --bg: #fff7ed;
  --bg2: #fff1f2;
  --panel: rgba(255,255,255,.82);
  --panel-solid: #ffffff;
  --border: rgba(120, 53, 15, .12);
  --text: #2b1b13;
  --muted: #7c5d4b;
  --accent: #d97706;
  --accent2: #e11d48;
  --mine1: #f59e0b;
  --mine2: #e11d48;
  --other: rgba(120, 53, 15, .07);
  color-scheme: light;
}

body[data-theme="ice"] {
  --bg: #eef8ff;
  --bg2: #ffffff;
  --panel: rgba(255,255,255,.8);
  --panel-solid: #ffffff;
  --border: rgba(15, 76, 117, .12);
  --text: #102033;
  --muted: #52677c;
  --accent: #0ea5e9;
  --accent2: #6366f1;
  --mine1: #0ea5e9;
  --mine2: #6366f1;
  --other: rgba(14, 165, 233, .08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 10%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 32%),
    radial-gradient(circle at 90% 20%, color-mix(in srgb, var(--accent2) 22%, transparent), transparent 36%),
    linear-gradient(135deg, var(--bg), var(--bg2));
  color: var(--text);
  overflow: hidden;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.5; }

.app-shell { height: 100vh; height: 100dvh; }
.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.orb {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  filter: blur(40px);
  opacity: .25;
}
.orb-a { background: var(--accent); top: -120px; left: -80px; }
.orb-b { background: var(--accent2); bottom: -150px; right: -120px; }
.login-card {
  position: relative;
  width: min(380px, 100%);
  padding: 24px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  border-radius: 24px;
}
.login-logo-wrap { display: flex; justify-content: center; margin: 0 0 22px; }
.login-logo { width: 190px; max-width: 80%; height: auto; object-fit: contain; }
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.brand.mini { margin: 0; }
.side-logo { width: 150px; height: auto; object-fit: contain; }
.brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 25px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  box-shadow: 0 16px 36px color-mix(in srgb, var(--accent) 34%, transparent);
}
.brand h1, .brand h2 { margin: 0; line-height: 1; }
.brand p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
label { display: block; margin: 13px 0; }
label span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
input, textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-solid) 72%, transparent);
  color: var(--text);
  border-radius: 14px;
  outline: none;
  padding: 11px 13px;
}
input:focus, textarea:focus { border-color: color-mix(in srgb, var(--accent) 70%, white); }
.alert {
  background: rgba(244, 63, 94, .14);
  border: 1px solid rgba(244,63,94,.28);
  color: #ff8fa3;
  padding: 12px 14px;
  border-radius: 16px;
  margin: 12px 0;
}
.primary-btn, .send-btn, .soft-btn, .icon-btn {
  border: 0;
  color: var(--text);
}
.primary-btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: 15px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  box-shadow: 0 20px 45px color-mix(in srgb, var(--accent) 25%, transparent);
}

.chat-view {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}
.sidebar, .settings-panel {
  background: var(--panel);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(18px);
}
.sidebar {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-x: hidden;
}
.side-top, .chat-header, .panel-head, .header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--other);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  text-align: center;
  color: var(--text);
}
.icon-btn svg,
.send-btn svg,
.msg-action svg,
.msg-hint svg {
  width: 20px;
  height: 20px;
  display: block;
  pointer-events: none;
}
.send-btn svg { color: white; }
.searchbox > span { color: var(--muted); }
.searchbox > span svg { width: 16px; height: 16px; }
#notifyBtn .btn-icon { display: inline-flex; align-items: center; }
#notifyBtn .btn-icon svg { width: 16px; height: 16px; display: block; }
#notifyBtn .btn-text { display: inline-flex; align-items: center; }
.msg-hint { display: none; }
@keyframes msgToolsPop {
  0% { opacity: 0; transform: translateY(-6px) scale(.75); filter: blur(2px); }
  60% { opacity: 1; transform: translateY(1px) scale(1.04); filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes reactionPop {
  0% { opacity: 0; transform: translateY(2px) scale(.7); }
  60% { opacity: 1; transform: translateY(-10px) scale(1.06); }
  100% { opacity: 1; transform: translateY(-8px) scale(1); }
}
@keyframes reactionPickFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.soft-btn {
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--other);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.2;
}
.soft-btn.danger { color: #fb7185; }
.searchbox {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0 12px;
  height: 42px;
  min-height: 42px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), color-mix(in srgb, var(--accent2) 8%, transparent)),
    var(--other);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.searchbox span {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}
.searchbox:focus-within {
  border-color: color-mix(in srgb, var(--accent) 62%, white);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 13%, transparent);
}
.searchbox input {
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 0;
}
.searchbox input:focus { border: 0; }
.archive-toggle {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 9px 12px;
  background: var(--other);
  color: var(--text);
  font-weight: 750;
  text-align: center;
}
.archive-toggle.active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--accent2) 14%, transparent));
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.rooms {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
}
.room {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 15px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.room-main {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.room:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.room.active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--accent2) 12%, transparent));
}
.room.reorderable { cursor: grab; }
.room.reorderable.dragging { opacity: .55; cursor: grabbing; }
.room.drop-target {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent);
}
.room-drag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 28px;
  color: var(--muted);
  opacity: .55;
  cursor: grab;
  touch-action: none;
}
.room-drag svg { width: 14px; height: 14px; }
.room.reorderable:hover .room-drag { opacity: 1; }
.room.reorderable.dragging .room-drag { cursor: grabbing; }
.room-archive,
.room-edit,
.room-notify {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--other);
  color: var(--muted);
  opacity: .8;
  transition: color .15s, opacity .15s, border-color .15s;
}
.room-archive svg,
.room-edit svg,
.room-notify svg { width: 15px; height: 15px; }
.room:hover .room-archive,
.room:hover .room-edit,
.room:hover .room-notify { opacity: 1; }
.room-edit:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}
.room-archive:hover {
  color: #fb7185;
  border-color: rgba(251, 113, 133, .45);
}
.room-notify.notify-on {
  color: var(--accent);
  opacity: 1;
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}
.room-notify.notify-off {
  color: #fb7185;
  opacity: 1;
  border-color: rgba(251, 113, 133, .45);
}
.room-notify:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}
.room-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.room-menu {
  display: none;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: .8;
  transition: background .15s, color .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.room-menu svg { width: 18px; height: 18px; }
.room-menu:hover, .room-menu:active {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--text);
  opacity: 1;
}

/* Room actions sheet (modal) */
.room-sheet { display: flex; flex-direction: column; gap: 12px; min-width: 260px; }
.schedule-modal {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 280px;
  max-width: 460px;
}
.schedule-head h3 {
  margin: 0 0 4px;
  font-size: 17px;
  letter-spacing: .005em;
}
.schedule-head .muted {
  font-size: 12.5px;
  line-height: 1.45;
  margin: 0;
}
.schedule-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  cursor: pointer;
  user-select: none;
}
.schedule-toggle input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.schedule-toggle span {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.schedule-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.schedule-time {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-solid);
}
.schedule-time span {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.schedule-time input[type=time] {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  padding: 0;
  width: 100%;
  outline: none;
  color-scheme: dark light;
}
.schedule-days-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.schedule-section-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.schedule-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.sched-day {
  border: 1px solid var(--border);
  background: var(--panel-solid);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 0;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.sched-day:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}
.sched-day:active { transform: scale(.95); }
.sched-day.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--accent) 60%, transparent);
}
.schedule-day-quick {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.schedule-day-quick .link-btn {
  background: transparent;
  border: 0;
  color: var(--accent);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background .15s ease;
}
.schedule-day-quick .link-btn:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.schedule-note {
  font-size: 12.5px;
  line-height: 1.5;
  margin: 0;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--border) 40%, transparent);
  border-radius: 10px;
  min-height: 36px;
}
.schedule-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.schedule-actions .soft-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.schedule-actions .soft-btn.primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, white);
}
.schedule-actions .soft-btn.danger {
  border-color: color-mix(in srgb, #ef4444 60%, var(--border));
  color: #ef4444;
}
.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 2px;
}
.schedule-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  color: var(--text);
  border-radius: 14px;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.schedule-list-row:hover {
  background: color-mix(in srgb, var(--accent) 8%, var(--panel-solid));
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}
.schedule-list-row:active { transform: scale(.985); }
.schedule-list-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}
.schedule-list-title strong {
  font-size: 14px;
  color: var(--text);
}
.schedule-list-meta {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .005em;
}
.schedule-list-edit {
  color: var(--muted);
  display: inline-flex;
}
.schedule-list-edit svg {
  width: 16px;
  height: 16px;
}
@media (max-width: 540px) {
  .schedule-modal { min-width: auto; }
  .schedule-times { grid-template-columns: 1fr; }
  .sched-day { font-size: 11.5px; padding: 6px 0; }
}
.room-sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 2px 12px;
  border-bottom: 1px solid var(--border);
}
.room-sheet-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.room-sheet-meta strong { font-size: 15px; color: var(--text); }
.room-sheet-meta span { font-size: 12.5px; color: var(--muted); }
.room-sheet-list { display: flex; flex-direction: column; gap: 4px; }
.room-sheet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.room-sheet-item:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.room-sheet-item:active { transform: scale(.98); }
.room-sheet-item.active {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.room-sheet-ico {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 14%, var(--panel-solid));
  color: var(--text);
  flex: 0 0 auto;
}
.room-sheet-ico svg { width: 18px; height: 18px; }
.room-sheet-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.room-sheet-label { font-weight: 600; font-size: 14px; }
.room-sheet-hint { font-size: 12px; color: var(--muted); }
.room-sheet-check {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.room-sheet-check svg { width: 18px; height: 18px; }
.room-ico {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  overflow: hidden;
  position: relative;
  isolation: isolate;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 18%, transparent);
}
.room-ico.has-avatar {
  background: transparent;
  border-radius: 999px;
  box-shadow: none;
}
.room-ico:has(.room-ico-img) {
  background: transparent;
  border-radius: 999px;
  box-shadow: none;
}
.room-ico-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}
.room-ico-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25));
}
.room-ico-svg svg { width: 22px; height: 22px; }
.room-photo-setting {
  margin: 4px 0 12px;
}
.room-title { font-weight: 750; }
.room-title,
.room-desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.room-desc { color: var(--muted); font-size: 12px; margin-top: 3px; }
.empty-rooms {
  padding: 18px 12px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  background: color-mix(in srgb, var(--other) 55%, transparent);
}
.unread-badge {
  margin-left: auto;
  align-self: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 7px;
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: 800;
}
.profile-box {
  margin-top: auto;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--other);
}
.profile-line { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: white;
  overflow: hidden;
}
.conversation {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  min-height: 0;
  position: relative;
}
.chat-header {
  flex: 0 0 auto;
  min-height: 54px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-solid);
  position: relative;
  z-index: 5;
}
.chat-header h2 { margin: 0; }
.chat-header p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.chat-header h2 {
  max-width: 52vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
  line-height: 1.1;
}
.chat-header-title { flex: 1 1 auto; min-width: 0; }
.chat-header-title p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-toggle, .sidebar-close, .header-more { display: none; }
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 9;
}
.messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.room-join-event {
  align-self: center;
  max-width: min(520px, 90%);
  padding: 2px 8px;
  border-radius: 999px;
  color: color-mix(in srgb, var(--muted) 78%, transparent);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}
.pinned-box {
  margin: 8px 14px 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-solid));
  color: var(--text);
  font-size: 13px;
}
.pinned-link {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.selection-toolbar {
  margin: 10px 14px 0;
  padding: 8px 10px 8px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--panel-solid)), color-mix(in srgb, var(--accent2) 16%, var(--panel-solid)));
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  color: var(--text);
  font-size: 13.5px;
  box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--accent) 60%, transparent);
  animation: selBarIn .18s ease-out;
}
.selection-toolbar.hidden { display: none; }
@keyframes selBarIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.selection-toolbar .sel-count {
  flex: 1;
  font-weight: 600;
  letter-spacing: .1px;
}
.selection-toolbar .sel-count b {
  font-weight: 800;
  color: var(--text);
  margin-right: 2px;
}
.selection-toolbar .sel-btn {
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background .15s ease, transform .12s ease, filter .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.selection-toolbar .sel-btn:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.selection-toolbar .sel-btn:active { transform: scale(.97); }
.selection-toolbar .sel-btn.sel-cancel {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.selection-toolbar .sel-btn.sel-cancel svg { width: 18px; height: 18px; }
.selection-toolbar .sel-btn.sel-all {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.selection-toolbar .sel-btn.sel-delete {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  font-weight: 700;
  padding: 8px 14px;
  box-shadow: 0 4px 12px -4px rgba(239, 68, 68, .55);
}
.selection-toolbar .sel-btn.sel-delete:hover { filter: brightness(1.06); }
.selection-toolbar .sel-btn.sel-delete[disabled] {
  opacity: .55;
  cursor: not-allowed;
}
.selection-toolbar .sel-btn.sel-delete .sel-ico svg { width: 16px; height: 16px; }

body.selecting .messages .msg {
  padding-left: 30px;
  transition: padding-left .15s ease;
}
body.selecting .messages .msg.mine {
  padding-left: 0;
  padding-right: 30px;
}
.msg-select-checkbox {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--accent) 60%, var(--border));
  background: var(--panel-solid);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
  z-index: 2;
}
.msg.mine .msg-select-checkbox {
  left: auto;
  right: 4px;
}
.msg-select-checkbox .msg-select-mark {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .12s ease, transform .15s ease;
}
.msg-select-checkbox .msg-select-mark svg { width: 14px; height: 14px; }
.msg-select-checkbox.checked {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
}
.msg-select-checkbox.checked .msg-select-mark {
  opacity: 1;
  transform: scale(1);
}
.msg-select-checkbox:active { transform: translateY(-50%) scale(.92); }

.msg.bulk-selected .bubble,
.msg.bulk-selected .attachment,
.msg.bulk-selected .reply-quote {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 14%, transparent);
}
.msg.bulk-selected {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border-radius: 14px;
}
body.selecting .messages .msg { cursor: pointer; }

.msg-read-row {
  display: flex;
  align-items: center;
  padding: 0 6px;
  min-height: 14px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1;
}
.msg.mine .msg-read-row { justify-content: flex-end; }
.msg-read {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  cursor: default;
  transition: color .15s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.msg-read-inline {
  align-self: center;
  flex: 0 0 auto;
}
.msg-read.is-sent { color: color-mix(in srgb, var(--muted) 90%, transparent); }
.msg-read.is-read { color: color-mix(in srgb, var(--accent) 80%, var(--muted)); }
.msg-read.is-read svg { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent) 35%, transparent)); }
.msg-read.is-pending { color: var(--muted); animation: msgPendingPulse 1.2s ease-in-out infinite; }
.msg-read.is-failed { color: #ef4444; font-weight: 700; }
.msg-read svg { width: 14px; height: 12px; }
.msg.msg-pending .bubble,
.msg.msg-pending .attachment { opacity: .75; }
.msg.msg-failed .bubble {
  outline: 1px solid color-mix(in srgb, #ef4444 60%, transparent);
}
@keyframes msgPendingPulse {
  0%, 100% { opacity: .5; }
  50% { opacity: 1; }
}
.msg-read-list {
  cursor: pointer;
}
.msg-read-list:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--text);
}
.msg-read-count { font-weight: 600; }

.readers-modal { min-width: 280px; max-width: 420px; display: flex; flex-direction: column; gap: 12px; }
.readers-modal h3 { margin: 0; }
.reader-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}
.reader-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: default;
  transition: background .15s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.reader-row.reader-clickable { cursor: pointer; }
.reader-row:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.reader-row.reader-clickable:active { transform: scale(.985); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.reader-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  flex: 0 0 auto;
  overflow: hidden;
}
.reader-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.reader-info { flex: 1 1 auto; min-width: 0; }
.reader-name { font-weight: 600; font-size: 14px; color: var(--text); }
.reader-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.reader-empty { padding: 18px 4px; text-align: center; color: var(--muted); font-size: 13px; }
.reader-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.reader-pages { font-size: 12.5px; color: var(--muted); }
.reader-pager .soft-btn[disabled] { opacity: .45; cursor: not-allowed; }

.participants-modal {
  width: 100%;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.participants-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.participants-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}
.participants-head .muted {
  flex: 0 1 auto;
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}
.participants-search {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--other);
  color: var(--text);
  padding: 9px 11px;
  outline: none;
  font-size: 14px;
}
.participant-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 2px;
}
.participant-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  padding: 7px 6px;
  text-align: left;
  font: inherit;
}
.participant-row:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.participant-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.participant-info b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.participant-info span {
  color: var(--muted);
  font-size: 11.5px;
}
.participants-modal .modal-actions {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.user-search { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; position: relative; }
.user-search-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-solid);
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .4);
}
.user-search-results.hidden { display: none; }
.user-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.user-search-item:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.user-search-item:active { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.user-search-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  flex: 0 0 auto;
  overflow: hidden;
}
.user-search-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.user-search-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.user-search-name { font-weight: 600; font-size: 13.5px; color: var(--text); }
.user-search-meta { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-search-empty { padding: 12px 4px; text-align: center; color: var(--muted); font-size: 12.5px; }
.msg.highlight .bubble,
.msg.highlight .attachment,
.msg.highlight .reply-quote {
  outline: 2px solid color-mix(in srgb, var(--accent) 80%, white);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 16%, transparent);
}
.jump-bottom {
  position: absolute;
  right: 18px;
  bottom: 76px;
  z-index: 10;
  border: 0;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  font-size: 20px;
  box-shadow: var(--shadow);
}
.msg {
  display: grid;
  grid-template-columns: 36px minmax(0, 680px);
  gap: 8px;
  align-items: end;
}
.msg.mine {
  grid-template-columns: minmax(0, 680px) 36px;
  align-self: flex-end;
}
.msg.mine .avatar { grid-column: 2; }
.msg.mine .bubble-wrap { grid-column: 1; grid-row: 1; align-items: flex-end; }
.bubble-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }
.bubble-line {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  flex-wrap: wrap;
}
.msg.mine .bubble-line { flex-direction: row-reverse; }
.bubble-line > .bubble,
.bubble-line > .attachment { min-width: 0; }
.meta { display: flex; gap: 8px; align-items: baseline; color: var(--muted); font-size: 12px; padding: 0 6px; }
.meta strong { color: var(--text); }
.user-link {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.user-link:hover { text-decoration: underline; }
.avatar-btn {
  border: 0;
  padding: 0;
  cursor: pointer;
  background-clip: padding-box;
}
.avatar-btn:hover { outline: 2px solid color-mix(in srgb, var(--accent) 72%, white); }
.badge {
  border-radius: 999px;
  padding: 2px 7px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: color-mix(in srgb, var(--accent) 70%, white);
  font-size: 11px;
}
.badge.online {
  background: rgba(34, 197, 94, .18);
  color: #4ade80;
}
.bubble {
  padding: 9px 12px;
  border-radius: 16px 16px 16px 7px;
  background: var(--other);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 12px 26px rgba(0,0,0,.08);
}
.bubble a {
  color: color-mix(in srgb, var(--accent) 82%, white);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}
.mine .bubble a {
  color: #fff;
  font-weight: 700;
}
.edit-inline {
  display: grid;
  gap: 6px;
}
.edit-inline textarea {
  min-width: min(520px, 72vw);
  min-height: 70px;
}
.edit-actions { display: flex; justify-content: flex-end; gap: 6px; }
.mine .bubble {
  border-radius: 16px 16px 7px 16px;
  color: white;
  background: linear-gradient(135deg, var(--mine1), var(--mine2));
  border: 0;
}
body.no-gradient .mine .bubble {
  background: color-mix(in srgb, var(--accent) 80%, black);
}
.reactions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 6px;
}
.reaction, .react-add, .msg-action {
  border: 1px solid var(--border);
  background: var(--other);
  color: var(--text);
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 12px;
}
.msg-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.reply-quote {
  width: 100%;
  max-width: min(520px, 72vw);
  padding: 7px 9px;
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--muted);
  font-size: 12px;
}
.reply-quote b { color: var(--text); }
.profile-info {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  min-width: 0;
}
.profile-info div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--other) 76%, transparent);
  min-width: 0;
}
.profile-info span {
  color: var(--muted);
  flex: 0 0 auto;
}
.profile-info b {
  color: var(--text);
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.composer {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 42px 42px minmax(0, 1fr) 46px;
  grid-auto-rows: min-content;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--panel-solid);
  position: relative;
  z-index: 4;
}
.reply-preview {
  grid-column: 1 / -1;
  grid-row: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 10%, var(--other));
  color: var(--muted);
  font-size: 13px;
}
.join-room-prompt {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 8px;
  margin: 0 14px 10px;
  padding: 7px 8px 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-solid) 86%, transparent);
  color: var(--muted);
  font-size: 12.5px;
}
.join-room-prompt .soft-btn {
  white-space: nowrap;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--text);
}
.composer textarea {
  resize: none;
  min-height: 42px;
  max-height: 140px;
  grid-column: 3;
  grid-row: auto;
  padding: 10px 14px;
  border-radius: 17px;
  line-height: 20px;
}
.send-btn {
  width: 46px;
  height: 42px;
  align-self: center;
  grid-column: 4;
  grid-row: auto;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.composer { position: relative; }
.composer-popover, .reaction-popover {
  position: absolute;
  z-index: 50;
  display: flex;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}
.composer-popover {
  left: 14px;
  bottom: 64px;
  width: min(340px, calc(100vw - 28px));
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(60vh, 460px);
}
.reaction-popover {
  transform: translateY(-8px);
  transform-origin: top center;
  animation: reactionPop .28s cubic-bezier(.34, 1.56, .64, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.reaction-popover button {
  border: 0;
  background: var(--other);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.reaction-popover button:hover { transform: scale(1.15); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.reaction-popover button:active { transform: scale(.92); }
.picker-tabs {
  display: flex;
  gap: 4px;
  background: var(--other);
  padding: 4px;
  border-radius: 12px;
}
.picker-tab-btn {
  flex: 1 1 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
}
.picker-tab-btn.active {
  background: var(--panel-solid);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.picker-pane { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.picker-pane.hidden { display: none; }
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}
.emoji-grid .emoji-btn {
  border: 0;
  background: var(--other);
  color: var(--text);
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  font-size: 20px;
  cursor: pointer;
}
.picker-search {
  width: 100%;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-solid) 72%, transparent);
  color: var(--text);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 14px;
}
.gif-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-content: start;
}
.gif-cell {
  border: 0;
  padding: 0;
  margin: 0;
  background: var(--other);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  min-height: 96px;
  position: relative;
}
.gif-cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.gif-cell:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.gif-status {
  font-size: 12px;
  padding: 8px 4px;
  text-align: center;
}
.msg { position: relative; }
.msg-tools {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 12px;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px) scale(.96);
  transition: opacity .18s ease, transform .18s ease;
  flex-shrink: 0;
  align-self: center;
}
.msg.mine .msg-tools { transform: translateX(6px) scale(.96); }
.msg:hover .msg-tools,
.msg:focus-within .msg-tools {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}
.attachment {
  width: 280px;
  height: 180px;
  max-width: 100%;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
  position: relative;
  cursor: zoom-in;
  background: var(--other);
}
.attachment:hover { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: -2px; }
.att-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .22);
  color: white;
  pointer-events: none;
}
.play-overlay svg {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .55));
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, .92);
  display: grid;
  place-items: center;
  padding: 16px;
  animation: lightboxIn .18s ease-out;
}
@keyframes lightboxIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.lightbox-content {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-content img,
.lightbox-content video {
  max-width: 96vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  touch-action: pinch-zoom;
}
.lightbox-close {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: white;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 201;
  padding: 0;
}
.lightbox-close:active { background: rgba(255, 255, 255, .26); }
.lightbox-close svg { width: 22px; height: 22px; }
body.lightbox-open { overflow: hidden; }
.attachment-preview {
  grid-column: 1 / -1;
  grid-row: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--other);
  color: var(--muted);
  font-size: 13px;
}
.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
}
.avatar-setting {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar-upload {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 13px;
  background: var(--other);
  cursor: pointer;
}
.avatar-upload input { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,.48);
  backdrop-filter: blur(10px);
}
.modal-card {
  width: min(420px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}
.modal-card h3 { margin: 0 0 12px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.profile-card { display: grid; gap: 12px; min-width: 0; }
.profile-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.profile-head > div:last-child { min-width: 0; }
.profile-head h3 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.react-user { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.restricted-list { display: grid; gap: 8px; }
.restricted-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--other);
}
.restricted-main { min-width: 0; }
.restrict-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}
.restrict-actions .soft-btn {
  font-size: 12px;
  padding: 7px 9px;
}
.restriction-editor {
  display: grid;
  gap: 10px;
}
.restriction-editor select {
  width: 100%;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-solid) 72%, transparent);
  color: var(--text);
  border-radius: 14px;
  padding: 11px 13px;
}
.blocked-chat {
  margin: auto;
  max-width: 420px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-solid));
  box-shadow: var(--shadow);
}
.blocked-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  font-size: 28px;
}
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: color-mix(in srgb, #000 55%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px 16px;
  animation: searchFade .18s ease-out;
}
.search-overlay.hidden { display: none; }
@keyframes searchFade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.search-panel {
  width: 100%;
  max-width: 560px;
  background: var(--panel-solid);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, .45);
  display: flex;
  flex-direction: column;
  max-height: min(82vh, 720px);
  overflow: hidden;
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 85%, transparent);
}
.search-bar-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  color: var(--muted);
  flex: 0 0 auto;
}
.search-bar-icon svg { width: 22px; height: 22px; }
.search-bar input {
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  outline: none;
  padding: 6px 0;
  min-width: 0;
}
.search-close {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--other);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.search-close svg { width: 14px; height: 14px; }
.search-status {
  padding: 14px;
  text-align: center;
  font-size: 14px;
}
.search-results {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.search-result {
  text-align: left;
  background: var(--other);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--text);
  display: grid;
  gap: 4px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.search-result:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--other));
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.search-result-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.search-result-user {
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-room {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 50%;
}
.search-result-body {
  font-size: 14px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-result-body mark {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--text);
  padding: 0 2px;
  border-radius: 4px;
}
.search-result-time {
  font-size: 12px;
  color: var(--muted);
}
.header-search { flex: 0 0 auto; }

@media (max-width: 760px) {
  .search-overlay { padding: 0; }
  .search-panel {
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .search-bar { padding: 14px; padding-top: max(14px, env(safe-area-inset-top)); }
}

.blocked-chat h3 { margin: 0 0 8px; }
.blocked-chat p { margin: 0 0 16px; color: var(--muted); }
.blocked-chat .primary-btn { width: auto; padding: 10px 18px; margin: 0 auto; display: inline-flex; align-items: center; justify-content: center; }
.restricted-main b,
.restricted-main .muted {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-card .modal-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}
.profile-card .modal-actions .soft-btn {
  width: 100%;
  min-height: 40px;
  white-space: normal;
}
.crop-wrap {
  display: grid;
  place-items: center;
  gap: 12px;
}
.crop-wrap canvas {
  width: min(320px, 78vw);
  height: min(320px, 78vw);
  border-radius: 22px;
  background: #111;
  touch-action: none;
  cursor: move;
}
.crop-zoom {
  width: min(320px, 78vw);
  margin: 0;
}
.crop-zoom input {
  width: 100%;
  accent-color: var(--accent);
}
.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(360px, 92vw);
  height: 100vh;
  height: 100dvh;
  padding: 18px;
  border-left: 1px solid var(--border);
  border-right: 0;
  box-shadow: var(--shadow);
  z-index: 40;
  overflow-y: auto;
}
.setting-block {
  border: 1px solid var(--border);
  background: var(--other);
  border-radius: 20px;
  padding: 14px;
  margin-top: 14px;
}
.setting-block h4 { margin: 0 0 12px; }
.theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 4px 4px 12px;
  scrollbar-gutter: stable;
}
.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-height: 46vh;
  overflow-y: auto;
  padding: 4px 4px 8px;
  scrollbar-gutter: stable;
}
.wallpaper-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.wallpaper-option:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.wallpaper-option:active {
  transform: scale(.97);
}
.wallpaper-option.active {
  border-color: color-mix(in srgb, var(--accent) 75%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 60%, transparent);
}
.wallpaper-preview {
  display: block;
  width: 100%;
  aspect-ratio: 16/11;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}
.wallpaper-name {
  font-size: 11.5px;
  line-height: 1.2;
  text-align: center;
  color: var(--muted);
  letter-spacing: .01em;
  word-break: break-word;
}
.wallpaper-option.active .wallpaper-name {
  color: var(--text);
}
.conversation.has-wallpaper .chat-header,
.conversation.has-wallpaper .composer,
.conversation.has-wallpaper .pinned-box {
  background: color-mix(in srgb, var(--panel-solid) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
@media (max-width: 540px) {
  .wallpaper-grid { grid-template-columns: repeat(2, 1fr); }
}
.theme-dot {
  position: relative;
  padding: 12px 14px;
  border: 0;
  color: white;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: .2px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, filter .15s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .14),
    inset 0 -2px 6px rgba(0, 0, 0, .12);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  outline: 0;
  -webkit-tap-highlight-color: transparent;
}
.theme-dot:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .18),
    inset 0 -2px 6px rgba(0, 0, 0, .14);
}
.theme-dot:active { transform: translateY(0); filter: brightness(.97); }
.theme-dot:focus { outline: 0; }
.theme-dot:focus-visible {
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, .9),
    inset 0 1px 0 rgba(255, 255, 255, .14);
}
.theme-dot.active {
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, .9),
    inset 0 1px 0 rgba(255, 255, 255, .14);
}
.theme-dot.light,
.theme-dot.champagne,
.theme-dot.ice {
  text-shadow: 0 1px 2px rgba(255, 255, 255, .5);
}
.theme-dot.light.active,
.theme-dot.champagne.active,
.theme-dot.ice.active {
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, .55),
    inset 0 1px 0 rgba(255, 255, 255, .4);
}
.theme-dot.midnight { background: linear-gradient(135deg, #0f1020, #7c3aed); }
.theme-dot.light { background: linear-gradient(135deg, #fff, #e2e8f0); color: #111827; }
.theme-dot.aurora { background: linear-gradient(135deg, #111827, #22c55e); }
.theme-dot.ocean { background: linear-gradient(135deg, #06131f, #38bdf8); }
.theme-dot.sunset { background: linear-gradient(135deg, #32122a, #f97316); }
.theme-dot.cyber { background: linear-gradient(135deg, #050816, #22d3ee); }
.theme-dot.amethyst { background: linear-gradient(135deg, #21103c, #ec4899); }
.theme-dot.forest { background: linear-gradient(135deg, #06150f, #84cc16); }
.theme-dot.ruby { background: linear-gradient(135deg, #19070d, #f43f5e); }
.theme-dot.graphite { background: linear-gradient(135deg, #0b0f14, #64748b); }
.theme-dot.champagne { background: linear-gradient(135deg, #fff7ed, #f59e0b); color: #2b1b13; }
.theme-dot.ice { background: linear-gradient(135deg, #eef8ff, #0ea5e9); color: #102033; }
.switch-row { display: flex; align-items: center; justify-content: space-between; margin: 10px 0; }
.switch-row input { width: auto; }
.emoji-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.emoji-picker button { border: 0; border-radius: 12px; background: var(--other); padding: 8px 10px; }

body.compact .messages { gap: 8px; padding-top: 16px; padding-bottom: 16px; }
body.compact .bubble { padding: 9px 12px; }

@media (max-width: 820px) {
  .chat-view { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(320px, 86vw);
    height: 100vh;
    height: 100dvh;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 18px 0 40px rgba(0, 0, 0, .35);
    padding-top: 12px;
    background: var(--panel-solid);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .sidebar-toggle, .sidebar-close, .header-more { display: inline-flex; }
  .side-top {
    justify-content: flex-start;
    gap: 8px;
  }
  .side-top .brand { flex: 1 1 auto; min-width: 0; }
  .side-top .icon-btn { flex: 0 0 auto; }

  .chat-header {
    position: relative;
    min-height: 54px;
    padding: 8px 10px;
    gap: 8px;
    background: var(--panel-solid);
  }
  .composer { background: var(--panel-solid); }
  .messages { background: transparent; }
  .chat-header h2 {
    max-width: 100%;
    font-size: 16px;
    line-height: 1.15;
  }
  .chat-header p {
    display: block;
    font-size: 11px;
    margin-top: 1px;
  }

  .header-actions {
    position: absolute;
    top: calc(100% + 6px);
    right: 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--border);
    background: var(--panel-solid);
    border-radius: 16px;
    box-shadow: var(--shadow);
    z-index: 25;
    min-width: 220px;
    display: none;
  }
  body.header-actions-open .header-actions { display: flex; }
  .header-actions .soft-btn {
    padding: 11px 12px;
    border-radius: 12px;
    font-size: 14px;
    min-width: 0;
    height: auto;
    text-align: left;
    background: var(--other);
  }
  .header-actions .soft-btn:active {
    background: color-mix(in srgb, var(--accent) 18%, var(--other));
  }

  .messages { padding: 12px 10px; gap: 9px; }
  .composer {
    padding: 8px 10px;
    grid-template-columns: 40px 40px minmax(0, 1fr) 44px;
    gap: 6px;
  }
  .join-room-prompt {
    margin: 0 10px 8px;
    max-width: calc(100% - 20px);
  }
  .composer textarea { font-size: 16px; padding: 10px 12px; }
  .searchbox input { font-size: 16px; }
  input, textarea { font-size: 16px; }
  .icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    font-size: 22px;
    line-height: 1;
  }
  .icon-btn svg { width: 20px; height: 20px; }
  .send-btn {
    width: 44px;
    height: 40px;
    border-radius: 14px;
    font-size: 20px;
  }
  .send-btn svg { width: 20px; height: 20px; }

  .msg { grid-template-columns: 30px minmax(0, 1fr); gap: 6px; align-items: end; }
  .msg.mine { grid-template-columns: minmax(0, 1fr); }
  .msg.mine .avatar,
  .msg.mine .avatar-btn { display: none; }
  .msg.mine .bubble-wrap { grid-column: 1; }
  .msg.same-author .avatar-btn { visibility: hidden; }
  .avatar { width: 30px; height: 30px; }
  .bubble { font-size: 15px; padding: 9px 12px; max-width: 78vw; }
  .reply-quote { max-width: 78vw; }
  .attachment {
    width: min(260px, 70vw);
    height: 180px;
  }
  .bubble-line { gap: 4px; }
  .meta { flex-wrap: wrap; row-gap: 2px; }
  .msg-tools {
    display: none;
    transform: none;
    pointer-events: auto;
    opacity: 1;
    box-shadow: none;
    background: transparent;
    border: 0;
    padding: 0;
  }
  .msg.selected .msg-tools {
    position: absolute;
    z-index: 8;
    left: 38px;
    bottom: calc(100% + 4px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 2px;
    margin-top: 0;
    padding: 5px;
    border-radius: 16px;
    background: var(--panel-solid);
    border: 1px solid var(--border);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .32);
    width: max-content;
    max-width: 100%;
    transform-origin: top left;
    animation: msgToolsPop .3s cubic-bezier(.34, 1.56, .64, 1);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    align-self: flex-start;
  }
  .msg.mine.selected .msg-tools {
    left: auto;
    right: 0;
    align-self: flex-end;
    transform-origin: top right;
  }
  .msg.selected .msg-tools .msg-action {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 12px;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, transform .12s ease;
  }
  .msg.selected .msg-tools .msg-action:active {
    background: var(--other);
    transform: scale(.92);
  }
  .msg.selected .msg-tools .msg-action svg { width: 20px; height: 20px; }
  .msg.selected .bubble {
    outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
    outline-offset: 1px;
  }
  .msg .bubble {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
  .reaction, .react-add {
    padding: 6px 10px;
    font-size: 13px;
    min-height: 30px;
  }
  .msg-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    opacity: .38;
    transition: opacity .15s ease, background .15s ease, transform .15s ease;
    border-radius: 999px;
    flex-shrink: 0;
    align-self: center;
  }
  .msg-hint:active {
    opacity: 1;
    background: var(--other);
    transform: scale(.92);
  }
  .msg-hint svg { width: 14px; height: 14px; }
  .msg.selected .msg-hint { opacity: 0; pointer-events: none; }
  .pinned-box { margin: 6px 10px 0; font-size: 12px; }
  .jump-bottom { right: 12px; bottom: 76px; }

  .modal { padding: 12px; }
  .modal-card { padding: 14px; border-radius: 18px; }
  .participants-modal {
    width: 100%;
    max-height: 76vh;
    gap: 10px;
  }
  .participants-head {
    align-items: baseline;
    flex-direction: row;
    gap: 8px;
  }
  .participants-head h3 { font-size: 17px; }
  .participants-head .muted {
    max-width: 42%;
    text-align: right;
    font-size: 12px;
  }
  .participants-search { font-size: 13px; }
  .participant-list { max-height: 48vh; }
  .participant-row { padding: 7px 4px; }
  .participant-info span { font-size: 11px; }
}

/* Compact desktop layout */
@media (min-width: 821px) {
  .chat-view { grid-template-columns: 260px minmax(0, 1fr); }
  .sidebar { padding: 10px; gap: 8px; }
  .side-logo { width: 132px; }
  .icon-btn { width: 32px; height: 32px; border-radius: 10px; font-size: 16px; }
  .icon-btn svg { width: 16px; height: 16px; }
  .send-btn svg { width: 18px; height: 18px; }
  .msg-action svg { width: 14px; height: 14px; }
  .soft-btn { padding: 7px 10px; border-radius: 10px; font-size: 13px; }
  .searchbox { height: 36px; min-height: 36px; border-radius: 15px; padding: 0 10px; }
  .searchbox input { height: 100%; font-size: 13px; }
  .archive-toggle { padding: 7px 10px; border-radius: 12px; font-size: 13px; }
  .room { gap: 9px; padding: 7px 8px; border-radius: 13px; }
  .room-ico { width: 32px; height: 32px; border-radius: 12px; }
  .room-ico.has-avatar, .room-ico:has(.room-ico-img) { border-radius: 999px; }
  .room-ico-svg, .room-ico-svg svg { width: 18px; height: 18px; }
  .room-title { font-size: 13px; }
  .room-desc { font-size: 11px; margin-top: 1px; }
  .room-archive, .room-edit { width: 24px; height: 24px; font-size: 11px; }
  .room-actions { display: none; }
  .room-menu { display: inline-flex; width: 30px; height: 30px; }
  .room-menu svg { width: 18px; height: 18px; }
  .unread-badge { min-width: 19px; height: 19px; font-size: 11px; }
  .profile-box { padding: 9px; border-radius: 14px; }
  .avatar { width: 30px; height: 30px; }
  .chat-header { min-height: 46px; padding: 7px 12px; }
  .chat-header h2 { font-size: 17px; }
  .chat-header p { font-size: 11px; }
  .messages { padding: 12px 14px; gap: 7px; }
  .msg { grid-template-columns: 30px minmax(0, 680px); gap: 7px; }
  .msg.mine { grid-template-columns: minmax(0, 680px) 30px; }
  .bubble-wrap { gap: 4px; }
  .meta { gap: 6px; font-size: 11px; padding: 0 5px; }
  .bubble { padding: 7px 10px; border-radius: 14px 14px 14px 6px; font-size: 13px; }
  .mine .bubble { border-radius: 14px 14px 6px 14px; }
  .reaction, .react-add, .msg-action { padding: 2px 6px; font-size: 11px; }
  .msg-tools { gap: 4px; }
  .pinned-box { margin: 6px 12px 0; padding: 7px 9px; border-radius: 12px; font-size: 12px; }
  .composer {
    grid-template-columns: 36px 36px minmax(0, 1fr) 40px;
    gap: 7px;
    padding: 8px 12px;
  }
  .composer .icon-btn { width: 36px; height: 36px; border-radius: 13px; }
  .composer textarea { min-height: 36px; max-height: 110px; font-size: 13px; border-radius: 14px; padding: 8px 12px; }
  .send-btn { width: 40px; height: 36px; border-radius: 13px; font-size: 18px; }
  .reply-preview, .attachment-preview { padding: 6px 9px; border-radius: 11px; font-size: 12px; }
  .jump-bottom { width: 36px; height: 36px; bottom: 62px; right: 14px; font-size: 18px; }
}
