: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;
  --emoji-font: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Segoe UI Symbol", sans-serif;
  --bubble-radius: 16px;
  --bubble-tail-size: 10px;
  --message-shadow: 0 1px 1px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
  --composer-control: 40px;
  --topbar-height: 44px;
  --sidebar-width: 360px;
}

* {
  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;
  overflow: hidden;
  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-icon svg,
.icon-button svg,
.mobile-back svg,
.home-button svg,
.topbar-hub span svg,
.window-controls button svg,
.attach-panel [data-attach-close] svg,
.attach-action i svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  overflow: visible;
}

.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-keyboard-active:not(.is-active) {
  color: var(--accent);
  background: rgba(51, 144, 236, 0.12);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.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);
  line-height: 0;
}

.topbar-hub span svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.3;
}

.topbar-hub b {
  font: inherit;
}

.window-controls {
  gap: 4px;
}

.window-controls button {
  display: grid;
  width: 32px;
  height: 32px;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  line-height: 0;
  overflow: hidden;
}

.window-controls button > * {
  grid-area: 1 / 1;
}

.window-controls button svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

.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 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;
  grid-row: 1;
  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;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #64748b;
  background: transparent;
  font-size: 19px;
  font-weight: 800;
  line-height: 0;
  overflow: hidden;
  text-decoration: none;
}

.home-button > *,
.icon-button > *,
.mobile-back > * {
  grid-area: 1 / 1;
}

.brand-row .icon-button {
  color: var(--accent);
}

.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);
}

.chat-actions .icon-button.is-keyboard-active {
  color: var(--text);
  background: rgba(51, 144, 236, 0.13);
  box-shadow: inset 0 0 0 2px rgba(51, 144, 236, 0.34);
}

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

.search-box::before {
  position: absolute;
  top: 50%;
  left: 18px;
  z-index: 1;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: var(--muted-2);
  content: "";
  opacity: 0.82;
  pointer-events: none;
  transform: translateY(-58%);
}

.search-box::after {
  position: absolute;
  top: 50%;
  left: 29px;
  z-index: 1;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: var(--muted-2);
  content: "";
  opacity: 0.82;
  pointer-events: none;
  transform: translateY(4px) rotate(45deg);
}

.search-box input {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px 0 42px;
  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: grid;
  grid-row: 2;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  max-width: 100%;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding: 2px 8px 0;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-padding-inline: 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

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

.room-tabs button {
  position: relative;
  display: grid;
  width: 100%;
  gap: 0;
  max-width: none;
  min-height: 34px;
  min-width: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
  padding: 0 2px 5px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
  white-space: nowrap;
  transition: background 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
}

.room-tabs button::after {
  position: absolute;
  right: 50%;
  bottom: 0;
  width: 18px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: transparent;
  content: "";
  transform: translateX(50%);
  transition: width 0.12s ease, background 0.12s ease;
}

.tab-icon {
  display: none;
  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 {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  letter-spacing: 0;
  line-height: 1.05;
}

.tab-count {
  display: none;
  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-custom-folder {
  padding-inline: 2px;
}

.room-tabs button.is-custom-folder .tab-icon {
  color: #2a9d74;
  background: rgba(42, 157, 116, 0.14);
}

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

.room-tabs button.is-keyboard-active:not(.is-active) {
  background: rgba(51, 144, 236, 0.12);
  box-shadow: none;
}

.room-tabs button.is-active {
  color: var(--accent);
  background: transparent;
  box-shadow: none;
}

.room-tabs button.is-active::after,
.room-tabs button.is-keyboard-active:not(.is-active)::after {
  background: var(--accent);
}

.room-tabs button.is-active::after {
  width: 24px;
}

.folder-manage-row {
  display: flex;
  grid-row: 3;
  min-width: 0;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 5px 8px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
}

.folder-manage-row [data-folder-manage] {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.1);
  font-size: 11px;
  font-weight: 950;
}

.folder-manage-row [data-folder-manage]:hover,
.folder-manage-row [data-folder-manage]:focus-visible {
  background: rgba(51, 144, 236, 0.18);
}

.folder-manage-row svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}

.folder-manage-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.stories-rail {
  display: grid;
  gap: 7px;
  padding: 8px 4px 10px;
}

.stories-rail header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.stories-rail header small {
  min-width: 18px;
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--accent);
  background: rgba(51, 144, 236, 0.12);
  text-align: center;
}

.stories-list {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.stories-list::-webkit-scrollbar {
  display: none;
}

.story-chip {
  display: grid;
  min-width: 58px;
  max-width: 70px;
  gap: 5px;
  justify-items: center;
  border: 0;
  border-radius: 8px;
  padding: 5px 5px 7px;
  color: var(--text);
  background: transparent;
}

.story-chip span,
.story-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 50%;
  color: #ffffff;
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    conic-gradient(#3390ec, #4fae4e, #d97706, #3390ec) border-box;
  font-size: 12px;
  font-weight: 1000;
}

.story-chip.is-seen span {
  filter: grayscale(0.8);
  opacity: 0.62;
}

.story-chip b {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-chip:hover,
.story-chip:focus-visible {
  background: rgba(51, 144, 236, 0.1);
  outline: none;
}

.global-search-results {
  display: grid;
  grid-row: 3;
  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: 48px minmax(0, 1fr) minmax(38px, auto);
  gap: 8px;
  width: 100%;
  min-height: 64px;
  align-items: center;
  border: 0;
  border-radius: 8px;
  padding: 6px 8px;
  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-keyboard-active:not(.is-active) {
  background: rgba(51, 144, 236, 0.12);
  box-shadow: inset 3px 0 0 var(--accent);
}

.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: 2px;
}

.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: 14px;
  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;
}

.pin-dot {
  width: 28px;
  flex-basis: 28px;
  border-radius: 999px;
  background: rgba(51, 144, 236, 0.12);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
}

.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-active .pin-dot {
  background: rgba(255, 255, 255, 0.18);
}

.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: 13px;
  line-height: 1.32;
}

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

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

.avatar {
  position: relative;
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  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: 10px;
  height: 10px;
  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 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[data-wallpaper="mint"] {
  --chat-bg: #dff4e8;
  --chat-pattern: rgba(30, 126, 92, 0.12);
}

.chat[data-wallpaper="ocean"] {
  --chat-bg: #dcebfa;
  --chat-pattern: rgba(35, 120, 201, 0.14);
}

.chat[data-wallpaper="dusk"] {
  --chat-bg: #e9e3f6;
  --chat-pattern: rgba(124, 58, 237, 0.13);
}

.chat[data-wallpaper="paper"] {
  --chat-bg: #f3ead8;
  --chat-pattern: rgba(148, 104, 48, 0.13);
}

.chat-header {
  grid-row: 1;
  position: relative;
  z-index: 34;
  min-height: 54px;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 10px;
  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) minmax(52px, auto) minmax(78px, 118px) 32px 32px 32px 32px;
  column-gap: 6px;
  row-gap: 0;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 5px 10px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(16px);
}

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

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

.chat-search-bar span {
  min-width: 52px;
  border-radius: 999px;
  padding: 0 8px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel-2) 86%, transparent);
  font-size: 11px;
  font-weight: 900;
  line-height: 24px;
  text-align: center;
}

.chat-search-index-status {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 24px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-search-index-status[data-status="running"] {
  color: var(--accent);
}

.chat-search-bar button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  font-weight: 800;
  line-height: 0;
}

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

.chat-search-bar button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

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

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

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

.chat-search-result {
  display: grid;
  grid-template-columns: minmax(64px, 82px) minmax(0, 1fr) minmax(70px, auto);
  gap: 7px;
  align-items: center;
  min-height: 40px;
  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: 11px;
  font-weight: 900;
}

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

.chat-search-result time {
  max-width: 92px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  justify-self: end;
  text-overflow: ellipsis;
  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: 12px;
  font-weight: 800;
  text-align: center;
}

.date-strip {
  grid-row: 6;
  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: 27px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.76);
  font-size: 11.5px;
  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(292px, calc(100% - 48px));
  gap: 7px;
  max-height: min(304px, calc(100% - 150px));
  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 14px 36px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
}

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

.date-jump-panel header {
  display: flex;
  min-height: 34px;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 1px 3px;
}

.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: 50%;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.date-jump-panel header button svg {
  width: 15px;
  height: 15px;
}

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

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

.date-jump-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  padding: 7px 9px;
  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-options button.is-keyboard-active,
.notification-read-toggle.is-keyboard-active,
.notification-read-toggle:hover {
  background: rgba(51, 144, 236, 0.16);
}

.notification-options button.is-keyboard-active,
.notification-read-toggle.is-keyboard-active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.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-deliveries {
  display: grid;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 8px;
  padding: 8px;
  background: color-mix(in srgb, var(--panel-2) 72%, transparent);
}

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

.notification-deliveries header span,
.notification-deliveries header small {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-deliveries header small {
  color: var(--muted);
}

.notification-deliveries ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.notification-deliveries li {
  display: grid;
  grid-template-columns: minmax(56px, auto) minmax(0, 1fr) minmax(56px, auto);
  gap: 6px;
  align-items: center;
  min-height: 26px;
  border-radius: 8px;
  padding: 4px 6px;
  background: color-mix(in srgb, var(--panel) 76%, transparent);
}

.notification-deliveries li span,
.notification-deliveries li b,
.notification-deliveries li small,
.notification-deliveries p {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-deliveries li span {
  color: var(--accent);
}

.notification-deliveries li small,
.notification-deliveries p {
  color: var(--muted);
}

.notification-deliveries p {
  margin: 0;
}

.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,
.scheduled-queue-item:has(.is-active) {
  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-main.is-active,
.scheduled-queue-actions button.is-active {
  background: rgba(51, 144, 236, 0.16);
  box-shadow: inset 3px 0 0 var(--accent);
}

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

.pinned-strip {
  position: relative;
  grid-row: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  min-height: 36px;
  align-items: center;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 5px 14px 5px 20px;
  color: var(--text);
  background: color-mix(in srgb, var(--panel) 92%, rgba(51, 144, 236, 0.18));
  text-align: left;
  transition: background 0.12s ease;
}

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

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

.pinned-strip:hover {
  background: color-mix(in srgb, var(--panel) 86%, rgba(51, 144, 236, 0.28));
}

.pinned-strip strong {
  display: block;
  color: var(--accent-dark);
  font-size: 10.5px;
  font-weight: 950;
  line-height: 1;
}

.pinned-strip span {
  display: block;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.18;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

.hashtag-strip::-webkit-scrollbar {
  display: none;
}

.hashtag-strip-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.hashtag-strip button {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  font-size: 12px;
  font-weight: 900;
}

.hashtag-strip button:hover,
.hashtag-strip button.is-active {
  color: #ffffff;
  background: var(--accent);
}

.hashtag-strip button b,
.hashtag-strip button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hashtag-strip button b {
  max-width: 116px;
}

.hashtag-strip button small {
  color: inherit;
  opacity: 0.72;
  font-size: 11px;
}

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

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

.topic-strip::-webkit-scrollbar {
  display: none;
}

.topic-strip-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.topic-strip button,
.topic-badge {
  display: inline-flex;
  max-width: 172px;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  font-size: 12px;
  font-weight: 900;
}

.topic-strip button {
  flex: 0 0 auto;
}

.topic-strip button:hover,
.topic-strip button.is-active,
.topic-badge:hover {
  color: #ffffff;
  background: var(--accent);
}

.topic-strip button.is-closed {
  color: #8f1d3b;
  background: rgba(244, 63, 94, 0.12);
}

.topic-strip button.is-muted {
  color: #5b3b00;
  background: rgba(245, 158, 11, 0.16);
}

.topic-strip button.is-closed:hover,
.topic-strip button.is-closed.is-active,
.topic-strip button.is-muted:hover,
.topic-strip button.is-muted.is-active {
  color: #ffffff;
}

.topic-strip button span,
.topic-badge span {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
  font-size: 10px;
  font-weight: 1000;
}

.topic-strip button.is-active span,
.topic-strip button:hover span,
.topic-badge:hover span {
  color: var(--accent);
  background: #ffffff;
}

.topic-strip button b,
.topic-strip button small,
.topic-badge b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-strip button b,
.topic-badge b {
  max-width: 104px;
}

.topic-strip button small {
  color: inherit;
  opacity: 0.72;
  font-size: 11px;
}

.topic-badge {
  justify-self: start;
  margin-top: 2px;
  margin-bottom: 3px;
}

.inline-bot-badge {
  display: inline-flex;
  max-width: 156px;
  min-width: 0;
  justify-self: start;
  align-items: center;
  overflow: hidden;
  border-radius: 999px;
  padding: 3px 8px;
  color: #0f766e;
  background: rgba(15, 118, 110, 0.11);
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-keyboard {
  display: grid;
  min-width: 0;
  max-width: min(360px, 100%);
  gap: 7px;
  border: 1px solid rgba(51, 144, 236, 0.14);
  border-radius: 8px;
  padding: 8px;
  background: rgba(51, 144, 236, 0.08);
}

.bot-keyboard header {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.bot-keyboard header span,
.bot-keyboard header strong,
.bot-keyboard-result {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-keyboard header span {
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
}

.bot-keyboard header strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.bot-keyboard-grid {
  display: grid;
  gap: 6px;
}

.bot-keyboard-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.bot-keyboard-button {
  display: grid;
  min-width: 0;
  min-height: 34px;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  padding: 0 8px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.14);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-keyboard-button:hover,
.bot-keyboard-button.is-selected {
  color: #ffffff;
  background: var(--accent);
}

.bot-keyboard-button.is-url {
  color: #0f766e;
  background: rgba(15, 118, 110, 0.13);
}

.bot-keyboard-result {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

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

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

.pinned-popover header {
  display: flex;
  min-height: 32px;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 1px 2px 3px 6px;
}

.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: 28px;
  height: 28px;
  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: 2px;
  max-height: 226px;
  overflow-y: auto;
  padding-right: 0;
}

.pinned-popover-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) minmax(72px, auto);
  gap: 7px;
  align-items: center;
  min-height: 44px;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  padding: 5px 8px 5px 5px;
  color: var(--text);
  background: transparent;
  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: 22px;
  height: 22px;
  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: 12px;
  font-weight: 850;
}

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

.pinned-popover-item time {
  max-width: 112px;
  overflow: hidden;
  justify-self: end;
  text-overflow: ellipsis;
  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: 22px;
  bottom: 76px;
  z-index: 35;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
  cursor: pointer;
  transition: background 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

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

.scroll-bottom:hover {
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.2);
  transform: translateY(-1px);
}

.scroll-bottom svg {
  width: 19px;
  height: 19px;
}

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

.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 8px 22px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: background 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.unread-jump:hover,
.scroll-date-float:hover {
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.2);
  transform: translateY(-1px);
}

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

.unread-jump {
  right: 72px;
  bottom: 79px;
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 6px;
  min-height: 34px;
  align-items: center;
  border-radius: 999px;
  padding: 0 11px 0 6px;
  font-size: 11.5px;
  font-weight: 900;
}

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

.scroll-date-float {
  top: 112px;
  right: 22px;
  display: inline-grid;
  min-height: 28px;
  place-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: #ffffff;
  background: rgba(85, 108, 130, 0.68);
  font-size: 11.5px;
  font-weight: 900;
}

.mobile-back {
  display: none;
}

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

.chat-title {
  flex: 1 1 auto;
  min-height: 50px;
  border-radius: 8px;
  padding: 2px 6px 2px 2px;
  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 .avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  color: #ffffff;
  font-size: 12px;
}

.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: 10px;
  height: 10px;
  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;
  grid-template-rows: auto auto;
  gap: 2px;
}

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

.chat-title-copy [data-room-meta],
.profile-panel p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-meta-row {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: flex-start;
  gap: 4px 6px;
  overflow: visible;
}

.chat-meta-row [data-room-meta] {
  flex: 0 0 auto;
  min-width: 0;
  max-width: min(210px, 38vw);
}

.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;
  align-content: flex-start;
  overflow: visible;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 18px;
  max-height: 40px;
}

.chat-status-chips .status-chip {
  height: 18px;
  max-width: 132px;
  flex: 0 1 auto;
  padding: 0 6px;
  font-size: 10px;
  white-space: nowrap;
}

.chat-status-chips .status-chip i {
  width: 5px;
  height: 5px;
  flex-basis: 5px;
}

.chat-actions {
  flex: 0 0 auto;
  gap: 4px;
}

.chat-actions .icon-button {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  font-size: 17px;
}

.realtime-translation-button.is-active {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 6px 16px rgba(51, 144, 236, 0.24);
}

.realtime-translation-button.is-active svg {
  stroke: #ffffff;
}

.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-slow {
  color: #8a4b0f;
  background: rgba(245, 158, 11, 0.18);
}

.status-chip.is-protected {
  color: #0f5f78;
  background: rgba(45, 178, 196, 0.16);
}

.status-chip.is-secret {
  color: #0f6b5f;
  background: rgba(20, 184, 166, 0.16);
}

.status-chip.is-secret-requested {
  color: #7a4b00;
  background: rgba(245, 158, 11, 0.18);
}

.status-chip.is-secret-active {
  color: #ffffff;
  background: #0ea5a3;
}

.status-chip.is-secret-local {
  color: #0f6b5f;
  background: rgba(20, 184, 166, 0.16);
}

.status-chip.is-invite {
  color: #126b46;
  background: rgba(35, 171, 104, 0.14);
}

.status-chip.is-requests {
  color: #ffffff;
  background: #0ea5a3;
}

.status-chip.is-admins {
  color: #ffffff;
  background: #1677b8;
}

.status-chip.is-blocked {
  color: #8f1d3b;
  background: rgba(244, 63, 94, 0.14);
}

.status-chip.is-perm-messages,
.status-chip.is-perm-media,
.status-chip.is-perm-polls,
.status-chip.is-perm-links,
.status-chip.is-perm-stickers,
.status-chip.is-perm-gifs,
.status-chip.is-perm-contacts,
.status-chip.is-perm-location {
  color: #8f1d3b;
  background: rgba(244, 63, 94, 0.14);
}

.status-chip.is-ttl {
  color: #ffffff;
  background: #7c3aed;
}

.status-chip.is-wallpaper {
  color: #0f5f78;
  background: rgba(45, 178, 196, 0.16);
}

.status-chip.is-notifications.is-notifications-pending {
  color: #075985;
  background: rgba(14, 165, 233, 0.16);
}

.status-chip.is-notifications.is-notifications-read {
  color: #126b46;
  background: rgba(35, 171, 104, 0.14);
}

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

.messages {
  grid-row: 7;
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
  padding: 18px clamp(16px, 2.1vw, 34px) 14px;
}

.messages > :first-child {
  margin-top: auto;
}

.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: 6px 0;
  user-select: none;
}

.message-day-divider {
  border-radius: 999px;
  padding: 5px 10px;
  color: #ffffff;
  background: rgba(85, 108, 130, 0.56);
  font-size: 11.5px;
  font-weight: 800;
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px);
}

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

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

.unread-divider span {
  min-height: 25px;
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.82);
  line-height: 17px;
  backdrop-filter: blur(10px);
}

.message {
  position: relative;
  display: grid;
  max-width: min(620px, 76%);
  gap: 4px;
  align-self: flex-start;
  border-radius: var(--bubble-radius) var(--bubble-radius) var(--bubble-radius) 5px;
  padding: 8px 10px 6px 11px;
  color: var(--text);
  background: var(--bubble-in);
  box-shadow: var(--message-shadow);
}

.message.is-grouped {
  margin-top: -3px;
  border-top-left-radius: var(--bubble-radius);
}

.message.is-grouped.is-mine {
  border-top-right-radius: var(--bubble-radius);
}

.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-keyboard-active {
  outline: 2px solid rgba(51, 144, 236, 0.5);
  outline-offset: 3px;
}

.message.is-keyboard-active.is-selected {
  outline-color: var(--accent);
}

.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: var(--message-shadow);
  }

  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;
  z-index: 3;
  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);
  font-size: 0;
  line-height: 0;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.12s ease, background 0.12s ease;
}

.message-select::before {
  width: 8px;
  height: 5px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  content: "";
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg);
}

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

body.has-selection-mode .message:hover .message-select,
.message.is-selected .message-select {
  opacity: 1;
}

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

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

.message::after {
  position: absolute;
  bottom: 1px;
  left: calc(var(--bubble-tail-size) / -2);
  width: var(--bubble-tail-size);
  height: var(--bubble-tail-size);
  background: var(--bubble-in);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  content: "";
}

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

.message.is-mine::after {
  right: calc(var(--bubble-tail-size) / -2);
  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.4;
  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;
}

.poll-card {
  display: grid;
  gap: 8px;
  min-width: min(270px, 64vw);
  max-width: 100%;
  margin-top: 6px;
  border-radius: 8px;
  padding: 10px;
  background: rgba(51, 144, 236, 0.1);
}

.poll-card header {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.poll-card header strong {
  min-width: 0;
  overflow: hidden;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poll-card header small,
.poll-summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.poll-options {
  display: grid;
  gap: 6px;
}

.poll-option {
  position: relative;
  display: grid;
  min-height: 34px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  padding: 7px 9px;
  color: inherit;
  background: rgba(255, 255, 255, 0.6);
  text-align: left;
}

.poll-option-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--poll-percent, 0%);
  background: rgba(51, 144, 236, 0.18);
  pointer-events: none;
  transition: width 0.16s ease;
}

.poll-option-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.poll-option-label {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poll-option-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

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

.poll-option.is-selected {
  box-shadow: inset 0 0 0 2px rgba(51, 144, 236, 0.42);
}

.poll-option.is-selected .poll-option-bar {
  background: rgba(51, 144, 236, 0.28);
}

.poll-card.is-quiz header small {
  color: #126b46;
}

.poll-card.is-closed {
  opacity: 0.88;
}

.poll-option:disabled {
  cursor: default;
}

.poll-option.is-correct {
  box-shadow: inset 0 0 0 2px rgba(35, 171, 104, 0.36);
}

.poll-option.is-correct .poll-option-bar {
  background: rgba(35, 171, 104, 0.24);
}

.poll-option.is-wrong {
  box-shadow: inset 0 0 0 2px rgba(244, 63, 94, 0.3);
}

.poll-option.is-wrong .poll-option-bar {
  background: rgba(244, 63, 94, 0.18);
}

.poll-vote-log {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.poll-vote-log span {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.poll-vote-log b,
.poll-vote-log em,
.poll-vote-log time {
  min-width: 0;
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poll-vote-log em {
  color: var(--text);
}

.sticker-message {
  display: inline-grid;
  justify-items: center;
  gap: 6px;
  width: min(156px, 52vw);
  max-width: 100%;
  margin-top: 4px;
}

.sticker-art {
  position: relative;
  display: grid;
  width: min(136px, 48vw);
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border-radius: 26px 26px 18px 26px;
  color: #ffffff;
  background: linear-gradient(145deg, #3390ec, #5ba6e8);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
  transform: rotate(-2deg);
}

.sticker-art::after {
  position: absolute;
  inset: 14px 14px auto auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.26);
  content: "";
}

.sticker-art b {
  position: relative;
  z-index: 1;
  font-size: 36px;
  font-weight: 1000;
}

.sticker-art.is-green {
  background: linear-gradient(145deg, #4fae4e, #8bd36f);
}

.sticker-art.is-violet {
  background: linear-gradient(145deg, #7c5cff, #4f7cff);
}

.sticker-art.is-amber {
  background: linear-gradient(145deg, #f59f00, #ffd43b);
}

.sticker-art.is-rose {
  background: linear-gradient(145deg, #f06595, #ff8787);
}

.sticker-message small {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gif-message {
  display: inline-grid;
  gap: 6px;
  width: min(184px, 58vw);
  max-width: 100%;
  margin-top: 4px;
}

.gif-art {
  position: relative;
  display: grid;
  width: min(176px, 56vw);
  aspect-ratio: 16 / 10;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #17212b, #3390ec);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}

.gif-art::before,
.gif-art i {
  position: absolute;
  inset: 0;
  content: "";
}

.gif-art::before {
  background: linear-gradient(110deg, transparent 0 28%, rgba(255, 255, 255, 0.28) 42%, transparent 56% 100%);
  animation: gifSweep 1.4s linear infinite;
}

.gif-art i {
  background:
    radial-gradient(circle at 22% 28%, rgba(255, 255, 255, 0.34), transparent 16%),
    radial-gradient(circle at 78% 72%, rgba(255, 255, 255, 0.2), transparent 18%);
  animation: gifPulse 1.1s ease-in-out infinite alternate;
}

.gif-art b {
  position: relative;
  z-index: 1;
  font-size: 34px;
  font-weight: 1000;
}

.gif-art.is-pulse {
  background: linear-gradient(135deg, #7c5cff, #4f7cff);
}

.gif-art.is-launch {
  background: linear-gradient(135deg, #f59f00, #3390ec);
}

.gif-art.is-wave {
  background: linear-gradient(135deg, #20c997, #3390ec);
}

.gif-art.is-sync {
  background: linear-gradient(135deg, #4fae4e, #17212b);
}

.gif-message small {
  display: flex;
  max-width: 100%;
  min-width: 0;
  gap: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gif-message small b {
  border-radius: 4px;
  padding: 0 4px;
  color: #ffffff;
  background: var(--accent);
  font-size: 10px;
}

.dice-message {
  display: inline-grid;
  justify-items: center;
  gap: 7px;
  width: min(168px, 54vw);
  max-width: 100%;
  margin-top: 4px;
  border-radius: 8px;
  padding: 9px;
  background: rgba(51, 144, 236, 0.1);
}

.dice-art {
  position: relative;
  display: grid;
  width: min(118px, 42vw);
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border-radius: 24px;
  color: #ffffff;
  background: linear-gradient(145deg, #3390ec, #5ba6e8);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

.dice-art::before {
  position: absolute;
  inset: 10px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 26% 26%, rgba(255, 255, 255, 0.45), transparent 10%),
    radial-gradient(circle at 74% 74%, rgba(255, 255, 255, 0.32), transparent 10%);
  content: "";
}

.dice-art i {
  position: absolute;
  inset: auto -20px -22px auto;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.dice-art b,
.dice-art strong {
  position: relative;
  z-index: 1;
}

.dice-art b {
  font-size: 28px;
  font-weight: 1000;
}

.dice-art strong {
  position: absolute;
  right: 10px;
  bottom: 8px;
  display: grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 1000;
}

.dice-art.is-red {
  background: linear-gradient(145deg, #f03e3e, #ff8787);
}

.dice-art.is-orange {
  background: linear-gradient(145deg, #f76707, #ffd43b);
}

.dice-art.is-green {
  background: linear-gradient(145deg, #2f9e44, #8ce99a);
}

.dice-art.is-violet {
  background: linear-gradient(145deg, #7048e8, #91a7ff);
}

.dice-art.is-gold {
  background: linear-gradient(145deg, #f59f00, #fab005);
}

.dice-caption {
  display: grid;
  max-width: 100%;
  min-width: 0;
  gap: 1px;
  text-align: center;
}

.dice-caption b,
.dice-caption small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dice-caption b {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.dice-caption small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dice-message [data-dice-reroll] {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.14);
  font-size: 12px;
  font-weight: 900;
}

.dice-message [data-dice-reroll]:hover {
  background: rgba(51, 144, 236, 0.22);
}

.contact-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: min(270px, 64vw);
  max-width: 100%;
  margin-top: 6px;
  border-radius: 8px;
  padding: 9px;
  background: rgba(51, 144, 236, 0.1);
}

.contact-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(145deg, #3390ec, #4fae4e);
  font-size: 13px;
  font-weight: 1000;
}

.contact-main {
  display: grid;
  min-width: 0;
  gap: 2px;
}

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

.contact-main strong {
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 900;
}

.contact-main small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.contact-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.contact-actions button {
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.14);
  font-size: 12px;
  font-weight: 900;
}

.contact-actions button:hover {
  background: rgba(51, 144, 236, 0.22);
}

.location-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: min(286px, 66vw);
  max-width: 100%;
  margin-top: 6px;
  border-radius: 8px;
  padding: 9px;
  background: rgba(51, 144, 236, 0.1);
}

.location-map {
  position: relative;
  display: block;
  width: 74px;
  height: 74px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(51, 144, 236, 0.18), rgba(79, 174, 78, 0.22)),
    #edf6ff;
}

.location-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(51, 144, 236, 0.2) 1px, transparent 1px),
    linear-gradient(0deg, rgba(51, 144, 236, 0.18) 1px, transparent 1px),
    linear-gradient(135deg, transparent 0 42%, rgba(79, 174, 78, 0.32) 43% 52%, transparent 53% 100%);
  background-size: 18px 18px, 18px 18px, 100% 100%;
}

.location-pin {
  position: absolute;
  top: 22px;
  left: 34px;
  width: 16px;
  height: 16px;
  border-radius: 50% 50% 50% 0;
  background: #e03131;
  box-shadow: 0 6px 14px rgba(224, 49, 49, 0.28);
  transform: rotate(-45deg);
}

.location-pin::after {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  content: "";
}

.location-main {
  display: grid;
  min-width: 0;
  gap: 2px;
}

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

.location-main strong {
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 900;
}

.location-main small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.location-live-badge {
  justify-self: start;
  border-radius: 999px;
  padding: 2px 7px;
  color: #ffffff;
  background: var(--accent-green);
  font-size: 10px;
  font-weight: 900;
}

.location-card.is-ended .location-live-badge {
  background: #7d8b99;
}

.location-live-progress {
  grid-column: 1 / -1;
  display: block;
  overflow: hidden;
  height: 4px;
  border-radius: 999px;
  background: rgba(51, 144, 236, 0.16);
}

.location-live-progress i {
  display: block;
  width: var(--live-percent, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--accent-green);
  transition: width 0.2s ease;
}

.location-card.is-ended .location-live-progress i {
  background: #7d8b99;
}

.location-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.location-actions button {
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.14);
  font-size: 12px;
  font-weight: 900;
}

.location-actions button:hover {
  background: rgba(51, 144, 236, 0.22);
}

.call-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: min(286px, 66vw);
  max-width: 100%;
  margin-top: 6px;
  border-radius: 8px;
  padding: 9px;
  background: rgba(51, 144, 236, 0.1);
}

.call-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(145deg, #3390ec, #4fae4e);
  font-size: 11px;
  font-weight: 1000;
}

.call-card.is-audio .call-icon {
  background: linear-gradient(145deg, #3390ec, #7d8b99);
}

.call-card.is-ended .call-icon {
  background: linear-gradient(145deg, #7d8b99, #4b5563);
}

.call-main {
  display: grid;
  min-width: 0;
  gap: 2px;
}

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

.call-main strong {
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 900;
}

.call-main small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.call-signal {
  min-width: 0;
  overflow: hidden;
  color: var(--accent);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-status {
  justify-self: start;
  border-radius: 999px;
  padding: 2px 7px;
  color: #ffffff;
  background: var(--accent);
  font-size: 10px;
  font-weight: 900;
}

.call-card.is-joined .call-status {
  background: var(--accent-green);
}

.call-card.is-ended .call-status {
  background: #7d8b99;
}

.call-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.call-actions button {
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.14);
  font-size: 12px;
  font-weight: 900;
}

.call-actions button:hover:not(:disabled) {
  background: rgba(51, 144, 236, 0.22);
}

.call-actions button:disabled {
  color: #6b7280;
  cursor: default;
  background: rgba(125, 139, 153, 0.16);
}

.video-note-message {
  display: inline-grid;
  justify-items: center;
  gap: 7px;
  width: min(168px, 54vw);
  max-width: 100%;
  margin-top: 4px;
}

.video-note-ring {
  position: relative;
  display: grid;
  width: min(132px, 44vw);
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 4px solid transparent;
  border-radius: 50%;
  color: #ffffff;
  background:
    linear-gradient(145deg, #17212b, #3390ec) padding-box,
    conic-gradient(var(--accent) var(--video-note-progress, 0%), rgba(51, 144, 236, 0.18) 0) border-box;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

.video-note-ring::before {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 26% 24%, rgba(255, 255, 255, 0.28), transparent 16%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 52%);
  content: "";
}

.video-note-poster,
.video-note-play-icon {
  position: relative;
  z-index: 1;
}

.video-note-poster {
  font-size: 30px;
  font-weight: 1000;
}

.video-note-play-icon {
  position: absolute;
  right: 14px;
  bottom: 13px;
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.92);
  font-size: 9px;
  font-weight: 1000;
}

.video-note-message.is-playing .video-note-ring {
  background:
    linear-gradient(145deg, #1d7ed0, #4fae4e) padding-box,
    conic-gradient(var(--accent-green) var(--video-note-progress, 100%), rgba(79, 174, 78, 0.18) 0) border-box;
}

.video-note-caption {
  display: grid;
  max-width: 100%;
  min-width: 0;
  gap: 1px;
  text-align: center;
}

.video-note-caption strong,
.video-note-caption small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-note-caption strong {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.video-note-caption small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

@keyframes gifSweep {
  from {
    transform: translateX(-120%);
  }

  to {
    transform: translateX(120%);
  }
}

@keyframes gifPulse {
  from {
    opacity: 0.62;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: scale(1.04);
  }
}

.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: 16px;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  color: #6d7f8f;
  font-size: 10.5px;
  line-height: 1;
}

.message-comment-chip {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  justify-content: start;
  gap: 6px;
  width: fit-content;
  min-height: 28px;
  margin-top: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  padding: 4px 8px 4px 5px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: 12px;
  font-weight: 900;
}

.message-comment-chip:hover,
.message-comment-chip:focus-visible {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}

.message-comment-chip b {
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  font-size: 11px;
}

.message-comment-chip span {
  white-space: nowrap;
}

.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,
.message-secret-badge,
.message-protected-badge {
  display: inline-grid;
  min-width: 16px;
  height: 16px;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.message-secret-badge {
  width: auto;
  border-radius: 999px;
  padding: 0 5px;
  color: #0f6b5f;
  background: rgba(20, 184, 166, 0.14);
  font-size: 10px;
  font-weight: 900;
}

.message-protected-badge {
  width: auto;
  border-radius: 999px;
  padding: 0 5px;
  color: #0f5f78;
  background: rgba(45, 178, 196, 0.14);
  font-size: 10px;
  font-weight: 900;
}

.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-expiry-badge {
  display: inline-flex;
  min-height: 16px;
  align-items: center;
  border-radius: 999px;
  padding: 0 6px;
  color: #ffffff;
  background: rgba(124, 58, 237, 0.78);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.message-expiry-badge.is-expired {
  background: rgba(125, 139, 153, 0.72);
}

.message-spoiler {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  color: #ffffff;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.20) 0 3px, transparent 3px 7px),
    #4b5563;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.message-spoiler small {
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  font-weight: 800;
}

.message-spoiler:hover,
.message-spoiler:focus-visible {
  outline: 2px solid rgba(51, 144, 236, 0.55);
  outline-offset: 2px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.24) 0 3px, transparent 3px 7px),
    #374151;
}

.message-spoiler-text.is-revealed {
  border-left: 3px solid #7c3aed;
  padding-left: 9px;
}

.message-translation {
  display: grid;
  gap: 6px;
  max-width: min(286px, 100%);
  margin-top: 6px;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 8px 9px;
  background: rgba(51, 144, 236, 0.1);
}

.message-translation header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.message-translation header strong,
.message-translation header small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-translation header strong {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

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

.message-translation p {
  color: inherit;
  font-size: 13px;
}

.message-translation-original {
  display: grid;
  gap: 3px;
  min-width: 0;
  border-radius: 8px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.58);
}

.message-translation-original strong {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.message-translation-original span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.message-translation-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.message-translation [data-translation-hide],
.message-translation [data-translation-original-toggle] {
  justify-self: start;
  min-height: 26px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.14);
  font-size: 11px;
  font-weight: 900;
}

.message-translation [data-translation-hide]:hover,
.message-translation [data-translation-original-toggle]:hover {
  background: rgba(51, 144, 236, 0.22);
}

.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-failed {
  color: #dc2626;
}

.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%;
  max-height: 0;
  justify-self: start;
  gap: 2px;
  margin-top: 0;
  border-radius: 999px;
  padding: 0 2px;
  background: rgba(255, 255, 255, 0.68);
  opacity: 0;
  overflow: hidden;
  transform: translateY(-2px);
  transition: max-height 0.12s ease, margin 0.12s ease, opacity 0.12s ease, padding 0.12s ease, transform 0.12s ease, background 0.12s ease;
  backdrop-filter: blur(8px);
}

.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,
.message.is-selected .message-action-row {
  max-height: 30px;
  margin-top: 4px;
  padding: 2px;
  opacity: 1;
  transform: none;
}

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

.message-action-row button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.message-action-row button:disabled,
.message-tools button:disabled,
.detail-actions button:disabled,
.context-menu button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
}

.message-action-row button:disabled:hover,
.message-tools button:disabled:hover,
.detail-actions button:disabled:hover,
.context-menu button:disabled:hover {
  color: var(--accent-dark);
  background: transparent;
}

.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: 0;
}

.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-family: var(--emoji-font);
  font-size: 12px;
}

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

.voice-message {
  display: grid;
  grid-template-columns: 34px minmax(92px, 1fr) auto auto;
  gap: 7px;
  align-items: center;
  min-width: min(288px, 72vw);
  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 {
  min-width: 72px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.voice-message .voice-transcript-toggle {
  width: auto;
  min-width: 42px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.14);
  font-size: 11px;
}

.voice-transcript {
  display: grid;
  gap: 6px;
  max-width: min(286px, 100%);
  margin-top: 6px;
  border-left: 3px solid var(--accent-green);
  border-radius: 8px;
  padding: 8px 9px;
  background: rgba(79, 174, 78, 0.12);
}

.voice-transcript header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.voice-transcript header strong,
.voice-transcript header small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-transcript header strong {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

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

.voice-transcript p {
  color: inherit;
  font-size: 13px;
}

.voice-transcript [data-voice-transcript-hide] {
  justify-self: start;
  min-height: 26px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  color: var(--accent-dark);
  background: rgba(79, 174, 78, 0.16);
  font-size: 11px;
  font-weight: 900;
}

.voice-transcript [data-voice-transcript-hide]:hover {
  background: rgba(79, 174, 78, 0.24);
}

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

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

.voice-message.is-playing .voice-waveform i.is-played {
  box-shadow: 0 0 0 1px rgba(79, 174, 78, 0.18);
}

.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: none;
  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-family: var(--emoji-font);
  font-size: 21px;
}

.reaction-picker [data-picker-reaction]:hover,
.reaction-picker [data-picker-reaction].is-selected,
.reaction-picker [data-picker-reaction].is-active {
  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].is-active:not(.is-selected) {
  box-shadow: inset 0 0 0 2px rgba(51, 144, 236, 0.28);
}

.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-stack.is-album {
  width: min(292px, 100%);
  overflow: hidden;
  border-radius: 8px;
  background: rgba(51, 144, 236, 0.08);
}

.transfer-message {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: min(330px, 100%);
  margin-top: 6px;
  overflow: hidden;
  border: 1px solid rgba(51, 144, 236, 0.16);
  border-radius: 10px;
  padding: 8px;
  background: rgba(51, 144, 236, 0.08);
}

.transfer-message-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(145deg, #3390ec, #0ea78a);
  font-size: 11px;
  font-weight: 1000;
}

.transfer-message-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.transfer-message-copy strong,
.transfer-message-copy small,
.transfer-message-copy em,
.transfer-message-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-message-copy strong {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.transfer-message-copy small,
.transfer-message-copy em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.transfer-message-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.transfer-message-status {
  justify-self: end;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.transfer-message-actions {
  display: flex;
  grid-column: 2 / 4;
  min-width: 0;
  justify-content: flex-end;
  gap: 6px;
}

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

.transfer-message-actions button:hover,
.transfer-message-actions button:focus-visible {
  color: #ffffff;
  background: var(--accent);
  outline: none;
}

.transfer-message-actions button:disabled,
.shared-transfer-actions button:disabled {
  cursor: default;
  opacity: 0.48;
}

.transfer-message-actions button:disabled:hover,
.transfer-message-actions button:disabled:focus-visible,
.shared-transfer-actions button:disabled:hover,
.shared-transfer-actions button:disabled.is-keyboard-active {
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
}

.transfer-message.is-accepted .transfer-message-status {
  color: #0f766e;
  background: rgba(15, 118, 110, 0.12);
}

.transfer-message.is-prepared .transfer-message-status {
  color: #8a4b0f;
  background: rgba(245, 158, 11, 0.16);
}

.transfer-message.is-canceled {
  opacity: 0.72;
}

.album-header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px 0;
}

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

.album-header strong {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

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

.album-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  padding: 7px;
}

.album-tile {
  position: relative;
  display: grid;
  min-height: 92px;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  padding: 0;
  color: #ffffff;
  background: linear-gradient(145deg, #17212b, #3390ec);
}

.album-tile i,
.album-tile img {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 92px;
  place-items: center;
  color: #ffffff;
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.28), transparent 18%),
    linear-gradient(145deg, #3390ec, #1ca68a);
  font-style: normal;
  font-weight: 1000;
}

.album-tile img {
  object-fit: cover;
}

.album-tile span {
  position: absolute;
  right: 6px;
  bottom: 6px;
  left: 6px;
  overflow: hidden;
  border-radius: 999px;
  padding: 3px 7px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.56);
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.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: 8;
  display: grid;
  grid-template-columns: var(--composer-control) var(--composer-control) minmax(0, 1fr) 42px;
  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: 7px;
  row-gap: 0;
  align-items: end;
  margin-top: auto;
  padding: 8px 14px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(100, 116, 139, 0.14);
  background: var(--chat-bg);
  background: color-mix(in srgb, var(--chat-bg) 88%, 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-suggestion-header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(132, 150, 166, 0.18);
  padding: 3px 7px 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.composer-suggestion-header strong,
.composer-suggestion-header small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-suggestion-header strong {
  color: var(--text);
}

.composer-suggestion-header b {
  color: var(--accent-dark);
}

.composer-suggestions button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 42px;
  align-items: center;
  border: 0;
  border-radius: 10px;
  padding: 0 8px;
  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-suggestion-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(145deg, #3390ec, #0ea78a);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.composer-suggestions [data-suggestion-kind="hashtag"] .composer-suggestion-avatar {
  background: #697b8f;
}

.composer-suggestions [data-suggestion-kind="command"] .composer-suggestion-avatar {
  background: var(--accent);
}

.composer-suggestions [data-suggestion-kind="inline-bot-result"] .composer-suggestion-avatar {
  border-radius: 8px;
  background: linear-gradient(145deg, #0f766e, #3390ec);
}

.composer-suggestion-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

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

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

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

.composer-suggestion-copy em {
  color: var(--muted-2);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.composer-tools {
  display: flex;
  grid-area: tools;
  min-width: 0;
  width: min(620px, 100%);
  margin-left: 96px;
  margin-bottom: 5px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

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

.composer-tools [data-composer-hint] {
  min-width: 0;
  overflow: hidden;
  border-radius: 999px;
  padding: 4px 9px;
  color: #8a4b0f;
  background: rgba(245, 158, 11, 0.16);
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-translation-preview {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  font-size: 11px;
  font-weight: 850;
}

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

.composer-translation-preview strong,
.composer-translation-preview span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-translation-preview strong {
  flex: 0 0 auto;
  font-weight: 950;
}

.composer-translation-preview span {
  color: var(--text);
}

.composer-translation-preview [data-translation-target-cycle] {
  flex: 0 0 auto;
  min-width: 46px;
  height: 22px;
  border: 0;
  border-radius: 8px;
  padding: 0 8px;
  color: #ffffff;
  background: var(--accent);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0;
}

.composer-translation-preview [data-translation-target-cycle]:hover,
.composer-translation-preview [data-translation-target-cycle]:focus-visible {
  background: var(--accent-dark);
}

.composer-permissions {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  border-radius: 999px;
  padding: 4px 5px 4px 9px;
  color: #8a3a1b;
  background: rgba(239, 68, 68, 0.1);
  font-size: 11px;
  font-weight: 850;
}

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

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

.composer-permissions strong {
  flex: 0 0 auto;
  color: #b42318;
  font-weight: 950;
}

.composer-permissions small {
  color: #8a3a1b;
}

.composer-permission-chips {
  display: flex;
  min-width: 0;
  flex: 0 0 auto;
  gap: 4px;
}

.composer-permission-chips [data-permission-chip] {
  display: inline-flex;
  max-width: 92px;
  min-height: 20px;
  align-items: center;
  overflow: hidden;
  border-radius: 999px;
  padding: 0 7px;
  color: #9a3412;
  background: rgba(255, 255, 255, 0.68);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-permission-chips [data-permission-chip].is-active {
  color: #ffffff;
  background: #ef4444;
}

.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,
.send-options button.is-active,
.schedule-panel button:hover,
.schedule-panel button:focus-visible,
.schedule-panel button.is-active {
  background: rgba(51, 144, 236, 0.13);
  outline: none;
}

.send-options button.is-active,
.schedule-panel button.is-active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.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: var(--message-shadow);
}

.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: 42px;
  resize: none;
  border: 0;
  border-radius: 21px;
  padding: 10px 16px;
  color: var(--text);
  background: var(--panel);
  outline: none;
  box-shadow: var(--message-shadow);
}

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

.composer textarea[data-permission-blocked="true"] {
  color: #8a3a1b;
  background: rgba(239, 68, 68, 0.08);
  cursor: not-allowed;
}

.send-button {
  grid-area: send;
  position: relative;
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
  overflow: hidden;
  font-size: 0;
  font-weight: 900;
  opacity: 0.72;
  transform: none;
  transition: opacity 0.12s ease, transform 0.12s ease, background 0.12s ease;
}

.send-button::before,
.send-button::after {
  position: absolute;
  display: block;
  content: "";
}

.send-button[data-send-mode="send"]::before {
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 15px solid currentColor;
  transform: translateX(2px);
}

.send-button[data-send-mode="voice"]::before {
  top: 9px;
  left: 50%;
  width: 8px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 999px;
  transform: translateX(-50%);
}

.send-button[data-send-mode="voice"]::after {
  left: 50%;
  bottom: 9px;
  width: 16px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  border-radius: 0 0 999px 999px;
  transform: translateX(-50%);
}

.send-button[data-send-mode="save"]::before {
  width: 16px;
  height: 9px;
  border-bottom: 3px solid currentColor;
  border-left: 3px solid currentColor;
  transform: translateY(-1px) rotate(-45deg);
}

.send-button[data-send-mode="wait"]::before {
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.send-button[data-send-mode="wait"]::after {
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translate(2px, -2px);
}

.send-button.is-ready {
  opacity: 1;
  transform: none;
}

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

.send-button.is-slow-mode,
.send-button:disabled {
  color: #8a4b0f;
  background: rgba(245, 158, 11, 0.18);
  cursor: not-allowed;
  opacity: 1;
  transform: none;
}

.send-button.is-permission-blocked {
  color: #b42318;
  background: rgba(239, 68, 68, 0.14);
}

.composer [data-attach][aria-disabled="true"] {
  color: #b42318;
  background: rgba(239, 68, 68, 0.1);
  cursor: not-allowed;
  opacity: 1;
}

@media (hover: none) {
  .message-action-row {
    max-height: 30px;
    margin-top: 4px;
    padding: 2px;
    opacity: 0.62;
    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-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
  border-radius: 10px;
  padding: 3px;
  background: var(--panel-2);
}

.emoji-mode-tabs button {
  min-width: 0;
  height: 30px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

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

.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-family: var(--emoji-font);
  font-size: 20px;
}

.emoji-panel button:hover,
.emoji-grid button.is-active {
  background: var(--panel-2);
}

.emoji-grid button.is-active {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent);
}

.media-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  max-height: 226px;
  overflow-y: auto;
  padding-right: 2px;
}

.media-picker-item {
  display: grid;
  min-width: 0;
  min-height: 96px;
  align-content: center;
  justify-items: center;
  gap: 7px;
  border-radius: 10px;
  padding: 8px 6px;
}

.media-picker-item small {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-picker-item .media-picker-art {
  max-width: 100%;
  margin: 0;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.15);
}

.media-picker-item .sticker-art {
  width: 52px;
  border-radius: 14px 14px 10px 14px;
}

.media-picker-item .sticker-art::after {
  inset: 6px 6px auto auto;
  width: 12px;
  height: 12px;
}

.media-picker-item .sticker-art b {
  font-size: 17px;
}

.media-picker-item .gif-art {
  width: 66px;
  border-radius: 8px;
}

.media-picker-item .gif-art b {
  font-size: 16px;
}

.media-picker-item.is-active {
  background: var(--panel-2);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent);
}

.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;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  line-height: 0;
  overflow: hidden;
}

.attach-panel [data-attach-close] > * {
  grid-area: 1 / 1;
}

.attach-panel [data-attach-close] svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.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;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  place-items: center;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(145deg, var(--accent), #18a38b);
  font-style: normal;
  line-height: 0;
}

.attach-action i > * {
  grid-area: 1 / 1;
}

.attach-action i svg {
  width: 19px;
  height: 19px;
  stroke-width: 2.1;
}

.attach-action[data-attach-action="transfer"] i {
  background: linear-gradient(145deg, #3f7fda, #18a38b);
}

.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;
}

.attach-policy {
  border-radius: 9px;
  padding: 8px 10px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel-2) 74%, transparent);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

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);
}

body:not([data-theme="light"]) .attach-policy {
  background: rgba(36, 47, 61, 0.76);
}

.profile-panel {
  position: fixed;
  top: var(--topbar-height);
  right: 0;
  bottom: 0;
  z-index: 58;
  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: calc(var(--sidebar-width) + (100vw - var(--sidebar-width)) / 2);
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(190px, auto) minmax(12px, 1fr) repeat(10, auto);
  gap: 8px;
  width: min(1040px, calc(100vw - var(--sidebar-width) - 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-summary {
  display: grid;
  min-width: 0;
  gap: 3px;
  line-height: 1.1;
}

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

.selection-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-badges {
  display: flex;
  max-width: 100%;
  gap: 4px;
  overflow: hidden;
}

.selection-badges span {
  flex: 0 0 auto;
  max-width: 118px;
  overflow: hidden;
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.selection-bar button {
  display: grid;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  place-items: center;
  border-radius: 999px;
  padding: 0;
  font-size: 0;
}

.selection-bar button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.selection-bar button:disabled {
  cursor: default;
  opacity: 0.46;
}

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

.selection-bar button.is-keyboard-active {
  box-shadow: inset 0 0 0 2px rgba(51, 144, 236, 0.36);
}

.selection-bar button:disabled:hover {
  background: transparent;
}

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

.selection-bar [data-selection-pin],
.selection-bar [data-selection-unread] {
  color: var(--accent-dark);
}

body.has-selection-mode .message-select,
.chat.has-selection-mode .message-select {
  opacity: 1;
}

.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-family: var(--emoji-font);
  font-size: 17px;
}

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

.context-menu button.is-active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.forward-sheet {
  position: fixed;
  right: 18px;
  bottom: 92px;
  z-index: 65;
  display: grid;
  width: min(360px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 132px));
  grid-template-rows: auto auto 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,
.forward-targets button.is-active {
  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-preview {
  display: grid;
  gap: 6px;
  border-radius: 12px;
  padding: 8px;
  background: color-mix(in srgb, var(--panel-2) 88%, var(--accent) 12%);
}

.forward-preview:empty {
  display: none;
}

.forward-preview header {
  min-height: 0;
  padding: 0;
}

.forward-preview header strong,
.forward-preview header small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forward-preview > div {
  display: grid;
  gap: 4px;
}

.forward-preview-item {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(54px, auto) minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  border-radius: 8px;
  padding: 5px 7px;
  background: rgba(255, 255, 255, 0.58);
}

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

.forward-preview-item strong {
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
}

.forward-preview-item span,
.forward-preview-item small,
.forward-preview-more {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.forward-preview-more {
  padding-inline: 7px;
}

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

.forward-quick button {
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  background: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.forward-quick button:hover {
  background: var(--accent-dark);
}

.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 button.is-active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.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,
.new-chat-contacts button.is-active {
  background: var(--panel-2);
}

.new-chat-contacts button.is-active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.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;
}

.folder-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);
}

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

.folder-card {
  display: grid;
  width: min(460px, calc(100vw - 24px));
  max-height: min(650px, calc(100vh - 40px));
  grid-template-rows: 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);
}

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

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

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

.folder-card header strong {
  font-size: 17px;
  font-weight: 900;
}

.folder-card header small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.folder-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.folder-create label {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.folder-create span,
.folder-active-room span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.folder-create input {
  min-height: 40px;
  min-width: 0;
  border: 0;
  border-radius: 10px;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel-2);
  outline: none;
}

.folder-create button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 950;
}

.folder-active-room {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(51, 144, 236, 0.1);
}

.folder-active-room strong {
  min-width: 0;
  overflow: hidden;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-list {
  display: grid;
  gap: 5px;
  min-height: 0;
  overflow: auto;
}

.folder-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border-radius: 11px;
  padding: 8px;
  background: transparent;
}

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

.folder-item-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(145deg, #2a9d74, var(--accent));
  font-size: 12px;
  font-weight: 950;
}

.folder-item-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

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

.folder-item-copy strong {
  font-size: 13px;
  font-weight: 950;
}

.folder-item-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.folder-item-actions {
  display: flex;
  grid-column: 1 / -1;
  min-width: 0;
  gap: 6px;
  flex-wrap: wrap;
}

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

.folder-item-actions button:hover {
  background: rgba(51, 144, 236, 0.2);
}

.folder-item-actions button.is-danger {
  color: #d34848;
  background: rgba(211, 72, 72, 0.1);
}

.folder-empty {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
}

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

.transfer-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);
}

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

.transfer-card {
  display: grid;
  width: min(460px, calc(100vw - 24px));
  max-height: min(620px, calc(100vh - 40px));
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  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);
}

.transfer-card header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: center;
  min-height: 40px;
}

.transfer-card header span,
.transfer-empty {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.transfer-card header strong,
.transfer-card header small,
.transfer-empty strong,
.transfer-empty span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transfer-card header strong {
  font-size: 17px;
  font-weight: 900;
  white-space: nowrap;
}

.transfer-card header small,
.transfer-empty span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.transfer-card [data-transfer-close] {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--panel-2);
  font-weight: 900;
}

.transfer-list {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 164px;
  overflow: auto;
}

.transfer-import {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(51, 144, 236, 0.14);
  border-radius: 12px;
  padding: 9px;
  background: rgba(51, 144, 236, 0.06);
}

.transfer-import label {
  display: grid;
  gap: 6px;
}

.transfer-import label span {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.transfer-import textarea {
  min-height: 74px;
  max-height: 130px;
  resize: vertical;
  border: 0;
  border-radius: 10px;
  padding: 9px 10px;
  color: var(--text);
  background: var(--panel-2);
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  outline: none;
}

.transfer-import textarea:focus {
  box-shadow: inset 0 0 0 2px rgba(51, 144, 236, 0.34);
}

.transfer-import textarea.is-invalid {
  box-shadow: inset 0 0 0 2px rgba(244, 63, 94, 0.55);
}

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

.transfer-import-footer small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-import-footer button {
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  padding: 0 11px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 900;
}

.transfer-import-footer button:disabled {
  cursor: default;
  opacity: 0.45;
}

.transfer-import-preview {
  min-height: 30px;
  display: grid;
  align-items: center;
  overflow: hidden;
  border-radius: 8px;
  padding: 6px 9px;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-import-preview.is-ready {
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.13);
}

.transfer-import-preview.is-duplicate {
  color: #a16207;
  background: rgba(245, 158, 11, 0.16);
}

.transfer-import-preview.is-invalid {
  color: #be123c;
  background: rgba(244, 63, 94, 0.14);
}

.transfer-ready {
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  font-size: 12px;
  font-weight: 900;
}

.transfer-empty {
  min-height: 164px;
  place-content: center;
  justify-items: center;
  padding: 24px 18px;
  border: 1px dashed rgba(51, 144, 236, 0.28);
  border-radius: 12px;
  text-align: center;
}

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

.transfer-file-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 26px;
  gap: 10px;
  min-height: 54px;
  align-items: center;
  border: 0;
  border-radius: 12px;
  padding: 8px;
  color: inherit;
  background: var(--panel-2);
  text-align: left;
}

.transfer-file-row:hover,
.transfer-file-row:focus-visible {
  background: rgba(51, 144, 236, 0.12);
  outline: none;
}

.transfer-file-row i {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
  font-size: 10px;
  font-style: normal;
  font-weight: 1000;
}

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

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

.transfer-file-row strong {
  font-size: 13px;
  font-weight: 900;
}

.transfer-file-row small {
  color: var(--muted);
  font-size: 12px;
}

.transfer-file-row b {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(100, 116, 139, 0.12);
  font-size: 14px;
}

.transfer-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
}

.transfer-actions button {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel-2);
  font-weight: 900;
}

.transfer-actions [data-transfer-send] {
  color: #ffffff;
  background: var(--accent);
}

.transfer-actions button:disabled {
  cursor: default;
  opacity: 0.48;
}

.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.is-keyboard-active,
.toast:focus-within {
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22), 0 0 0 3px rgba(94, 203, 255, 0.24);
}

.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 button:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.42);
}

.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;
}

.context-menu button.is-keyboard-active {
  background: var(--panel-2);
  box-shadow: inset 3px 0 0 var(--accent);
}

.room-context-menu {
  min-width: 260px;
  gap: 5px;
}

.room-menu-header {
  display: grid;
  min-width: 0;
  gap: 2px;
  border-bottom: 1px solid rgba(132, 150, 166, 0.18);
  padding: 5px 7px 8px;
}

.room-menu-header strong,
.room-menu-header small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-menu-header strong {
  font-size: 13px;
  font-weight: 900;
}

.room-menu-header small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.room-menu-mute-group {
  display: grid;
  gap: 3px;
  border-top: 1px solid rgba(132, 150, 166, 0.18);
  padding-top: 5px;
}

.room-menu-mute-group > span {
  padding: 0 7px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.room-menu-mute-group button {
  display: grid;
  min-height: 44px;
  gap: 1px;
  padding-block: 5px;
}

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

.room-menu-mute-group button b,
.room-menu-mute-group button small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-menu-mute-group button b {
  font-size: 12px;
}

.room-menu-mute-group button small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.room-menu-mute-group button.is-active small {
  color: rgba(255, 255, 255, 0.78);
}

.room-context-menu > button.is-danger {
  color: #8f1d3b;
  background: rgba(244, 63, 94, 0.1);
}

.room-context-menu > button.is-danger:hover,
.room-context-menu > button.is-danger.is-keyboard-active {
  color: #ffffff;
  background: #e5486d;
}

.room-context-menu > button:disabled,
.room-context-menu > button[aria-disabled="true"] {
  cursor: default;
  opacity: 0.46;
}

.media-viewer,
.detail-sheet,
.comment-thread-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],
.comment-thread-sheet[hidden] {
  display: none;
}

.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(10px);
}

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

.story-viewer-card {
  display: grid;
  gap: 12px;
  width: min(360px, calc(100vw - 28px));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 12px;
  color: #ffffff;
  background: linear-gradient(145deg, #17212b, #243447);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

.story-progress {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 4px;
}

.story-progress i {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

.story-progress i.is-active,
.story-progress i.is-seen {
  background: #ffffff;
}

.story-viewer-card header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.story-viewer-card header span:not(.story-avatar) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.story-viewer-card header strong,
.story-viewer-card header small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-viewer-card header small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 700;
}

.story-viewer-card [data-story-close] {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 900;
}

.story-viewer-card p {
  min-height: 140px;
  border-radius: 8px;
  padding: 14px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 15px;
  line-height: 1.45;
}

.story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.story-meta span {
  min-height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 4px 8px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 800;
  line-height: 14px;
}

.story-viewer-card footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
}

.story-viewer-card footer button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: rgba(51, 144, 236, 0.5);
  font-weight: 900;
}

.story-viewer-card footer button.is-danger {
  background: rgba(239, 68, 68, 0.72);
}

.media-viewer-card,
.detail-card,
.comment-thread-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;
}

.comment-thread-card {
  width: min(460px, calc(100vw - 24px));
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.comment-thread-card header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.comment-thread-card header span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.comment-thread-card header strong,
.comment-thread-card header small,
.comment-thread-source strong,
.comment-thread-source small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-thread-card header small,
.comment-thread-source small,
.comment-thread-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.comment-thread-card [data-comment-thread-close] {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel-2);
  font-weight: 900;
}

.comment-thread-source {
  display: grid;
  gap: 3px;
  margin: 12px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

.comment-thread-source span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

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

.comment-thread-item {
  display: grid;
  justify-self: start;
  max-width: min(92%, 360px);
  gap: 4px;
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--panel-2);
}

.comment-thread-item.is-mine {
  justify-self: end;
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
}

.comment-thread-item span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.comment-thread-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.comment-thread-empty {
  margin: 22px 0;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.comment-thread-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}

.comment-thread-form textarea {
  min-height: 38px;
  max-height: 96px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text);
  background: var(--panel-2);
  font: inherit;
}

.comment-thread-form button {
  min-width: 64px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 900;
}

.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-receipt-breakdown {
  display: grid;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 13px;
  padding: 8px;
  background: var(--panel-2);
}

.detail-receipt-breakdown header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.detail-receipt-breakdown header span,
.detail-receipt-breakdown header small {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-receipt-breakdown header small {
  color: var(--muted);
}

.detail-receipt-breakdown ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-receipt-breakdown li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(62px, auto) minmax(0, 0.85fr) minmax(72px, auto);
  gap: 8px;
  align-items: center;
  min-height: 28px;
  border-radius: 8px;
  padding: 5px 7px;
  background: var(--panel);
}

.detail-receipt-breakdown li b,
.detail-receipt-breakdown li span,
.detail-receipt-breakdown li small,
.detail-receipt-breakdown li time {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-receipt-breakdown li span {
  color: var(--accent);
}

.detail-receipt-breakdown li.is-read span {
  color: var(--green);
}

.detail-receipt-breakdown li small {
  color: var(--muted);
  font-weight: 800;
}

.detail-receipt-breakdown li time {
  color: var(--muted);
  font-weight: 800;
}

.detail-edit-history {
  display: grid;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 13px;
  padding: 8px;
  background: var(--panel-2);
}

.detail-edit-history header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.detail-edit-history header span,
.detail-edit-history header small {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-edit-history header small {
  color: var(--muted);
}

.detail-edit-history ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-edit-history li {
  display: grid;
  grid-template-columns: minmax(70px, auto) minmax(0, 1fr) minmax(72px, auto);
  gap: 8px;
  align-items: center;
  min-height: 30px;
  border-radius: 8px;
  padding: 5px 7px;
  background: var(--panel);
}

.detail-edit-history li.is-current {
  box-shadow: inset 3px 0 0 var(--accent);
}

.detail-edit-history li b,
.detail-edit-history li span,
.detail-edit-history li time {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-edit-history li span {
  color: var(--text);
}

.detail-edit-history li time {
  color: var(--muted);
  font-weight: 800;
}

.detail-reaction-breakdown {
  display: grid;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 13px;
  padding: 8px;
  background: var(--panel-2);
}

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

.detail-reaction-breakdown header span,
.detail-reaction-breakdown header small {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-reaction-breakdown header small {
  color: var(--muted);
}

.detail-reaction-breakdown ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-reaction-breakdown li {
  display: grid;
  grid-template-columns: minmax(28px, auto) minmax(0, 1fr) minmax(72px, auto);
  gap: 8px;
  align-items: center;
  min-height: 30px;
  border-radius: 8px;
  padding: 5px 7px;
  background: var(--panel);
}

.detail-reaction-breakdown li.is-mine {
  box-shadow: inset 3px 0 0 var(--accent);
}

.detail-reaction-breakdown li b,
.detail-reaction-breakdown li span,
.detail-reaction-breakdown li time {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-reaction-breakdown li b {
  font-size: 15px;
  line-height: 1;
}

.detail-reaction-breakdown li time {
  color: var(--muted);
  font-weight: 800;
}

.detail-token-breakdown {
  display: grid;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 13px;
  padding: 8px;
  background: var(--panel-2);
}

.detail-token-breakdown header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.detail-token-breakdown header span,
.detail-token-breakdown header small {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-token-breakdown header small {
  color: var(--muted);
}

.detail-token-breakdown ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-token-breakdown li {
  display: grid;
  grid-template-columns: minmax(64px, auto) minmax(0, 1fr) minmax(64px, auto);
  gap: 8px;
  align-items: center;
  min-height: 30px;
  border-radius: 8px;
  padding: 5px 7px;
  background: var(--panel);
}

.detail-token-breakdown li b,
.detail-token-breakdown li span,
.detail-token-breakdown li button {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-token-breakdown li span {
  color: var(--accent);
}

.detail-token-breakdown li button {
  min-height: 24px;
  border: 0;
  border-radius: 8px;
  padding: 0 8px;
  color: #ffffff;
  background: var(--accent);
}

.detail-token-breakdown li button:hover,
.detail-token-breakdown li button.is-active {
  filter: brightness(1.06);
}

.detail-deep-link {
  display: grid;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 13px;
  padding: 8px;
  background: var(--panel-2);
}

.detail-deep-link header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.detail-deep-link header span,
.detail-deep-link header small,
.detail-deep-link code {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-deep-link header small {
  color: var(--muted);
}

.detail-deep-link > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(56px, auto) minmax(56px, auto);
  gap: 6px;
  align-items: center;
}

.detail-deep-link code {
  border-radius: 8px;
  padding: 7px 8px;
  color: var(--accent);
  background: var(--panel);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.detail-deep-link button {
  min-height: 28px;
  border: 0;
  border-radius: 8px;
  padding: 0 9px;
  color: #ffffff;
  background: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.detail-deep-link button:hover,
.detail-deep-link button.is-active {
  filter: brightness(1.06);
}

.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 button:hover,
.detail-attachments button.is-active {
  background: rgba(51, 144, 236, 0.13);
  box-shadow: inset 3px 0 0 var(--accent);
}

.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,
.detail-actions button.is-active {
  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-family: var(--emoji-font);
  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;
  grid-template-columns: 60px minmax(0, 1fr);
  grid-template-areas:
    "avatar name"
    "avatar desc"
    "language language"
    "status status"
    "actions actions";
  align-items: center;
  justify-items: stretch;
  gap: 5px 10px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.profile-card .avatar.large {
  grid-area: avatar;
  justify-self: start;
  align-self: center;
  width: 60px;
  height: 60px;
  font-size: 17px;
}

.profile-card h2 {
  grid-area: name;
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.16;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-card p {
  grid-area: desc;
  max-width: none;
  min-width: 0;
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 12px;
  line-height: 1.25;
  white-space: normal;
}

.language-setting {
  grid-area: language;
  display: flex;
  width: min(100%, 328px);
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 8px;
  padding: 3px 3px 3px 10px;
  color: var(--muted);
  background: transparent;
}

.language-setting > span {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.language-options {
  display: grid;
  width: 124px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  border-radius: 8px;
  padding: 2px;
  background: color-mix(in srgb, var(--panel-2) 82%, transparent);
}

.language-options button {
  min-width: 0;
  min-height: 24px;
  border: 0;
  border-radius: 7px;
  padding: 0 7px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.language-options button:focus-visible {
  outline: 2px solid rgba(51, 144, 236, 0.5);
  outline-offset: 2px;
}

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

.profile-action-grid {
  grid-area: actions;
  display: flex;
  width: min(100%, 328px);
  max-width: 100%;
  align-items: flex-start;
  gap: 6px;
  margin-top: 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 2px 2px 4px;
  scroll-padding-inline: 4px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.profile-action-grid::-webkit-scrollbar {
  display: none;
}

.profile-action-grid button {
  display: grid;
  flex: 0 0 50px;
  width: 50px;
  min-width: 50px;
  min-height: 50px;
  place-items: center;
  gap: 3px;
  border: 0;
  border-radius: 8px;
  padding: 5px 3px;
  color: var(--text);
  background: transparent;
  font-size: 10px;
  font-weight: 900;
  scroll-snap-align: start;
  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.is-keyboard-active:not([aria-disabled="true"]) {
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.16);
  box-shadow: inset 0 0 0 2px rgba(51, 144, 236, 0.28), 0 8px 18px 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: transparent;
}

.profile-action-grid button.is-danger {
  color: #8f1d3b;
}

.profile-action-grid button.is-danger i {
  background: linear-gradient(145deg, #f43f5e, #f59e0b);
}

.profile-action-grid button.is-danger:hover:not([aria-disabled="true"]) {
  color: #8f1d3b;
  background: rgba(244, 63, 94, 0.12);
}

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

.profile-action-grid i svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-action-grid span {
  max-width: 100%;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.status-grid div {
  display: flex;
  min-width: 0;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 8px;
  padding: 0 8px;
}

.status-grid dt {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-grid dd {
  display: inline-flex;
  max-width: 150px;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  margin: 0;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 11px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

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

.member-list {
  --profile-tabs-sticky-offset: 54px;
  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: 38px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border: 0;
  min-height: 52px;
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

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

.profile-member-card.is-keyboard-active {
  background: rgba(51, 144, 236, 0.12);
  box-shadow: inset 0 0 0 2px rgba(51, 144, 236, 0.22);
}

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

.profile-member-card.is-online.is-keyboard-active {
  background: color-mix(in srgb, rgba(35, 171, 104, 0.12) 48%, rgba(51, 144, 236, 0.14));
}

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

.profile-member-card.is-online .profile-member-avatar::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 9px;
  height: 9px;
  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: 11px;
  font-weight: 700;
}

.profile-member-role {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  max-width: 74px;
  overflow: hidden;
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-member-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  max-width: 84px;
  overflow: hidden;
  border-radius: 999px;
  padding: 3px 7px;
  color: #0f6b5f;
  background: rgba(20, 184, 166, 0.14);
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-member-role.is-owner,
.profile-member-role.is-admin {
  color: #ffffff;
  background: #1677b8;
}

.profile-member-role.is-banned,
.profile-member-card.is-banned .profile-member-role {
  color: #8f1d3b;
  background: rgba(244, 63, 94, 0.14);
}

.profile-member-card.is-banned {
  background: rgba(244, 63, 94, 0.06);
}

.profile-member-card.is-role-admin .profile-member-avatar,
.profile-member-card.is-role-owner .profile-member-avatar {
  background: linear-gradient(145deg, #f59e0b, #3390ec);
}

.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(3, minmax(0, 1fr));
  gap: 4px;
}

.profile-stats b {
  display: grid;
  min-height: 44px;
  align-content: center;
  justify-items: center;
  gap: 1px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-2);
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
}

.profile-stats small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
}

.profile-session {
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-2);
}

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

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

.profile-session header h3 {
  margin: 0;
}

.profile-session header small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.profile-session header b {
  display: inline-grid;
  min-height: 24px;
  place-items: center;
  border-radius: 999px;
  padding: 0 9px;
  color: #148e56;
  background: rgba(35, 171, 104, 0.12);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-session header b.is-revoked {
  color: #b42318;
  background: rgba(255, 84, 73, 0.12);
}

.profile-session-grid {
  display: grid;
  gap: 4px;
  margin: 0;
}

.profile-session-grid div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 28px;
}

.profile-session-grid dt,
.profile-session-grid dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-session-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.profile-session-grid dd {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.profile-session-devices {
  display: grid;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 8px;
  padding: 8px;
  background: var(--panel);
}

.profile-session-devices header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.profile-session-devices header span,
.profile-session-devices header small {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-session-devices header small {
  color: var(--muted);
}

.profile-session-devices ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-session-devices li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) minmax(76px, auto);
  gap: 8px;
  align-items: center;
  min-height: 40px;
  border-radius: 8px;
  padding: 5px 7px;
  background: color-mix(in srgb, var(--panel-2) 78%, transparent);
}

.profile-session-devices li i {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
}

.profile-session-devices li span {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.profile-session-devices li strong,
.profile-session-devices li small,
.profile-session-devices li em,
.profile-session-devices p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-session-devices li strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.profile-session-devices li strong b {
  margin-left: 4px;
  border-radius: 999px;
  padding: 1px 5px;
  color: #126b46;
  background: rgba(35, 171, 104, 0.14);
  font-size: 9px;
  font-weight: 900;
}

.profile-session-devices li small,
.profile-session-devices li em,
.profile-session-devices p {
  color: var(--muted);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 800;
}

.profile-session-devices li.is-revoked {
  opacity: 0.68;
}

.profile-session-devices li.is-revoked i {
  background: #ef4444;
}

.profile-session-devices p {
  margin: 0;
}

.profile-session-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.profile-session-actions button {
  min-width: 0;
  min-height: 32px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
  font-size: 11px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-session-actions button:hover,
.profile-session-actions button:focus-visible {
  border-color: rgba(51, 144, 236, 0.44);
  background: rgba(51, 144, 236, 0.1);
}

.profile-session-actions button.is-danger {
  color: #b42318;
}

.profile-session-actions button:disabled,
.profile-session-actions button[aria-disabled="true"] {
  cursor: default;
  opacity: 0.45;
}

.profile-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.profile-overview-card {
  display: grid;
  min-width: 0;
  min-height: 52px;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 7px;
  color: var(--text);
  background: var(--panel-2);
  text-align: left;
}

.profile-overview-card:hover {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
  background: color-mix(in srgb, var(--panel-2) 82%, var(--accent) 18%);
}

.profile-overview-card.is-keyboard-active:not(.is-disabled) {
  border-color: var(--accent);
  background: rgba(51, 144, 236, 0.12);
  box-shadow: inset 3px 0 0 var(--accent);
}

.profile-overview-card.is-disabled {
  cursor: default;
  opacity: 0.55;
}

.profile-overview-card.is-disabled:hover {
  border-color: var(--line);
  background: var(--panel-2);
}

.profile-overview-preview {
  display: grid;
  width: 32px;
  height: 32px;
  min-width: 0;
  overflow: hidden;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(145deg, #3390ec, #0ea78a);
}

.profile-overview-preview img,
.profile-overview-preview i,
.profile-overview-empty {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  object-fit: cover;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.profile-overview-empty {
  color: var(--muted);
  background: var(--panel);
}

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

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

.profile-overview-copy strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 11px;
  font-weight: 900;
}

.profile-overview-copy b {
  display: inline-grid;
  flex: 0 0 auto;
  min-width: 18px;
  min-height: 18px;
  place-items: center;
  border-radius: 999px;
  padding: 0 5px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  font-size: 10px;
  font-weight: 900;
}

.profile-overview-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.profile-tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 2px -4px 4px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding: 6px 4px;
  scroll-padding-inline: 4px;
  scrollbar-width: none;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(14px);
}

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

.profile-tabs button {
  display: grid;
  flex: 0 0 auto;
  grid-auto-flow: column;
  grid-template-columns: minmax(0, max-content) auto;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  padding: 0 9px;
  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-keyboard-active:not(.is-active) {
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.profile-tabs button.is-active {
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.14);
  box-shadow: inset 0 -2px 0 var(--accent);
}

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

.profile-tabs b {
  display: inline-grid;
  min-width: 18px;
  min-height: 18px;
  place-items: center;
  border-radius: 999px;
  padding: 0 5px;
  color: inherit;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: 10px;
  opacity: 1;
}

.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 {
  position: relative;
  display: grid;
  min-width: 0;
}

.profile-shared-search::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 11px;
  z-index: 1;
  width: 12px;
  height: 12px;
  border: 2px solid var(--muted-2);
  border-radius: 999px;
  transform: translateY(-50%);
  pointer-events: none;
}

.profile-shared-search::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 23px;
  z-index: 1;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: var(--muted-2);
  transform: translateY(4px) rotate(45deg);
  pointer-events: none;
}

.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: 999px;
  padding: 0 32px 0 36px;
  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-search button {
  position: absolute;
  top: 50%;
  right: 3px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 0;
  font-weight: 800;
  line-height: 1;
  transform: translateY(-50%);
}

.profile-shared-search button::before,
.profile-shared-search button::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.profile-shared-search button::before {
  transform: rotate(45deg);
}

.profile-shared-search button::after {
  transform: rotate(-45deg);
}

.profile-shared-search button:hover,
.profile-shared-search button:focus-visible {
  color: #ffffff;
  background: var(--accent);
}

.profile-shared-search button[hidden] {
  display: none;
}

.profile-shared-sort {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  overflow: hidden;
  border-radius: 999px;
  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-sort button.is-keyboard-active:not(.is-active) {
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  box-shadow: inset 0 -3px 0 var(--accent);
}

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

.profile-transfer-filter {
  display: flex;
  grid-column: 1 / -1;
  min-width: 0;
  gap: 6px;
  overflow-x: auto;
  padding: 1px 0 2px;
  scrollbar-width: none;
}

.profile-transfer-filter::-webkit-scrollbar {
  display: none;
}

.profile-transfer-filter button {
  display: inline-grid;
  grid-template-columns: minmax(0, auto) auto;
  min-width: 0;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.profile-transfer-filter button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-transfer-filter button b {
  display: grid;
  min-width: 18px;
  min-height: 18px;
  place-items: center;
  border-radius: 999px;
  padding: 0 5px;
  color: inherit;
  background: rgba(51, 144, 236, 0.12);
  font-size: 10px;
  font-weight: 1000;
}

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

.profile-transfer-filter button.is-active b {
  background: rgba(255, 255, 255, 0.2);
}

.profile-transfer-filter button.is-keyboard-active:not(.is-active) {
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  box-shadow: inset 0 0 0 2px rgba(51, 144, 236, 0.24);
}

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

.profile-empty-state.has-action {
  display: grid;
  gap: 8px;
  align-items: center;
  justify-items: start;
}

.profile-empty-state.has-action p {
  margin: 0;
}

.profile-empty-actions {
  display: flex;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-empty-state.has-action button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  font-size: 11px;
  font-weight: 900;
}

.profile-empty-state.has-action button:hover,
.profile-empty-state.has-action button:focus-visible,
.profile-empty-state.has-action button.is-keyboard-active {
  color: #ffffff;
  background: var(--accent);
}

.profile-shared-more {
  display: inline-grid;
  grid-column: 1 / -1;
  grid-template-columns: auto auto;
  justify-self: center;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  font-size: 11px;
  font-weight: 900;
}

.profile-shared-more b {
  display: grid;
  min-width: 18px;
  min-height: 18px;
  place-items: center;
  border-radius: 999px;
  padding: 0 5px;
  color: inherit;
  background: rgba(51, 144, 236, 0.14);
  font-size: 10px;
  font-weight: 1000;
}

.profile-shared-more.is-secondary {
  color: var(--muted);
  background: var(--panel-2);
}

.profile-shared-more:hover,
.profile-shared-more:focus-visible,
.profile-shared-more.is-keyboard-active {
  color: #ffffff;
  background: var(--accent);
}

.profile-shared-more:hover b,
.profile-shared-more:focus-visible b,
.profile-shared-more.is-keyboard-active b {
  background: rgba(255, 255, 255, 0.22);
}

.shared-media {
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.profile-shared-header {
  position: sticky;
  top: var(--profile-tabs-sticky-offset);
  z-index: 2;
  display: grid;
  grid-column: 1 / -1;
  gap: 6px;
  margin: -2px -4px 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  padding: 4px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(14px);
}

.profile-shared-header h3 {
  margin: 0 2px;
}

.shared-media-card {
  display: grid;
  position: relative;
  min-width: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 10px;
  background: var(--panel-2);
}

.shared-media-main {
  display: grid;
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.shared-media-thumb {
  display: grid;
  width: 100%;
  height: 100%;
  overflow: hidden;
  place-items: center;
  border-radius: inherit;
  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;
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  min-width: 0;
  gap: 2px;
  padding: 22px 8px 7px;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.78));
}

.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: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.shared-media-main em {
  display: none;
}

.shared-media-card > button:not(.shared-media-main) {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  width: 32px;
  min-height: 30px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(10px);
  font-size: 0;
  font-weight: 900;
}

.shared-media-card > button:not(.shared-media-main) span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.shared-media-card > button:not(.shared-media-main)::before {
  width: 14px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 5px;
  content: "";
}

.shared-media-card > button:not(.shared-media-main)::after {
  position: absolute;
  bottom: 7px;
  left: 11px;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

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

.shared-media-card > button.is-keyboard-active:not(.shared-media-main) {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(51, 144, 236, 0.16);
}

.shared-files {
  gap: 6px;
}

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

.shared-file-main {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  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: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  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) {
  position: relative;
  display: grid;
  width: 32px;
  min-height: 32px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  font-size: 0;
  font-weight: 900;
}

.shared-file-card > button:not(.shared-file-main) span,
.shared-link-card button span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.shared-file-chat::before,
.shared-link-chat::before {
  width: 14px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 5px;
  content: "";
}

.shared-file-chat::after,
.shared-link-chat::after {
  position: absolute;
  bottom: 8px;
  left: 11px;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

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

.shared-file-card > button.is-keyboard-active:not(.shared-file-main) {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(51, 144, 236, 0.16);
}

.shared-media-main.is-keyboard-active,
.shared-file-main.is-keyboard-active,
.shared-transfer-main.is-keyboard-active,
.shared-link-card a.is-keyboard-active {
  box-shadow: inset 0 0 0 2px rgba(51, 144, 236, 0.26), 0 8px 18px rgba(51, 144, 236, 0.12);
}

.shared-transfers {
  gap: 7px;
}

.shared-transfers h3 {
  grid-column: 1 / -1;
}

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

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

.shared-transfer-main i {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(145deg, #3390ec, #0ea78a);
  font-size: 10px;
  font-style: normal;
  font-weight: 1000;
}

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

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

.shared-transfer-main strong {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 850;
}

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

.shared-transfer-status {
  justify-self: end;
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.shared-transfer-card.is-accepted .shared-transfer-status {
  color: #0f766e;
  background: rgba(15, 118, 110, 0.12);
}

.shared-transfer-card.is-prepared .shared-transfer-status {
  color: #8a4b0f;
  background: rgba(245, 158, 11, 0.16);
}

.shared-transfer-card.is-canceled {
  opacity: 0.72;
}

.shared-transfer-actions {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.shared-transfer-actions button {
  display: grid;
  min-width: 32px;
  min-height: 30px;
  place-items: center;
  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-transfer-actions .is-manifest,
.shared-transfer-actions .is-receipt,
.shared-transfer-actions .is-details {
  position: relative;
  width: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 0;
}

.shared-transfer-actions .is-manifest::before,
.shared-transfer-actions .is-receipt::before {
  width: 14px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 4px;
  content: "";
}

.shared-transfer-actions .is-manifest::after,
.shared-transfer-actions .is-receipt::after {
  position: absolute;
  top: 9px;
  left: 11px;
  width: 8px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
  content: "";
}

.shared-transfer-actions .is-receipt::before {
  border-radius: 50%;
}

.shared-transfer-actions .is-receipt::after {
  top: 14px;
  left: 10px;
  width: 12px;
  height: 2px;
  box-shadow: none;
  transform: rotate(-45deg);
}

.shared-transfer-actions .is-details::before {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 -7px 0 currentColor, 0 7px 0 currentColor;
  content: "";
}

.shared-transfer-actions button:hover,
.shared-transfer-actions button.is-keyboard-active {
  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;
  min-height: 56px;
  border-radius: 8px;
  background: var(--panel-2);
  padding: 6px;
}

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

.shared-link-card i {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  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 {
  position: relative;
  display: grid;
  width: 32px;
  min-height: 32px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0;
  color: var(--accent-dark);
  background: rgba(51, 144, 236, 0.12);
  font-size: 0;
  font-weight: 900;
}

.shared-link-copy::before,
.shared-link-copy::after {
  position: absolute;
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 4px;
  content: "";
}

.shared-link-copy::before {
  transform: translate(2px, -2px);
}

.shared-link-copy::after {
  transform: translate(-2px, 2px);
}

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

.shared-link-card button.is-keyboard-active {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(51, 144, 236, 0.16);
}

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"]) .chat[data-wallpaper="mint"] {
  --chat-bg: #102f2a;
  --chat-pattern: rgba(59, 197, 134, 0.14);
}

body:not([data-theme="light"]) .chat[data-wallpaper="ocean"] {
  --chat-bg: #102a42;
  --chat-pattern: rgba(51, 144, 236, 0.16);
}

body:not([data-theme="light"]) .chat[data-wallpaper="dusk"] {
  --chat-bg: #241c3a;
  --chat-pattern: rgba(167, 139, 250, 0.14);
}

body:not([data-theme="light"]) .chat[data-wallpaper="paper"] {
  --chat-bg: #302719;
  --chat-pattern: rgba(217, 185, 135, 0.13);
}

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"]) .topbar-workflows a.is-keyboard-active:not(.is-active) {
  background: rgba(91, 166, 232, 0.18);
}

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"]) .room-item.is-keyboard-active:not(.is-active),
body:not([data-theme="light"]) .room-tabs button.is-keyboard-active:not(.is-active) {
  background: rgba(91, 166, 232, 0.18);
}

body:not([data-theme="light"]) .folder-manage-row {
  background: color-mix(in srgb, var(--panel) 94%, transparent);
}

body:not([data-theme="light"]) .folder-manage-row [data-folder-manage] {
  color: #9bd0ff;
  background: rgba(91, 166, 232, 0.14);
}

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"]) .transfer-message-copy small,
body:not([data-theme="light"]) .transfer-message-copy em,
body:not([data-theme="light"]) .transfer-message-meta,
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-tools button,
body:not([data-theme="light"]) .composer-tools button {
  color: #d9e5ef;
  background: #17212b;
}

body:not([data-theme="light"]) .message-action-row button {
  color: #d9e5ef;
  background: transparent;
}

body:not([data-theme="light"]) .composer-tools [data-composer-hint] {
  color: #f8d36c;
  background: rgba(245, 158, 11, 0.16);
}

body:not([data-theme="light"]) .composer-translation-preview {
  color: #9bd0ff;
  background: rgba(51, 144, 236, 0.16);
}

body:not([data-theme="light"]) .composer-translation-preview span {
  color: var(--text);
}

body:not([data-theme="light"]) .composer-translation-preview [data-translation-target-cycle] {
  color: #ffffff;
  background: #3390ec;
}

body:not([data-theme="light"]) .composer-permissions,
body:not([data-theme="light"]) .composer textarea[data-permission-blocked="true"],
body:not([data-theme="light"]) .composer [data-attach][aria-disabled="true"] {
  color: #ffc0b8;
  background: rgba(248, 113, 113, 0.14);
}

body:not([data-theme="light"]) .composer-permissions strong {
  color: #ff9b91;
}

body:not([data-theme="light"]) .composer-permissions small {
  color: #ffc0b8;
}

body:not([data-theme="light"]) .composer-permission-chips [data-permission-chip] {
  color: #ffc0b8;
  background: rgba(248, 113, 113, 0.12);
}

body:not([data-theme="light"]) .composer-permission-chips [data-permission-chip].is-active,
body:not([data-theme="light"]) .send-button.is-permission-blocked {
  color: #ffffff;
  background: rgba(239, 68, 68, 0.86);
}

body:not([data-theme="light"]) .attachment-card,
body:not([data-theme="light"]) .attachment-stack.is-album,
body:not([data-theme="light"]) .transfer-message,
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"]) .bot-keyboard,
body:not([data-theme="light"]) .message-translation,
body:not([data-theme="light"]) .voice-transcript,
body:not([data-theme="light"]) .voice-message,
body:not([data-theme="light"]) .poll-card,
body:not([data-theme="light"]) .message-comment-chip,
body:not([data-theme="light"]) .comment-thread-item,
body:not([data-theme="light"]) .dice-message,
body:not([data-theme="light"]) .contact-card,
body:not([data-theme="light"]) .location-card,
body:not([data-theme="light"]) .call-card,
body:not([data-theme="light"]) .typing-indicator {
  background: rgba(91, 166, 232, 0.16);
}

body:not([data-theme="light"]) .poll-option {
  background: rgba(23, 33, 43, 0.62);
}

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

body:not([data-theme="light"]) .contact-actions button {
  color: #d9e5ef;
  background: rgba(91, 166, 232, 0.18);
}

body:not([data-theme="light"]) .dice-message [data-dice-reroll] {
  color: #d9e5ef;
  background: rgba(91, 166, 232, 0.18);
}

body:not([data-theme="light"]) .message-translation-original {
  background: rgba(23, 33, 43, 0.58);
}

body:not([data-theme="light"]) .message-translation [data-translation-hide],
body:not([data-theme="light"]) .message-translation [data-translation-original-toggle] {
  color: #d9e5ef;
  background: rgba(91, 166, 232, 0.18);
}

body:not([data-theme="light"]) .voice-message .voice-transcript-toggle,
body:not([data-theme="light"]) .voice-transcript [data-voice-transcript-hide] {
  color: #d9e5ef;
  background: rgba(79, 174, 78, 0.18);
}

body:not([data-theme="light"]) .location-map {
  background:
    linear-gradient(135deg, rgba(91, 166, 232, 0.2), rgba(79, 174, 78, 0.18)),
    #17212b;
}

body:not([data-theme="light"]) .location-actions button {
  color: #d9e5ef;
  background: rgba(91, 166, 232, 0.18);
}

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

body:not([data-theme="light"]) .call-actions button {
  color: #d9e5ef;
  background: rgba(91, 166, 232, 0.18);
}

body:not([data-theme="light"]) .call-actions button:disabled {
  color: #91a3b4;
  background: rgba(125, 139, 153, 0.18);
}

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"]) .inline-bot-badge {
  color: #8de6d8;
  background: rgba(20, 184, 166, 0.14);
}

body:not([data-theme="light"]) .bot-keyboard-button {
  color: #7ab8f5;
  background: rgba(91, 166, 232, 0.18);
}

body:not([data-theme="light"]) .bot-keyboard-button.is-selected,
body:not([data-theme="light"]) .bot-keyboard-button:hover {
  color: #ffffff;
  background: #3390ec;
}

body:not([data-theme="light"]) .bot-keyboard-button.is-url {
  color: #8de6d8;
  background: rgba(20, 184, 166, 0.14);
}

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-preview,
body:not([data-theme="light"]) .forward-preview-item,
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-mode-tabs,
body:not([data-theme="light"]) .media-picker-item.is-active,
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 10px 30px 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 10px 30px 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"]) .scroll-bottom span {
  border-color: #17212b;
}

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"]) .topic-strip,
body:not([data-theme="light"]) .hashtag-strip,
body:not([data-theme="light"]) .reaction-picker,
body:not([data-theme="light"]) .forward-sheet,
body:not([data-theme="light"]) .new-chat-card,
body:not([data-theme="light"]) .folder-card,
body:not([data-theme="light"]) .transfer-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"]) .topic-strip button,
body:not([data-theme="light"]) .topic-badge,
body:not([data-theme="light"]) .hashtag-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-member-card.is-keyboard-active,
body:not([data-theme="light"]) .profile-overview-card,
body:not([data-theme="light"]) .profile-overview-empty,
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"]) .profile-shared-more,
body:not([data-theme="light"]) .profile-transfer-filter button,
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-transfer-card,
body:not([data-theme="light"]) .shared-transfer-actions button,
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"]) .folder-card [data-folder-close],
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"]) .folder-create input,
body:not([data-theme="light"]) .folder-item:hover,
body:not([data-theme="light"]) .new-chat-contacts button:hover,
body:not([data-theme="light"]) .transfer-card [data-transfer-close],
body:not([data-theme="light"]) .transfer-file-row,
body:not([data-theme="light"]) .transfer-import,
body:not([data-theme="light"]) .transfer-import textarea,
body:not([data-theme="light"]) .transfer-import-preview,
body:not([data-theme="light"]) .transfer-actions button,
body:not([data-theme="light"]) .transfer-empty {
  background: #242f3d;
}

body:not([data-theme="light"]) .profile-action-grid button {
  background: transparent;
}

body:not([data-theme="light"]) .transfer-import-preview.is-ready {
  color: #9bd1ff;
  background: rgba(91, 166, 232, 0.18);
}

body:not([data-theme="light"]) .transfer-import-preview.is-duplicate {
  color: #facc15;
  background: rgba(250, 204, 21, 0.16);
}

body:not([data-theme="light"]) .transfer-import-preview.is-invalid {
  color: #fda4af;
  background: rgba(251, 113, 133, 0.16);
}

body:not([data-theme="light"]) .profile-tabs button.is-keyboard-active:not(.is-active),
body:not([data-theme="light"]) .profile-overview-card.is-keyboard-active:not(.is-disabled),
body:not([data-theme="light"]) .profile-action-grid button.is-keyboard-active:not([aria-disabled="true"]),
body:not([data-theme="light"]) .profile-shared-sort button.is-keyboard-active:not(.is-active),
body:not([data-theme="light"]) .profile-transfer-filter button.is-keyboard-active:not(.is-active) {
  background: rgba(91, 166, 232, 0.18);
}

body:not([data-theme="light"]) .profile-tabs button.is-active {
  color: #9bd1ff;
  background: rgba(91, 166, 232, 0.18);
}

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-options button.is-keyboard-active,
body:not([data-theme="light"]) .notification-read-toggle.is-keyboard-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"]) .scheduled-queue-main.is-active,
body:not([data-theme="light"]) .scheduled-queue-actions button.is-active,
body:not([data-theme="light"]) .context-menu button.is-keyboard-active {
  background: rgba(91, 166, 232, 0.24);
}

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"]) .context-menu button.is-active,
body:not([data-theme="light"]) .detail-attachments button.is-active {
  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.1);
}

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 14px 36px rgba(0, 0, 0, 0.34);
}

body:not([data-theme="light"]) .pinned-popover-item {
  background: transparent;
}

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.18);
}

/* Keep the static shell precise before app state hydrates. */
.brand-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
}

.home-button,
.icon-button,
.mobile-back,
.send-button,
.window-controls button,
.chat-search-bar button,
.date-jump-panel header button,
.notification-panel header button,
.attach-panel [data-attach-close] {
  align-content: center;
  justify-content: center;
  justify-items: center;
  line-height: 0;
}

.send-button svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.25;
  transform: translateX(1px);
}

.send-button[data-send-mode] > svg {
  display: none;
}

.search-box input {
  height: 38px;
  min-height: 38px;
}

.room-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 8px 0;
}

.room-tabs button {
  flex: 1 0 max-content;
  width: auto;
  min-width: 50px;
  min-height: 34px;
  padding: 0 8px 5px;
}

.room-tabs .tab-label {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.chat-actions {
  align-items: center;
}

.chat-actions .icon-button {
  display: grid;
  place-items: center;
}

.composer {
  align-items: center;
}

.composer .icon-button,
.send-button {
  flex: 0 0 var(--composer-control);
}

.composer textarea {
  align-self: center;
  line-height: 1.35;
}

/* Profile panel rhythm: compact, scannable settings controls. */
.profile-card {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel-2) 54%, transparent), transparent 72%),
    var(--panel);
}

.profile-card h2,
.profile-card p {
  max-width: 100%;
}

.language-setting {
  width: 100%;
  min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 8px;
  padding: 4px;
  background: color-mix(in srgb, var(--panel-2) 76%, transparent);
}

.language-setting > span {
  padding-inline: 8px;
}

.language-options {
  width: 132px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
}

.language-options button {
  min-height: 28px;
  border-radius: 6px;
  font-size: 11px;
}

.profile-status-row {
  align-self: center;
  min-height: 22px;
  overflow: hidden;
}

.profile-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  gap: 6px;
  overflow: visible;
  padding: 2px 0 0;
  scroll-snap-type: none;
}

.profile-action-grid button {
  width: 100%;
  min-width: 0;
  min-height: 60px;
  grid-template-rows: 30px minmax(14px, auto);
  justify-items: center;
  align-content: center;
  gap: 5px;
  border-radius: 8px;
  padding: 6px 4px;
  background: color-mix(in srgb, var(--panel-2) 64%, transparent);
}

.profile-action-grid button:hover,
.profile-action-grid button.is-keyboard-active:not([aria-disabled="true"]) {
  transform: none;
}

.profile-action-grid i {
  width: 30px;
  height: 30px;
}

.profile-action-grid i svg {
  width: 16px;
  height: 16px;
}

.profile-action-grid span {
  max-width: 100%;
  min-width: 0;
  font-size: 10px;
  line-height: 1.15;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 6px 12px 10px;
}

.status-grid div {
  min-height: 32px;
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--panel-2) 42%, transparent);
}

.status-grid dd {
  max-width: 168px;
}

@media (max-width: 980px) {
  :root {
    --sidebar-width: 320px;
  }

  .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;
    --sidebar-width: 0px;
  }

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

  .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;
  }

  .profile-panel {
    width: 100vw;
    max-width: none;
    border-left: 0;
  }

  .profile-card {
    padding-inline: 12px;
  }

  .status-grid {
    padding-inline: 12px;
  }

  .status-grid div {
    gap: 8px;
  }

  .status-grid dd {
    max-width: min(58vw, 190px);
  }

  .member-list {
    padding-inline: 8px;
  }

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

  .chat {
    z-index: 1;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(100%);
    transition: transform 0.18s ease, visibility 0.18s ease;
  }

  .app-shell.chat-open .chat {
    z-index: 12;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
  }

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

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

  .message {
    max-width: 86%;
  }

  .message-tools {
    display: none;
  }

  .scroll-bottom {
    right: 12px;
    bottom: 72px;
  }

  .unread-jump {
    right: 60px;
    bottom: 75px;
    max-width: calc(100% - 76px);
  }

  .scroll-date-float {
    top: 106px;
    right: 12px;
  }

  .date-jump-panel {
    right: 12px;
    width: min(288px, calc(100% - 24px));
  }

  .message-select {
    left: 8px;
    width: 22px;
    height: 22px;
  }

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

  body.has-selection-mode .message:not(.is-mine),
  .chat.has-selection-mode .message:not(.is-mine),
  .message.is-selected:not(.is-mine) {
    padding-left: 38px;
  }

  body.has-selection-mode .message.is-mine,
  .chat.has-selection-mode .message.is-mine,
  .message.is-selected.is-mine {
    padding-right: 38px;
  }

  .message-action-row {
    max-width: 100%;
    overflow: hidden;
  }

  .message-action-row button {
    width: 26px;
    height: 24px;
  }

  .message-action-row [data-select-message] {
    display: none;
  }

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

  .chat-header {
    min-height: 62px;
    padding-block: 6px;
  }

  .chat-meta-row {
    align-items: flex-start;
    gap: 3px 5px;
    overflow: visible;
  }

  .chat-meta-row [data-room-meta] {
    flex-basis: auto;
    max-width: min(150px, 32vw);
  }

  .chat-status-chips {
    flex-wrap: wrap;
    overflow: visible;
    max-height: 38px;
  }

  .chat-status-chips .status-chip {
    height: 17px;
    max-width: 104px;
    padding-inline: 5px;
    font-size: 9px;
  }

  .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,
  .composer-tools {
    width: 100%;
    margin-left: 0;
  }

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

  .composer-tools {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .composer-permissions {
    flex-basis: 100%;
    border-radius: 10px;
  }

  .composer-permission-chips {
    flex-wrap: wrap;
  }

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

  .attach-panel {
    left: 8px;
    right: 8px;
    width: auto;
    max-height: min(300px, calc(100vh - var(--topbar-height) - 132px));
    overflow-y: auto;
  }

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

  .media-picker-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 214px;
  }

  .media-picker-item {
    min-height: 88px;
  }

  .selection-bar {
    top: 8px;
    left: 50%;
    grid-template-columns: minmax(118px, 1fr) repeat(10, max-content);
    width: calc(100vw - 16px);
    overflow-x: auto;
    border-radius: 18px;
    padding-left: 12px;
  }

  .selection-spacer {
    display: none;
  }

  .selection-meta {
    max-width: 170px;
  }

  .selection-badges {
    max-width: 220px;
  }

  .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: 420px) {
  .app-topbar {
    gap: 5px;
    padding-inline: 6px;
  }

  .topbar-brand {
    width: 32px;
    justify-content: center;
  }

  .topbar-brand span {
    display: none;
  }

  .topbar-workflows {
    gap: 2px;
  }

  .topbar-right,
  .window-controls {
    gap: 2px;
  }

  .chat-header {
    gap: 6px;
    min-height: 66px;
    align-items: center;
  }

  .mobile-back {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .chat-title {
    flex: 1 1 0;
    gap: 8px;
    min-height: 52px;
    padding-left: 0;
    padding-right: 2px;
  }

  .chat-title .avatar {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    font-size: 11px;
  }

  .chat-title strong {
    font-size: 14px;
  }

  .chat-title-copy [data-room-meta] {
    font-size: 11px;
  }

  .chat-meta-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 2px;
  }

  .chat-meta-row [data-room-meta] {
    max-width: 100%;
  }

  .chat-status-chips {
    max-height: 38px;
  }

  .chat-status-chips .status-chip {
    max-width: 118px;
  }

  .chat-actions {
    flex: 0 0 auto;
    gap: 4px;
  }

  .chat-actions [data-toggle-notifications],
  .chat-actions [data-refresh-status] {
    display: none;
  }

  .chat-actions .icon-button {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 16px;
  }

  .voice-message {
    grid-template-columns: 30px minmax(68px, 1fr) 56px auto;
    gap: 5px;
    min-width: min(252px, 78vw);
    padding: 6px;
  }

  .voice-message [data-voice-play] {
    width: 30px;
    height: 30px;
    font-size: 10px;
  }

  .voice-message time {
    min-width: 56px;
    font-size: 11px;
  }

  .voice-message .voice-transcript-toggle {
    min-width: 36px;
    height: 24px;
    padding-inline: 6px;
    font-size: 10px;
  }

  .voice-transcript {
    max-width: min(252px, 100%);
  }

  .profile-action-grid {
    width: 100%;
    gap: 5px;
    padding: 1px 2px 4px;
  }

  .profile-action-grid button {
    flex-basis: 48px;
    width: 48px;
    min-width: 48px;
    min-height: 46px;
  }

  .room-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    padding-inline: 7px;
    overflow-x: hidden;
    scroll-padding-inline: 7px;
  }

  .room-tabs button {
    width: 100%;
    max-width: none;
    min-width: 0;
    justify-content: center;
    gap: 0;
    padding: 0 2px 5px;
  }

  .tab-icon {
    display: none;
  }

  .tab-label {
    max-width: 100%;
    min-width: 0;
    font-size: 10px;
    line-height: 1;
  }

  .tab-count {
    display: none;
  }
}

@media (max-width: 380px) {
  .app-topbar {
    gap: 4px;
    padding-inline: 5px;
  }

  .topbar-brand {
    width: 30px;
  }

  .topbar-brand img {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
  }

  .topbar-workflows {
    justify-content: center;
    gap: 1px;
    overflow-x: hidden;
  }

  .topbar-workflows a {
    width: 30px;
    height: 32px;
  }

  .workflow-icon svg {
    width: 17px;
    height: 17px;
  }

  .global-search-results {
    gap: 4px;
    max-height: min(232px, calc(100vh - var(--topbar-height) - 126px));
    padding: 6px 5px;
  }

  .global-search-section {
    gap: 2px;
  }

  .global-search-section > strong {
    padding: 2px 6px 1px;
    font-size: 10px;
  }

  .global-search-section button {
    grid-template-columns: 30px minmax(0, 1fr) minmax(44px, auto);
    gap: 7px;
    min-height: 42px;
    border-radius: 9px;
    padding: 5px 6px;
  }

  .global-search-kind {
    width: 30px;
    height: 30px;
    font-size: 10px;
  }

  .global-search-section b {
    font-size: 12px;
  }

  .global-search-section small,
  .global-search-section time {
    font-size: 10px;
  }

  .global-search-section time {
    max-width: 62px;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
  }

  .global-search-empty {
    margin: 4px;
    padding: 10px 8px;
  }

  .pinned-strip {
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
    min-height: 32px;
    padding: 4px 10px 4px 16px;
  }

  .pinned-strip::before {
    top: 6px;
    bottom: 6px;
    left: 7px;
    width: 2px;
  }

  .pinned-strip strong {
    font-size: 10px;
  }

  .pinned-strip span {
    font-size: 11px;
  }

  .pinned-popover {
    right: 8px;
    left: 8px;
    width: auto;
    gap: 5px;
    max-height: min(240px, calc(100vh - var(--topbar-height) - 118px));
    padding: 5px;
  }

  .pinned-popover header {
    gap: 8px;
    padding: 1px 1px 2px 5px;
  }

  .pinned-popover header button {
    width: 28px;
    height: 28px;
  }

  .pinned-popover-list {
    gap: 3px;
    max-height: min(184px, calc(100vh - var(--topbar-height) - 178px));
    padding-right: 0;
  }

  .pinned-popover-item {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 7px;
    min-height: 40px;
    padding: 5px 7px 5px 5px;
  }

  .pinned-popover-item b {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .pinned-popover-item span {
    gap: 1px;
  }

  .pinned-popover-item strong {
    font-size: 11px;
  }

  .pinned-popover-item small,
  .pinned-popover-item time {
    font-size: 9.5px;
  }

  .pinned-popover-item time {
    grid-column: 2;
    max-width: 100%;
    overflow: hidden;
    justify-self: start;
    text-overflow: ellipsis;
  }

  .media-viewer {
    padding: 8px;
  }

  .media-viewer-card {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    border-radius: 12px;
  }

  .media-viewer-header,
  .media-viewer-footer {
    gap: 6px;
    padding: 7px 8px;
  }

  .media-viewer-header {
    min-height: 42px;
  }

  .media-viewer-card [data-media-close] {
    width: 30px;
    height: 30px;
  }

  .media-viewer-card [data-media-viewer-content] {
    min-height: min(214px, calc(100vh - 158px));
    padding: 14px 38px;
  }

  .media-nav {
    width: 34px;
    height: 34px;
    font-size: 22px;
  }

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

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

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

  .media-file-icon {
    width: 92px;
    height: 92px;
    border-radius: 20px;
  }

  .media-viewer-card img {
    max-height: min(214px, calc(100vh - 158px));
    border-radius: 10px;
  }

  .media-viewer-footer {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 58px;
  }

  .media-viewer-footer button {
    min-height: 30px;
    padding: 0 10px;
    font-size: 11px;
  }

  .media-viewer-strip {
    gap: 5px;
    padding: 6px 8px 8px;
  }

  .media-viewer-strip button {
    width: 60px;
    min-width: 60px;
    border-radius: 10px;
    padding: 4px;
  }

  .media-viewer-strip img,
  .media-viewer-strip i {
    width: 50px;
    height: 38px;
    border-radius: 7px;
  }

  .poll-card {
    min-width: min(244px, 100%);
    gap: 6px;
    padding: 8px;
  }

  .poll-card header strong {
    font-size: 13px;
  }

  .poll-option {
    min-height: 32px;
    padding: 6px 8px;
  }

  .poll-option-label,
  .poll-option-meta,
  .poll-summary {
    font-size: 11px;
  }

  .sticker-message {
    width: min(136px, 48vw);
  }

  .sticker-art {
    width: min(116px, 42vw);
    border-radius: 22px 22px 16px 22px;
  }

  .sticker-art b {
    font-size: 30px;
  }

  .sticker-message small {
    font-size: 11px;
  }

  .gif-message {
    width: min(160px, 54vw);
  }

  .gif-art {
    width: min(152px, 52vw);
  }

  .gif-art b {
    font-size: 28px;
  }

  .gif-message small {
    font-size: 11px;
  }

  .dice-message {
    width: min(148px, 52vw);
    gap: 6px;
    padding: 8px;
  }

  .dice-art {
    width: min(96px, 36vw);
    border-radius: 20px;
  }

  .dice-art b {
    font-size: 24px;
  }

  .dice-art strong {
    right: 7px;
    bottom: 6px;
    min-width: 23px;
    height: 23px;
    font-size: 12px;
  }

  .dice-caption b,
  .dice-caption small,
  .dice-message [data-dice-reroll] {
    font-size: 11px;
  }

  .video-note-message {
    width: min(144px, 50vw);
    gap: 6px;
  }

  .video-note-ring {
    width: min(104px, 38vw);
    border-width: 3px;
  }

  .video-note-poster {
    font-size: 24px;
  }

  .video-note-play-icon {
    right: 10px;
    bottom: 9px;
    padding: 2px 6px;
    font-size: 8px;
  }

  .video-note-caption strong,
  .video-note-caption small {
    font-size: 11px;
  }

  .contact-card {
    grid-template-columns: 36px minmax(0, 1fr);
    min-width: min(232px, 100%);
    gap: 7px;
    padding: 8px;
  }

  .contact-avatar {
    width: 36px;
    height: 36px;
    font-size: 11px;
  }

  .contact-main strong {
    font-size: 13px;
  }

  .contact-main small,
  .contact-actions button {
    font-size: 11px;
  }

  .contact-actions button {
    min-height: 28px;
  }

  .location-card {
    grid-template-columns: 58px minmax(0, 1fr);
    min-width: min(232px, 100%);
    gap: 7px;
    padding: 8px;
  }

  .location-map {
    width: 58px;
    height: 58px;
  }

  .location-pin {
    top: 16px;
    left: 26px;
  }

  .location-main strong {
    font-size: 13px;
  }

  .location-main small,
  .location-actions button {
    font-size: 11px;
  }

  .location-live-badge {
    padding: 1px 6px;
    font-size: 9px;
  }

  .location-live-progress {
    height: 3px;
  }

  .location-actions button {
    min-height: 28px;
  }

  .hashtag-strip {
    gap: 5px;
    padding: 5px 8px;
  }

  .hashtag-strip-label {
    display: none;
  }

  .hashtag-strip button {
    min-height: 26px;
    padding: 0 8px;
    font-size: 11px;
  }

  .hashtag-strip button b {
    max-width: 92px;
  }

  .call-card {
    grid-template-columns: 36px minmax(0, 1fr);
    min-width: min(232px, 100%);
    gap: 7px;
    padding: 8px;
  }

  .call-icon {
    width: 36px;
    height: 36px;
    font-size: 10px;
  }

  .call-main strong {
    font-size: 13px;
  }

  .call-main small,
  .call-actions button {
    font-size: 11px;
  }

  .call-status {
    padding: 1px 6px;
    font-size: 9px;
  }

  .call-actions button {
    min-height: 28px;
  }

  .reaction-picker {
    width: calc(100vw - 16px);
    max-height: min(248px, calc(100vh - var(--topbar-height) - 80px));
    gap: 6px;
    overflow-y: auto;
    border-radius: 12px;
    padding: 8px;
  }

  .reaction-picker header {
    gap: 8px;
  }

  .reaction-picker [data-reaction-close] {
    width: 28px;
    height: 28px;
  }

  .reaction-picker-section {
    gap: 4px;
  }

  .reaction-picker-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
  }

  .reaction-picker [data-picker-reaction] {
    width: 100%;
    height: 34px;
    border-radius: 9px;
    font-size: 19px;
  }

  .reaction-picker [data-picker-reaction] small {
    right: 3px;
    bottom: 1px;
    font-size: 9px;
  }

  .composer-suggestions {
    max-height: min(242px, calc(100vh - var(--topbar-height) - 168px));
    overflow-y: auto;
    border-radius: 12px;
    padding: 5px;
  }

  .composer-suggestion-header {
    gap: 6px;
    padding: 2px 6px 6px;
  }

  .composer-suggestions button {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 38px;
    padding-inline: 7px;
  }

  .composer-suggestion-avatar {
    width: 28px;
    height: 28px;
    font-size: 10px;
  }

  .composer {
    grid-template-columns: 36px 36px minmax(0, 1fr) 40px;
    column-gap: 6px;
    padding: 6px;
  }

  .composer .icon-button {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    font-size: 16px;
  }

  .composer textarea {
    min-height: 40px;
    border-radius: 20px;
    padding: 9px 14px;
  }

  .send-button {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .emoji-panel {
    position: fixed;
    max-height: min(268px, calc(100vh - var(--topbar-height) - 132px));
    overflow-y: auto;
    right: 8px;
    bottom: 62px;
    left: 8px;
    width: auto;
    border-radius: 12px;
    padding: 8px;
  }

  .emoji-panel-header {
    gap: 6px;
  }

  .emoji-search input {
    height: 32px;
  }

  .emoji-tabs {
    gap: 4px;
  }

  .emoji-tabs button {
    height: 26px;
    padding-inline: 8px;
    font-size: 11px;
  }

  .emoji-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 4px;
    max-height: 132px;
  }

  .emoji-grid button {
    height: 32px;
    min-width: 0;
    border-radius: 8px;
    font-size: 18px;
  }

  .attach-panel {
    padding: 8px;
  }

  .attach-panel-header {
    gap: 8px;
  }

  .attach-action {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    min-height: 48px;
    padding: 6px 8px 6px 6px;
  }

  .attach-action i {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .context-menu {
    min-width: min(236px, calc(100vw - 16px));
    max-height: min(348px, calc(100vh - var(--topbar-height) - 64px));
    gap: 2px;
    border-radius: 12px;
    padding: 6px;
  }

  .context-menu button {
    min-height: 34px;
    border-radius: 8px;
    padding: 0 10px;
    font-size: 13px;
  }

  .room-context-menu {
    width: min(248px, calc(100vw - 16px));
    min-width: 0;
    max-height: min(336px, calc(100vh - 64px));
    gap: 1px;
    padding: 5px;
  }

  .room-context-menu > button {
    min-height: 32px;
    padding: 0 9px;
  }

  .room-menu-header {
    gap: 1px;
    padding: 4px 6px 6px;
  }

  .room-menu-mute-group {
    gap: 1px;
    padding-top: 4px;
  }

  .room-menu-mute-group > span {
    padding: 0 6px 1px;
    font-size: 10px;
  }

  .room-menu-mute-group button {
    min-height: 30px;
    gap: 0;
    padding-block: 3px;
  }

  .room-menu-mute-group button small {
    display: none;
  }

  .context-reaction-strip {
    grid-template-columns: repeat(6, 28px);
    gap: 3px;
    margin-bottom: 2px;
    padding: 1px 1px 6px;
  }

  .context-reaction-strip button {
    width: 28px;
    height: 28px;
    min-height: 28px;
    font-size: 16px;
  }

  .context-menu [data-menu-react] {
    order: 10;
  }

  .context-menu [data-menu-reply] {
    order: 20;
  }

  .context-menu [data-menu-forward] {
    order: 30;
  }

  .context-menu [data-menu-copy] {
    order: 40;
  }

  .context-menu [data-menu-select] {
    order: 50;
  }

  .context-menu [data-menu-pin] {
    order: 60;
  }

  .context-menu [data-menu-save] {
    order: 70;
  }

  .context-menu [data-menu-link] {
    order: 80;
  }

  .context-menu [data-menu-info] {
    order: 90;
  }

  .context-menu [data-menu-unread] {
    order: 100;
  }

  .context-menu [data-menu-edit] {
    order: 110;
  }

  .context-menu [data-menu-delete-local] {
    order: 120;
  }

  .context-menu [data-menu-delete] {
    order: 130;
  }

  .forward-sheet {
    bottom: 8px;
    max-height: min(392px, calc(100vh - var(--topbar-height) - 16px));
    gap: 4px;
    overflow: hidden;
    border-radius: 14px;
    padding: 7px;
  }

  .forward-sheet header {
    min-height: 36px;
    gap: 8px;
    padding: 0 2px 2px 8px;
  }

  .forward-sheet header button {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .forward-search {
    padding: 0 2px 1px;
  }

  .forward-search input {
    min-height: 34px;
    border-radius: 10px;
    padding-inline: 10px;
  }

  .forward-preview {
    gap: 4px;
    border-radius: 10px;
    padding: 6px;
  }

  .forward-preview header {
    min-height: 24px;
  }

  .forward-preview > div {
    display: none;
  }

  .forward-preview-item {
    grid-template-columns: minmax(46px, auto) minmax(0, 1fr) auto;
    gap: 5px;
    padding: 4px 6px;
  }

  .forward-quick {
    padding: 0 2px;
  }

  .forward-quick button {
    min-height: 34px;
    border-radius: 10px;
  }

  .forward-targets {
    min-height: 132px;
    gap: 1px;
  }

  .forward-targets button {
    grid-template-columns: 38px minmax(0, 1fr) minmax(42px, auto);
    gap: 8px;
    min-height: 48px;
    border-radius: 10px;
    padding: 5px 6px;
  }

  .forward-targets .avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    font-size: 12px;
  }

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

  .forward-targets small {
    font-size: 11px;
  }

  .forward-targets b {
    max-width: 64px;
    padding: 3px 6px;
    font-size: 9px;
  }

  .new-chat-sheet {
    padding: 6px;
  }

  .new-chat-card {
    max-height: min(520px, calc(100vh - 12px));
    gap: 6px;
    border-radius: 16px 16px 10px 10px;
    padding: 8px;
  }

  .new-chat-card header {
    min-height: 34px;
    gap: 8px;
  }

  .new-chat-card header strong {
    font-size: 16px;
  }

  .new-chat-card header button {
    width: 32px;
    height: 32px;
  }

  .new-chat-mode,
  .new-chat-actions {
    gap: 6px;
  }

  .new-chat-mode button,
  .new-chat-actions button {
    min-height: 34px;
    border-radius: 9px;
    font-size: 13px;
  }

  .new-chat-search {
    gap: 4px;
  }

  .new-chat-search span {
    font-size: 11px;
  }

  .new-chat-search input {
    min-height: 36px;
    border-radius: 10px;
    padding-inline: 10px;
  }

  .new-chat-contacts {
    gap: 2px;
  }

  .new-chat-contacts button {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px;
    min-height: 50px;
    border-radius: 10px;
    padding: 5px 6px;
  }

  .new-chat-contacts .avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    font-size: 12px;
  }

  .new-chat-contacts strong {
    font-size: 13px;
  }

  .new-chat-contacts small {
    font-size: 11px;
  }

  .new-chat-empty {
    padding: 18px 10px;
  }

  .folder-sheet {
    padding: 6px;
  }

  .folder-card {
    max-height: min(520px, calc(100vh - 12px));
    gap: 7px;
    border-radius: 16px 16px 10px 10px;
    padding: 8px;
  }

  .folder-card header {
    min-height: 34px;
  }

  .folder-card header strong {
    font-size: 16px;
  }

  .folder-create {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .folder-create input,
  .folder-create button {
    min-height: 36px;
  }

  .folder-item {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 8px;
    padding: 6px;
  }

  .folder-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .folder-item-actions button {
    min-height: 26px;
    padding-inline: 8px;
  }

  .transfer-sheet {
    padding: 6px;
  }

  .transfer-card {
    max-height: min(520px, calc(100vh - 12px));
    gap: 8px;
    border-radius: 16px 16px 10px 10px;
    padding: 8px;
  }

  .transfer-card header {
    min-height: 34px;
  }

  .transfer-card header strong {
    font-size: 16px;
  }

  .transfer-list {
    min-height: 132px;
  }

  .transfer-import {
    gap: 6px;
    padding: 7px;
  }

  .transfer-import textarea {
    min-height: 66px;
  }

  .transfer-import-footer {
    grid-template-columns: 1fr;
  }

  .transfer-import-footer small {
    white-space: normal;
  }

  .transfer-empty {
    min-height: 132px;
    padding: 18px 10px;
  }

  .transfer-file-row {
    grid-template-columns: 34px minmax(0, 1fr) 24px;
    min-height: 48px;
    gap: 8px;
    padding: 6px;
  }

  .transfer-file-row i {
    width: 34px;
    height: 34px;
  }

  .transfer-actions {
    grid-template-columns: 1fr 1fr;
  }

  .transfer-actions [data-transfer-send] {
    grid-column: 1 / -1;
  }

  .transfer-message {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .transfer-message-icon {
    width: 38px;
    height: 38px;
  }

  .transfer-message-status {
    grid-column: 2;
    justify-self: start;
  }

  .transfer-message-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .transfer-message-actions button {
    flex: 1 1 0;
  }

  .notification-panel {
    top: 50px;
    right: 8px;
    left: 8px;
    width: auto;
    max-height: min(316px, calc(100vh - var(--topbar-height) - 76px));
    gap: 6px;
    overflow-y: auto;
    border-radius: 10px;
    padding: 8px;
  }

  .notification-panel header {
    gap: 8px;
  }

  .notification-panel header button {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  .notification-options {
    gap: 4px;
  }

  .notification-options button,
  .notification-read-toggle {
    min-height: 42px;
    border-radius: 8px;
    padding: 7px 9px;
  }

  .notification-options span {
    font-size: 12px;
  }

  .notification-options small {
    margin-top: 1px;
    font-size: 10px;
  }

  .notification-read-toggle {
    min-height: 32px;
    font-size: 12px;
  }

  .chat-search-bar {
    grid-template-columns: minmax(0, 1fr) 44px minmax(0, 74px) 30px 30px 30px 30px;
    column-gap: 4px;
    padding: 5px 7px;
  }

  .chat-search-bar input {
    min-height: 32px;
    padding-inline: 10px;
  }

  .chat-search-bar span {
    min-width: 44px;
    padding-inline: 5px;
    font-size: 10px;
    line-height: 22px;
    text-align: center;
  }

  .chat-search-index-status {
    font-size: 10px;
    line-height: 22px;
  }

  .chat-search-bar button {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .chat-search-bar button svg {
    width: 15px;
    height: 15px;
  }

  .chat-search-results {
    right: 8px;
    left: 8px;
    width: auto;
    gap: 3px;
    max-height: min(238px, calc(100vh - var(--topbar-height) - 118px));
    padding: 5px;
  }

  .chat-search-result-list {
    gap: 2px;
    max-height: min(188px, calc(100vh - var(--topbar-height) - 168px));
  }

  .chat-search-result {
    grid-template-columns: minmax(52px, 64px) minmax(0, 1fr);
    gap: 6px;
    min-height: 38px;
    padding: 5px 7px;
  }

  .chat-search-result b {
    font-size: 10px;
  }

  .chat-search-result span {
    font-size: 11px;
  }

  .chat-search-result time {
    grid-column: 2;
    max-width: 100%;
    overflow: hidden;
    justify-self: start;
    font-size: 9.5px;
    text-overflow: ellipsis;
  }

  .detail-sheet {
    padding: 8px;
  }

  .detail-card {
    width: min(304px, calc(100vw - 16px));
    max-height: min(384px, calc(100vh - 16px));
    border-radius: 12px;
    padding: 8px;
  }

  .detail-card header {
    min-height: 34px;
    gap: 8px;
  }

  .detail-card [data-detail-close] {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .detail-card [data-detail-content] {
    gap: 6px;
  }

  .detail-message-card {
    gap: 2px;
    border-radius: 10px;
    padding: 8px;
  }

  .detail-message-card strong {
    font-size: 13px;
    line-height: 1.25;
  }

  .detail-list {
    gap: 5px;
  }

  .detail-list div {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 7px;
  }

  .detail-list dt,
  .detail-list dd {
    font-size: 11px;
  }

  .detail-list dd {
    min-height: 20px;
    border-radius: 7px;
    padding: 0 7px;
  }

  .detail-receipt {
    gap: 3px;
    border-radius: 10px;
    padding: 6px;
  }

  .detail-receipt span {
    gap: 3px;
    font-size: 10px;
  }

  .detail-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .detail-actions button {
    min-height: 30px;
    border-radius: 8px;
    padding: 0 4px;
    font-size: 11px;
  }

  .profile-panel {
    grid-template-rows: 44px auto auto minmax(0, 1fr);
  }

  .profile-panel header {
    min-height: 44px;
    gap: 8px;
    padding: 5px 8px;
  }

  .profile-panel .panel-actions {
    gap: 4px;
  }

  .profile-panel .panel-actions .icon-button {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .profile-card {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 4px 8px;
    padding: 8px 10px 7px;
  }

  .profile-card .avatar.large {
    width: 50px;
    height: 50px;
    font-size: 15px;
  }

  .profile-card h2 {
    font-size: 15px;
  }

  .profile-card p {
    display: -webkit-box;
    max-width: 30ch;
    font-size: 10px;
    line-height: 1.2;
    -webkit-line-clamp: 1;
  }

  .language-setting {
    min-height: 30px;
    padding: 2px 2px 2px 8px;
  }

  .language-setting > span {
    font-size: 10px;
  }

  .language-options {
    width: 108px;
  }

  .language-options button {
    min-height: 22px;
    padding: 0 5px;
    font-size: 9px;
  }

  .profile-status-row {
    display: flex;
    max-height: 40px;
    justify-content: center;
    overflow: hidden;
    gap: 3px;
  }

  .profile-status-row .status-chip {
    height: 17px;
    max-width: 112px;
    padding-inline: 5px;
    font-size: 9px;
  }

  .profile-action-grid {
    width: 100%;
    gap: 4px;
    margin-top: 1px;
    padding: 1px 2px 3px;
  }

  .profile-action-grid button {
    flex-basis: 34px;
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    border-radius: 8px;
    padding: 3px;
  }

  .profile-action-grid i {
    width: 24px;
    height: 24px;
    font-size: 0;
  }

  .profile-action-grid i svg {
    width: 15px;
    height: 15px;
  }

  .profile-action-grid span {
    display: none;
  }

  .status-grid {
    gap: 1px;
    padding: 4px 8px 6px;
  }

  .status-grid div {
    display: flex;
    min-height: 30px;
    gap: 8px;
    justify-items: initial;
    padding: 0 6px;
  }

  .status-grid dt,
  .status-grid dd {
    font-size: 10px;
  }

  .status-grid dd {
    width: auto;
    max-width: 152px;
    min-height: 18px;
    justify-content: center;
    border-radius: 999px;
    padding: 0 7px;
  }

  .member-list {
    --profile-tabs-sticky-offset: 48px;
    gap: 3px;
    padding: 6px 8px 10px;
  }

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

  .profile-overview-card {
    min-height: 44px;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 4px;
    padding: 5px;
  }

  .profile-overview-preview {
    width: 28px;
    height: 28px;
  }

  .profile-overview-copy small {
    display: none;
  }

  .profile-tabs {
    gap: 4px;
    margin: 0 -4px 3px;
    padding: 4px;
    scroll-padding-inline: 4px;
  }

  .profile-tabs button {
    min-width: 50px;
    min-height: 30px;
    border-radius: 8px;
    gap: 4px;
    padding: 0 7px;
    font-size: 10px;
  }

  .profile-tabs b {
    min-width: 16px;
    min-height: 16px;
    padding: 0 4px;
    font-size: 9px;
  }

  .profile-shared-tools {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px;
  }

  .profile-shared-search {
    grid-column: 1 / -1;
  }

  .profile-shared-search input,
  .profile-shared-sort button,
  .profile-shared-count {
    min-height: 28px;
    font-size: 10px;
  }

  .profile-shared-search input {
    padding-right: 30px;
    padding-left: 34px;
  }

  .profile-shared-search::before {
    left: 10px;
    width: 11px;
    height: 11px;
  }

  .profile-shared-search::after {
    left: 21px;
    width: 6px;
  }

  .profile-shared-search button {
    right: 2px;
    width: 24px;
    height: 24px;
  }

  .profile-shared-sort button {
    padding: 0 7px;
  }

  .profile-shared-count {
    min-width: 38px;
  }

  .shared-file-card,
  .shared-transfer-card,
  .shared-link-card {
    min-height: 50px;
    border-radius: 8px;
    padding: 5px;
  }

  .shared-file-main,
  .shared-transfer-main,
  .shared-link-card a {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 7px;
  }

  .shared-file-main i,
  .shared-transfer-main i,
  .shared-link-card i {
    width: 34px;
    height: 34px;
    font-size: 9px;
  }

  .shared-transfer-status {
    padding: 4px 7px;
    font-size: 10px;
  }

  .shared-file-card > button:not(.shared-file-main),
  .shared-link-card button,
  .shared-transfer-actions .is-manifest,
  .shared-transfer-actions .is-receipt,
  .shared-transfer-actions .is-details {
    width: 30px;
    min-width: 30px;
    min-height: 30px;
  }

  .profile-stats {
    gap: 3px;
  }

  .profile-stats b {
    min-height: 38px;
    border-radius: 8px;
    font-size: 14px;
  }

  .profile-stats small {
    font-size: 9px;
  }

  .profile-member-card {
    grid-template-columns: 34px minmax(0, 1fr) minmax(42px, auto) minmax(42px, auto);
    gap: 6px;
    min-height: 44px;
    border-radius: 8px;
    padding: 5px 6px;
  }

  .profile-member-avatar {
    width: 34px;
    height: 34px;
    font-size: 10px;
  }

  .profile-member-card.is-online .profile-member-avatar::after {
    width: 8px;
    height: 8px;
  }

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

  .profile-member-copy small {
    font-size: 10px;
  }

  .profile-member-role {
    min-height: 18px;
    max-width: 54px;
    padding: 2px 5px;
    font-size: 9px;
  }

  .profile-member-tag {
    min-height: 18px;
    max-width: 62px;
    padding: 2px 5px;
    font-size: 9px;
  }

  .selection-bar {
    top: 6px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-areas:
      "summary summary summary summary summary"
      "all jump reply forward save"
      "copy pin unread delete clear";
    gap: 4px;
    min-height: 106px;
    overflow-x: hidden;
    border-radius: 16px;
    padding: 6px;
  }

  .selection-summary {
    grid-area: summary;
    min-height: 24px;
    align-content: center;
  }

  .selection-meta {
    max-width: none;
  }

  .selection-badges {
    max-width: none;
  }

  .selection-badges span {
    max-width: 86px;
    padding-inline: 6px;
  }

  .selection-bar button {
    width: 100%;
    min-height: 30px;
    border-radius: 8px;
    padding: 0;
    font-size: 0;
  }

  .selection-bar [data-selection-select-all] {
    grid-area: all;
  }

  .selection-bar [data-selection-jump] {
    grid-area: jump;
  }

  .selection-bar [data-selection-reply] {
    grid-area: reply;
  }

  .selection-bar [data-selection-forward] {
    grid-area: forward;
  }

  .selection-bar [data-selection-save] {
    grid-area: save;
  }

  .selection-bar [data-selection-copy] {
    grid-area: copy;
  }

  .selection-bar [data-selection-pin] {
    grid-area: pin;
  }

  .selection-bar [data-selection-unread] {
    grid-area: unread;
  }

  .selection-bar [data-selection-delete] {
    grid-area: delete;
  }

  .selection-bar [data-selection-clear] {
    grid-area: clear;
  }

  .room-item {
    grid-template-columns: 44px minmax(0, 1fr) minmax(34px, auto);
    min-height: 58px;
    padding: 5px 7px;
  }

  .avatar {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    font-size: 12px;
  }

  .room-tabs {
    gap: 0;
    padding-inline: 6px;
    scroll-padding-inline: 6px;
  }

  .room-tabs button {
    min-height: 32px;
    padding: 0 1px 5px;
  }

  .tab-label {
    font-size: 9.5px;
  }

  .room-copy strong {
    font-size: 13px;
  }

  .room-copy p {
    font-size: 12px;
  }

  .room-side {
    gap: 3px;
    font-size: 10px;
  }

  .room-side b {
    min-width: 18px;
    height: 18px;
    font-size: 10px;
  }
}

@media (max-width: 720px) {
  .profile-card {
    grid-template-columns: 50px minmax(0, 1fr);
    grid-template-areas:
      "avatar name"
      "avatar desc"
      "language language"
      "status status"
      "actions actions";
    gap: 5px 8px;
  }

  .language-setting {
    min-height: 34px;
    padding: 3px;
  }

  .language-options {
    width: 116px;
  }

  .language-options button {
    min-height: 24px;
    font-size: 10px;
  }

  .profile-action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    overflow: visible;
    padding: 2px 0 0;
  }

  .profile-action-grid button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    grid-template-rows: 26px;
    justify-items: center;
    border-radius: 8px;
    padding: 4px;
  }

  .profile-action-grid i {
    width: 26px;
    height: 26px;
  }

  .profile-action-grid span {
    display: none;
  }

  .status-grid div {
    min-height: 30px;
    background: color-mix(in srgb, var(--panel-2) 42%, transparent);
  }
}
