:root {
  color-scheme: light;
  font-family: "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
  color: #111827;
  background: #ffffff;
  --accent: #3390ec;
  --accent-dark: #2378c9;
  --accent-green: #4fae4e;
  --bubble-out: #d7f4c6;
  --bubble-in: #ffffff;
  --chat-bg: #e6ebef;
  --chat-pattern: rgba(80, 105, 130, 0.08);
  --line: #dfe5ec;
  --panel: #ffffff;
  --panel-2: #f5f7fa;
  --text: #111827;
  --muted: #6b7280;
  --muted-2: #9aa6b2;
  --topbar-height: 44px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(119, 136, 153, 0.42) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(119, 136, 153, 0.45);
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(119, 136, 153, 0.64);
  background-clip: content-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.app-shell {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  grid-template-rows: var(--topbar-height) minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  height: 100svh;
  background: var(--panel);
}

.app-topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  position: relative;
  z-index: 80;
  display: grid;
  grid-template-columns: minmax(180px, 360px) minmax(0, 1fr) auto;
  gap: 10px;
  min-width: 0;
  min-height: var(--topbar-height);
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 8px 0 12px;
  color: var(--text);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(18px);
}

.app-topbar [data-tooltip] {
  position: relative;
}

body.has-topbar-tooltip-portal .app-topbar [data-tooltip]::after,
body.has-topbar-tooltip-portal .app-topbar [data-tooltip]::before {
  display: none;
  content: none;
}

.app-topbar [data-tooltip]::after {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 140;
  max-width: 220px;
  border-radius: 8px;
  padding: 6px 9px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.25;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  text-overflow: ellipsis;
  transform: translate(-50%, -4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  white-space: nowrap;
}

.app-topbar [data-tooltip]::before {
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  z-index: 141;
  width: 8px;
  height: 8px;
  background: rgba(15, 23, 42, 0.96);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -2px) rotate(45deg);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.app-topbar [data-tooltip]:hover::after,
.app-topbar [data-tooltip]:hover::before,
.app-topbar [data-tooltip]:focus-visible::after,
.app-topbar [data-tooltip]:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0);
}

.app-topbar [data-tooltip]:hover::before,
.app-topbar [data-tooltip]:focus-visible::before {
  transform: translate(-50%, 0) rotate(45deg);
}

.topbar-brand[data-tooltip]::after {
  left: 0;
  transform: translate(0, -4px);
}

.topbar-brand[data-tooltip]::before {
  left: 16px;
}

.topbar-brand[data-tooltip]:hover::after,
.topbar-brand[data-tooltip]:focus-visible::after {
  transform: translate(0, 0);
}

.topbar-right [data-tooltip]::after,
.window-controls [data-tooltip]::after {
  right: 0;
  left: auto;
  transform: translate(0, -4px);
}

.topbar-right [data-tooltip]::before,
.window-controls [data-tooltip]::before {
  right: 12px;
  left: auto;
  transform: translate(0, -2px) rotate(45deg);
}

.topbar-right [data-tooltip]:hover::after,
.topbar-right [data-tooltip]:focus-visible::after,
.window-controls [data-tooltip]:hover::after,
.window-controls [data-tooltip]:focus-visible::after {
  transform: translate(0, 0);
}

.topbar-right [data-tooltip]:hover::before,
.topbar-right [data-tooltip]:focus-visible::before,
.window-controls [data-tooltip]:hover::before,
.window-controls [data-tooltip]:focus-visible::before {
  transform: translate(0, 0) rotate(45deg);
}

.topbar-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  max-width: min(220px, calc(100vw - 16px));
  border-radius: 8px;
  padding: 6px 9px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.25;
  opacity: 0;
  overflow: visible;
  pointer-events: none;
  text-overflow: ellipsis;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
  visibility: hidden;
  white-space: nowrap;
}

.topbar-tooltip::before {
  position: absolute;
  top: -4px;
  left: var(--tooltip-arrow-left, 50%);
  width: 8px;
  height: 8px;
  background: rgba(15, 23, 42, 0.96);
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.topbar-tooltip.is-above::before {
  top: auto;
  bottom: -4px;
}

.topbar-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.topbar-brand,
.topbar-workflows,
.topbar-right,
.window-controls {
  display: flex;
  min-width: 0;
  align-items: center;
}

.topbar-brand {
  gap: 9px;
  color: var(--text);
  text-decoration: none;
}

.topbar-brand img {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
}

.topbar-brand span {
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-workflows {
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.topbar-workflows::-webkit-scrollbar {
  display: none;
}

.topbar-workflows a,
.topbar-hub {
  display: inline-flex;
  height: 32px;
  flex: 0 0 auto;
  align-items: center;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.topbar-workflows a {
  justify-content: center;
  width: 32px;
  padding: 0;
  font-size: 16px;
  font-weight: 800;
}

.workflow-icon {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  line-height: 1;
}

.workflow-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.topbar-workflows a:hover,
.topbar-hub:hover {
  color: var(--text);
  background: var(--panel-2);
}

.topbar-workflows a.is-active,
.topbar-workflows a[aria-current="page"] {
  color: #ffffff;
  background: var(--accent);
}

.topbar-right {
  justify-content: end;
  gap: 6px;
}

.topbar-hub {
  gap: 7px;
  padding: 0 10px 0 7px;
  font-size: 13px;
  font-weight: 900;
}

.topbar-hub span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(145deg, #3390ec, #0ea78a);
  font-size: 11px;
}

.topbar-hub b {
  font: inherit;
}

.window-controls {
  gap: 4px;
}

.window-controls button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 15px;
  font-weight: 900;
}

.window-controls button:not([aria-disabled="true"]):hover {
  color: var(--text);
  background: var(--panel-2);
}

.window-controls [data-window-control="close"]:not([aria-disabled="true"]):hover {
  color: #ffffff;
  background: #e25555;
}

.window-controls button:disabled,
.window-controls button[aria-disabled="true"] {
  cursor: default;
  opacity: 0.36;
}

body.has-window-host .window-controls button {
  opacity: 1;
}

.window-controls[data-host="desktop"] button {
  opacity: 1;
}

.sidebar {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.brand-row,
.chat-header,
.profile-panel header {
  display: flex;
  min-width: 0;
  min-height: 56px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.brand-row {
  position: relative;
  z-index: 6;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(18px);
}

.home-button,
.icon-button,
.mobile-back {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #64748b;
  background: transparent;
  font-size: 19px;
  font-weight: 800;
  text-decoration: none;
}

.brand-row .icon-button {
  color: var(--accent);
  font-size: 22px;
}

.home-button {
  color: #ffffff;
  background: linear-gradient(145deg, #3390ec, #1ca68a);
  font-size: 14px;
}

.icon-button:hover,
.mobile-back:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.14);
}

.search-box {
  position: relative;
  min-width: 0;
  flex: 1;
}

.search-box::before {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 1;
  color: var(--muted-2);
  font-size: 15px;
  font-weight: 900;
  content: "⌕";
  pointer-events: none;
  transform: translateY(-50%);
}

.search-box input {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px 0 38px;
  color: var(--text);
  background: var(--panel-2);
  outline: none;
}

.search-box input:focus {
  box-shadow: 0 0 0 2px rgba(51, 144, 236, 0.24);
}

.room-tabs {
  display: flex;
  gap: 7px;
  min-width: 0;
  padding: 7px 10px 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.room-tabs::-webkit-scrollbar {
  display: none;
}

.room-tabs button {
  display: inline-flex;
  gap: 6px;
  min-height: 34px;
  align-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.tab-icon {
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  font-size: 10px;
  font-weight: 950;
}

.tab-label {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-count {
  min-width: 18px;
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 11px;
  font-weight: 900;
}

.room-tabs button.is-active .tab-count {
  color: var(--accent);
  background: #ffffff;
}

.room-tabs button.is-active .tab-icon {
  color: var(--accent);
  background: #ffffff;
}

.tab-count[hidden] {
  display: none;
}

.room-tabs button:hover {
  background: var(--panel-2);
}

.room-tabs button.is-active {
  color: #ffffff;
  background: var(--accent);
}

.room-list {
  min-height: 0;
  overflow: auto;
  padding: 0 6px 10px;
}

.global-search-results {
  display: grid;
  gap: 8px;
  min-height: 0;
  max-height: min(360px, 46vh);
  overflow-y: auto;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  padding: 8px 6px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
}

.global-search-results[hidden] {
  display: none;
}

.global-search-section {
  display: grid;
  gap: 4px;
}

.global-search-section > strong {
  padding: 4px 8px 2px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.global-search-section button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  padding: 8px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.global-search-section button:hover,
.global-search-section button.is-active {
  background: rgba(51, 144, 236, 0.12);
}

.global-search-kind {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(145deg, #3390ec, #1ca68a);
  font-size: 11px;
  font-weight: 950;
}

.global-search-section button > span:not(.global-search-kind) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.global-search-section b,
.global-search-section small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-section b {
  font-size: 13px;
  font-weight: 900;
}

.global-search-section small,
.global-search-section time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.global-search-section time {
  white-space: nowrap;
}

.global-search-section mark {
  border-radius: 5px;
  padding: 1px 3px;
  color: #111827;
  background: rgba(255, 214, 102, 0.82);
}

.global-search-empty {
  display: grid;
  gap: 4px;
  margin: 8px;
  border-radius: 8px;
  padding: 14px 12px;
  color: var(--muted);
  background: var(--panel-2);
  text-align: center;
}

.global-search-empty strong {
  color: var(--text);
  font-size: 13px;
}

.room-section {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 -6px;
  padding: 10px 14px 4px;
  color: var(--muted-2);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  backdrop-filter: blur(14px);
}

.room-section b {
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 11px;
}

.room-empty {
  display: grid;
  gap: 6px;
  margin: 18px 10px;
  border-radius: 14px;
  padding: 18px 14px;
  color: var(--muted);
  background: var(--panel-2);
  text-align: center;
}

.room-empty strong {
  color: var(--text);
  font-size: 15px;
}

.room-empty span {
  font-size: 13px;
}

.sidebar-unread-badge {
  position: absolute;
  top: 8px;
  left: 40px;
  z-index: 2;
  min-width: 18px;
  border: 2px solid var(--panel);
  border-radius: 999px;
  padding: 1px 5px;
  color: #ffffff;
  background: #e25555;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.sidebar-unread-badge[hidden] {
  display: none;
}

.room-item {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  min-height: 70px;
  align-items: center;
  border: 0;
  border-radius: 10px;
  padding: 8px 9px;
  color: inherit;
  background: transparent;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
}

.room-item:hover {
  background: var(--panel-2);
}

.room-item.is-active {
  color: #ffffff;
  background: var(--accent);
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.36);
}

.room-item.is-active .room-copy p,
.room-item.is-active .room-side {
  color: rgba(255, 255, 255, 0.78);
}

.room-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.room-copy strong,
.room-copy p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-copy strong {
  display: flex;
  align-items: center;
  gap: 5px;
  color: inherit;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

.room-match-mark {
  border-radius: 4px;
  padding: 0 2px;
  color: inherit;
  background: rgba(255, 197, 61, 0.32);
}

.room-item.is-active .room-match-mark {
  background: rgba(255, 255, 255, 0.28);
}

.draft-label {
  color: #e25555;
  font-weight: 900;
}

.room-item.is-active .draft-label {
  color: rgba(255, 255, 255, 0.92);
}

.pin-dot,
.mute-dot,
.archive-dot {
  display: inline-grid;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  place-items: center;
  border-radius: 50%;
  color: var(--muted-2);
  font-size: 12px;
  font-style: normal;
}

.room-item.is-active .pin-dot,
.room-item.is-active .mute-dot,
.room-item.is-active .archive-dot {
  color: rgba(255, 255, 255, 0.78);
}

.room-item.is-muted .room-copy p,
.room-item.is-archived .room-copy p {
  opacity: 0.72;
}

.room-copy p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.32;
}

.room-side {
  display: grid;
  justify-items: end;
  gap: 7px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
}

.room-side b {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent-green);
  font-size: 12px;
}

.avatar {
  position: relative;
  display: inline-grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(145deg, #3390ec, #0ea78a);
  font-size: 13px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.room-item.has-online .avatar::after {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: var(--accent-green);
  content: "";
}

.room-item.has-online.is-active .avatar::after {
  border-color: var(--accent);
}

.avatar.large {
  width: 96px;
  height: 96px;
  font-size: 24px;
}

.profile-card .avatar.large {
  width: 76px;
  height: 76px;
  font-size: 20px;
}

.chat {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  background:
    linear-gradient(135deg, var(--chat-pattern) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(225deg, var(--chat-pattern) 25%, transparent 25%) 0 0 / 18px 18px,
    var(--chat-bg);
}

.chat-header {
  grid-row: 1;
  position: relative;
  z-index: 34;
  justify-content: space-between;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(18px);
}

.chat-search-bar {
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  column-gap: 8px;
  row-gap: 0;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 8px 12px;
  background: var(--panel);
}

.chat-search-bar[hidden] {
  display: none;
}

.chat-search-bar input {
  min-width: 0;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--text);
  background: var(--panel-2);
  outline: none;
}

.chat-search-bar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chat-search-bar button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  color: var(--text);
  background: transparent;
  font-weight: 800;
}

.chat-search-bar button:hover {
  background: var(--panel-2);
}

.chat-search-results {
  position: absolute;
  left: 12px;
  right: 12px;
  z-index: 46;
  display: grid;
  gap: 6px;
  max-height: min(320px, calc(100% - 150px));
  overflow: hidden;
  border: 1px solid rgba(51, 144, 236, 0.16);
  border-radius: 8px;
  padding: 8px;
  background: color-mix(in srgb, var(--panel) 95%, transparent);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
}

.chat-search-results[hidden] {
  display: none;
}

.chat-search-result-list {
  display: grid;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 2px;
}

.chat-search-result,
.chat-search-empty {
  border-radius: 8px;
  padding: 9px 10px;
}

.chat-search-result {
  display: grid;
  grid-template-columns: minmax(84px, auto) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.chat-search-result:hover,
.chat-search-result.is-active {
  background: rgba(51, 144, 236, 0.12);
}

.chat-search-result b,
.chat-search-result span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-search-result b {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.chat-search-result span {
  font-size: 13px;
  font-weight: 750;
}

.chat-search-result time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.chat-search-result mark {
  border-radius: 5px;
  padding: 1px 3px;
  color: #111827;
  background: rgba(255, 214, 102, 0.82);
}

.chat-search-empty {
  color: var(--muted);
  background: rgba(51, 144, 236, 0.08);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.date-strip {
  grid-row: 4;
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  padding: 7px 12px;
  background: color-mix(in srgb, var(--chat-bg) 88%, transparent);
  scrollbar-width: none;
}

.date-strip[hidden] {
  display: none;
}

.date-strip button {
  flex: 0 0 auto;
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  padding: 0 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 800;
}

.date-strip button:hover {
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.13);
}

.date-strip .date-jump-toggle {
  color: #ffffff;
  background: var(--accent);
}

.date-jump-panel {
  position: absolute;
  right: 24px;
  z-index: 45;
  display: grid;
  width: min(300px, calc(100% - 48px));
  gap: 8px;
  max-height: min(320px, calc(100% - 160px));
  overflow: hidden;
  border: 1px solid rgba(51, 144, 236, 0.18);
  border-radius: 8px;
  padding: 8px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
}

.date-jump-panel[hidden] {
  display: none;
}

.date-jump-panel header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 4px;
}

.date-jump-panel header span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.date-jump-panel header strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.date-jump-panel header small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.date-jump-panel header button {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.date-jump-panel header button:hover {
  color: var(--text);
  background: var(--panel-2);
}

.date-jump-list {
  display: grid;
  gap: 4px;
  max-height: 248px;
  overflow-y: auto;
  padding-right: 2px;
}

.date-jump-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text);
  background: rgba(51, 144, 236, 0.07);
  text-align: left;
}

.date-jump-item:hover,
.date-jump-item.is-active {
  background: rgba(51, 144, 236, 0.14);
}

.date-jump-item span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.date-jump-item strong,
.date-jump-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-jump-item strong {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.date-jump-item small,
.date-jump-item time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.date-jump-item time {
  white-space: nowrap;
}

.notification-panel {
  position: absolute;
  top: 58px;
  right: 12px;
  z-index: 48;
  display: grid;
  width: min(320px, calc(100% - 24px));
  gap: 9px;
  border: 1px solid rgba(51, 144, 236, 0.18);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  background: color-mix(in srgb, var(--panel) 95%, transparent);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(18px);
}

.notification-panel[hidden] {
  display: none;
}

.notification-panel header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-panel header span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.notification-panel header strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.notification-panel header small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.notification-panel header button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.notification-panel header button:hover {
  color: var(--text);
  background: var(--panel-2);
}

.notification-options {
  display: grid;
  gap: 5px;
}

.notification-options button,
.notification-read-toggle {
  display: grid;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text);
  background: rgba(51, 144, 236, 0.08);
  text-align: left;
}

.notification-options button:hover,
.notification-options button.is-active,
.notification-read-toggle:hover {
  background: rgba(51, 144, 236, 0.16);
}

.notification-options button.is-active {
  color: var(--accent-dark);
}

.notification-options span {
  font-size: 13px;
  font-weight: 900;
}

.notification-options small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.notification-read-toggle {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.scheduled-queue {
  position: sticky;
  top: 0;
  z-index: 24;
  display: grid;
  width: min(640px, 100%);
  align-self: center;
  gap: 6px;
  margin: 0 0 8px;
}

.scheduled-strip {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 42px;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(51, 144, 236, 0.18);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.88);
  text-align: left;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(14px);
}

.scheduled-strip:hover,
.scheduled-queue.is-open .scheduled-strip {
  background: rgba(51, 144, 236, 0.12);
}

.scheduled-strip i,
.scheduled-strip b {
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 900;
}

.scheduled-strip i {
  width: 28px;
  height: 28px;
  color: #ffffff;
  background: var(--accent);
  font-size: 12px;
  font-style: normal;
}

.scheduled-strip b {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.14);
  font-size: 12px;
}

.scheduled-strip span,
.scheduled-queue-main {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.scheduled-strip strong,
.scheduled-strip small,
.scheduled-queue-main strong,
.scheduled-queue-main small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scheduled-strip strong {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.scheduled-strip small,
.scheduled-queue-main small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.scheduled-queue-list {
  display: grid;
  gap: 4px;
  max-height: 228px;
  overflow-y: auto;
  border: 1px solid rgba(51, 144, 236, 0.14);
  border-radius: 8px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(16px);
}

.scheduled-queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-radius: 8px;
  padding: 5px 6px;
  background: rgba(51, 144, 236, 0.07);
}

.scheduled-queue-item:hover {
  background: rgba(51, 144, 236, 0.13);
}

.scheduled-queue-main {
  border: 0;
  padding: 4px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.scheduled-queue-main strong {
  font-size: 13px;
  font-weight: 850;
}

.scheduled-queue-actions {
  display: flex;
  gap: 4px;
}

.scheduled-queue-actions button {
  min-height: 28px;
  border: 0;
  border-radius: 8px;
  padding: 0 9px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  font-size: 12px;
  font-weight: 900;
}

.scheduled-queue-actions button:hover {
  color: #ffffff;
  background: var(--accent);
}

.pinned-strip {
  position: relative;
  grid-row: 3;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 38px;
  align-items: center;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 6px 16px 6px 22px;
  color: var(--text);
  background: rgba(51, 144, 236, 0.1);
  text-align: left;
  transition: background 0.12s ease;
}

.pinned-strip[hidden] {
  display: none;
}

.pinned-strip::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 10px;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

.pinned-strip:hover {
  background: rgba(51, 144, 236, 0.16);
}

.pinned-strip strong {
  color: var(--accent-dark);
  font-size: 12px;
}

.pinned-strip span {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pinned-popover {
  position: absolute;
  left: 12px;
  right: 12px;
  z-index: 44;
  display: grid;
  gap: 8px;
  max-height: min(330px, calc(100% - 140px));
  overflow: hidden;
  border: 1px solid rgba(51, 144, 236, 0.18);
  border-radius: 8px;
  padding: 8px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
}

.pinned-popover[hidden] {
  display: none;
}

.pinned-popover header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 4px;
}

.pinned-popover header span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.pinned-popover header strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.pinned-popover header small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.pinned-popover header button {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.pinned-popover header button:hover {
  color: var(--text);
  background: var(--panel-2);
}

.pinned-popover-list {
  display: grid;
  gap: 4px;
  max-height: 246px;
  overflow-y: auto;
  padding-right: 2px;
}

.pinned-popover-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px 8px 6px;
  color: var(--text);
  background: rgba(51, 144, 236, 0.07);
  text-align: left;
}

.pinned-popover-item:hover,
.pinned-popover-item.is-active {
  background: rgba(51, 144, 236, 0.14);
}

.pinned-popover-item b {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.14);
  font-size: 12px;
  font-weight: 900;
}

.pinned-popover-item span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.pinned-popover-item strong,
.pinned-popover-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pinned-popover-item strong {
  font-size: 13px;
  font-weight: 850;
}

.pinned-popover-item small,
.pinned-popover-item time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.pinned-popover-item time {
  justify-self: end;
  white-space: nowrap;
}

.drop-overlay {
  position: absolute;
  inset: 64px 18px 82px;
  z-index: 45;
  display: grid;
  place-content: center;
  gap: 6px;
  border: 2px dashed rgba(51, 144, 236, 0.72);
  border-radius: 18px;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.76);
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(12px);
}

.drop-overlay[hidden] {
  display: none;
}

.drop-overlay strong {
  font-size: 20px;
}

.drop-overlay span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.chat.is-dragging .messages {
  filter: saturate(0.9) brightness(0.96);
}

.scroll-bottom {
  position: absolute;
  right: 24px;
  bottom: 82px;
  z-index: 35;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.scroll-bottom[hidden] {
  display: none;
}

.scroll-bottom b {
  font-size: 19px;
  line-height: 1;
}

.scroll-bottom span {
  position: absolute;
  top: -6px;
  right: -4px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  background: #4fae4e;
  font-size: 11px;
  font-weight: 900;
}

.scroll-bottom span[hidden] {
  display: none;
}

.unread-jump,
.scroll-date-float {
  position: absolute;
  z-index: 35;
  border: 0;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(14px);
}

.unread-jump[hidden],
.scroll-date-float[hidden] {
  display: none;
}

.unread-jump {
  right: 78px;
  bottom: 86px;
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 7px;
  min-height: 38px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px 0 7px;
  font-size: 12px;
  font-weight: 900;
}

.unread-jump b {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent-green);
  font-size: 11px;
}

.scroll-date-float {
  top: 118px;
  right: 24px;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 12px;
  color: #ffffff;
  background: rgba(85, 108, 130, 0.68);
  font-size: 12px;
  font-weight: 900;
}

.mobile-back {
  display: none;
}

.chat-title,
.chat-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.chat-title {
  flex: 1 1 auto;
  border-radius: 12px;
  padding: 4px 6px 4px 4px;
  cursor: pointer;
  outline: none;
  transition: background 0.12s ease;
}

.chat-title:hover,
.chat-title:focus-visible {
  background: rgba(148, 163, 184, 0.12);
}

.chat-title.is-online .avatar::after,
.chat-title.is-typing .avatar::after,
.profile-card .avatar.large.is-online::after,
.profile-card .avatar.large.is-typing::after {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: var(--accent-green);
  content: "";
}

.chat-title.is-typing .avatar::after,
.profile-card .avatar.large.is-typing::after {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(51, 144, 236, 0.14);
}

.chat-title-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.chat-title strong,
.profile-panel header strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-title span,
.profile-panel p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-meta-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.chat-meta-row [data-room-meta] {
  flex: 0 1 auto;
  min-width: 0;
}

.chat-status-chips,
.profile-status-row {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.chat-status-chips {
  flex: 1 1 auto;
  overflow: hidden;
}

.status-chip {
  display: inline-flex;
  min-width: 0;
  max-width: 118px;
  height: 20px;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 0 7px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel-2) 88%, transparent);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-chip i {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-chip.is-online,
.status-chip.is-typing {
  color: #148e56;
  background: rgba(35, 171, 104, 0.12);
}

.status-chip.is-typing {
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
}

.status-chip.is-unread {
  color: #ffffff;
  background: var(--accent-green);
}

.status-chip.is-pinned {
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
}

.status-chip.is-muted,
.status-chip.is-archived {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.16);
}

.messages {
  grid-row: 5;
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
  padding: 18px max(22px, calc((100vw - 360px - 760px) / 2)) 14px;
}

.channel-intro {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(380px, 100%);
  margin: 8px auto 14px;
  color: var(--muted);
  text-align: center;
}

.intro-photo {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(145deg, #3390ec, #0ea78a);
  font-size: 22px;
  font-weight: 900;
}

.channel-intro strong {
  color: var(--text);
  font-size: 20px;
}

.channel-intro p,
.date-pill {
  margin: 0;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  backdrop-filter: blur(10px);
}

.channel-intro p {
  max-width: 340px;
  border-radius: 16px;
  line-height: 1.45;
}

.message-day-divider,
.unread-divider {
  align-self: center;
  margin: 8px 0;
  user-select: none;
}

.message-day-divider {
  border-radius: 999px;
  padding: 6px 12px;
  color: #ffffff;
  background: rgba(85, 108, 130, 0.56);
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.unread-divider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  width: min(680px, 100%);
  align-items: center;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.unread-divider::before,
.unread-divider::after {
  height: 1px;
  background: rgba(51, 144, 236, 0.42);
  content: "";
}

.unread-divider span {
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.82);
}

.message {
  position: relative;
  display: grid;
  max-width: min(540px, 72%);
  gap: 3px;
  align-self: flex-start;
  border-radius: 11px 11px 11px 3px;
  padding: 8px 10px 5px;
  color: var(--text);
  background: var(--bubble-in);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.message.is-grouped {
  margin-top: -3px;
  border-top-left-radius: 11px;
}

.message.is-grouped.is-mine {
  border-top-right-radius: 11px;
}

.message.is-grouped::after,
.message.is-grouped .message-author {
  display: none;
}

.message.is-selected {
  outline: 2px solid rgba(51, 144, 236, 0.62);
  outline-offset: 2px;
}

.message.is-search-match {
  box-shadow: 0 0 0 2px rgba(245, 197, 24, 0.38), 0 1px 1px rgba(0, 0, 0, 0.08);
}

.message.is-search-active {
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.72), 0 10px 30px rgba(0, 0, 0, 0.18);
}

.message.is-jump-target {
  animation: messageJump 1.2s ease;
}

@keyframes messageJump {
  0%,
  100% {
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
  }

  35% {
    box-shadow: 0 0 0 4px rgba(51, 144, 236, 0.42), 0 12px 34px rgba(15, 23, 42, 0.18);
  }
}

.message-select {
  position: absolute;
  top: 50%;
  left: -34px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  color: transparent;
  background: rgba(51, 144, 236, 0.22);
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.12s ease, background 0.12s ease;
}

.message.is-mine .message-select {
  right: -34px;
  left: auto;
}

.message:hover .message-select,
.message.is-selected .message-select {
  opacity: 1;
}

.message.is-selected .message-select {
  color: #ffffff;
  background: var(--accent);
}

.message::after {
  position: absolute;
  bottom: 0;
  left: -7px;
  width: 12px;
  height: 12px;
  background: var(--bubble-in);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  content: "";
}

.message.is-mine {
  align-self: flex-end;
  border-radius: 11px 11px 3px 11px;
  background: var(--bubble-out);
}

.message.is-mine::after {
  right: -7px;
  left: auto;
  background: var(--bubble-out);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.message.is-system {
  align-self: center;
  max-width: min(520px, 92%);
  border-radius: 999px;
  padding: 6px 12px;
  color: #ffffff;
  background: rgba(85, 108, 130, 0.48);
  box-shadow: none;
  text-align: center;
}

.message.is-system::after {
  display: none;
}

.message.is-system .message-author,
.message.is-system .message-meta,
.message.is-system .message-tools,
.message.is-system .message-select {
  display: none;
}

.message-author {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.message p {
  margin: 0;
  color: inherit;
  line-height: 1.42;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-link {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.message-link:hover {
  text-decoration: underline;
}

.message-mention,
.message-hashtag {
  border-radius: 6px;
  padding: 0 3px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  font-weight: 800;
}

.link-preview {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr);
  gap: 9px;
  min-width: min(260px, 60vw);
  margin-top: 5px;
  border-radius: 10px;
  padding: 8px 10px;
  color: inherit;
  background: rgba(51, 144, 236, 0.1);
  text-decoration: none;
}

.link-preview i {
  border-radius: 999px;
  background: var(--accent);
}

.link-preview span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.link-preview strong,
.link-preview small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-preview strong {
  color: var(--accent-dark);
  font-size: 13px;
}

.link-preview small {
  color: var(--muted);
  font-size: 12px;
}

.reply-quote {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 4px 7px;
  color: inherit;
  background: rgba(51, 144, 236, 0.1);
  text-align: left;
}

.forwarded-header {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-quote strong,
.reply-quote span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-quote strong {
  color: var(--accent-dark);
  font-size: 12px;
}

.reply-quote span {
  color: var(--muted);
  font-size: 12px;
}

.message-meta {
  display: flex;
  min-height: 18px;
  align-items: end;
  justify-content: flex-end;
  gap: 7px;
  color: #6d7f8f;
  font-size: 11px;
}

.message-edited {
  color: inherit;
  opacity: 0.72;
}

.message-pin-badge {
  display: inline-grid;
  min-width: 16px;
  height: 16px;
  place-items: center;
  color: var(--accent-dark);
  font-size: 11px;
  line-height: 1;
}

.message-silent-badge {
  display: inline-grid;
  min-width: 16px;
  height: 16px;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.message-scheduled-badge {
  display: inline-flex;
  min-height: 16px;
  align-items: center;
  border-radius: 999px;
  padding: 0 6px;
  color: #ffffff;
  background: rgba(51, 144, 236, 0.72);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.message-status {
  display: inline-flex;
  min-width: 17px;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.message-status.is-pending {
  color: #8a9aa8;
}

.message-status.is-sent,
.message-status.is-delivered {
  color: #6d7f8f;
}

.message-status.is-read {
  color: var(--accent);
}

.message-action-row {
  display: inline-flex;
  max-width: 100%;
  justify-self: start;
  gap: 3px;
  margin-top: 2px;
  border-radius: 999px;
  padding: 3px 4px 3px 3px;
  background: rgba(255, 255, 255, 0.58);
  opacity: 0.74;
  transition: opacity 0.12s ease, background 0.12s ease;
}

.message.is-mine .message-action-row {
  justify-self: end;
  background: rgba(255, 255, 255, 0.22);
}

.message:hover .message-action-row,
.message:focus-within .message-action-row {
  opacity: 1;
}

.message-action-row button {
  display: grid;
  width: 25px;
  height: 23px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: var(--accent-dark);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.message-action-row button:hover {
  color: #ffffff;
  background: var(--accent);
}

.message-action-row button:focus-visible {
  outline: 2px solid rgba(51, 144, 236, 0.55);
  outline-offset: 2px;
}

.message-action-row [data-quick-more] {
  font-size: 15px;
}

.message-action-row [data-quick-react] {
  color: #d89100;
}

.message-action-row [data-quick-react]:hover {
  color: #ffffff;
}

.message-reactions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.message-reactions button {
  min-height: 22px;
  border: 0;
  border-radius: 999px;
  padding: 1px 7px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  font-size: 12px;
}

.message-reactions button.is-mine {
  color: #ffffff;
  background: var(--accent);
}

.voice-message {
  display: grid;
  grid-template-columns: 34px minmax(120px, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-width: min(260px, 64vw);
  border-radius: 12px;
  padding: 6px 8px;
  background: rgba(51, 144, 236, 0.1);
}

.voice-message button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.voice-message time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.voice-message.is-playing .voice-waveform i {
  background: var(--accent-green);
}

.typing-indicator {
  display: flex;
  gap: 8px;
  align-items: center;
  align-self: flex-start;
  border-radius: 14px 14px 14px 4px;
  padding: 8px 10px;
  color: var(--muted);
  background: var(--bubble-in);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.typing-indicator span {
  display: flex;
  gap: 3px;
}

.typing-indicator i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: typingPulse 1s infinite ease-in-out;
}

.typing-indicator i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-indicator i:nth-child(3) {
  animation-delay: 0.3s;
}

.typing-indicator b {
  font-size: 12px;
}

@keyframes typingPulse {
  0%,
  100% {
    opacity: 0.32;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.message-tools {
  position: absolute;
  top: 50%;
  right: -46px;
  z-index: 20;
  display: flex;
  gap: 2px;
  border-radius: 999px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.86);
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14);
  transform: translate(8px, -50%) scale(0.96);
  transition: opacity 0.12s ease, transform 0.12s ease;
  backdrop-filter: blur(12px);
}

.message.is-mine .message-tools {
  right: auto;
  left: -46px;
  transform: translate(-8px, -50%) scale(0.96);
}

.message:hover .message-tools,
.message:focus-within .message-tools {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%) scale(1);
}

.message.is-mine:hover .message-tools,
.message.is-mine:focus-within .message-tools {
  transform: translate(0, -50%) scale(1);
}

.message-tools button,
.emoji-panel button {
  border: 0;
  background: transparent;
}

.message-tools button {
  width: 28px;
  height: 26px;
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
}

.message-tools button:hover {
  background: rgba(51, 144, 236, 0.12);
}

.reaction-picker {
  position: fixed;
  z-index: 72;
  display: grid;
  width: min(320px, calc(100vw - 20px));
  gap: 9px;
  border: 1px solid rgba(51, 144, 236, 0.16);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(18px);
}

.reaction-picker[hidden] {
  display: none;
}

.reaction-picker header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reaction-picker header span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.reaction-picker header strong,
.reaction-picker-section > strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.reaction-picker header small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reaction-picker [data-reaction-close] {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.reaction-picker [data-reaction-close]:hover {
  color: var(--text);
  background: var(--panel-2);
}

.reaction-picker-section {
  display: grid;
  gap: 6px;
}

.reaction-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 42px);
  gap: 5px;
}

.reaction-picker [data-picker-reaction] {
  position: relative;
  display: grid;
  width: 42px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 21px;
}

.reaction-picker [data-picker-reaction]:hover,
.reaction-picker [data-picker-reaction].is-selected {
  background: rgba(51, 144, 236, 0.14);
}

.reaction-picker [data-picker-reaction].is-selected {
  box-shadow: inset 0 0 0 2px rgba(51, 144, 236, 0.36);
}

.reaction-picker [data-picker-reaction] small {
  position: absolute;
  right: 4px;
  bottom: 2px;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 900;
}

.attachment-stack {
  display: grid;
  gap: 6px;
  margin-top: 5px;
}

.attachment-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 8px;
  color: inherit;
  background: rgba(51, 144, 236, 0.08);
  overflow: hidden;
  text-align: left;
}

.attachment-card:hover {
  background: rgba(51, 144, 236, 0.14);
}

.attachment-card i,
.attachment-card img {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
  font-style: normal;
  font-weight: 900;
}

.attachment-card img {
  display: block;
  object-fit: cover;
}

.attachment-card.is-image {
  grid-template-columns: 68px minmax(0, 1fr);
}

.attachment-card.is-image img {
  width: 68px;
  height: 54px;
  border-radius: 8px;
}

.attachment-card strong,
.attachment-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-card small {
  color: var(--muted);
  font-size: 12px;
}

.composer {
  position: sticky;
  bottom: 0;
  z-index: 32;
  grid-row: 6;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  grid-template-areas:
    "suggestions suggestions suggestions suggestions"
    "tools tools tools tools"
    "reply reply reply reply"
    "attachments attachments attachments attachments"
    "voice voice voice voice"
    "emoji attach input send";
  column-gap: 8px;
  row-gap: 0;
  align-items: end;
  margin-top: auto;
  padding: 6px 14px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--chat-bg);
  background: color-mix(in srgb, var(--chat-bg) 82%, transparent);
  backdrop-filter: blur(16px);
}

.composer-suggestions {
  position: absolute;
  bottom: calc(100% + 48px);
  left: 110px;
  z-index: 40;
  display: grid;
  grid-area: suggestions;
  width: min(620px, calc(100% - 124px));
  gap: 4px;
  border-radius: 14px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.16);
}

.composer-suggestions[hidden] {
  display: none;
}

.composer-suggestions button {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 38px;
  align-items: center;
  border: 0;
  border-radius: 10px;
  padding: 0 10px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.composer-suggestions button:hover,
.composer-suggestions button.is-active {
  background: rgba(51, 144, 236, 0.13);
}

.composer-suggestions b,
.composer-suggestions span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-suggestions b {
  color: var(--accent-dark);
  font-size: 13px;
}

.composer-suggestions span,
.composer-suggestions small {
  color: var(--muted);
  font-size: 12px;
}

.composer-tools {
  display: none;
}

.send-options,
.schedule-panel {
  position: absolute;
  right: 14px;
  bottom: 58px;
  z-index: 42;
  display: grid;
  min-width: 184px;
  gap: 4px;
  border-radius: 12px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(14px);
}

.schedule-panel {
  bottom: 108px;
  width: min(300px, calc(100vw - 28px));
}

.send-options[hidden],
.schedule-panel[hidden] {
  display: none;
}

.send-options button,
.schedule-panel button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  min-height: 40px;
  align-items: center;
  border: 0;
  border-radius: 9px;
  padding: 0 10px 0 7px;
  color: var(--text);
  background: transparent;
  font-weight: 900;
  text-align: left;
}

.send-options button:hover,
.send-options button:focus-visible,
.schedule-panel button:hover,
.schedule-panel button:focus-visible {
  background: rgba(51, 144, 236, 0.13);
  outline: none;
}

.send-options i {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
  font-size: 13px;
  font-style: normal;
}

.schedule-panel header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 4px 4px 6px;
}

.schedule-panel header span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.schedule-panel header strong {
  font-size: 13px;
}

.schedule-panel header small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.schedule-panel [data-schedule-close] {
  display: grid;
  width: 28px;
  min-height: 28px;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 0;
  color: var(--muted);
  font-size: 16px;
}

.schedule-presets {
  display: grid;
  gap: 4px;
}

.schedule-presets button {
  grid-template-columns: minmax(0, 1fr);
  min-height: 36px;
  padding: 0 10px;
}

.reply-preview {
  display: grid;
  grid-area: reply;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: min(620px, 100%);
  margin-left: 96px;
  margin-bottom: 6px;
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.reply-preview-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  min-width: 0;
  border: 0;
  border-radius: 10px;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.reply-preview-main:disabled {
  cursor: default;
}

.reply-preview-main:not(:disabled):hover {
  background: rgba(51, 144, 236, 0.08);
}

.reply-preview[hidden] {
  display: none;
}

.reply-preview span {
  grid-row: 1 / span 2;
  align-self: stretch;
  border-left: 3px solid var(--accent);
  padding-left: 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.reply-preview strong,
.reply-preview p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-preview strong {
  color: var(--text);
  font-size: 13px;
}

.reply-preview p {
  color: var(--muted);
  font-size: 13px;
}

.reply-preview > [data-reply-clear] {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
}

.reply-preview > [data-reply-clear]:hover {
  color: var(--text);
  background: var(--panel-2);
}

.reply-preview-main:hover {
  color: inherit;
}

.reply-preview-main,
.reply-preview-main:hover {
  width: auto;
  height: auto;
  border-radius: 10px;
  font-size: inherit;
}

.reply-preview-main:not(:disabled):hover {
  background: rgba(51, 144, 236, 0.08);
}

.attachment-preview {
  display: grid;
  grid-area: attachments;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: min(620px, 100%);
  margin-left: 96px;
  margin-bottom: 6px;
  border-radius: 12px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.attachment-preview[hidden] {
  display: none;
}

.attachment-preview-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(152px, 190px);
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.attachment-preview-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  border: 0;
  border-radius: 10px;
  padding: 6px;
  color: var(--text);
  background: var(--panel-2);
  text-align: left;
}

.attachment-preview-card:hover {
  background: rgba(51, 144, 236, 0.14);
}

.attachment-preview-card i,
.attachment-preview-card img {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 9px;
  color: #ffffff;
  background: var(--accent);
  object-fit: cover;
  font-style: normal;
  font-weight: 900;
}

.attachment-preview-card strong,
.attachment-preview-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview-card strong {
  font-size: 13px;
}

.attachment-preview-card small {
  color: var(--muted);
  font-size: 12px;
}

.attachment-preview > button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
}

.attachment-preview > button:hover {
  color: var(--text);
  background: var(--panel-2);
}

.voice-preview {
  display: grid;
  grid-area: voice;
  grid-template-columns: auto auto auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: min(620px, 100%);
  margin-left: 96px;
  margin-bottom: 6px;
  border-radius: 14px;
  padding: 8px 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.voice-preview[hidden] {
  display: none;
}

.voice-preview button {
  min-width: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  color: var(--text);
  background: var(--panel-2);
  font-weight: 900;
}

.voice-preview [data-voice-send] {
  padding: 0 14px;
  color: #ffffff;
  background: var(--accent);
}

.voice-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e25555;
  animation: voiceBlink 1s infinite ease-in-out;
}

.voice-preview strong {
  min-width: 38px;
  font-size: 13px;
}

.voice-preview-wave,
.voice-waveform {
  display: flex;
  min-width: 0;
  height: 32px;
  align-items: center;
  gap: 2px;
}

.voice-preview-wave i,
.voice-waveform i {
  width: 3px;
  border-radius: 999px;
  background: rgba(51, 144, 236, 0.7);
}

@keyframes voiceBlink {
  0%,
  100% {
    opacity: 0.35;
  }

  50% {
    opacity: 1;
  }
}

.composer .icon-button,
.send-button {
  background: var(--panel);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.composer [data-emoji-toggle] {
  grid-area: emoji;
}

.composer [data-attach] {
  grid-area: attach;
}

.composer textarea {
  grid-area: input;
  width: 100%;
  max-height: 150px;
  min-height: 44px;
  resize: none;
  border: 0;
  border-radius: 22px;
  padding: 11px 16px;
  color: var(--text);
  background: var(--panel);
  outline: none;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.composer textarea:focus {
  box-shadow: 0 0 0 2px rgba(51, 144, 236, 0.2), 0 1px 1px rgba(0, 0, 0, 0.08);
}

.send-button {
  grid-area: send;
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
  font-size: 17px;
  font-weight: 900;
  opacity: 0.72;
  transform: rotate(-8deg);
  transition: opacity 0.12s ease, transform 0.12s ease, background 0.12s ease;
}

.send-button.is-ready {
  opacity: 1;
  transform: rotate(0deg);
}

.send-button.is-voice-mode {
  color: var(--accent);
  background: var(--panel);
  opacity: 1;
  transform: none;
}

.emoji-panel,
.attach-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  z-index: 30;
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.24);
}

.emoji-panel {
  left: 14px;
  display: grid;
  width: min(360px, calc(100vw - 24px));
  gap: 8px;
  padding: 10px;
}

.emoji-panel[hidden],
.attach-panel[hidden] {
  display: none;
}

.emoji-panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.emoji-search {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.emoji-search span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.emoji-search input {
  min-width: 0;
  height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel-2);
  outline: none;
}

.emoji-panel [data-emoji-close] {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 900;
}

.emoji-tabs {
  display: flex;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
}

.emoji-tabs button {
  width: auto;
  min-width: 0;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.emoji-tabs button.is-active {
  color: #ffffff;
  background: var(--accent);
}

.emoji-panel-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.emoji-panel-summary b {
  color: var(--accent-dark);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 36px);
  gap: 5px;
  max-height: 184px;
  overflow-y: auto;
  padding-right: 2px;
}

.emoji-grid button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 9px;
  font-size: 20px;
}

.emoji-panel button:hover {
  background: var(--panel-2);
}

.emoji-empty {
  border-radius: 8px;
  padding: 16px 10px;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.attach-panel {
  left: 60px;
  display: grid;
  width: min(330px, calc(100vw - 24px));
  gap: 8px;
  padding: 10px;
}

.attach-panel-header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.attach-panel-header span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.attach-panel-header strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.attach-panel-header small,
.attach-action small,
.attach-drop-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.attach-panel [data-attach-close] {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.attach-action {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  min-height: 54px;
  align-items: center;
  border: 0;
  border-radius: 9px;
  padding: 7px 10px 7px 7px;
  color: var(--text);
  background: transparent;
  text-align: left;
  font-weight: 700;
}

.attach-action i {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(145deg, var(--accent), #18a38b);
  font-style: normal;
  font-size: 14px;
}

.attach-action span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.attach-action strong,
.attach-action small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attach-panel [data-attach-close]:hover,
.attach-action:hover,
.attach-action.is-active {
  background: var(--panel-2);
}

.attach-drop-hint {
  border: 1px dashed rgba(51, 144, 236, 0.34);
  border-radius: 9px;
  padding: 8px 10px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.08);
  text-align: center;
}

body:not([data-theme="light"]) .attach-panel {
  background: rgba(23, 33, 43, 0.92);
}

body:not([data-theme="light"]) .attach-panel [data-attach-close]:hover,
body:not([data-theme="light"]) .attach-action:hover,
body:not([data-theme="light"]) .attach-action.is-active {
  background: #242f3d;
}

body:not([data-theme="light"]) .attach-drop-hint {
  background: rgba(91, 166, 232, 0.14);
}

.profile-panel {
  position: fixed;
  top: var(--topbar-height);
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  width: min(360px, 94vw);
  min-width: 0;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  border-left: 1px solid var(--line);
  background: var(--panel);
  box-shadow: -20px 0 60px rgba(15, 23, 42, 0.16);
  transform: translateX(100%);
  transition: transform 0.2s ease;
}

.profile-panel.is-open {
  transform: translateX(0);
}

.selection-bar {
  position: fixed;
  top: calc(var(--topbar-height) + 10px);
  left: 50%;
  z-index: 60;
  display: grid;
  grid-template-columns: auto minmax(12px, 1fr) repeat(6, auto);
  gap: 8px;
  width: min(760px, calc(100vw - 24px));
  min-height: 48px;
  align-items: center;
  border-radius: 999px;
  padding: 6px 8px 6px 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.selection-bar[hidden] {
  display: none;
}

.selection-bar strong {
  font-size: 14px;
}

.selection-bar button,
.context-menu button {
  border: 0;
  color: var(--text);
  background: transparent;
  font-weight: 800;
}

.selection-bar button {
  min-height: 36px;
  border-radius: 999px;
  padding: 0 12px;
}

.selection-bar button:hover,
.context-menu button:hover {
  background: var(--panel-2);
}

.selection-bar [data-selection-delete],
.context-menu button.is-danger {
  color: #d34848;
}

.context-menu {
  position: fixed;
  z-index: 70;
  display: grid;
  min-width: 210px;
  max-height: calc(100vh - 16px);
  gap: 3px;
  overflow-y: auto;
  border-radius: 13px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(18px);
}

.context-reaction-strip {
  display: grid;
  grid-template-columns: repeat(6, 30px);
  gap: 4px;
  margin-bottom: 3px;
  border-bottom: 1px solid rgba(132, 150, 166, 0.18);
  padding: 2px 1px 7px;
}

.context-reaction-strip button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  font-size: 17px;
}

.context-reaction-strip button:hover,
.context-reaction-strip button.is-selected {
  background: rgba(51, 144, 236, 0.14);
}

.forward-sheet {
  position: fixed;
  right: 18px;
  bottom: 92px;
  z-index: 65;
  display: grid;
  width: min(360px, calc(100vw - 24px));
  max-height: min(440px, calc(100vh - 132px));
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 6px;
  border-radius: 16px;
  padding: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.26);
  backdrop-filter: blur(18px);
}

.forward-sheet[hidden] {
  display: none;
}

.forward-sheet header {
  display: flex;
  min-width: 0;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px 4px 10px;
}

.forward-sheet header span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.forward-sheet header strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forward-sheet header small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.forward-sheet header button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
}

.forward-sheet header button:hover,
.forward-targets button:hover {
  background: var(--panel-2);
}

.forward-search {
  display: grid;
  padding: 0 4px 2px;
}

.forward-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.forward-search input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 11px;
  color: var(--text);
  background: var(--panel-2);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  outline: none;
}

.forward-search input:focus {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  box-shadow: 0 0 0 2px rgba(51, 144, 236, 0.16);
}

.forward-targets {
  display: grid;
  gap: 2px;
  min-height: 0;
  overflow: auto;
}

.forward-targets button {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 58px;
  align-items: center;
  border: 0;
  border-radius: 12px;
  padding: 7px;
  color: inherit;
  background: transparent;
  text-align: left;
}

.forward-targets span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.forward-targets strong,
.forward-targets small,
.forward-targets b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forward-targets strong {
  font-size: 14px;
}

.forward-targets small {
  color: var(--muted);
  font-size: 12px;
}

.forward-targets b {
  max-width: 82px;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 10px;
  font-weight: 900;
}

.forward-targets mark {
  border-radius: 4px;
  padding: 0 2px;
  color: inherit;
  background: rgba(255, 197, 61, 0.32);
}

.forward-empty {
  display: grid;
  gap: 5px;
  margin: 8px 4px;
  border-radius: 12px;
  padding: 18px 12px;
  color: var(--muted);
  background: var(--panel-2);
  text-align: center;
}

.forward-empty strong {
  color: var(--text);
  font-size: 14px;
}

.forward-empty span {
  font-size: 12px;
}

.new-chat-sheet {
  position: fixed;
  inset: 0;
  z-index: 84;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 16, 24, 0.46);
  backdrop-filter: blur(10px);
}

.new-chat-sheet[hidden] {
  display: none;
}

.new-chat-card {
  display: grid;
  width: min(430px, calc(100vw - 24px));
  max-height: min(650px, calc(100vh - 40px));
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
  border-radius: 16px;
  padding: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

.new-chat-card header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
}

.new-chat-card header strong {
  overflow: hidden;
  font-size: 17px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-chat-card header button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--panel-2);
  font-weight: 900;
}

.new-chat-mode,
.new-chat-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.new-chat-mode button,
.new-chat-actions button {
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  color: var(--text);
  background: var(--panel-2);
  font-weight: 900;
}

.new-chat-mode button.is-active,
.new-chat-actions [data-new-chat-create] {
  color: #ffffff;
  background: var(--accent);
}

.new-chat-search {
  display: grid;
  gap: 6px;
}

.new-chat-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.new-chat-search input {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel-2);
  outline: none;
}

.new-chat-contacts {
  display: grid;
  gap: 3px;
  min-height: 0;
  overflow: auto;
}

.new-chat-contacts button {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  min-height: 60px;
  align-items: center;
  border: 0;
  border-radius: 12px;
  padding: 7px;
  color: inherit;
  background: transparent;
  text-align: left;
}

.new-chat-contacts button:hover {
  background: var(--panel-2);
}

.new-chat-contacts button > span:last-child,
.new-chat-empty {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.new-chat-contacts strong,
.new-chat-contacts small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-chat-contacts small,
.new-chat-empty span {
  color: var(--muted);
  font-size: 12px;
}

.new-chat-empty {
  justify-items: center;
  padding: 28px 12px;
  text-align: center;
}

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 90;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 24px));
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  border-radius: 999px;
  padding: 9px 14px;
  color: #ffffff;
  background: rgba(23, 33, 43, 0.92);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22);
  font-size: 13px;
  font-weight: 800;
  pointer-events: auto;
  animation: toastIn 0.18s ease;
}

.toast button {
  min-width: 44px;
  border: 0;
  border-radius: 7px;
  padding: 5px 8px;
  color: #5ecbff;
  background: rgba(255, 255, 255, 0.1);
  font: inherit;
  cursor: pointer;
}

.toast button:hover,
.toast button:focus-visible {
  color: #ffffff;
  background: rgba(84, 169, 235, 0.34);
  outline: none;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.context-menu[hidden] {
  display: none;
}

.context-menu button {
  min-height: 38px;
  border-radius: 9px;
  padding: 0 12px;
  text-align: left;
}

.room-context-menu {
  min-width: 190px;
}

.media-viewer,
.detail-sheet {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 16, 24, 0.58);
  backdrop-filter: blur(10px);
}

.media-viewer[hidden],
.detail-sheet[hidden] {
  display: none;
}

.media-viewer-card,
.detail-card {
  position: relative;
  display: grid;
  width: min(520px, calc(100vw - 24px));
  max-height: min(680px, calc(100vh - 40px));
  overflow: hidden;
  border-radius: 16px;
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

.media-viewer-card {
  width: min(760px, calc(100vw - 24px));
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  text-align: left;
}

.media-viewer-header,
.media-viewer-footer {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

.media-viewer-header {
  grid-template-columns: minmax(0, 1fr) auto;
  border-bottom: 1px solid var(--line);
}

.media-viewer-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.media-viewer-footer {
  grid-template-columns: minmax(0, 1fr) auto;
  border-top: 1px solid var(--line);
}

.media-viewer-footer strong,
.media-viewer-footer span {
  grid-column: 1;
}

.media-viewer-footer button {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  color: #ffffff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.media-viewer-card [data-media-viewer-content] {
  display: grid;
  min-height: min(430px, 58vh);
  place-items: center;
  overflow: auto;
  padding: 18px 60px;
  background: color-mix(in srgb, var(--panel-2) 68%, transparent);
}

.media-viewer-card [data-media-close],
.detail-card [data-detail-close] {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--panel-2);
  font-weight: 900;
}

.media-viewer-card [data-media-close] {
  position: static;
}

.media-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22);
  transform: translateY(-50%);
}

.media-nav.is-prev {
  left: 12px;
}

.media-nav.is-next {
  right: 12px;
}

.media-nav[disabled],
.media-nav[aria-disabled="true"] {
  opacity: 0.35;
}

.media-viewer-card img {
  display: block;
  max-width: 100%;
  max-height: 58vh;
  border-radius: 12px;
  object-fit: contain;
}

.media-file-icon {
  display: grid;
  width: 108px;
  height: 108px;
  place-items: center;
  border-radius: 24px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 900;
}

.media-viewer-card strong,
.media-viewer-card span,
.media-viewer-card small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-viewer-card span,
.media-viewer-card small {
  color: var(--muted);
  font-size: 13px;
}

.media-viewer-strip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  padding: 9px 12px 11px;
  scrollbar-width: thin;
}

.media-viewer-strip[hidden] {
  display: none;
}

.media-viewer-strip button {
  display: grid;
  width: 74px;
  min-width: 74px;
  gap: 5px;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 5px;
  color: var(--muted);
  background: transparent;
  text-align: center;
}

.media-viewer-strip button.is-active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(51, 144, 236, 0.12);
}

.media-viewer-strip img,
.media-viewer-strip i {
  display: grid;
  width: 60px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  object-fit: cover;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.media-viewer-strip span {
  min-width: 0;
  overflow: hidden;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-card {
  grid-template-rows: auto minmax(0, 1fr);
  overflow: auto;
  padding: 12px;
}

.detail-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
}

.detail-card [data-detail-content] {
  display: grid;
  gap: 10px;
}

.detail-message-card {
  display: grid;
  gap: 4px;
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(145deg, rgba(51, 144, 236, 0.14), rgba(14, 167, 138, 0.1));
}

.detail-message-card span,
.detail-message-card small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-message-card strong {
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.detail-list dd {
  justify-self: start;
  max-width: 100%;
}

.detail-receipt {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  border-radius: 13px;
  padding: 8px;
  background: var(--panel-2);
}

.detail-receipt span {
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.detail-receipt i {
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: transparent;
}

.detail-receipt span.is-active {
  color: var(--accent);
}

.detail-receipt span.is-active i {
  background: currentColor;
}

.detail-attachments {
  display: grid;
  gap: 6px;
}

.detail-attachments button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border: 0;
  border-radius: 12px;
  padding: 7px;
  color: var(--text);
  background: var(--panel-2);
  text-align: left;
}

.detail-attachments i {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  background: var(--accent);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.detail-attachments span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.detail-attachments strong,
.detail-attachments small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-attachments small {
  color: var(--muted);
  font-size: 12px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-actions button {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  font-size: 12px;
  font-weight: 900;
}

.detail-actions button:hover {
  color: #ffffff;
  background: var(--accent);
}

.detail-preview {
  border-radius: 12px;
  padding: 10px;
  background: var(--panel-2);
  line-height: 1.45;
  white-space: pre-wrap;
}

.detail-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.detail-reactions span {
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.13);
  font-size: 12px;
  font-weight: 800;
}

.profile-panel header {
  justify-content: space-between;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-card {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.profile-card h2 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 19px;
}

.profile-card p {
  max-width: 34ch;
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.34;
  white-space: normal;
}

.profile-status-row {
  justify-content: center;
  max-width: 100%;
  padding-top: 2px;
}

.profile-action-grid {
  display: grid;
  width: min(100%, 328px);
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  margin-top: 2px;
}

.profile-action-grid button {
  display: grid;
  min-width: 0;
  min-height: 46px;
  place-items: center;
  gap: 3px;
  border: 0;
  border-radius: 8px;
  padding: 5px 3px;
  color: var(--text);
  background: var(--panel-2);
  font-size: 10px;
  font-weight: 900;
  transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
}

.profile-action-grid button:hover {
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
}

.profile-action-grid button:active {
  transform: scale(0.98);
}

.profile-action-grid button.is-disabled,
.profile-action-grid button[aria-disabled="true"] {
  cursor: default;
  opacity: 0.46;
}

.profile-action-grid button.is-disabled:hover,
.profile-action-grid button[aria-disabled="true"]:hover {
  color: var(--text);
  background: var(--panel-2);
}

.profile-action-grid i {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(145deg, #3390ec, #0ea78a);
  font-size: 12px;
  font-style: normal;
}

.profile-action-grid span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-grid {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
}

.status-grid div {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

dd {
  display: inline-flex;
  max-width: 160px;
  min-height: 26px;
  align-items: center;
  margin: 0;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

dd[data-state="ready"] {
  color: #148e56;
  background: rgba(35, 171, 104, 0.12);
}

dd[data-state="blocked"],
dd[data-state="missing"],
dd[data-state="unreachable"] {
  color: #b42318;
  background: rgba(255, 84, 73, 0.12);
}

dd[data-state="checking"] {
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
}

.member-list {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 0;
  overflow: auto;
  padding: 8px 12px 12px;
}

.profile-member-card {
  display: grid;
  min-width: 0;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.profile-member-card:hover {
  background: var(--panel-2);
}

.profile-member-card.is-online {
  background: rgba(35, 171, 104, 0.08);
}

.profile-member-avatar {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(145deg, #3390ec, #0ea78a);
  font-size: 12px;
  font-weight: 900;
}

.profile-member-card.is-online .profile-member-avatar::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: var(--accent-green);
  content: "";
}

.profile-member-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.profile-member-copy strong,
.profile-member-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-member-copy strong {
  font-size: 14px;
}

.profile-member-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.profile-member-role {
  max-width: 82px;
  overflow: hidden;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-member-card.is-online .profile-member-copy small {
  color: #16a064;
}

.profile-section {
  display: grid;
  gap: 6px;
}

.profile-section + .profile-section {
  margin-top: 8px;
}

.profile-section h3 {
  margin: 8px 6px 2px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.profile-section p {
  margin: 0 6px;
  color: var(--muted);
  font-size: 13px;
  white-space: normal;
}

.profile-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.profile-stats b {
  display: grid;
  min-height: 52px;
  place-items: center;
  border-radius: 12px;
  color: var(--text);
  background: var(--panel-2);
  font-size: 18px;
}

.profile-stats small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.profile-tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: 2px -2px 4px;
  padding: 6px 2px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(14px);
}

.profile-tabs button {
  display: grid;
  min-width: 0;
  min-height: 34px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  padding: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 900;
  transition: background 0.12s ease, color 0.12s ease;
}

.profile-tabs button:hover {
  background: var(--panel-2);
}

.profile-tabs button.is-active {
  color: #ffffff;
  background: var(--accent);
}

.profile-tabs span,
.profile-tabs b {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-tabs b {
  font-size: 10px;
  opacity: 0.78;
}

.profile-shared-tools {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  margin: 0 0 2px;
}

.profile-shared-search {
  display: grid;
  min-width: 0;
}

.profile-shared-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.profile-shared-search input {
  width: 100%;
  min-height: 32px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  color: var(--text);
  background: var(--panel-2);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  outline: none;
}

.profile-shared-search input:focus {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  box-shadow: 0 0 0 2px rgba(51, 144, 236, 0.16);
}

.profile-shared-sort {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  overflow: hidden;
  border-radius: 10px;
  background: var(--panel-2);
}

.profile-shared-sort button {
  min-height: 32px;
  border: 0;
  border-radius: 0;
  padding: 0 9px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 900;
}

.profile-shared-sort button.is-active {
  color: #ffffff;
  background: var(--accent);
}

.profile-shared-count {
  display: grid;
  min-width: 42px;
  min-height: 32px;
  place-items: center;
  border-radius: 10px;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 11px;
  font-weight: 900;
}

.profile-empty-state {
  grid-column: 1 / -1;
}

.shared-media {
  gap: 7px;
  grid-template-columns: 1fr;
}

.shared-media h3,
.shared-files h3,
.shared-links h3 {
  grid-column: 1 / -1;
}

.shared-media-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  gap: 7px;
  align-items: center;
  border-radius: 10px;
  padding: 7px;
  background: var(--panel-2);
}

.shared-media-main {
  display: grid;
  min-width: 0;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.shared-media-thumb {
  display: grid;
  width: 58px;
  height: 46px;
  overflow: hidden;
  place-items: center;
  border-radius: 9px;
  color: #ffffff;
  background: linear-gradient(145deg, #3390ec, #0ea78a);
}

.shared-media-thumb img,
.shared-media-thumb i {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  object-fit: cover;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.shared-media-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.shared-media-main strong,
.shared-media-main small,
.shared-media-main em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shared-media-main strong {
  font-size: 13px;
  font-weight: 850;
}

.shared-media-main small,
.shared-media-main em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.shared-media-card > button:not(.shared-media-main) {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  font-size: 11px;
  font-weight: 900;
}

.shared-media-card > button:not(.shared-media-main):hover {
  color: #ffffff;
  background: var(--accent);
}

.shared-files {
  gap: 6px;
}

.shared-file-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  border-radius: 10px;
  background: var(--panel-2);
  padding: 7px;
}

.shared-file-main {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  min-width: 0;
  align-items: center;
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.shared-file-main i {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  background: var(--accent);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.shared-file-main span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.shared-file-main strong,
.shared-file-main small,
.shared-file-main em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shared-file-main small,
.shared-file-main em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.shared-file-card > button:not(.shared-file-main) {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  font-size: 11px;
  font-weight: 900;
}

.shared-file-card > button:not(.shared-file-main):hover {
  color: #ffffff;
  background: var(--accent);
}

.shared-links {
  gap: 7px;
}

.shared-link-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  border-radius: 10px;
  background: var(--panel-2);
  padding: 7px;
}

.shared-link-card a {
  display: grid;
  min-width: 0;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.shared-link-card i {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  background: linear-gradient(145deg, #3390ec, #0ea78a);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.shared-link-card span {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.shared-link-card strong,
.shared-link-card small,
.shared-link-card em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shared-link-card strong {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.shared-link-card small,
.shared-link-card em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.shared-link-card button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  font-size: 11px;
  font-weight: 900;
}

.shared-link-card button:hover {
  color: #ffffff;
  background: var(--accent);
}

body:not([data-theme="light"]) {
  color: #e7edf3;
  background: #17212b;
  --accent: #2f8de4;
  --accent-dark: #5aa8ed;
  --bubble-out: #2b5278;
  --bubble-in: #182533;
  --chat-bg: #0e1621;
  --chat-pattern: rgba(255, 255, 255, 0.035);
  --line: #101921;
  --panel: #17212b;
  --panel-2: #242f3d;
  --text: #f2f5f8;
  --muted: #8f9dac;
  --muted-2: #6e7f90;
}

body:not([data-theme="light"]) .app-topbar {
  background: rgba(23, 33, 43, 0.94);
}

body:not([data-theme="light"]) .topbar-workflows a:hover,
body:not([data-theme="light"]) .topbar-hub:hover,
body:not([data-theme="light"]) .window-controls button:not(:disabled):hover {
  background: #242f3d;
}

body:not([data-theme="light"]) .room-item:hover {
  background: #202b38;
}

body:not([data-theme="light"]) .room-item.is-active {
  background: var(--accent);
}

body:not([data-theme="light"]) .global-search-results {
  border-color: rgba(91, 166, 232, 0.12);
  background: rgba(23, 33, 43, 0.86);
}

body:not([data-theme="light"]) .global-search-section button:hover,
body:not([data-theme="light"]) .global-search-section button.is-active {
  background: rgba(91, 166, 232, 0.16);
}

body:not([data-theme="light"]) .global-search-empty {
  background: #242f3d;
}

body:not([data-theme="light"]) .draft-label {
  color: #ff8b8b;
}

body:not([data-theme="light"]) .room-item.is-active .draft-label {
  color: rgba(255, 255, 255, 0.92);
}

body:not([data-theme="light"]) .channel-intro p,
body:not([data-theme="light"]) .date-pill,
body:not([data-theme="light"]) .message-day-divider,
body:not([data-theme="light"]) .unread-divider span {
  color: #d7e0ea;
  background: rgba(23, 33, 43, 0.72);
}

body:not([data-theme="light"]) .message {
  color: #f3f7fb;
}

body:not([data-theme="light"]) .message.is-system {
  background: rgba(80, 98, 116, 0.6);
}

body:not([data-theme="light"]) .message-tools {
  background: rgba(36, 47, 61, 0.9);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

body:not([data-theme="light"]) .message-action-row {
  background: rgba(36, 47, 61, 0.72);
}

body:not([data-theme="light"]) .message-meta,
body:not([data-theme="light"]) .attachment-card small,
body:not([data-theme="light"]) .attachment-preview-card small {
  color: #9eb0c1;
}

body:not([data-theme="light"]) .composer .icon-button,
body:not([data-theme="light"]) .composer textarea,
body:not([data-theme="light"]) .message-action-row button,
body:not([data-theme="light"]) .message-tools button,
body:not([data-theme="light"]) .composer-tools button {
  color: #d9e5ef;
  background: #17212b;
}

body:not([data-theme="light"]) .attachment-card,
body:not([data-theme="light"]) .attachment-preview-card,
body:not([data-theme="light"]) .message-reactions button,
body:not([data-theme="light"]) .reply-quote,
body:not([data-theme="light"]) .link-preview,
body:not([data-theme="light"]) .voice-message,
body:not([data-theme="light"]) .typing-indicator {
  background: rgba(91, 166, 232, 0.16);
}

body:not([data-theme="light"]) .message-mention,
body:not([data-theme="light"]) .message-hashtag {
  background: rgba(91, 166, 232, 0.18);
}

body:not([data-theme="light"]) .reply-preview,
body:not([data-theme="light"]) .attachment-preview,
body:not([data-theme="light"]) .voice-preview,
body:not([data-theme="light"]) .composer-suggestions,
body:not([data-theme="light"]) .composer-tools,
body:not([data-theme="light"]) .send-options,
body:not([data-theme="light"]) .schedule-panel,
body:not([data-theme="light"]) .emoji-panel,
body:not([data-theme="light"]) .forward-search input,
body:not([data-theme="light"]) .forward-targets b,
body:not([data-theme="light"]) .forward-empty {
  background: rgba(23, 33, 43, 0.92);
}

body:not([data-theme="light"]) .emoji-search input,
body:not([data-theme="light"]) .emoji-empty {
  background: #242f3d;
}

body:not([data-theme="light"]) .drop-overlay {
  color: #7ab8f5;
  background: rgba(23, 33, 43, 0.74);
}

body:not([data-theme="light"]) .scroll-bottom {
  color: #7ab8f5;
  background: rgba(23, 33, 43, 0.96);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.34);
}

body:not([data-theme="light"]) .unread-jump {
  color: #7ab8f5;
  background: rgba(23, 33, 43, 0.96);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.34);
}

body:not([data-theme="light"]) .scroll-date-float {
  background: rgba(23, 33, 43, 0.76);
}

body:not([data-theme="light"]) .profile-panel {
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.34);
}

body:not([data-theme="light"]) .selection-bar,
body:not([data-theme="light"]) .context-menu,
body:not([data-theme="light"]) .chat-search-bar,
body:not([data-theme="light"]) .chat-search-results,
body:not([data-theme="light"]) .date-jump-panel,
body:not([data-theme="light"]) .reaction-picker,
body:not([data-theme="light"]) .forward-sheet,
body:not([data-theme="light"]) .new-chat-card {
  background: rgba(23, 33, 43, 0.94);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

body:not([data-theme="light"]) .date-strip button,
body:not([data-theme="light"]) .media-nav,
body:not([data-theme="light"]) .media-viewer-card [data-media-viewer-content],
body:not([data-theme="light"]) .profile-member-role,
body:not([data-theme="light"]) .profile-member-card:hover,
body:not([data-theme="light"]) .profile-stats b,
body:not([data-theme="light"]) .profile-tabs button:hover,
body:not([data-theme="light"]) .profile-action-grid button,
body:not([data-theme="light"]) .profile-shared-search input,
body:not([data-theme="light"]) .profile-shared-sort,
body:not([data-theme="light"]) .profile-shared-count,
body:not([data-theme="light"]) .detail-attachments button,
body:not([data-theme="light"]) .shared-media-card,
body:not([data-theme="light"]) .shared-media-card > button:not(.shared-media-main),
body:not([data-theme="light"]) .shared-file-card,
body:not([data-theme="light"]) .shared-file-card > button:not(.shared-file-main),
body:not([data-theme="light"]) .shared-link-card,
body:not([data-theme="light"]) .shared-link-card button,
body:not([data-theme="light"]) .shared-links a,
body:not([data-theme="light"]) .detail-preview,
body:not([data-theme="light"]) .new-chat-card header button,
body:not([data-theme="light"]) .new-chat-mode button,
body:not([data-theme="light"]) .new-chat-actions button,
body:not([data-theme="light"]) .new-chat-search input,
body:not([data-theme="light"]) .new-chat-contacts button:hover {
  background: #242f3d;
}

body:not([data-theme="light"]) .chat-search-result:hover,
body:not([data-theme="light"]) .chat-search-result.is-active,
body:not([data-theme="light"]) .chat-search-empty {
  background: rgba(91, 166, 232, 0.14);
}

body:not([data-theme="light"]) .date-jump-item {
  background: rgba(91, 166, 232, 0.12);
}

body:not([data-theme="light"]) .date-jump-item:hover,
body:not([data-theme="light"]) .date-jump-item.is-active {
  background: rgba(91, 166, 232, 0.2);
}

body:not([data-theme="light"]) .notification-panel {
  border-color: rgba(91, 166, 232, 0.22);
  background: rgba(23, 33, 43, 0.94);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
}

body:not([data-theme="light"]) .notification-options button,
body:not([data-theme="light"]) .notification-read-toggle {
  background: rgba(91, 166, 232, 0.12);
}

body:not([data-theme="light"]) .notification-options button:hover,
body:not([data-theme="light"]) .notification-options button.is-active,
body:not([data-theme="light"]) .notification-read-toggle:hover {
  background: rgba(91, 166, 232, 0.2);
}

body:not([data-theme="light"]) .scheduled-strip,
body:not([data-theme="light"]) .scheduled-queue-list {
  border-color: rgba(91, 166, 232, 0.22);
  background: rgba(23, 33, 43, 0.94);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
}

body:not([data-theme="light"]) .scheduled-strip:hover,
body:not([data-theme="light"]) .scheduled-queue.is-open .scheduled-strip,
body:not([data-theme="light"]) .scheduled-queue-item {
  background: rgba(91, 166, 232, 0.14);
}

body:not([data-theme="light"]) .scheduled-queue-item:hover,
body:not([data-theme="light"]) .scheduled-queue-actions button {
  background: rgba(91, 166, 232, 0.2);
}

body:not([data-theme="light"]) .reaction-picker {
  border-color: rgba(91, 166, 232, 0.2);
}

body:not([data-theme="light"]) .reaction-picker [data-picker-reaction]:hover,
body:not([data-theme="light"]) .reaction-picker [data-picker-reaction].is-selected {
  background: rgba(91, 166, 232, 0.2);
}

body:not([data-theme="light"]) .new-chat-mode button.is-active,
body:not([data-theme="light"]) .new-chat-actions [data-new-chat-create] {
  color: #ffffff;
  background: var(--accent);
}

body:not([data-theme="light"]) .pinned-strip {
  border-color: rgba(255, 255, 255, 0.05);
  background: rgba(91, 166, 232, 0.12);
}

body:not([data-theme="light"]) .pinned-popover {
  border-color: rgba(91, 166, 232, 0.24);
  background: rgba(30, 41, 54, 0.94);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.38);
}

body:not([data-theme="light"]) .pinned-popover-item {
  background: rgba(91, 166, 232, 0.12);
}

body:not([data-theme="light"]) .pinned-popover-item:hover,
body:not([data-theme="light"]) .pinned-popover-item.is-active {
  background: rgba(91, 166, 232, 0.2);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .app-topbar {
    grid-template-columns: minmax(146px, 320px) minmax(0, 1fr) auto;
  }

  .messages {
    padding-inline: 18px;
  }
}

@media (max-width: 720px) {
  :root {
    --topbar-height: 48px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 7px;
    padding-inline: 8px;
  }

  .topbar-brand {
    gap: 7px;
  }

  .topbar-brand span {
    max-width: 84px;
  }

  .topbar-hub {
    width: 32px;
    padding: 0;
    justify-content: center;
  }

  .topbar-hub b {
    display: none;
  }

  .sidebar,
  .chat {
    grid-column: 1;
    grid-row: 2;
  }

  .chat {
    z-index: 1;
    transform: translateX(100%);
    transition: transform 0.18s ease;
  }

  .app-shell.chat-open .chat {
    z-index: 12;
    transform: translateX(0);
  }

  .mobile-back {
    display: inline-grid;
  }

  .messages {
    padding: 14px 10px 12px;
  }

  .message {
    max-width: 86%;
  }

  .message-tools {
    display: none;
  }

  .scroll-bottom {
    right: 14px;
    bottom: 78px;
  }

  .unread-jump {
    right: 66px;
    bottom: 82px;
  }

  .scroll-date-float {
    top: 112px;
    right: 14px;
  }

  .date-jump-panel {
    right: 14px;
    width: min(300px, calc(100% - 28px));
  }

  .message-select {
    left: -28px;
  }

  .message.is-mine .message-select {
    right: -28px;
  }

  .brand-row,
  .chat-header {
    min-height: 54px;
    padding: 7px 8px;
  }

  .chat-meta-row {
    gap: 5px;
  }

  .chat-status-chips .status-chip:not(.is-online):not(.is-typing) {
    display: none;
  }

  .status-chip {
    max-width: 92px;
  }

  .room-list {
    padding-inline: 6px;
  }

  .composer {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    padding: 8px;
  }

  .reply-preview,
  .attachment-preview,
  .voice-preview {
    width: 100%;
    margin-left: 0;
  }

  .composer-suggestions,
  .composer-tools {
    right: 8px;
    left: 8px;
    width: auto;
    margin-left: 0;
  }

  .emoji-panel {
    left: 8px;
    right: 8px;
    width: auto;
  }

  .emoji-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .selection-bar {
    top: 8px;
    grid-template-columns: auto repeat(3, minmax(0, auto));
    width: calc(100vw - 16px);
    overflow-x: auto;
    border-radius: 18px;
  }

  .selection-bar span {
    display: none;
  }

  .selection-bar button {
    padding-inline: 10px;
    white-space: nowrap;
  }

  .forward-sheet {
    right: 8px;
    bottom: 82px;
    width: calc(100vw - 16px);
  }

  .new-chat-sheet {
    align-items: end;
    padding: 8px;
  }

  .new-chat-card {
    width: 100%;
    max-height: min(620px, calc(100vh - 16px));
    border-radius: 18px 18px 12px 12px;
  }

  .reaction-picker {
    width: min(244px, calc(100vw - 20px));
    border-radius: 14px;
  }

  .reaction-picker-grid {
    grid-template-columns: repeat(4, 50px);
  }

  .reaction-picker [data-picker-reaction] {
    width: 50px;
  }

  .emoji-grid button {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .room-item {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    min-height: 66px;
    padding: 8px;
  }

  .avatar {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .room-tabs button {
    padding-inline: 12px;
  }
}
